private void HandleSendGameLogin(ProjectG client, ClientPacket packet, byte Key) { client.GetKey = Key; client.KeyLogin = client.GetKey; client.Response.Write(new byte[] { 0x02, 0x00 }); client.Response.WritePStr(client.GetLogin); client.Response.Write(client.GetUID); client.Response.Write(0); client.Response.Write(new byte[] { 0x96, 0x66, }); client.Response.WritePStr(client.GetAuth1); if (client.Login.PangyaVersion == EnumPangyaVersion.US) { client.Response.WritePStr("824.00");// is server version US client.Response.Write(new byte[] { 0xD2, 0xC9, 0x4A, 0x25, 0x00, 0x00, 0x00, 0x00, }); client.Response.WritePStr(client.GetAuth2); } if (client.Login.PangyaVersion == EnumPangyaVersion.TH) { packet.Skip(9); var ipAdress = packet.ReadPStr(); Console.WriteLine($"[PLAYER_ADRESS]: {ipAdress}"); client.Response.WritePStr("829.01");// is server version TH client.Response.Write(new byte[] { 0xC7, 0xD2, 0x4A, 0x25, 0x00, 0x00, 0x00, 0x00, }); client.Response.WritePStr(client.GetAuth2); client.Response.Write(new byte[] { 0x32, 0x33, 0x5D, 0x0D, 0x05, }); } client.SendResponse(); }
public void HandleSendClientEnterPapelShop(ProjectG player) { if (player.Pangs > 0) { player.Response.Write(new byte[] { 0x98, 0x00 }); } player.SendResponse(); }
public void HandleSendClientSelectChannelID(ProjectG player) { var rnd = new Random(); player.Response.Write(new byte[] { 0x04, 0x00 }); player.Response.Write(player.Info.Lobby.ID); player.Response.Write((byte)rnd.Next(1, 255)); player.Response.Write((ushort)0x0700); player.Response.Write((byte)rnd.Next(1, 255)); player.Response.Write(new byte[] { 0x69, 0x69, 0x01 }); player.SendResponse(); }
public void HandleSendClientCreateRoom(ProjectG player, int VersusTime = 0, int TorneyTime = 0, byte MaxProjectG = 0, byte GameType = 0, byte TotalHoles = 0, byte Map = 0, byte Mode = 0, int natural = 0, string RomName = "Test", string RomPass = "") { player.Response.Write(new byte[] { 0x08, 0x00 }); player.Response.Write((byte)0);//unk player.Response.Write(VersusTime); player.Response.Write(TorneyTime); player.Response.Write(MaxProjectG); player.Response.Write(GameType); player.Response.Write(TotalHoles); player.Response.Write(Map); player.Response.Write(Mode); player.Response.Write(natural); player.Response.WritePStr(RomName); player.Response.WritePStr(RomPass); player.Response.Write(0);//artefato player.SendResponse(); }
void SelectServer(ProjectG player) { player.Response.Write(new byte[] { 0x03, 0x00 }); player.Response.Write(player.Game.ID); player.SendResponse(); }
private void HandleLoginProcess(ProjectG client, ClientPacket packet) { if (client.Login.PangyaVersion == EnumPangyaVersion.US) { LoginPacketCodeEnum Code = (LoginPacketCodeEnum)packet.ReadByte(); WriteConsole.WriteLine($"[BOOT_LOGIN_PROCESS]: {Code}"); switch (Code) { case LoginPacketCodeEnum.Sucess: { client.GetLogin = packet.ReadPStr(); client.GetUID = packet.ReadUInt32(); client.GetCapability = (byte)packet.ReadInt32(); client.GetLevel = (byte)packet.ReadUInt32(); packet.Skip(6); client.GetNickname = packet.ReadPStr(); Console.WriteLine(); Console.WriteLine("**************************************************************************"); Console.WriteLine(" LOGIN: "******" UID: " + client.GetUID); Console.WriteLine(" TYPE: " + client.GetCapability); Console.WriteLine(" LEVEL: " + client.GetLevel); Console.WriteLine(" NICK: " + client.GetNickname); Console.WriteLine("**************************************************************************"); Console.WriteLine(); } break; case LoginPacketCodeEnum.InvalidoIdPw: { } break; case LoginPacketCodeEnum.InvalidoId: { } break; case LoginPacketCodeEnum.UsuarioEmUso: { WriteConsole.WriteLine("[BOOT_LOGIN_PROCESS]: Await User"); client.SendResponse(new byte[] { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 }); WriteConsole.WriteLine("[BOOT_LOGIN_PROCESS]: Logging in do User"); } break; case LoginPacketCodeEnum.Banido: break; case LoginPacketCodeEnum.UsernameOuSenhaInvalido: break; case LoginPacketCodeEnum.ContaSuspensa: break; case LoginPacketCodeEnum.Player13AnosOuMenos: break; case LoginPacketCodeEnum.SSNIncorreto: break; case LoginPacketCodeEnum.UsuarioIncorreto: break; case LoginPacketCodeEnum.OnlyUserAllowed: break; case LoginPacketCodeEnum.ServerInMaintenance: break; case LoginPacketCodeEnum.NaoDisponivelNaSuaArea: break; case LoginPacketCodeEnum.CreateNickName_US: break; case LoginPacketCodeEnum.CreateNickName: break; default: { } break; } } else if (client.Login.PangyaVersion == EnumPangyaVersion.TH) { THLoginPacketCodeEnum Code = THLoginPacketCodeEnum.LOGIN_SUCESS; if (packet.Message.Count() <= 7) { Code = (THLoginPacketCodeEnum)packet.ReadUInt32(); } else if (packet.Message.Count() > 7) { Code = (THLoginPacketCodeEnum)packet.ReadByte(); } WriteConsole.WriteLine($"[BOOT_LOGIN_PROCESS]: Type {Code}"); switch (Code) { case THLoginPacketCodeEnum.LOGIN_SUCESS: { client.GetLogin = packet.ReadPStr(); client.GetUID = packet.ReadUInt32(); client.GetCapability = (byte)packet.ReadInt32(); client.GetLevel = (byte)packet.ReadUInt32(); packet.Skip(6); client.GetNickname = packet.ReadPStr(); Console.WriteLine(); Console.WriteLine("**************************************************************************"); Console.WriteLine(" LOGIN: "******" UID: " + client.GetUID); Console.WriteLine(" TYPE: " + client.GetCapability); Console.WriteLine(" LEVEL: " + client.GetLevel); Console.WriteLine(" NICK: " + client.GetNickname); Console.WriteLine("**************************************************************************"); Console.WriteLine(); } break; case THLoginPacketCodeEnum.INVALID_USER: { //client.Disconnect(); } break; case THLoginPacketCodeEnum.INVALID_PASS: { throw new Exception("SORRY, USER PASS INVALID "); } case THLoginPacketCodeEnum.Banido: { // client.Disconnect(); } break; case THLoginPacketCodeEnum.USER_IN_USE: { client.Response.Write(new byte[] { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 }); client.SendResponse(); } break; case THLoginPacketCodeEnum.ServerInMaintenance: break; default: { //client.Disconnect(); WriteConsole.WriteLine($"[BOOT_LOGIN_PACKETLOG]: {packet.GetLog()}"); packet.Save(); } break; } } }
public void HandleSendClientDisconnect(ProjectG player) { player.Response.Write(new byte[] { 0x6E, 0x01 }); player.SendResponse(); }
public void HandleSendLeaveLobbyList(ProjectG player) { player.Response.Write(new byte[] { 0x82, 0x00 }); player.SendResponse(); }