Пример #1
0
 public void TryHandshake()
 {
     try
     {
         SendCore(PacketFactory.MakeConnectBuffer(userId, connectArgs.matchId, connectArgs.matchToken));
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #2
0
 private void TryHandshake(ConnectArgs connectArgs)
 {
     try
     {
         // Write directly to the SSL stream instead of enqueueing
         // to the send packets queue in order to know immediately
         // if the server closes the socket because of an invalid
         // match token.
         sslStream.Write(PacketFactory.MakeConnectBuffer(userId, connectArgs.MatchId, connectArgs.MatchToken));
     }
     catch (Exception)
     {
         // The server will close the socket if the client's match
         // token was either invalid or its encrypted timestamp
         // is expired.
         RaiseServerHandshakeFailed();
         throw;
     }
 }