public override void Initialize()
        {
            HookManager serverHooks = ServerApi.Hooks;

            serverHooks.NetGetData.Register(this, OnGetData);

            GetDataHandlers.InitGetDataHandler();

            plugin = new MPPacketWrapperPlugin();
        }
示例#2
0
        public override void Initialize()
        {
            ServerApi.Hooks.NetGreetPlayer.Register(this, GreetPlayer);
            ServerApi.Hooks.ServerLeave.Register(this, PlayerLeave);
            ServerApi.Hooks.GameInitialize.Register(this, OnInitialize);

            GetDataHandlers.InitGetDataHandler();

            TShockAPI.Commands.ChatCommands.Add(new Command("streak.check", CheckStreakCommand, "streak"));
            TShockAPI.Commands.ChatCommands.Add(new Command("streak.reload", Reload, "streaksreload"));
            OnSecondUpdate          = new Timer(1000);
            OnSecondUpdate.Enabled  = true;
            OnSecondUpdate.Elapsed += SecondUpdate;

            string path = Path.Combine(TShock.SavePath, "Streaks.json");

            if (!File.Exists(path))
            {
                Config.WriteTemplates(path);
            }
            Config = Config.Read(path);
        }
示例#3
0
 public override void Initialize()
 {
     ServerApi.Hooks.GameInitialize.Register(this, OnInitialize);
     GetDataHandlers.InitGetDataHandler();
 }