Ejemplo n.º 1
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);
    }
Ejemplo n.º 2
0
    //创建空数据包
    public static WritePacket CreateNullPacket()
    {
        WritePacket wp = new WritePacket();

        wp.WriteInt8(MsgOutsideDef.MsgNull);
        return(wp);
    }
Ejemplo n.º 3
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);
    }
Ejemplo n.º 4
0
    //创建单发数据包
    public static WritePacket CreatePeerPacket(Int64 to)
    {
        WritePacket wp = new WritePacket();

        wp.WriteInt8(MsgOutsideDef.MsgPeer);
        wp.WriteInt64(to);
        return(wp);
    }