예제 #1
0
 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)
예제 #2
0
 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
예제 #3
0
 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)
예제 #4
0
 def dec_wrapper(func):
     imm_actions.add(func)
     func.imm_level = imm_level
     return make_action(func, verbs, msg_class, **kwargs)
예제 #5
0
 def dec_wrapper(func):
     action = make_action(func, verbs, msg_class, **kwargs)
     _mud_actions.add_unique(action)
예제 #6
0
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
예제 #7
0
 def __init__(self, verb):
     make_action(self, verb)
     self.color = verb + "_channel"
예제 #8
0
 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)
예제 #9
0
 def dec_wrapper(func):
     mud_actions.append(func)
     return make_action(func, verbs, msg_class)