示例#1
0
        public void ReloadChecksum()
        {
            using (var lua = new Lua()) {
                Checksum.Clear();

                lua.LoadCLRPackage();
                lua.RegisterFunction("AddChecksum", null, typeof(Checksum).GetMethod("Add"));

                lua.DoFile("Checksum.lua");
            }
        }
示例#2
0
        public void StopServer()
        {
            Server.Stop();

            TcpTransfer.Disconnect();
            TcpTransfer = null;

            IpFiltering.Clear();

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

            CloseLog();
        }
示例#3
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");
            }
        }