Exemplo n.º 1
0
 public void SendOperationRequest(OperationRequest request)
 {
     using (var packet = PhotonClientPacket.CreatePacket())
         using (var buffer = new StreamBuffer(0))
         {
             SerializationProtocol.SerializeOperationRequest(buffer, request.OperationCode, request.Parameters, false);
             packet.Write(buffer.ToArray(), 0, (int)buffer.Length);
             Send(packet);
         }
 }
Exemplo n.º 2
0
        public void SendEventData(OperationRequest eventData)
        {
            var tcpHeader = new byte[] { 251, 0, 0, 0, 0, 0, 1, 243, 4 };

            var buffer = default(byte[]);

            using (var stream = new StreamBuffer(0))
            {
                stream.Write(tcpHeader, 0, tcpHeader.Length);
                SerializationProtocol.SerializeOperationRequest(stream, eventData.OperationCode, eventData.Parameters, false);

                buffer = stream.ToArray();
                int num = 1;
                Protocol.Serialize(buffer.Length, buffer, ref num);
            }

            using (var photonPacket = new PhotonPacket())
            {
                photonPacket.Write(buffer, 0, buffer.Length);
                Send(photonPacket);
            }
        }