Mini Kabibi Habibi
-- "$Id: init.lua 5264 2006-11-15 04:33:20Z yuan_shiyong $"
-- (c) Copyright 1992-2005, ZheJiang Dahua Information Technology Stock CO.LTD.
-- All Rights Reserved
--
-- �� �� ��� Global.lua
-- �� �: ��ű�
-- �ļ�¼�� 2005-10-11 ����� <wanghw@dhmail.com> ����ԭ���İ汾�Գ���������,�ṹ���������
--
local basePath = "/usr/bin/lua";
local customPath = "/mnt/custom"; -- ���������Ϣ��·��
local configPath = "/usr/data"; -- ���Ĭ��������Ϣ
-- local vendorPath = "/var/vendor"; -- ���ODM���̵�������Ϣ��·��
local user_config_path = "/mnt/mtd/Config"; -- ����û���������Ϣ��·��
-- WARNING:
-- ����Windows�ϵĵ���,��Ҫ�Դ�basePath������,����ᵼ�³������ȷ����
--
if(os.getenv("windir")) then
basePath = "./Common/Lua";
configPath = basePath .. "/Script/Config";
user_config_path = "config";
end
LUA_PATH = basePath .. "/?.lua;" ..
basePath .. "/?.lc;" ..
basePath .. "/script/conf/?.lua;" ..
basePath .. "/script/?.lua;" ;
require("compat-5.1");
-- I don't know why,but it worked :(
pcall(require, "compat-5.1");
Global = {};
local Utils = require("utils"); -- ����Utils
-- ���ڼ����û��������ļ�
-- params:
-- None
-- return:
-- None
local function loadUserConfig ()
local user_config_file = user_config_path .. "/user.lua";
local my_file = io.open(user_config_file, "r");
local config_file_content;
if (my_file) then
local content = my_file:read("*a");
my_file:close();
if(content) then
local f = loadstring(content);
if (f) then
pcall(f);
end
end
end
end
-- ��������õĸ���ű��ļ�����GB��Windowsƽ̨����Ϊû��ZIP��,
-- ���ػ�ʧ�ܣ����ʹ��pcall���ã�ȷ�����سɹ�
local ret, LiveUpdate = pcall(dofile, basePath .. "/LiveUpdate.lua");
if (ret) then
Global.LiveUpdate = LiveUpdate;
end
-- ������̨�Ľ���ű�
local ptzCtrl = dofile(basePath .. "/PTZCtrl.lua");
-- ��̨����Э����ڵ�·��
if(os.getenv("windir")) then
ptzCtrl.PathSet = {basePath .. "/ptz",
basePath .. "/plugin/ptz",
basePath .. "plugin/specialptz",
}
else
ptzCtrl.PathSet = {basePath .. "/ptz",
user_config_path .. "/ptzPlugin",
--vendorPath .. "/plugin/ptz",
}
end;
Global.PtzCtrl= ptzCtrl;
-- ���ش��ڵĽ���ű�
local atmCtrl = dofile(basePath .. "/ATMCtrl.lua");
if(os.getenv("windir")) then
atmCtrl.PathSet = {basePath .. "/plugin/com",
basePath .. "/plugin/extcom",
}
else
atmCtrl.PathSet = {customPath,
basePath .. "/com",
user_config_path .. "/comPlugin",};
end;
Global.AtmCtrl = atmCtrl;
-- �ȼ���Ӳ����ص���Ϣ�������ز��ɹ����ټ���Ĭ��Ŀ¼
local hardware= dofile(configPath .. "/hardware.lua");
local config= dofile(configPath .. "/config.lua");
-- �ȼ��ؾɰ汾������
local ret, custom = pcall(dofile, customPath .. "/config.lua");
-- �����ɹ����ټ����µ�������Ϣ
if (not ret) then
ret, custom = pcall(dofile, customPath .. "/custom.lua");
-- �����ز��ɹ����ټ���Ĭ��Ŀ¼
if (not ret) then
ret, custom = pcall(dofile, configPath .. "/custom.lua");
-- ���ټ��ز��ɹ���˵���ʽ��������config��
if (not ret) then
custom = config;
end
end
end
local verndor = config;
Global.Vendor = config;
local meminfo = Utils.QueryMemInfo();
-- �����û��Ľű������ļ�
loadUserConfig();
----------------------------------------------------------------------------
--
-- ��Ҫ������Ĵ���
--
----------------------------------------------------------------------------
Global.Hardware = hardware;
Global.Frontboard = config.Frontboard;
Global.MaxPlaybackChannels = config.MaxPlaybackChannels;
if config.ForATM then
Global.ForATM = config.ForATM;
end;
-- �������ֵ��·�x�ֱ��ʿ�x�ֱ��ʸ�x֡�ʣ���Ӧ�ò��ݻ���ͺŶ�ȡ��Ӧ��ֵ��Ȼ�����ø��ײ㣬added by hank
Global.GPUEnabled = 1;
if Global.GPUEnabled == 1 then
Global.DecCaps_NVR6000 = {}; -- ��ӦNVR6000
Global.DecCaps_NVR6000.Monitor_TV0 = 5 * 1920 * 1080 * 30; -- ��һ�����
Global.DecCaps_NVR6000.Monitor_TV1 = 3 * 1920 * 1080 * 30; -- �ڶ������
Global.DecCaps_NVR6000.Monitor_TV2 = 4 * 1920 * 1080 * 30; -- ��������
Global.DecCaps_NVR6000.Monitor_TV3 = 4 * 1920 * 1080 * 30; -- ���������
Global.DecCaps_NVR6000.Monitor_TV4 = 4 * 1920 * 1080 * 30; -- ���������
Global.DecCaps_NVR6000.Monitor_TV5 = 4 * 1920 * 1080 * 30; -- ��������
Global.DecCaps_NVR6000.PlayBack = 5 * 1920 * 1080 * 30; -- �ط�
Global.DecCaps_NVR6064 = {}; -- ��ӦNVR6064
Global.DecCaps_NVR6064.Monitor_TV0 = 4 * 1920 * 1080 * 30; -- ��һ�����
Global.DecCaps_NVR6064.Monitor_TV1 = 2 * 1920 * 1080 * 30; -- �ڶ������
Global.DecCaps_NVR6064.Monitor_TV2 = 4 * 1920 * 1080 * 30; -- ��������
Global.DecCaps_NVR6064.Monitor_TV3 = 4 * 1920 * 1080 * 30; -- ���������
Global.DecCaps_NVR6064.Monitor_TV4 = 4 * 1920 * 1080 * 30; -- ���������
Global.DecCaps_NVR6064.Monitor_TV5 = 4 * 1920 * 1080 * 30; -- ��������
Global.DecCaps_NVR6064.PlayBack = 5 * 1920 * 1080 * 30; -- �ط�
Global.DecCaps_NVR7000 = {}; -- ��ӦNVR7000
Global.DecCaps_NVR7000.Monitor_TV0 = 16 * 1920 * 1080 * 30; -- ��һ�����
Global.DecCaps_NVR7000.Monitor_TV1 = 4 * 1920 * 1080 * 30; -- �ڶ������
Global.DecCaps_NVR7000.Monitor_TV2 = 4 * 1920 * 1080 * 30; -- ��������
Global.DecCaps_NVR7000.Monitor_TV3 = 4 * 1920 * 1080 * 30; -- ���������
Global.DecCaps_NVR7000.Monitor_TV4 = 4 * 1920 * 1080 * 30; -- ���������
Global.DecCaps_NVR7000.Monitor_TV5 = 4 * 1920 * 1080 * 30; -- ��������
Global.DecCaps_NVR7000.PlayBack = 16 * 1920 * 1080 * 30; -- �ط�
else
Global.DecCaps_NVR6000 = {}; -- ��ӦNVR6000
Global.DecCaps_NVR6000.Monitor_TV0 = 4 * 1920 * 1080 * 25; -- ��һ�����
Global.DecCaps_NVR6000.Monitor_TV1 = 1 * 1920 * 1080 * 25; -- �ڶ������
Global.DecCaps_NVR6000.Monitor_TV2 = 4 * 1920 * 1080 * 25; -- ��������
Global.DecCaps_NVR6000.Monitor_TV3 = 4 * 1920 * 1080 * 25; -- ���������
Global.DecCaps_NVR6000.Monitor_TV4 = 4 * 1920 * 1080 * 25; -- ���������
Global.DecCaps_NVR6000.Monitor_TV5 = 4 * 1920 * 1080 * 25; -- ��������
Global.DecCaps_NVR6000.PlayBack = 4 * 1920 * 1080 * 25; -- �ط�
Global.DecCaps_NVR6064 = {}; -- ��ӦNVR6064
Global.DecCaps_NVR6064.Monitor_TV0 = 2 * 1920 * 1080 * 25; -- ��һ�����
Global.DecCaps_NVR6064.Monitor_TV1 = 1 * 1920 * 1080 * 25; -- �ڶ������
Global.DecCaps_NVR6064.Monitor_TV2 = 4 * 1920 * 1080 * 25; -- ��������
Global.DecCaps_NVR6064.Monitor_TV3 = 4 * 1920 * 1080 * 25; -- ���������
Global.DecCaps_NVR6064.Monitor_TV4 = 4 * 1920 * 1080 * 25; -- ���������
Global.DecCaps_NVR6064.Monitor_TV5 = 4 * 1920 * 1080 * 25; -- ��������
Global.DecCaps_NVR6064.PlayBack = 2 * 1920 * 1080 * 25; -- �ط�
Global.DecCaps_NVR7000 = {}; -- ��ӦNVR7000
Global.DecCaps_NVR7000.Monitor_TV0 = 8 * 1920 * 1080 * 30; -- ��һ�����
Global.DecCaps_NVR7000.Monitor_TV1 = 8 * 1920 * 1080 * 30; -- �ڶ������
Global.DecCaps_NVR7000.Monitor_TV2 = 4 * 1920 * 1080 * 30; -- ��������
Global.DecCaps_NVR7000.Monitor_TV3 = 4 * 1920 * 1080 * 30; -- ���������
Global.DecCaps_NVR7000.Monitor_TV4 = 4 * 1920 * 1080 * 30; -- ���������
Global.DecCaps_NVR7000.Monitor_TV5 = 4 * 1920 * 1080 * 30; -- ��������
Global.DecCaps_NVR7000.PlayBack = 8 * 1920 * 1080 * 30; -- �ط�
end
-- ¼���һЩ��������
Global.Record = {};
Global.Memory = {};
-- ����������Ĵ�С,����64M�İ���,�����24M�ռ�������Ƶ��
-- ����,�û�����Ԥ¼�Ĵ�С,����32M�İ���,Ŀǰ��4M,�պ���Ҫ���
-- Ϊ6M
-- local PacketBufSize =1536 * 1024;
Global.Memory.PacketBufSize_1536M = 1536 * 1024;
Global.Memory.PacketBufSize_1024M = 1024 * 1024;
Global.Memory.PacketBufSize_1230M = 1230 * 1024;
Global.Memory.PacketBufSize_512M = 400 * 1024;
Global.Memory.PacketBufSize_3072M = 3072 * 1024;
local SupportedLanguage = custom.SupportedLanguage;
local SupportedLanguageDefault = custom.SupportedLanguageDefault;
local SupportedVideoStand = custom.SupportedVideoStand;
local SupportedVideoStandDefault = custom.SupportedVideoStandDefault;
---����汾�ͺ���汾ֵ
Global.DVR_VENDOR_ID = custom.DVR_VENDOR_ID;
Global.IsSupportDetailLog = custom.SupportDetailLog;
Global.ShowLogo = custom.ShowLogo;
Global.DefaultDahuaddns = custom.DefaultDahuaddns;
Global.DahuaddnsType = custom.DahuaddnsType;
Global.OEMType = custom.OEMType;
Global.MaxStreams = custom.MaxStreams;
Global.DefaultIpv6HostIp = custom.DefaultIpv6HostIp;
Global.DefaultIpv6HostIp0= custom.DefaultIpv6HostIp0;
Global.DefaultIpv6HostIp1= custom.DefaultIpv6HostIp1;
Global.DefaultIpv6HostIp2= custom.DefaultIpv6HostIp2;
Global.DefaultIpv6HostIp3= custom.DefaultIpv6HostIp3;
Global.DefaultIpv6HostIp4= custom.DefaultIpv6HostIp4;
Global.DefaultIpv6HostIp5= custom.DefaultIpv6HostIp5;
Global.DefaultIpv6HostIp6= custom.DefaultIpv6HostIp6;
Global.DefaultIpv6HostIp7= custom.DefaultIpv6HostIp7;
Global.DefaultIpv6Gateway = custom.DefaultIpv6Gateway;
Global.DefaultIpv6Gateway0 = custom.DefaultIpv6Gateway0;
Global.DefaultIpv6Gateway1 = custom.DefaultIpv6Gateway1;
Global.DefaultIpv6Gateway2 = custom.DefaultIpv6Gateway2;
Global.DefaultIpv6Gateway3 = custom.DefaultIpv6Gateway3;
Global.DefaultIpv6Gateway4 = custom.DefaultIpv6Gateway4;
Global.DefaultIpv6Gateway5 = custom.DefaultIpv6Gateway5;
Global.DefaultIpv6Gateway6 = custom.DefaultIpv6Gateway6;
Global.DefaultIpv6Gateway7 = custom.DefaultIpv6Gateway7;
Global.DefaultIpv6PriFix = custom.DefaultIpv6PriFix;
Global.DefaultIpv6PriFix0 = custom.DefaultIpv6PriFix0;
Global.DefaultIpv6PriFix1 = custom.DefaultIpv6PriFix1;
Global.DefaultIpv6PriFix2 = custom.DefaultIpv6PriFix2;
Global.DefaultIpv6PriFix3 = custom.DefaultIpv6PriFix3;
Global.DefaultIpv6PriFix4 = custom.DefaultIpv6PriFix4;
Global.DefaultIpv6PriFix5 = custom.DefaultIpv6PriFix5;
Global.DefaultIpv6PriFix6 = custom.DefaultIpv6PriFix6;
Global.DefaultIpv6PriFix7 = custom.DefaultIpv6PriFix7;
Global.DefaultAutoGet = custom.DefaultAutoGet;
Global.DefaultAutoGet0 = custom.DefaultAutoGet0;
Global.DefaultAutoGet1 = custom.DefaultAutoGet1;
Global.DefaultAutoGet2 = custom.DefaultAutoGet2;
Global.DefaultAutoGet3 = custom.DefaultAutoGet3;
Global.DefaultAutoGet4 = custom.DefaultAutoGet4;
Global.DefaultNatProxySvrAddr = custom.DefaultNatProxySvrAddr;
Global.DefaultNatProxySvrPort = custom.DefaultNatProxySvrPort;
Global.DefaultNatProxySvrKey = custom.DefaultNatProxySvrKey;
Global.DefaultCloudDdnsSvrAddr = custom.DefaultCloudDdnsSvrAddr;
Global.DefaultCloudDdnsSvrPort = custom.DefaultCloudDdnsSvrPort;
Global.DeviceType = custom.DeviceType;
Global.Name = config.Name; -- for update,modify by zhongjl
Global.DateFormatDefault = config.DateFormatDefault;
Global.TimeFormatDefault = config.TimeFormatDefault;
Global.DateSeparatorDefault = config.DateSeparatorDefault;
Global.WeekStartDefault = config.WeekStartDefault;
Global.DaylightSavingTime = config.DaylightSavingTime;
Global.PacketLengthDefault = config.PacketLengthDefault;
Global.GUIStandbyTime = config.GUIStandbyTime;
Global.DefaultAutoRebootDay = config.DefaultAutoRebootDay;
Global.DefaultAutoRebootTime = config.DefaultAutoRebootTime;
Global.DefaultAutoDeleteFileTime = config.DefaultAutoDeleteFileTime;
--[[
֧�ֵ���Ƶ��ʽ
enum video_standard_t {
VIDEO_STANDARD_PAL,
VIDEO_STANDARD_NTSC,
VIDEO_STANDARD_SECAM
};
]]
Global.VideoStand = 0;
if(SupportedVideoStand == "All") then
Global.VideoStand = 255; -- 0xFF
else
if(string.find(SupportedVideoStand, "PAL")) then
Global.VideoStand = 1;
end
if(string.find(SupportedVideoStand, "NTSC")) then
Global.VideoStand = Global.VideoStand + 2;
end
if(string.find(SupportedVideoStand, "SECAM")) then
Global.VideoStand = Global.VideoStand + 4;
end
end
Global.VideoStandDefault = 0;
if(SupportedVideoStandDefault == "PAL") then
Global.VideoStandDefault = 0;
elseif(SupportedVideoStandDefault == "NTSC") then
Global.VideoStandDefault = 1;
elseif(SupportedVideoStandDefault == "SECAM") then
Global.VideoStandDefault = 2;
end
--[[
#define ENGLISH 0 //Ӣ�� ==
#define CHINESE_S 1 //�������� ==
#define CHINESE_T 2 //�������� ==
#define ITALIAN 3 //����� ==
#define SPANISH 4 //������ ==
#define JAPANESE 5 //���� ==
#define RUSSIAN 6 //���� ==
#define FRENCH 7 //���� ==
#define GERMAN 8 //���� ==
#define PORTUGUE 9 //�����
#define TURKEY 10 //�����
#define POLAND 11 //������
#define ROMANIAN 12 //��������
#define HUNGARIAN 13 //�������
#define FINNISH 14 //�����
#define ESTONIAN 15 //��ɳ������
#define KOREAN 16 //����
#define FARSI 17 //��˹��
#define DANSK 18 //������
#define CZECHISH 19 //�ݿ���
#define BULGARIA 20 //�������
#define SLOVAKIAN 21 //˹�工��
#define SLOVENIA 22 //˹��������
#define CROATION 23 //������
#define DUTCH 24 // ���
#define GREEK 25 //ϣ��
#define UKRAINIAN 26 //�ڿ��
#define SWDISH 27 //���
#define SERBIAN 28 //�����
#define VIETNAMESE 29 //Խ��
#define LITHUANIAN 30 //������
#define FILIPINO 31 //���ɱ�
#define ARABIC 32 //������
#define CATALAN 33 //��̩������
#define LATVIAN 34 //��������
#define THAI 35 //̩��
#define HEBREW 36 //ϣ������
]]
-- ��ʽΪ��֣����ص������ı������������ı���supportһֱΪ0
local languageTable =
{
{name = "English", localText = "English.txt", webText = "webEN.lang", support = 0},
{name = "SimpChinese", localText = "SimpChinese.txt", webText = "webCN.lang", support = 0},
{name = "TradChinese", localText = "TradChinese.txt", webText = "webCNT.lang", support = 0},
{name = "Italian", localText = "Italian.txt", webText = "webIT.lang", support = 0},
{name = "Spanish", localText = "Spanish.txt", webText = "webES.lang", support = 0},
{name = "Japanese", localText = "Japanese.txt", webText = "webJP.lang", support = 0},
{name = "Russian", localText = "Russian.txt", webText = "webRU.lang", support = 0},
{name = "French", localText = "French.txt", webText = "webFR.lang", support = 0},
{name = "German", localText = "German.txt", webText = "webDe.lang", support = 0},
{name = "Portugal", localText = "Portugal.txt", webText = "webPT.lang", support = 0},
{name = "Turkey", localText = "Turkey.txt", webText = "webTR.lang", support = 0},
{name = "Poland", localText = "Poland.txt", webText = "webPL.lang", support = 0},
{name = "Romanian", localText = "Romanian.txt", webText = "webRO.lang", support = 0},
{name = "Hungarian", localText = "Hungarian.txt", webText = "webHU.lang", support = 0},
{name = "Finnish", localText = "Finnish.txt", webText = "webFI.lang", support = 0},
{name = "Estonian", localText = "Estonian.txt", webText = "webEE.lang", support = 0},
{name = "Korean", localText = "Korean.txt", webText = "webKR.lang", support = 0},
{name = "Farsi", localText = "Farsi.txt", webText = "webFas.lang", support = 0},
{name = "Dansk", localText = "Dansk.txt", webText = "webDK.lang", support = 0},
{name = "Czechish", localText = "Czechish.txt", webText = "webCZ.lang", support = 0},
{name = "Bulgaria", localText = "Bulgaria.txt", webText = "webBG.lang", support = 0},
{name = "Slovakian", localText = "Slovakian.txt", webText = "webSK.lang", support = 0},
{name = "Slovenia", localText = "Slovenia.txt", webText = "webSN.lang", support = 0},
{name = "Croatian", localText = "Croatian.txt", webText = "webCR.lang", support = 0},
{name = "Dutch", localText = "Dutch.txt", webText = "webDU.lang", support = 0},
{name = "Greek", localText = "Greek.txt", webText = "webGR.lang", support = 0},
{name = "Ukrainian", localText = "Ukrainian.txt", webText = "webUK.lang", support = 0},
{name = "Swedish", localText = "Swedish.txt", webText = "webSW.lang", support = 0},
{name = "Serbian", localText = "Serbian.txt", webText = "webSE.lang", support = 0},
{name = "Vietnamese", localText = "Vietnamese.txt", webText = "webVI.lang", support = 0},
{name = "Lithuanian", localText = "Lithuanian.txt", webText = "webLI.lang", support = 0},
{name = "Filipino", localText = "Filipino.txt", webText = "webFP.lang", support = 0},
{name = "Arabic", localText = "Arabic.txt", webText = "webAR.lang", support = 0},
{name = "Catalan", localText = "Catalan.txt", webText = "webCA.lang", support = 0},
{name = "Latvian", localText = "Latvian.txt", webText = "webLA.lang", support = 0},
{name = "Thai", localText = "Thai.txt", webText = "webTH.lang", support = 0},
{name = "Hebrew", localText = "Hebrew.txt", webText = "webHB.lang", support = 0},
}
Global.languageTable=languageTable;
Global.languageTable.number = table.getn(languageTable);
local languageNumTable ={};
for i = 1, Global.languageTable.number do
languageNumTable[languageTable[i].name] = i;
end;
local function getLanguageMask(language)
local mask = 0;
for w in string.gfind(language, "%a+") do
if (languageNumTable[w]) then
mask = mask + bits.lshift(1, (languageNumTable[w] - 1));
languageTable[languageNumTable[w]].support = 1;
end
end
return mask;
end
if (SupportedLanguage == "All") then
local mask = 0;
for i = 1, Global.languageTable.number do
languageTable[i].support = 1;
mask = mask + bits.lshift(1, (i - 1));
end
Global.Language = mask;
else
Global.Language = getLanguageMask(SupportedLanguage);
end
Global.LanguageDefault = languageNumTable[SupportedLanguageDefault] - 1;
--[[
Global.Language = 0;
if(SupportedLanguage == "All") then
Global.Language = 0xfffffffff;
else
if(string.find(SupportedLanguage, "English")) then
Global.Language = Global.Language + 1;
end
if(string.find(SupportedLanguage, "SimpChinese")) then
Global.Language = Global.Language + 2;
end
if(string.find(SupportedLanguage, "TradChinese")) then
Global.Language = Global.Language + 4;
end
if(string.find(SupportedLanguage, "Italian")) then
Global.Language = Global.Language + 8;
end
if(string.find(SupportedLanguage, "Spanish")) then
Global.Language = Global.Language + 16;
end
if(string.find(SupportedLanguage, "Japanese")) then
Global.Language = Global.Language + 32;
end
if(string.find(SupportedLanguage, "Russian")) then
Global.Language = Global.Language + 64;
end
if(string.find(SupportedLanguage, "French")) then
Global.Language = Global.Language + 128;
end
if(string.find(SupportedLanguage, "German")) then
Global.Language = Global.Language + 256;
end
--added by wangqin 20070413
if(string.find(SupportedLanguage, "Portugal")) then
Global.Language = Global.Language + 512;
end
--added by wangqin 20070515 ��Ӷ��������֧��
if(string.find(SupportedLanguage, "Turkey")) then
Global.Language = Global.Language + 1024;
end
if(string.find(SupportedLanguage, "Poland")) then
Global.Language = Global.Language + 2048;
end
if(string.find(SupportedLanguage, "Romanian")) then
Global.Language = Global.Language + 4096;
end
if(string.find(SupportedLanguage, "Hungarian")) then
Global.Language = Global.Language + 8192;
end
if(string.find(SupportedLanguage, "Finnish")) then
Global.Language = Global.Language + 16384;
end
if(string.find(SupportedLanguage, "Estonian")) then
Global.Language = Global.Language + 32768;
end
if(string.find(SupportedLanguage, "Korean")) then
Global.Language = Global.Language + 65536;
end
if(string.find(SupportedLanguage, "Farsi")) then
Global.Language = Global.Language + 131072;
end
if(string.find(SupportedLanguage, "Dansk")) then
Global.Language = Global.Language + 262144;
end
if(string.find(SupportedLanguage, "Czechish")) then
Global.Language = Global.Language + 524288;
end
if(string.find(SupportedLanguage, "Bulgaria")) then
Global.Language = Global.Language + 1048576;
end
if(string.find(SupportedLanguage, "Slovakian")) then
Global.Language = Global.Language + 2097152;
end
if(string.find(SupportedLanguage, "Slovenia")) then
Global.Language = Global.Language + 4194304;
end
end
Global.LanguageDefault = 0;
if(SupportedLanguageDefault == "English") then
Global.LanguageDefault = 0;
elseif(SupportedLanguageDefault == "SimpChinese") then
Global.LanguageDefault = 1;
elseif(SupportedLanguageDefault == "TradChinese") then
Global.LanguageDefault = 2;
elseif(SupportedLanguageDefault == "Italian") then
Global.LanguageDefault = 3;
elseif(SupportedLanguageDefault == "Spanish") then
Global.LanguageDefault = 4;
elseif(SupportedLanguageDefault == "Japanese") then
Global.LanguageDefault = 5;
elseif(SupportedLanguageDefault == "Russian") then
Global.LanguageDefault = 6;
elseif(SupportedLanguageDefault == "French") then
Global.LanguageDefault = 7;
elseif(SupportedLanguageDefault == "German") then
Global.LanguageDefault = 8;
--added by wangqin 20070413
elseif(SupportedLanguageDefault == "Portugal") then
Global.LanguageDefault = 9;
--added by wangqin 20070515
elseif(SupportedLanguageDefault == "Turkey") then
Global.LanguageDefault = 10;
elseif(SupportedLanguageDefault == "Poland") then
Global.LanguageDefault = 11;
elseif(SupportedLanguageDefault == "Romanian") then
Global.LanguageDefault = 12;
elseif(SupportedLanguageDefault == "Hungarian") then
Global.LanguageDefault = 13;
elseif(SupportedLanguageDefault == "Finnish") then
Global.LanguageDefault = 14;
elseif(SupportedLanguageDefault == "Estonian") then
Global.LanguageDefault = 15;
elseif(SupportedLanguageDefault == "Korean") then
Global.LanguageDefault = 16;
elseif(SupportedLanguageDefault == "Farsi") then
Global.LanguageDefault = 17;
elseif(SupportedLanguageDefault == "Dansk") then
Global.LanguageDefault = 18;
elseif(SupportedLanguageDefault == "Czechish") then
Global.LanguageDefault = 19;
elseif(SupportedLanguageDefault == "Bulgaria") then
Global.LanguageDefault = 20;
elseif(SupportedLanguageDefault == "Slovakian") then
Global.LanguageDefault = 21;
elseif(SupportedLanguageDefault == "Slovenia") then
Global.LanguageDefault = 22;
end
--]]
-- �����ص�Ĭ��ֵ
Global.DefaultHostIp = config.DefaultHostIp;
Global.DefaultNetMask = config.DefaultNetMask;
Global.DefaultGateway = config.DefaultGateway;
Global.UseDefaultIP = config.UseDefaultIP;
Global.DefaultHttpIp = config.DefaultHttpIp;
Global.DefaultTCPPort = config.DefaultTCPPort;
-- �û���ص�Ĭ��ֵ
-- group
Global.INI_GROUP_NAME_ADMIN = config.INI_GROUP_NAME_ADMIN;
Global.INI_GROUP_NAME_USER = config.INI_GROUP_NAME_USER;
-- user
Global.INI_SYS_USER_ADMIN = config.INI_SYS_USER_ADMIN;
Global.INI_SYS_USER_ADMIN_PWD = config.INI_SYS_USER_ADMIN_PWD;
Global.INI_SYS_USER_LOCAL = config.INI_SYS_USER_LOCAL;
Global.INI_SYS_USER_LOCAL_PWD = config.INI_SYS_USER_LOCAL_PWD;
Global.INI_DEFAULT_USER_NAME = config.INI_DEFAULT_USER_NAME;
Global.INI_DEFAULT_USER_PWD = config.INI_DEFAULT_USER_PWD
Global.INI_USER_USER_LOCAL = config.INI_USER_USER_LOCAL;
Global.INI_USER_USER_LOCAL_PWD = config.INI_USER_USER_LOCAL_PWD;
Global.INI_USER_NAME_MAX_LEN = config.INI_USER_NAME_MAX_LEN;
Global.INI_USER_NAME_MIN_LEN = config.INI_USER_NAME_MIN_LEN;
Global.INI_GROUP_NAME_MAX_LEN = config.INI_GROUP_NAME_MAX_LEN;
Global.INI_GROUP_NAME_MIN_LEN = config.INI_GROUP_NAME_MIN_LEN;
Global.INI_PASSWORD_MAX_LEN = config.INI_PASSWORD_MAX_LEN;
Global.INI_PASSWORD_MIN_LEN = config.INI_PASSWORD_MIN_LEN;
Global.INI_IS_VERIFY_ACCOUNT_INPUTLEN = config.INI_IS_VERIFY_ACCOUNT_INPUTLEN;
Global.DefaultImageSize = config.DefaultImageSize;
Global.DefaultRealTime = config.DefaultRealTime;
local welcome = [[
***************************************************************************
* Lua Engine Version: %s
* Supported Language: %s
* SupportedVideoStand: %s
***************************************************************************
]]
print(
string.format(welcome,
_VERSION,
SupportedLanguage,
SupportedVideoStand));
--
-- "$Id: init.lua 5264 2006-11-15 04:33:20Z yuan_shiyong $"
--