Ejemplo n.º 1
0
        public static PhotonPacket PingTemplate()
        {
            var packet = new PhotonPacket();

            packet.Write((byte)0xF0);
            return(packet);
        }
Ejemplo n.º 2
0
        public static PhotonPacket InitResponseTemplate()
        {
            var packet    = new PhotonPacket();
            var initBytes = "fb0000000a0001f30100".ToArray();

            packet.Write(initBytes, 0, initBytes.Length);
            return(packet);
        }
Ejemplo n.º 3
0
        public static PhotonPacket InitTemplate()
        {
            var packet    = new PhotonPacket();
            var initBytes = "fb000000300001f30001061e410106004c6f616442616c616e63696e6700000000000000000000000000000000000000".ToArray();

            packet.Write(initBytes, 0, initBytes.Length);
            return(packet);
        }
Ejemplo n.º 4
0
        public static PhotonPacket OperationRequestTemplate(byte channelId = 0, bool reliable = true, bool encrypted = false)
        {
            var packet = new PhotonPacket();

            packet.Write((byte)0xFB);
            packet.Write(0);
            packet.Write(channelId);
            packet.Write(Convert.ToByte(reliable));
            packet.Write((byte)0xF3);

            if (encrypted)
            {
                packet.Write((((byte)PhotonCode.Operation)) | 128);
            }
            else
            {
                packet.Write((byte)PhotonCode.Operation);
            }

            return(packet);
        }