Example #1
0
        internal void SendCharacterSelect(byte[] data)
        {
            UC_CHARACTER_SELECT_REQ iPkt = new UC_CHARACTER_SELECT_REQ();

            iPkt.SetData(data);
            SysCons.LogInfo("UC_CHARACTER_SELECT_REQ charId({0}) ServerChannelIndex({1})", iPkt.charId, iPkt.byServerChannelIndex);

            CU_CHARACTER_SELECT_RES sPkt = new CU_CHARACTER_SELECT_RES();

            sPkt.szGameServerIP           = Encoding.ASCII.GetBytes("127.0.0.1");
            sPkt.wGameServerPortForClient = 50400;
            SysCons.LogInfo("CU_CHARACTER_SELECT_RES IPAddress({0}) Port({1})", sPkt.szGameServerIP, sPkt.wGameServerPortForClient);
            sPkt.AuthKey    = Encoding.ASCII.GetBytes("SE@WASDE#$RFWD@D");
            sPkt.ResultCode = 200;
            // connecting to GameServer
            sPkt.BuildPacket();
            this.Client.Send(sPkt.Data);
        }
Example #2
0
        public void SendCharacterSelectResult(byte[] data)
        {
            var iPkt = new UC_CHARACTER_SELECT_REQ();

            iPkt.SetData(data);
            SysCons.LogInfo("UC_CHARACTER_SELECT_REQ ServerID({0}) CharID({1})", iPkt.ServerID, iPkt.CharID);
            ServerID = iPkt.ServerID;
            CharID   = iPkt.CharID;

            using (var oPkt = new CU_CHARACTER_SELECT_RES())
            {
                oPkt.ResultCode     = (ushort)ResultCodes.CHARACTER_SUCCESS;
                oPkt.CharID         = CharID;
                oPkt.AuthKey        = AuthKey;
                oPkt.GameServerIP   = CharConfig.Instance.GetGameServerIP(ServerID, ChannelID);
                oPkt.GameServerPort = CharConfig.Instance.GetGameServerPort(ServerID, ChannelID);
                oPkt.BuildPacket();
                Client.Send(oPkt.Data);
            }
        }