/// <summary>
 /// 角色列表
 /// </summary>
 private void OnCharacterList(PacketBase packet)
 {
     ss2c.EnumCharacter msg = packet as ss2c.EnumCharacter;
     if (msg.list.Count == 0 || msg.list.Count > 1)
     {
         ServerMsgSend.SendCreateCharacter(m_conn_idx, "test" + m_account_idx, (uint)eSexType.BOY);
     }
     else
     {
         CharacterLogin char_info = msg.list[0];
         ServerMsgSend.SendEnterGame(m_conn_idx, char_info.char_idx);
     }
 }
示例#2
0
        /// <summary>
        /// 角色列表
        /// </summary>
        private void OnEnumCharacterList(PacketBase packet)
        {
            gs2ss.EnumCharacter msg        = packet as gs2ss.EnumCharacter;
            ClientUID           client_uid = msg.client_uid;

            SQLCharHandle.QueryCharacterList(msg.account_idx, new DBID(msg.game_db_id), (data) =>
            {
                ss2c.EnumCharacter rep_msg = PacketPools.Get(ss2c.msg.ENUM_CHAR) as ss2c.EnumCharacter;
                foreach (var char_data in data)
                {
                    rep_msg.list.Add(char_data);
                }
                ServerNetManager.Instance.SendProxy(client_uid, rep_msg);
            }
                                             );
        }
        /// <summary>
        /// 角色列表
        /// </summary>
        private void OnCharacterList(PacketBase packet)
        {
            ss2c.EnumCharacter msg = packet as ss2c.EnumCharacter;
            LoginDataMgr.Instance.AddCharacterList(msg.list);
            if (msg.list.Count == 0 || msg.list.Count > 1)
            {
                EventController.TriggerEvent(ClientEventID.OPEN_FORM, eFormType.CreateUser);
            }
            else
            {
                CharacterLogin char_info = msg.list[0];
                EventController.TriggerEvent(ClientEventID.SHOW_STATUS, eFormStatusType.User, "当前角色:" + char_info.char_name);

                ServerMsgSend.SendEnterGame(char_info.char_idx);
            }
        }