def create_table_data(self, scene_id, dungeon_id, dungeon_star=0, dungeon_today_count=0, dungeon_last_time=0, dungeon_award=0): gsattrib = GSAttribute(self.cid, GSSceneMgr._table) res_err = yield gsattrib.new(cid=self.cid, scene_id=scene_id, dungeon_id=dungeon_id, dungeon_star=dungeon_star, dungeon_today_count=dungeon_today_count, dungeon_award=dungeon_award, dungeon_last_time=dungeon_last_time) if res_err: log.error('GSSceneMgr create table data error. ') defer.returnValue((UNKNOWN_ERROR, None)) if self.__scenes.has_key(gsattrib.scene_id): _scene_data = self.__scenes[gsattrib.scene_id] _scene_data[gsattrib.dungeon_id] = gsattrib else: _scene_data = {gsattrib.dungeon_id: gsattrib} self.__scenes[gsattrib.scene_id] = _scene_data defer.returnValue((NO_ERROR, gsattrib))
def create_table_data(self, item_type, item_id, item_num, time_now, camp_id=0, position_id=0, level=0, exp=0): gsattrib = GSAttribute(self.cid, GSBagJadeMgr._table) res_err = yield gsattrib.new(cid=self.cid, item_type=item_type, item_id=item_id, item_num=item_num, camp_id=camp_id, position_id=position_id, level=level, exp=exp, deleted=0, create_time=time_now, update_time=time_now, del_time=0) if res_err: log.error('GSBagJadeMgr create table data error. ') defer.returnValue((res_err, None)) self.__gsattribs[gsattrib.attrib_id] = gsattrib defer.returnValue((NO_ERROR, gsattrib))
def create_table_data(self, item_type, item_id, item_num, time_now): gsattrib = GSAttribute( self.cid, GSBagFellowsoulMgr._table ) res_err = yield gsattrib.new( cid=self.cid, item_type=item_type, item_id=item_id, item_num=item_num, deleted=0, create_time=time_now, update_time=time_now, del_time=0, aux_data='' ) if res_err: log.error('GSBagFellowsoulMgr create table data error. ') defer.returnValue( (UNKNOWN_ERROR, None) ) self.__gsattribs[gsattrib.attrib_id] = gsattrib defer.returnValue( (NO_ERROR, gsattrib) )
def create_table_data(self, item_type, item_id, item_num, time_now, level=0, exp=0, refine_level=0, camp_id=0, position_id=0): gsattrib = GSAttribute( self.cid, GSBagTreasureMgr._table ) res_err = yield gsattrib.new( cid=self.cid, item_type=item_type, item_id=item_id, item_num=item_num, camp_id=camp_id, position_id=position_id, level=level, exp=exp, refine_level=refine_level, deleted=0, create_time=time_now, update_time=time_now, del_time=0, aux_data='' ) if res_err: log.error('GSBagTreasureMgr create table data error. ') defer.returnValue( (UNKNOWN_ERROR, None) ) self.__gsattribs[gsattrib.attrib_id] = gsattrib defer.returnValue( (NO_ERROR, gsattrib) )
def create_table_data(self, item_type, item_id, item_num, time_now, level=0, refine_attribute=[], refine_cost=0, camp_id=0, position_id=0, strengthen_cost=0): gsattrib = GSAttribute( self.cid, GSBagEquipMgr._table ) # refine_attribute 是json格式保存 res_err = yield gsattrib.new( cid=self.cid, item_type=item_type, item_id=item_id, item_num=item_num, camp_id=camp_id, position_id=position_id, level=level, strengthen_cost=strengthen_cost, refine_attribute=dumps(refine_attribute), refine_cost=refine_cost, deleted=0, create_time=time_now, update_time=time_now, del_time=0, aux_data='' ) if res_err: log.error('GSBagEquipMgr create table data error. ') defer.returnValue( (UNKNOWN_ERROR, None) ) self.__gsattribs[gsattrib.attrib_id] = gsattrib defer.returnValue( (NO_ERROR, gsattrib) )
def create_table_data(self, scene_id, dungeon_id, dungeon_star=0, dungeon_today_count=0, dungeon_last_time=0, dungeon_award=0): gsattrib = GSAttribute( self.cid, GSSceneMgr._table ) res_err = yield gsattrib.new( cid=self.cid, scene_id=scene_id, dungeon_id=dungeon_id, dungeon_star=dungeon_star, dungeon_today_count=dungeon_today_count, dungeon_award=dungeon_award, dungeon_last_time=dungeon_last_time ) if res_err: log.error('GSSceneMgr create table data error. ') defer.returnValue( (UNKNOWN_ERROR, None) ) if self.__scenes.has_key( gsattrib.scene_id ): _scene_data = self.__scenes[gsattrib.scene_id] _scene_data[gsattrib.dungeon_id] = gsattrib else: _scene_data = {gsattrib.dungeon_id: gsattrib} self.__scenes[gsattrib.scene_id] = _scene_data defer.returnValue( (NO_ERROR, gsattrib) )
def create_table_data(self, fellow_id, is_major, camp_id, on_troop, way_type=WAY_UNKNOWN, way_others=''): yield self._load() time_now = int(time()) #datetime2string() gsattrib = GSAttribute(self.cid, GSFellowMgr._table) res_err = yield gsattrib.new(cid=self.cid, fellow_id=fellow_id, level=1, exp=0, advanced_level=0, on_troop=on_troop, is_major=is_major, camp_id=camp_id, deleted=0, create_time=time_now, update_time=time_now, del_time=0) if res_err: log.error( 'GSBagEquipMgr create table data error. res_err: {0}.'.format( res_err)) defer.returnValue((UNKNOWN_ERROR, None)) self.__gsattribs[gsattrib.attrib_id] = gsattrib # 创建玩家角色时初始化阵容等信息 if is_major: self.initialize(gsattrib) conf = get_fellow_by_fid(fellow_id) if conf: # 判断图鉴 yield self.user.atlaslist_mgr.new_atlaslist( CATEGORY_TYPE_FELLOW, conf['Camp'], conf['Quality'], fellow_id) if conf['Quality'] >= QUALITY_PURPLE: yield self.user.goodwill_mgr.create_table_data(fellow_id) # add syslog syslogger(LOG_FELLOW_GET, self.cid, self.user.level, self.user.vip_level, self.user.alliance_id, gsattrib.attrib_id, fellow_id, conf['QualityLevel'], conf['Star'], way_type, way_others) defer.returnValue((NO_ERROR, gsattrib))
def create_table_data(self, item_type, item_id, item_num, time_now): gsattrib = GSAttribute(self.cid, GSBagEquipshardMgr._table) res_err = yield gsattrib.new(cid=self.cid, item_type=item_type, item_id=item_id, item_num=item_num, deleted=0, create_time=time_now, update_time=time_now, del_time=0, aux_data='') if res_err: log.error('GSBagEquipshardMgr create table data error. ') defer.returnValue((UNKNOWN_ERROR, None)) self.__gsattribs[gsattrib.attrib_id] = gsattrib defer.returnValue((NO_ERROR, gsattrib))
def create_table_data(self, fellow_id): gsattrib = yield self.get_fellow(fellow_id) if gsattrib: defer.returnValue( (NO_ERROR, gsattrib) ) gsattrib = GSAttribute(self.cid, GSGoodwillMgr._table) res_err = yield gsattrib.new(cid=self.cid, fellow_id=fellow_id, goodwill_exp=0, goodwill_level=0, last_gift=0) if res_err: log.error('GSGoodwillMgr create table data error. ') defer.returnValue( (UNKNOWN_ERROR, None) ) self.__goodwills[gsattrib.fellow_id] = gsattrib if self.last_fellow_id == 0: self.last_fellow_id = fellow_id defer.returnValue( (NO_ERROR, gsattrib) )
def create_table_data(self, fellow_id): gsattrib = yield self.get_fellow(fellow_id) if gsattrib: defer.returnValue((NO_ERROR, gsattrib)) gsattrib = GSAttribute(self.cid, GSGoodwillMgr._table) res_err = yield gsattrib.new(cid=self.cid, fellow_id=fellow_id, goodwill_exp=0, goodwill_level=0, last_gift=0) if res_err: log.error('GSGoodwillMgr create table data error. ') defer.returnValue((UNKNOWN_ERROR, None)) self.__goodwills[gsattrib.fellow_id] = gsattrib if self.last_fellow_id == 0: self.last_fellow_id = fellow_id defer.returnValue((NO_ERROR, gsattrib))
def create_table_data(self, fellow_id, is_major, camp_id, on_troop, way_type=WAY_UNKNOWN, way_others=''): yield self._load() time_now = int(time()) #datetime2string() gsattrib = GSAttribute( self.cid, GSFellowMgr._table ) res_err = yield gsattrib.new( cid=self.cid, fellow_id=fellow_id, level=1, exp=0, advanced_level=0, on_troop=on_troop, is_major=is_major, camp_id=camp_id, deleted=0, create_time=time_now, update_time=time_now, del_time=0) if res_err: log.error('GSBagEquipMgr create table data error. res_err: {0}.'.format( res_err )) defer.returnValue( (UNKNOWN_ERROR, None) ) self.__gsattribs[gsattrib.attrib_id] = gsattrib # 创建玩家角色时初始化阵容等信息 if is_major: self.initialize( gsattrib ) conf = get_fellow_by_fid( fellow_id ) if conf: # 判断图鉴 yield self.user.atlaslist_mgr.new_atlaslist(CATEGORY_TYPE_FELLOW, conf['Camp'], conf['Quality'], fellow_id) if conf['Quality'] >= QUALITY_PURPLE: yield self.user.goodwill_mgr.create_table_data( fellow_id ) # add syslog syslogger(LOG_FELLOW_GET, self.cid, self.user.level, self.user.vip_level, self.user.alliance_id, gsattrib.attrib_id, fellow_id, conf['QualityLevel'], conf['Star'], way_type, way_others) defer.returnValue( (NO_ERROR, gsattrib) )