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); }
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; } }
private void Client_OnGMCommand(object sender, GMCommandPacket e) { TaskProcessor.AddTask(new Task(Task.TaskType.GMCommand_Process, (Connection)sender, e)); }
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; }
void GMCommand_Handler(PacketHeader header, BinaryReader br) { OnGMCommand(this, GMCommandPacket.Read(header, br)); }