示例#1
0
    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);
    }
示例#2
0
    //创建单发数据包
    public static WritePacket CreatePeerPacket(Int64 to)
    {
        WritePacket wp = new WritePacket();

        wp.WriteInt8(MsgOutsideDef.MsgPeer);
        wp.WriteInt64(to);
        return(wp);
    }
示例#3
0
    //创建群发数据包
    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);
    }