public CmdInputAction(short t, long aid, byte action, byte not, long to = 0) { cmdType = t; switch (not) { case MsgBroadcastType.Peer: wp = PacketFunc.CreatePeerPacket(to); break; case MsgBroadcastType.Broadcast: wp = PacketFunc.CreateBroadcastPacket(true); break; case MsgBroadcastType.BroadcastNot: wp = PacketFunc.CreateBroadcastPacket(false); break; default: wp = PacketFunc.CreateBroadcastPacket(true); break; } wp.WriteInt16(MsgInsideDef.MsgInputAction); wp.WriteInt8(action); wp.WriteInt64(aid); }
//创建单发数据包 public static WritePacket CreatePeerPacket(Int64 to) { WritePacket wp = new WritePacket(); wp.WriteInt8(MsgOutsideDef.MsgPeer); wp.WriteInt64(to); return(wp); }
//创建群发数据包 public static WritePacket CreateBroadcastPacket(bool notself) { WritePacket wp = new WritePacket(); wp.WriteInt8(MsgOutsideDef.MsgBroadcast); wp.WriteInt64(0); wp.WriteInt8(notself ? (byte)1 : (byte)0); return(wp); }