コード例 #1
0
        public void InitializeScript()
        {
            using (var lua = new Lua()) {
                lua.RegisterFunction("AddIpAddress", null, typeof(IpBlockList).GetMethod("AddIpAddress"));

                IpBlockList.Clear();
                lua.DoFile("BlockList.lua");
            }
        }
コード例 #2
0
        public void ReloadBlockList()
        {
            using (var lua = new Lua()) {
                IpBlockList.Clear();

                lua.LoadCLRPackage();
                lua.RegisterFunction("AddIpAddress", null, typeof(IpBlockList).GetMethod("AddIpAddress"));

                lua.DoFile("BlockList.lua");
            }
        }
コード例 #3
0
        public void StopServer()
        {
            Server.Stop();
            Login.Stop();

            DataManagement.ClearDatabases();
            Authentication.Clear();

            IpFiltering.Clear();
            IpBlockList.Clear();

            CloseLog();
        }
コード例 #4
0
        public void StopServer()
        {
            Server.Stop();

            TcpTransfer.Disconnect();
            TcpTransfer = null;

            IpFiltering.Clear();

            Checksum.Clear();
            GeoIpBlock.Clear();
            IpBlockList.Clear();

            CloseLog();
        }
コード例 #5
0
        public void InitializeScript()
        {
            using (var lua = new Lua()) {
                lua.LoadCLRPackage();
                lua.RegisterFunction("AddChecksum", null, typeof(Checksum).GetMethod("Add"));
                lua.RegisterFunction("AddCountry", null, typeof(GeoIpBlock).GetMethod("AddCountry"));
                lua.RegisterFunction("AddIpAddress", null, typeof(IpBlockList).GetMethod("AddIpAddress"));

                Checksum.Clear();
                lua.DoFile("Checksum.lua");

                GeoIpBlock.Clear();
                lua.DoFile("GeoIP.lua");

                IpBlockList.Clear();
                lua.DoFile("BlockList.lua");
            }
        }