Example #1
0
        public void SendApple(string userName, int count)
        {
            lock (UsersPool.Requests)
            {
                //decrease the amount of user request admin approved
                if (UsersPool.Requests.ContainsKey(userName))
                {
                    UsersPool.Requests[userName] -= count;

                    //update all admin views
                    UsersPool.UpdateAdminScreens(userName, UsersPool.Requests[userName]);
                }
            }
            lock (MessageBroker.PreUserDefinitions)
            {
                if (MessageBroker.PreUserDefinitions.ContainsKey(userName))
                {
                    MessageBroker.PreUserDefinitions[userName].Apples += count;
                }
            }
            BaseUserClass.RaiseAppleSent(userName);
        }
Example #2
0
 //Request more apple
 public void RequestSomeApple()
 {
     UsersPool.RequestApple(userDefinition.Username);
     AdminSent(userDefinition.Username);
 }