def fix(cls, char_id): for k, v in ACTIVITY_STATIC.iteritems(): if v.condition_objs: ae = ActivityEntry(char_id, k) for c in v.condition_objs: cls(char_id, c.id, ae.activity_time) # NOTE F**K # 17002 累计充值送月卡是特殊处理的 x = Activity17002(char_id) cls(char_id, x.CONDITION_ID, x.activity_time)
def send_notify(self, Msg=ActivityNotify, activity_ids=None, force_send=False): msg = Msg() if not activity_ids: activity_ids = ACTIVITY_STATIC.keys() for i in activity_ids: if not force_send and not self.is_show(i): continue msg_activity = msg.activities.add() self._msg_activity(msg_activity, i) publish_to_char(self.char_id, pack_msg(msg))
def send_notify(self, Msg=ActivityNotify, activity_ids=None, force_send=False): msg = Msg() if not activity_ids: activity_ids = ACTIVITY_STATIC.keys() activity_ids.sort() for i in activity_ids: if not force_send and not self.is_show(i): continue msg_activity = msg.activities.add() self._msg_activity(msg_activity, i) publish_to_char(self.char_id, pack_msg(msg))