Beispiel #1
0
 public void WriteRpcLog(int gameCode, string ipAddress, Shared.RpcCalls rpcCall, byte[] data)
 {
     if (data.Length > 240)
     {
         throw new Exception("Too much data. Please write max. 255 bytes at a time.");
     }
     BeginWriteLine((byte)Shared.LogType.Rpc, GetTime());
     EncodeStream.WriteByte((byte)rpcCall);
     EncodeStream.Write(BitConverter.GetBytes(gameCode), 0, 4);
     EncodeStream.Write((IPAddress.Parse(ipAddress).GetAddressBytes()), 0, 4);
     EncodeStream.Write(data, 0, data.Length);
     EndWriteLine();
 }
Beispiel #2
0
 /// <summary>
 /// This is used to log RPC. It is not currently in use anywhere, but is handled.
 /// </summary>
 /// <param name="gameCode">The Game's ID.</param>
 /// <param name="ipAddress">The IP address of the sender.</param>
 /// <param name="rpcCall">The RPC call.</param>
 /// <param name="data">The RPC data.</param>
 public void WriteRpcLog(int gameCode, string ipAddress, Shared.RpcCalls rpcCall, byte[] data)
 {
     lock (_writerLock)
     {
         if (!IoStream.CanWrite)
         {
             return;
         }
         BeginWriteLine((byte)Shared.LogType.Rpc, GetTime());
         EncodeStream.WriteByte((byte)rpcCall);
         EncodeStream.Write(BitConverter.GetBytes(gameCode), 0, 4);
         EncodeStream.Write((IPAddress.Parse(ipAddress).GetAddressBytes()), 0, 4);
         EncodeStream.Write(data, 0, data.Length);
         EndWriteLine();
     }
 }