public static System.Object PacketToProtocol(ushort packetId, Packet packet) { switch (packetId) { case 1520: AckChatSendOk ackChatSendOk = new AckChatSendOk(packet); return(ackChatSendOk); case 1040: AckRoleRandNameOk ackRoleRandNameOk = new AckRoleRandNameOk(packet); return(ackRoleRandNameOk); case 1050: AckRoleLoginOk ackRoleLoginOk = new AckRoleLoginOk(packet); return(ackRoleLoginOk); case 1060: AckRoleLoginOkNoRole ackRoleLoginOkNoRole = new AckRoleLoginOkNoRole(packet); return(ackRoleLoginOkNoRole); case 2040: AckSceneEnter ackSceneEnter = new AckSceneEnter(packet); return(ackSceneEnter); case 2050: AckScenePlayers ackScenePlayers = new AckScenePlayers(packet); return(ackScenePlayers); case 2060: AckSceneExit ackSceneExit = new AckSceneExit(packet); return(ackSceneExit); case 2080: AckSceneMove ackSceneMove = new AckSceneMove(packet); return(ackSceneMove); case 40020: AckTestSendOk ackTestSendOk = new AckTestSendOk(packet); return(ackTestSendOk); case 40050: AckTestXX ackTestXX = new AckTestXX(packet); return(ackTestXX); case 40070: AckTestPhpOk ackTestPhpOk = new AckTestPhpOk(packet); return(ackTestPhpOk); } return(null); }
private static void DoMsg(Socket clientSocket, ushort packetid, Packet packet) { Console.WriteLine("packetid: {0}", packetid); switch (packetid) { case 40050: AckTestXX ackTestXX = new AckTestXX(packet); Console.WriteLine("{0} {1} {2} {3} {4}", ackTestXX.id_u8, ackTestXX.id_u16, ackTestXX.id_u32, ackTestXX.repeat_id_u8, ackTestXX.optional_id_u8); break; } }
public static System.Object PacketToProtocol(ushort packetId, Packet packet) { switch (packetId) { case 1520: AckChatSendOk ackChatSendOk = new AckChatSendOk(packet); return ackChatSendOk; case 1040: AckRoleRandNameOk ackRoleRandNameOk = new AckRoleRandNameOk(packet); return ackRoleRandNameOk; case 1050: AckRoleLoginOk ackRoleLoginOk = new AckRoleLoginOk(packet); return ackRoleLoginOk; case 1060: AckRoleLoginOkNoRole ackRoleLoginOkNoRole = new AckRoleLoginOkNoRole(packet); return ackRoleLoginOkNoRole; case 2040: AckSceneEnter ackSceneEnter = new AckSceneEnter(packet); return ackSceneEnter; case 2050: AckScenePlayers ackScenePlayers = new AckScenePlayers(packet); return ackScenePlayers; case 2060: AckSceneExit ackSceneExit = new AckSceneExit(packet); return ackSceneExit; case 2080: AckSceneMove ackSceneMove = new AckSceneMove(packet); return ackSceneMove; case 40020: AckTestSendOk ackTestSendOk = new AckTestSendOk(packet); return ackTestSendOk; case 40050: AckTestXX ackTestXX = new AckTestXX(packet); return ackTestXX; case 40070: AckTestPhpOk ackTestPhpOk = new AckTestPhpOk(packet); return ackTestPhpOk; } return null; }
private static void DoMsg(Socket clientSocket, ushort packetid, Packet packet) { Console.WriteLine("packetid: {0}", packetid); switch (packetid) { case 40040: // ReqTestXX reqTestXX = new ReqTestXX(packet); ReqTestXX reqTestXX = P2P.PacketToProtocol(packetid, packet) as ReqTestXX; Console.WriteLine("{0} {1} {2} {3} {4}", reqTestXX.id_u8, reqTestXX.id_u16, reqTestXX.id_u32, reqTestXX.repeat_id_u8, reqTestXX.optional_id_u8); AckTestXX ackTestXX = new AckTestXX(); ackTestXX.id_u8 = 111; ackTestXX.id_u16 = 11111; ackTestXX.id_u32 = 1111111; ackTestXX.optional_id_u8 = 222; ackTestXX.repeat_id_u8 = new List <byte>(); clientSocket.Send(ackTestXX.Encode().GetBufferBytes()); break; } }
private static void DoMsg(Socket clientSocket, ushort packetid, Packet packet) { Console.WriteLine("packetid: {0}", packetid); switch (packetid) { case 40040: // ReqTestXX reqTestXX = new ReqTestXX(packet); ReqTestXX reqTestXX = P2P.PacketToProtocol(packetid, packet) as ReqTestXX; Console.WriteLine("{0} {1} {2} {3} {4}", reqTestXX.id_u8, reqTestXX.id_u16, reqTestXX.id_u32, reqTestXX.repeat_id_u8, reqTestXX.optional_id_u8); AckTestXX ackTestXX = new AckTestXX(); ackTestXX.id_u8 = 111; ackTestXX.id_u16 = 11111; ackTestXX.id_u32 = 1111111; ackTestXX.optional_id_u8= 222; ackTestXX.repeat_id_u8 =new List<byte>(); clientSocket.Send(ackTestXX.Encode().GetBufferBytes()); break; } }