def __init__(self, channel_type, instance_id=None, general=False, aliases=(), tag=''): if instance_id == 'next': instance_id = db.db_counter('channel') make_action(self, (channel_type,) + aliases, target_class='cmd_str') self.id = "{}_{}".format(channel_type, instance_id) if instance_id else channel_type self.tag = tag cs.register_channel(self.id, general)
def dec_wrapper(func): action = make_action(func, msg_class=msg_class, **kwargs) for verb in convert_verbs(verbs): if verb in _mud_actions: error("Adding mud action for existing verb {}", verb) else: _mud_actions[verb] = action
def on_loaded(self): try: if mud_actions[self.dbo_id] != self: warn("Mud action already exists for social id {}", self.dbo_id) except KeyError: mud_actions[(self.dbo_id,)] = make_action(self, self.dbo_id) self.broadcast_map = BroadcastMap(**self.b_map)
def dec_wrapper(func): imm_actions.add(func) func.imm_level = imm_level return make_action(func, verbs, msg_class, **kwargs)
def dec_wrapper(func): action = make_action(func, verbs, msg_class, **kwargs) _mud_actions.add_unique(action)
def add_social_action(social): if mud_actions.primary(social.dbo_id): log.warn("Mud action already exists for social id {}", social.dbo_id) else: mud_actions.add(make_action(social, social.dbo_id)) all_socials[social.dbo_id] = social
def __init__(self, verb): make_action(self, verb) self.color = verb + "_channel"
def __init__(self, channel_type, instance_id=None, general=False, aliases=()): if instance_id == 'next': instance_id = db_counter('channel') make_action(self, (channel_type,) + aliases) self.id = "{}_{}".format(channel_type, instance_id) if instance_id else channel_type channel_service.register_channel(self.id, general)
def dec_wrapper(func): mud_actions.append(func) return make_action(func, verbs, msg_class)