예제 #1
0
        private static void ProcessInventoryService(UdpClient udp, QPacket p, RMCPacket rmc, ClientInfo client)
        {
            RMCPacketReply reply;

            switch (rmc.methodID)
            {
            case 1:
                reply = new RMCPacketResponseInventoryService_GetTemplateItems();
                SendReply(udp, p, rmc, client, reply);
                break;

            case 2:
                reply = new RMCPacketResponseInventoryService_Method2();
                SendReply(udp, p, rmc, client, reply);
                break;

            case 4:
                reply = new RMCPacketResponseInventoryService_GetAllApplyItems();
                SendReply(udp, p, rmc, client, reply);
                break;

            case 16:
                reply = new RMCPacketResponseInventoryService_GetAllDefaultLoadoutKits();
                SendReply(udp, p, rmc, client, reply);
                break;

            default:
                WriteLog("Error: Unknown Method 0x" + rmc.methodID.ToString("X"));
                break;
            }
        }
예제 #2
0
        private static void ProcessInventoryService(UdpClient udp, QPacket p, RMCPacket rmc, ClientInfo client)
        {
            RMCPacketReply reply;

            switch (rmc.methodID)
            {
            case 1:
                reply = new RMCPacketResponseInventoryService_GetTemplateItems();
                List <GR5_TemplateItem> items = DBHelper.GetTemplateItems();
                ((RMCPacketResponseInventoryService_GetTemplateItems)reply).items.AddRange(items);
                SendReply(udp, p, rmc, client, reply);
                break;

            case 2:
                reply = new RMCPacketResponseInventoryService_Method2();
                SendReply(udp, p, rmc, client, reply);
                break;

            case 3:
                reply = new RMCPacketResponseInventoryService_Method3();
                SendReply(udp, p, rmc, client, reply);
                break;

            case 4:
                reply = new RMCPacketResponseInventoryService_GetAllApplyItems();
                SendReply(udp, p, rmc, client, reply);
                break;

            case 6:
                reply = new RMCPacketResponseInventoryService_Method6();
                SendReply(udp, p, rmc, client, reply);
                break;

            case 16:
                reply = new RMCPacketResponseInventoryService_GetAllDefaultLoadoutKits();
                List <GR5_LoadoutKit> kits = DBHelper.GetLoadoutKits(client.PID);
                ((RMCPacketResponseInventoryService_GetAllDefaultLoadoutKits)reply).kits.AddRange(kits);
                SendReply(udp, p, rmc, client, reply);
                break;

            default:
                WriteLog(1, "Error: Unknown Method 0x" + rmc.methodID.ToString("X"));
                break;
            }
        }