Exemple #1
0
        /// <summary>
        /// Test sign in callback
        /// </summary>
        /// <param name="accountInfo"></param>
        /// <param name="error"></param>
        private void SignInCallback(ClientAccountInfo accountInfo, string error)
        {
            if (accountInfo == null)
            {
                logger.Error(error);
                return;
            }

            logger.Debug($"Signed in successfully as {accountInfo.Username}");
            logger.Debug("Finding games...");

            Mst.Client.Matchmaker.FindGames((games) =>
            {
                if (games.Count == 0)
                {
                    logger.Error("No test game found");
                    return;
                }

                logger.Debug($"Found {games.Count} games");

                // Get first game fromlist
                GameInfoPacket firstGame = games.First();

                // Let's try to get access data for room we want to connect to
                GetRoomAccess(firstGame.Id);
            });
        }
Exemple #2
0
 public virtual ClientAccountInfo GetClientAccount(NHibernate.ISession session)
 {
     // client/account mismatches are possible because of remote processing, so this may be null
     if (_clientAccountInfo == null)
     {
         _clientAccountInfo = session.Query <ClientAccountInfo>().FirstOrDefault(x => x.ClientID == Client.ClientID && x.AccountID == Account.AccountID);
     }
     return(_clientAccountInfo);
 }
Exemple #3
0
        /// <summary>
        /// Fired when msf user is successfully signed in in test mode
        /// </summary>
        /// <param name="accountInfo"></param>
        /// <param name="error"></param>
        protected virtual void OnSignInCallbackHandler(ClientAccountInfo accountInfo, string error)
        {
            if (accountInfo == null)
            {
                logger.Error(error);
                return;
            }

            StartClient();
        }
    /**
     * <summary> Passe un client en mode "hors ligne". </summary>
     */
    void LogOff(ClientAccountInfo client)
    {
        if (client == null || !KnownClients.ContainsKey(client.GetUsername()) || client.GetConnectionID() == -1)
        {
            BloodAndBileEngine.Debugger.Log("ERREUR - Ce client est déjà hors ligne ou n'existe pas !");
            return;
        }
        int coID = client.GetConnectionID();

        OnlineClients.Remove(coID);
        BloodAndBileEngine.Debugger.Log("Client " + client.GetUsername() + " déconnecté !", Color.yellow);
    }
 /**
  * <summary> Passe un client en mode "en ligne". </summary>
  */
 void LogIn(ClientAccountInfo client, int coID)
 {
     if (!OnlineClients.ContainsKey(coID))
     {
         client.Login(coID);
         OnlineClients.Add(coID, client);
         BloodAndBileEngine.Debugger.Log("Client " + client.GetUsername() + " connecté !");
     }
     else
     {
         BloodAndBileEngine.Debugger.Log("ERREUR - Cette ID de connexion est déjà associée à un client !", Color.red);
     }
 }