Esempio n. 1
0
        private static Packet DoAction(DataPayload payload)
        {
            var dataPayload = new DataPayload(receiverId: payload.ReceiverId, payload: payload.Payload);

            return(new Packet(RealTimeHandler.PlayerHash, RealTimeConst.ActionPrivateMessage,
                              GProtocolSendType.Reliable,
                              dataPayload.Serialize()));
        }
 internal static void AddToQueue(DataPayload dataPayload)
 {
     try
     {
         var payload = dataPayload.Serialize();
         if (GsSerializer.Object.GetSendQueueBufferSize(_sendQueue) + payload.Length <=
             RealTimeConst.MaxPacketBeforeSize &&
             _sendQueue.Count <= MaxQueueSize)
         {
             _sendQueue?.Enqueue(payload);
         }
         else
         {
             DebugUtil.LogError(typeof(ObserverCompacterUtil), DebugLocation.RealTime, "AddToQueue",
                                new GameServiceException("Send Queue is Full"));
         }
     }
     catch (Exception e)
     {
         e.LogException(typeof(ObserverCompacterUtil), DebugLocation.RealTime, "AddToQueue");
     }
 }
 private static Packet DoAction(DataPayload payload)
 {
     return(new Packet(RealTimeHandler.PlayerHash, RealTimeConst.ActionEvent, GProtocolSendType.Reliable,
                       payload.Serialize()));
 }