Ejemplo n.º 1
0
 public void CloseWrite(string channelName, Identity user, EPacket type)
 {
     if (!type.IsChunk())
     {
         LogUtils.LogNetwork("Error: Failed to stream non chunk: " + type);
     }
     else
     {
         NetworkCallAttribute networkCall;
         var index =
             GetCall(channelName, out networkCall);
         if (index == -1)
         {
             return;
         }
         byte[] buffer;
         GetPacket(type, index, out buffer);
         if (IsOwner && (user == Connection.ClientID))
         {
             Receive(Connection.ClientID, buffer);
         }
         else if (Connection.IsServer() && (user == Connection.ServerID))
         {
             Receive(Connection.ServerID, buffer);
         }
         else
         {
             Connection.Send(user, type, buffer, ID);
         }
     }
 }
Ejemplo n.º 2
0
 public void CloseWrite(string channelName, ECall mode, EPacket type)
 {
     LogUtils.Debug(nameof(CloseWrite) + ": " + channelName);
     if (!type.IsChunk())
     {
         LogUtils.LogNetwork("Error: Failed to stream non chunk: " + type);
     }
     else
     {
         NetworkCallAttribute networkCall;
         var index =
             GetCall(channelName, out networkCall);
         if (index == -1)
         {
             return;
         }
         byte[] buffer;
         GetPacket(type, index, out buffer);
         Send(mode, type, buffer);
     }
 }