Exemplo n.º 1
0
 public override void Load(bool startup)
 {
     OnPlayerConnectEvent.Register(HandleConnect, Priority.Low);
     OnPlayerDisconnectEvent.Register(HandleDisconnect, Priority.Low);
     OnPlayerChatEvent.Register(HandleChat, Priority.Low);
     OnPlayerActionEvent.Register(HandlePlayerAction, Priority.Low);
     OnModActionEvent.Register(HandleModerationAction, Priority.Low);
 }
Exemplo n.º 2
0
 public override void Load(bool startup) {
     OnPlayerConnectEvent.Register(ConnectHandler.HandleConnect, Priority.Critical);
     OnPlayerCommandEvent.Register(ChatHandler.HandleCommand, Priority.Critical);
     OnChatEvent.Register(ChatHandler.HandleOnChat, Priority.Critical);
     OnPlayerStartConnectingEvent.Register(ConnectingHandler.HandleConnecting, Priority.Critical);
     
     OnSentMapEvent.Register(MiscHandlers.HandleOnMapSent, Priority.Critical);
     OnPlayerMoveEvent.Register(MiscHandlers.HandlePlayerMove, Priority.Critical);
     OnPlayerClickEvent.Register(MiscHandlers.HandlePlayerClick, Priority.Critical);
     
     OnEcoTransactionEvent.Register(EcoHandlers.HandleEcoTransaction, Priority.Critical);
     OnModActionEvent.Register(ModActionHandler.HandleModAction, Priority.Critical);
     clearTask = Server.Background.QueueRepeat(IPThrottler.CleanupTask, null, 
                                               TimeSpan.FromMinutes(10));
 }
Exemplo n.º 3
0
        public override void Load(bool startup)
        {
            OnPlayerConnectEvent.Register(ConnectHandler.HandleConnect, Priority.Critical);
            OnPlayerCommandEvent.Register(ChatHandler.HandleCommand, Priority.Critical);
            OnChatEvent.Register(ChatHandler.HandleOnChat, Priority.Critical);
            OnPlayerStartConnectingEvent.Register(ConnectingHandler.HandleConnecting, Priority.Critical);

            OnSentMapEvent.Register(MiscHandlers.HandleSentMap, Priority.Critical);
            OnPlayerMoveEvent.Register(MiscHandlers.HandlePlayerMove, Priority.Critical);
            OnPlayerClickEvent.Register(MiscHandlers.HandlePlayerClick, Priority.Critical);
            OnChangedZoneEvent.Register(MiscHandlers.HandleChangedZone, Priority.Critical);

            OnEcoTransactionEvent.Register(EcoHandlers.HandleEcoTransaction, Priority.Critical);
            OnModActionEvent.Register(ModActionHandler.HandleModAction, Priority.Critical);
        }
Exemplo n.º 4
0
        void InitServerTask(SchedulerTask task)
        {
            Server.Start();
            // The first check for updates is run after 10 seconds, subsequent ones every two hours
            Server.Background.QueueRepeat(Updater.UpdaterTask, null, TimeSpan.FromSeconds(10));

            OnPlayerConnectEvent.Register(Player_PlayerConnect, Priority.Low);
            OnPlayerDisconnectEvent.Register(Player_PlayerDisconnect, Priority.Low);
            OnSentMapEvent.Register(Player_OnJoinedLevel, Priority.Low);
            OnModActionEvent.Register(Player_OnModAction, Priority.Low);

            OnLevelAddedEvent.Register(Level_LevelAdded, Priority.Low);
            OnLevelRemovedEvent.Register(Level_LevelRemoved, Priority.Low);
            OnPhysicsLevelChangedEvent.Register(Level_PhysicsLevelChanged, Priority.Low);

            RunOnUI_Async(() => main_btnProps.Enabled = true);
        }
Exemplo n.º 5
0
        public override void Load(bool startup)
        {
            config.LoadConfig();
            if (config.Token == "" || config.ChannelID == "")
            {
                Logger.Log(LogType.Warning, "Invalid config! Please setup the Discord bot in discord.properties! (plugin reload required)");
                return;
            }

            dc = new Discord.Discord(config.Token, config.ChannelID);

            OnPlayerConnectEvent.Register(PlayerConnect, Priority.Low);
            OnPlayerDisconnectEvent.Register(PlayerDisconnect, Priority.Low);
            OnPlayerChatEvent.Register(PlayerChat, Priority.Low);
            OnPlayerCommandEvent.Register(PlayerCommand, Priority.Low);
            OnModActionEvent.Register(ModAction, Priority.Low);

            OnMessageReceivedEvent.Register(DiscordMessage, Priority.Low);

            Command.Register(new CmdDiscordBot());
            registered = true;
        }
Exemplo n.º 6
0
 public override void Load(bool startup)
 {
     OnModActionEvent.Register(HandleModerationAction, Priority.Low);
 }