示例#1
0
        public static GMCommandPacket Read(PacketHeader header, BinaryReader br)
        {
            GMCommandPacket pkt = new GMCommandPacket();

            pkt.Command   = br.ReadUInt32();
            pkt.Param     = br.ReadInt32();
            pkt.X         = br.ReadInt32();
            pkt.Y         = br.ReadInt32();
            pkt.Param2    = br.ReadInt32();
            pkt.Character = Utils.ReadByteString(br, 0x1F);
            return(pkt);
        }
示例#2
0
        void GMCommand_Process_Handler(Task t)
        {
            GMCommandPacket cmd = (GMCommandPacket)t.Args;

            string cmdString = string.Format("GM Command - {0} ({1}, {2}, {3}, {4}); Character: {5}", cmd.Command, cmd.Param, cmd.X, cmd.Y, cmd.Param2, cmd.Character);

            LogInterface.Log(cmdString);

            switch (cmd.Command)
            {
            case 0xfa3:
                AddTask(new Task(Task.TaskType.GiveItem, t.Client, new GiveItemArgs((uint)cmd.Param, GiveItemArgs.TheReason.GMCommand, 0)));
                break;

            default:
                //LogInterface.Log("Unhandled GM Command: 0x" + cmd.Command.ToString("x"));
                break;
            }
        }
示例#3
0
 private void Client_OnGMCommand(object sender, GMCommandPacket e)
 {
     TaskProcessor.AddTask(new Task(Task.TaskType.GMCommand_Process, (Connection)sender, e));
 }
示例#4
0
 public static GMCommandPacket Read(PacketHeader header, BinaryReader br)
 {
     GMCommandPacket pkt = new GMCommandPacket();
     pkt.Command = br.ReadUInt32();
     pkt.Param = br.ReadInt32();
     pkt.X = br.ReadInt32();
     pkt.Y = br.ReadInt32();
     pkt.Param2 = br.ReadInt32();
     pkt.Character = Utils.ReadByteString(br, 0x1F);
     return pkt;
 }
示例#5
0
 void GMCommand_Handler(PacketHeader header, BinaryReader br)
 {
     OnGMCommand(this, GMCommandPacket.Read(header, br));
 }
示例#6
0
 private void Client_OnGMCommand(object sender, GMCommandPacket e)
 {
     TaskProcessor.AddTask(new Task(Task.TaskType.GMCommand_Process, (Connection)sender, e));
 }