public void SendCharacterLoad(byte[] data) { var iPkt = new UC_CHARACTER_LOAD_REQ(); iPkt.SetData(data); SysCons.LogInfo("UC_CHARACTER_LOAD_REQ AccountID({0}) LastServerID({1})", iPkt.AccountID, iPkt.ServerID); AccountID = iPkt.AccountID; ServerID = iPkt.ServerID; using (var oPkt = new CU_SERVER_CHANNEL_INFO()) { oPkt.BuildChannelList(iPkt.ServerID); oPkt.BuildPacket(); Client.Send(oPkt.Data); } using (var oPkt = new CU_CHARACTER_INFO()) { oPkt.BuildCharList(AccountID, ServerID); oPkt.BuildPacket(); SysCons.SavePacket(oPkt); Client.Send(oPkt.Data); } using (var oPkt = new CU_CHARACTER_LOAD_RES()) { oPkt.ServerID = iPkt.ServerID; oPkt.BuildPacket(); Client.Send(oPkt.Data); } }
public void SendGameEnterResult(byte[] data) { var iPkt = new UG_GAME_ENTER_REQ(); iPkt.SetData(data); SysCons.LogInfo("UG_GAME_ENTER_REQ AccountID({0}) CharID({1}) AuthKey({2}) IsTutorialMode({3})", iPkt.AccountID, iPkt.CharID, iPkt.AuthKey, iPkt.IsTutorialMode); AccountID = iPkt.AccountID; CharID = iPkt.CharID; AuthKey = iPkt.AuthKey; using (var oPkt = new GU_GAME_ENTER_RES()) { oPkt.ResultCode = (ushort)ResultCodes.GAME_SUCCESS; oPkt.CommunityServerIP = GameConfig.Instance.CommunityServerIP; oPkt.CommunityServerPort = GameConfig.Instance.CommunityServerPort; oPkt.GameEnterTime = Utils.GetTimestamp(DateTime.Now); oPkt.BuildPacket(); Client.Send(oPkt.Data); SysCons.SavePacket(oPkt); } }
public static void LogPacketData(Packet pkt) { SysCons.LogWarn("Recv Packet({0}) Len({1}) Enc({2}) Opcode({3})", PacketDefinitions.getPacketName(pkt.Opcode), pkt.Lenght, pkt.Encrypt, pkt.Opcode); SysCons.SavePacket(pkt); }