Пример #1
0
def login_chat_remote(dynamic_id, character_id, character_nickname, guild_id):
    """登录聊天服务器
    @param dynamic_id: int 客户端的id
    @param character_id: int角色的id
    """
    character = ChaterManager().addchater_by_id(character_id)
    if character:
        ChaterManager().update_onland(character_id, dynamic_id, guild_id)
        character.name = character_nickname
        character.guild_id = guild_id
        ChatRoomManager().join_room(dynamic_id, character.room_id)
        if guild_id:
            ChatRoomManager().join_room(dynamic_id, character.guild_id)
    return True
Пример #2
0
def login_chat_remote(dynamic_id, character_id, character_nickname, guild_id, gag_time):
    """登录聊天服务器
    @param dynamic_id: int 客户端的id
    @param character_id: int角色的id
    """
    character = ChaterManager().addchater_by_id(character_id)
    if character:
        ChaterManager().update_onland(character_id, dynamic_id, guild_id, gag_time)
        character.name = character_nickname
        character.guild_id = guild_id
        ChatRoomManager().join_room(dynamic_id, character.room_id)
        if guild_id != 0:
            ChatRoomManager().join_room(dynamic_id, character.guild_id)
    return True
Пример #3
0
def logout_guild_chat_remote(dynamic_id):
    """退出公会房间
    """
    character_id = ChaterManager().getid_by_dynamicid(dynamic_id)

    if not character_id:
        return False

    character = ChaterManager().getchater_by_id(character_id)
    if character:
        ChatRoomManager().leave_room(dynamic_id, character.guild_id)
        ChaterManager().leave_room(dynamic_id, character.guild_id)
        character.guild_id = 0

    return True
Пример #4
0
def login_guild_chat_remote(dynamic_id, guild_id):
    """加入公会房间
    """
    character_id = ChaterManager().getid_by_dynamicid(dynamic_id)

    if not character_id:
        return False

    character = ChaterManager().getchater_by_id(character_id)
    if character:
        character.guild_id = guild_id
        ChatRoomManager().join_room(dynamic_id, guild_id)
        ChaterManager().join_room(dynamic_id, guild_id)

    return True
Пример #5
0
def logout_guild_chat_remote(dynamic_id):
    """退出公会房间
    """
    character_id = ChaterManager().getid_by_dynamicid(dynamic_id)

    if not character_id:
        return False

    character = ChaterManager().getchater_by_id(character_id)
    if character:
        ChatRoomManager().leave_room(dynamic_id, character.guild_id)
        ChaterManager().leave_room(dynamic_id, character.guild_id)
        character.guild_id = 0

    return True
Пример #6
0
def login_guild_chat_remote(dynamic_id, guild_id):
    """加入公会房间
    """
    character_id = ChaterManager().getid_by_dynamicid(dynamic_id)

    if not character_id:
        return False

    character = ChaterManager().getchater_by_id(character_id)
    if character:
        character.guild_id = guild_id
        ChatRoomManager().join_room(dynamic_id, guild_id)
        ChaterManager().join_room(dynamic_id, guild_id)

    return True
Пример #7
0
def del_guild_room_remote(guild_id):
    """退出公会房间
    """
    ids = ChaterManager().get_guild_dynamicid(guild_id)
    for dynamic_id in ids:

        character_id = ChaterManager().getid_by_dynamicid(dynamic_id)

        if not character_id:
            return False

        character = ChaterManager().getchater_by_id(character_id)
        if character:
            ChatRoomManager().leave_room(dynamic_id, character.guild_id)
            ChaterManager().leave_room(dynamic_id, character.guild_id)
            character.guild_id = 0

    return True
Пример #8
0
def del_guild_room_remote(guild_id):
    """退出公会房间
    """
    ids = ChaterManager().get_guild_dynamicid(guild_id)
    for dynamic_id in ids:

        character_id = ChaterManager().getid_by_dynamicid(dynamic_id)

        if not character_id:
            return False

        character = ChaterManager().getchater_by_id(character_id)
        if character:
            ChatRoomManager().leave_room(dynamic_id, character.guild_id)
            ChaterManager().leave_room(dynamic_id, character.guild_id)
            character.guild_id = 0

    return True