Exemplo n.º 1
0
 void OnRequestNewStatus(Request_NewStatus e)
 {
     if (e.IsMainRequest && (e.NewStatus == RequestStatus.Finished))
     {
         var req    = _request.Get(e.Id);
         var user   = req.Owner;
         var client = user.Client;
         var change = _rules.CalculateClientMoodChange(user.Mood);
         _logger.MessageFormat("Update client {0} mood to: {1} (from user mood: {2})", client, change, user.Mood);
         _client.UpdateMood(client, change);
         var newMood = _client.Get(client)?.Mood;
         _logger.MessageFormat("New client {0} mood is {1}", client, newMood);
         if (newMood <= 0)
         {
             _client.RemoveClient(client);
         }
     }
 }
Exemplo n.º 2
0
 public List <ServerType> GetAdditionalServers(User user)
 {
     return((user != null) ? _client.Get(user.Client)?.AdditionalServers : null);
 }