Пример #1
0
 /// <summary>
 /// Responsible for preventing spam to the user by setting a timer to prevent messages from Handyman for a set duration.
 /// </summary>
 private void ConfigureMessageTimer()
 {
     //checks if our timer exists
     if (RepairMessageTimer == null)
     {
         //no - create it
         RepairMessageTimer = new PluginTimers(this);
         //set it to fire every xx seconds based on configuration
         RepairMessageTimer.Every(configData.HandyManChatInterval, RepairMessageTimer_Elapsed);
     }
 }
Пример #2
0
        private void Loaded()
        {
            permission.RegisterPermission("handyman.use", this);
            LoadVariables();

            try
            {
                playerData = dataFile.ReadObject <Dictionary <ulong, bool> >();
            }
            catch { }

            if (playerData == null)
            {
                playerData = new Dictionary <ulong, bool>();
            }

            //Set message timer to prevent user spam
            RepairMessageTimer = new PluginTimers(this);
            RepairMessageTimer.Every(HandyManChatInterval, () => _allowHandyManFixMessage = true);
        }