Пример #1
0
        void DonationRewardCommand(BasePlayer player, string command, string[] args)
        {
            Puts("PacketInit." + packetSent);
            reloadUser(player);

            _timer = timer.Repeat(1, 0, () => {
                Puts("PacketSent." + packetSent);
                if (player != null && packetSent == true)
                {
                    var playername = player.displayName;
                    var playerData = getConnectedPlayerDetailsData(player.userID);
                    int amount     = (int)playerData["amount"];

                    packetSent = false;

                    if (amount == 0)
                    {
                        PrintToChat(player, GetMessage("CreditAddFail", player.UserIDString));
                        _timer.Destroy();
                        return;
                    }
                    else
                    {
                        PrintToChat(player, GetMessage("CreditAddSuccess", player.UserIDString).Replace("{amount}", amount.ToString()).Replace("{playername}", playername.ToString()));
                        rewardUser(player);
                        _timer.Destroy();
                    }
                }
            });
        }
Пример #2
0
        private void StopThisRagnarokBabeChatCommand(BasePlayer player, string command, string[] args)
        {
            bool isadmin = permission.UserHasPermission(player.UserIDString, RagnarokAdmin);

            if (!isadmin)
            {
                SendReply(player, $"You don't have permission for this.");
                return;
            }
            if (RagnarokIsOn)
            {
                if (RagnaEndTimer != null)
                {
                    RagnaEndTimer.Destroy();
                }
                if (RagnaTimer != null)
                {
                    RagnaTimer.Destroy();
                }
                StopThisRagnarokBabe();
                SendReply(player, $"Ragnarok has stopped.");
            }
            else
            {
                SendReply(player, $"Ragnarok is already Off.");
            }
        }
Пример #3
0
 void Unload()
 {
     if (AttackTimer != null)
     {
         AttackTimer.Destroy();
     }
 }
Пример #4
0
 void Unload()
 {
     eventpause?.Destroy();
     eventstart?.Destroy();
     ingameTimer?.Destroy();
     runningman = null;
 }
Пример #5
0
 void Unload()
 {
     Abort();
     if (TimerRefresh != null)
     {
         TimerRefresh.Destroy();
     }
 }
Пример #6
0
 void OnUserDisconnected(IPlayer player)
 {
     if (target != null && activeVote && player.Id == target.Id)
     {
         server.Broadcast(lang.GetMessage("Target Disconnected", this));
         activeVote = false;
         voteTimer?.Destroy();
         voted.Clear();
         target = null;
     }
 }
Пример #7
0
        private void StartPeriod()
        {
            _cachedRaidTime = DateTime.UtcNow;
            _canRaid        = false;
            foreach (var p in BasePlayer.activePlayerList)
            {
                PrintToChat(p, Lang("Cmd_NoRaid", p.UserIDString, GetFormattedTime((_cachedRaidTime.AddMinutes(_startMinutes)
                                                                                    - DateTime.UtcNow).TotalSeconds)));
            }
            _startTimer = timer.Every(cFile.NoRaidCommand.CheckInterval, () =>
            {
                if (UI.ShouldDestroy(_cachedRaidTime, _startMinutes))
                {
                    _canRaid = true;
                    PrintToChat(Lang("CanRaid"));
                    _startTimer?.Destroy();
                    _startUiTimer?.Destroy();
                    _startTimer   = null;
                    _startUiTimer = null;
                    foreach (var p in BasePlayer.activePlayerList)
                    {
                        if (_uiPlayers.Contains(p.userID))
                        {
                            _uiPlayers.Remove(p.userID);
                        }
                        CuiHelper.DestroyUi(p, _uiParent);
                    }
                }
            });
            if (cFile.Ui.Enabled)
            {
                UI.ConstructCachedUi();
                _startUiTimer = timer.Every(cFile.Ui.RefreshInterval, () =>
                {
                    if (UI.ShouldDestroy(_cachedRaidTime, _startMinutes))
                    {
                        return;
                    }

                    var container = UI.ConstructTimer(_cachedRaidTime, _startMinutes);

                    foreach (var p in BasePlayer.activePlayerList)
                    {
                        if (!_uiPlayers.Contains(p.userID))
                        {
                            CuiHelper.AddUi(p, _cachedContainer);
                            _uiPlayers.Add(p.userID);
                        }
                        CuiHelper.DestroyUi(p, _timerParent);
                        CuiHelper.AddUi(p, container);
                    }
                });
            }
        }
Пример #8
0
 void Unload()
 {
     if (VotingTimer != null)
     {
         VotingTimer.Destroy();
     }
     if (TimeCheck != null)
     {
         TimeCheck.Destroy();
     }
 }
Пример #9
0
            public void StopEvent(bool completed = false)
            {
                _eventTimer?.Destroy();

                StopSpawnRoutine();
                DespawnPlane();
                DespawnMarker();
                DespawnCrate(completed);
                DespawnAI();

                _plugin?.DelEvent(this);
            }
Пример #10
0
        void Unload()
        {
            if (voteTimer != null)
            {
                voteTimer.Destroy();
            }

            foreach (var player in BasePlayer.activePlayerList)
            {
                CuiHelper.DestroyUi(player, Main);
            }
        }
Пример #11
0
 public void Destroy()
 {
     if (Timer != null && !Timer.Destroyed)
     {
         Timer.Destroy();
     }
 }
Пример #12
0
                public new void Exit(IemStateManager.StateManager sm)
                {
                    EmbankStateManager gsm = (EmbankStateManager)sm;

                    IemUI.UpdateGameStatusBanner("", gsm.eg);
                    completeTimer?.Destroy();
                }
Пример #13
0
 void Unload()
 {
     if (FCleanupTimer != null && !FCleanupTimer.Destroyed)
     {
         FCleanupTimer.Destroy();
     }
 }
Пример #14
0
 private void StopTimer()
 {
     if (EventTimer != null)
     {
         EventTimer.Destroy();
     }
 }
Пример #15
0
        void RunnerStop(PlayerSession session, bool admin = false)
        {
            if (session != null)
            {
                give(session);
            }
            if (admin)
            {
                Server.Broadcast("<color=#95E447>[RUN]</color> Event stopped!");
            }
            if (!ts.Destroyed)
            {
                ts.Destroy();
            }
            if (mark != null)
            {
                try
                {
                    MapManagerServer.Instance.DeregisterMarker(mark);
                }catch {}
            }


            if (runningman.WorldPlayerEntity != null)
            {
                var rn = runningman.WorldPlayerEntity.GetComponent <RunnerMan>();
                OnUnRegisterRunner();
                rn.TryDestroy();
            }
            runningman = null;
            cTimer     = 0;
        }
            public void Stop()
            {
                _onDeactivate.Invoke(this);

                _innerTimer?.Destroy();
                _innerTimer = null;
            }
Пример #17
0
 void Unload()
 {
     if (broadcastTimer != null)
     {
         broadcastTimer.Destroy();
     }
 }
Пример #18
0
////////////////////////////////////////////////////////////////////////////////

        void Destroytimer()
        {
            if (cargorefresh != null)
            {
                cargorefresh.Destroy();
            }
        }
Пример #19
0
 void Unload()
 {
     if (timeCheck != null)
     {
         timeCheck.Destroy();
     }
 }
Пример #20
0
 void Unload()
 {
     if (LocationUpdater != null && !LocationUpdater.Destroyed)
     {
         LocationUpdater.Destroy();
     }
 }
Пример #21
0
 void cmdEventOff(BasePlayer player, string cmd, string[] args)
 {
     if (!hasAccess(player, "runningman.admin"))
     {
         SendReply(player,
                   string.Format(lang.GetMessage("NoPerm", this, player.UserIDString), Config["Default", "ChatName"]));
         return;
     }
     if (eventpause != null)
     {
         eventpause.Destroy();
         eventpause = null;
         runningman = null;
         Runlog("timer eventpause stopped");
     }
     if (eventstart != null)
     {
         eventstart.Destroy();
         eventstart = null;
         runningman = null;
         Runlog("timer eventstart stopped");
     }
     if (ingameTimer != null)
     {
         ingameTimer.Destroy();
         Runlog("ingameTimer stopped");
     }
     Runlog("Running Man has stopped");
     SendReply(player, string.Format(lang.GetMessage("EventStopped", this, player.UserIDString), Config["Default", "ChatName"]));
 }
Пример #22
0
 void Unload()
 {
     if (announceTimer != null)
     {
         announceTimer.Destroy();
     }
 }
Пример #23
0
 void Unload()
 {
     if (currentPositionLogTimer != null)
     {
         currentPositionLogTimer.Destroy();
     }
 }
Пример #24
0
 void RunOnce()
 {
     if (chaintimer != null)
     {
         chaintimer.Destroy();
     }
     if (Convert.ToBoolean(Config["EnableTimerOnce"]) == true)
     {
         foreach (var cmdc in Config["TimerOnce"] as Dictionary <string, object> )
         {
             chaintimer = timer.Once(Convert.ToSingle(cmdc.Value), () => {
                 ConsoleManager.Instance?.ExecuteCommand(cmdc.Key);
                 Puts($"ran the command || " + cmdc.Key.ToString());
             });
         }
     }
 }
Пример #25
0
 void RunRepeater()
 {
     if (repeater != null)
     {
         repeater.Destroy();
     }
     if (Convert.ToBoolean(Config["EnableTimerRepeat"]) == true)
     {
         foreach (var cmd in Config["TimerRepeat"] as Dictionary <string, object> )
         {
             repeater = timer.Repeat(Convert.ToSingle(cmd.Value), 0, () => {
                 ConsoleManager.Instance?.ExecuteCommand(cmd.Key);
                 Puts($"ran the command || " + cmd.Key.ToString());
             });
         }
     }
 }
Пример #26
0
 void Unloaded()
 {
     if (g_refreshTimer != null)
     {
         g_refreshTimer.Destroy();
         g_refreshTimer = null;
     }
 }
Пример #27
0
        private void ResetEvent()
        {
            _currentScramble = null;

            _repeater?.Destroy();
            _repeater = timer.Every(_config.EventTime, StartEvent);

            _currentTimer?.Destroy();
        }
Пример #28
0
 void Unload()
 {
     PrintWarning("Saving created promocodes, removing timers and existing codes...");
     LoadData();
     if (_timer != null && !_timer.Destroyed)
     {
         _timer.Destroy();
         int timeleft = (int)NextSpawn.Subtract(DateTime.Now).TotalSeconds;
         data.Timer = timeleft;
         SaveData();
     }
     foreach (var item in CreatedBoxes)
     {
         item.Key.entityOwner.Kill();
         data.SavedCodes.Add(item.Value);
         SaveData();
     }
 }
Пример #29
0
                public new void Exit(IemStateManager.StateManager sm)
                {
                    EmbankStateManager gsm = (EmbankStateManager)sm;

                    gameLobbyWaitTimer.Destroy();
                    gameLobbyBannerTimer.Destroy();

                    EntitiesTakingDamage -= gsm.eg.PlayerImmortal;
                }
Пример #30
0
        void Unloaded()
        {
            if (g_refreshTimer == null)
            {
                return;
            }

            g_refreshTimer.Destroy();
            g_refreshTimer = null;
        }