Beispiel #1
0
        public override void SendMsg(ulong msgid, byte[] bytearray)
        {
            gtmInterface.ByteBuffer buff = new gtmInterface.ByteBuffer();
            UInt16 lengh = (UInt16)(bytearray.Length + sizeof(ulong));

            buff.WriteShort(Converter.GetBigEndian(lengh));
            buff.WriteUlong(msgid);
            buff.WriteBytes(bytearray);

            if (NetManager.instance != null)
            {
                NetManager.instance.SendMessage(buff);
            }
        }
Beispiel #2
0
        public override void SendFBMsg(ulong msgid, FlatBufferBuilder builder)
        {
            byte[] bytearray = builder.DataBuffer.ToSizedArray();

            gtmInterface.ByteBuffer buff = new gtmInterface.ByteBuffer();
            UInt16 lengh  = (UInt16)(bytearray.Length + sizeof(ulong));
            UInt16 biglen = Converter.GetBigEndian(lengh);

            buff.WriteShort(biglen);
            buff.WriteUlong(msgid);
            buff.WriteBytes(bytearray);

            if (NetManager.instance != null)
            {
                NetManager.instance.SendMessage(buff);
            }
        }