def __init__(self): setattr(Game, self._rpc_name_, self) self.cache = TimeMemCache(default_timeout=600, name='rank_mgr.cache') #[[ret1,ret2...],{pid:ret索引},{con:rank}] self.player_level_data = None self.player_cbe_data = None #当天第一次的排名时间 self.first_time = None #深渊排名数据的保存 #{层数:[pid1,pid2]...} 此数据保存数据库 self.deep_floor_pids = {} #{pid1:层数,...} self.deep_pid_floor = {} #世界boss排名 #[{排名:1, 名字:xx, 等级:22, 总伤害血量}...} self.boss_rank_datas = [] #{pid1:(rank1, hurts),...} 此数据由世界boss广播而来 保存数据库 self.boss_pid_data = {} #是否将当天排名数据保存到log_rank(当前只有深渊是每天零点更新) self.is_save_rank = False import app app.sub(MSG_START, self.start)
def __init__(self): setattr(Game, self._rpc_name_, self) self.max_players = config.max_players self.logic_players = config.logic_players self._users = {} self._players = {} self._sub_mgrs = {} self.mgr2addrs = {} self.logons = TimeMemCache(size=10000, default_timeout=2, name='rpc_player_mgr.logons') # self.names = TimeMemCache(size=10000, default_timeout=1*30) #缓存保证不重名 self.name2pids = {} self.pid2names = {} self._name_lock = RLock() self._new_player_lock = RLock() self.names4ad = {} self.overload_time = 0 self._debug_ips = None self._debug_status = False self._area_url = None self._area_legal = None import app from game.base import msg_define app.sub(msg_define.MSG_START, self.start)
def __init__(self): setattr(Game, self._rpc_name_, self) self._loop_task = None self._game = Game #{boss表id1:boss表对象1, ...}包括同盟和世界boss战 self.bosses = {} #同盟boss保存 {同盟id1:boss表id1, ...} self.a_bosses = {} #世界boss保存 {resblid:boss表id1, ...} self.w_bosses = {} #boss开启提前广播列表[同盟id1, ...] self.notices = [] #当前开启的世界boss战(包括通知的时间) self.w_start_boss = None #广播世界boss剩余血量的条件 self.w_horn_conds = [] #广播同盟boss剩余血量的条件 self.a_horn_conds = [] import app app.sub(MSG_START, self.start)
def __init__(self): setattr(Game, self._rpc_name_, self) self._game = Game self.msgs = [] self.res_horn = {} self.stoped = False app.sub(MSG_START, self.start)
def __init__(self): setattr(Game, self._rpc_name_, self) app.sub(MSG_START, self.start) #保存战报 {(章节id1, 时光盒基础表id1):[第一名对象,第二名对象,第三名对象]...} #该章有部分无名次 保存None{(章节id1, 时光盒基础表id1):[第一名对象, None, None]...} self.news = {} # self._lock = RLock()
def __init__(self): setattr(Game, self._rpc_name_, self) self.scenes = {} #scene_id=[scene, ...] self.ids = {} #id=scene self.players = {} #player_id=scene self.player_infos = {} #player_id=info self.rpc_sub_mgrs = {} #proxy_id=rpc_sub_mgr self.scene_index = 0 self.key2scenes = {} #mid:{key:scene} 根据key获取场景对象,如同盟地图 self.scene_cap = 0 self.bot = SceneBots(self) app.sub(msg_define.MSG_START, self.start)
def __init__(self): self.arenas = TimeMemCache( size=CACHE_SIZE, default_timeout=CACHE_TIME) #玩家信息 {pid:PlayerArena} self.rivals = TimeMemCache( size=CACHE_SIZE, default_timeout=CACHE_TIME) # {pid:[name, rid]} self.rewards = HitMemCache(size=CACHE_SIZE) self.bots = {} self._lock = RLock() self.stoped = True self._reward_task = None self._auto_start_task = None self.clear() app.sub(MSG_START, self.start) self._active_mul = 1 self.sorts = {} #数据库中保存,方便修改 {sort:id}
def __init__(self): setattr(Game, self._rpc_name_, self) self._game = Game self._loop_task = None #保存资源的势力地图结构{节点1:[关联的节点2,...]...} self.res_strong_map = {} #基础表战场开启的配置表 self.res_warstart_configs = {} #当前开启活动的配置信息 self.warstart_config = None #活动 self.init() import app app.sub(msg_define.MSG_START, self.start)
def __init__(self): self.words = None import app app.sub(MSG_START, self.start)
import tkinter def main(): calc = tkinter.Tk() calc.title("Aiden Calculator") # Width, height in pixels f1 = Frame(calc, height=50, width=50) f1.pack() calc.mainloop() main() num1 = float(input("first number: ")) operator = input("select operator: ") # + - * / num2 = float(input("second number: ")) if operator == "+": ans = add(num1, num2) if operator == "-": ans = sub(num1, num2) if operator == "*": ans = mul(num1, num2) if operator == "/": ans = div(num1, num2) print(round(ans, 10))
def start(self): import app app.sub(MSG_START, self.load)
def __init__(self): import app app.sub(MSG_START, self.start)
def __init__(self): setattr(Game, self._rpc_name_, self) self.iter_id = common.IterId() self.ally_tbox_mgr = AllyTboxTeamMgr(self) self.arena_mgr = ArenaTeamMgr(self) app.sub(msg_define.MSG_START, self.start)
def __init__(self): setattr(Game, self._rpc_name_, self) self.db_ver = 0 self.server_id = 0 self.stoped = True app.sub(msg_define.MSG_START, self.start)
def __init__(self): setattr(Game, self._rpc_name_, self) app.sub(MSG_START, self.start) self._loop_task = None self.clear()
def test_sub(self): self.assertEqual(app.sub(3, 4), -1)
def test_sub(): assert sub() == "The difference is : " + '-1'
def test_sub(): assert sub() == '-1'