def add_message(self, msg_type, content, player_id, source_id=None):
        if self.is_blocked(player_id, source_id):
            raise ActionError("You are blocked from sending messages to that player.")
        msg_id = db_counter("message_id")
        message = {'msg_type': msg_type, 'msg_id': msg_id, 'content': content, 'source': user_manager.id_to_name(source_id)}
        timestamp(message)
        set_db_hash(_message_key(player_id), msg_id, message)
        try:
            session_manager.player_session(player_id).append({'new_message': message})
        except __HOLE__:
            pass
dataset/ETHPy150Open genzgd/Lampost-Mud/lampost/comm/message.py/MessageService.add_message