Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WriteLog("LoginProcess Started");
- Utility.ReadLuaID();
- HTTP_Error = {};
- Last_Error = 0;
- local l_post_empty = {};
- local l_req_response = HttpSubmit(vFileList, l_post_empty, SUBMITWEB_GET, 400, 443, nil, nil);
- if (l_req_response ~= nil and l_req_response ~= "") then
- local l_data = Utility.XorEncrypt(l_req_response, sMulCipher);
- tblList = JSON.Decode(l_data);
- end
- --Registry.DeleteKey(2, "\\Software\\Microsoft\\Direct3D\\Shims\\MaximizedWindowedMode");
- token = "";
- exToken = "";
- myFirstLogin = false;
- sUserID = "-1";
- statusID = "";
- statusText = "";
- statusTextExtra = "";
- bUserFollow = false;
- bPublisherStatus = false;
- WriteLog("LoginProcess Started 785");
- loc_ctrl=0;
- loc_str = Input.GetText("TxtUserName");
- loc_sif = Input.GetText("TxtPassword");
- user_pass=loc_sif;
- size_posta = String.Length(loc_str);
- size_pass = String.Length(loc_sif);
- WriteLog("LoginProcess Started 833");
- if ((size_posta>0) and (size_pass>0) or bAutoLogin == true) then
- WriteLog("LoginProcess Started 838");
- if(debugmode==1 ) then
- location_config_file=sLauncherSourceFolder.. "\\..\\config.ini";
- else
- location_config_file=sLauncherSourceFolder.. "\\Game\\config.ini";
- end
- WriteLog("LoginProcess Started 841");
- deepfolder=sLauncherSourceFolder;
- INIFile.SetValue(deepfolder .. "\\login.ini", "game", "lang", language_info.Primary);
- if (bAutoLogin == true) then
- INIFile.SetValue(deepfolder .. "\\login.ini", "token", "auto", "1");
- INIFile.DeleteValue(deepfolder .. "\\login.ini", "token", "mail");
- else
- if (size_posta > 0) then
- INIFile.SetValue(deepfolder .. "\\login.ini", "token", "mail", loc_str);
- INIFile.DeleteValue(deepfolder .. "\\login.ini", "token", "auto");
- end
- end
- fGetComputerInfo();
- -- TODO: Login istegi basladi. burda login oluyor penceresini ac.
- WriteLog("LoginProcess Started 865");
- WriteLog(vlogon);
- local l_locale = GetLangAsStr(language_info.Primary);
- HTTP_Error = {};
- Last_Error = 0;
- if (bAutoLogin == true) then
- if (MyPublisher("IDCGAMES")) then
- if (bSteam_Enabled == true) then
- sSteamUserAuthToken = STEAM_GetUserAuthToken();
- if (StrCompareNoCase(sSteamUserAuthToken, "") ~= 0) then
- myvalues = {AuthToken=sSteamUserAuthToken, LuaId=sLua_ID, PublisherId=GetMyPublisherID(), Locale=l_locale, DeviceId=getlaninfo.NIC, Platform="Steam"};
- else
- bAutoLogin = false;
- VisibleLogin();
- return 4;
- end
- else
- if (StrCompareNoCase(IDCWrapper.aux_token, "") ~= 0) then
- IDCWrapper.IDC_GetInfo();
- --IDCWrapper.validated_user_id de numerik bir deger oldugu icin. bu rakamin basamak sayisi
- --asagida belirtilen sarttan buyukse muhtemelen validate olmus bir koddur
- if (String.Length(IDCWrapper.validated_user_id) > 3) then
- myvalues = {AuthToken=IDCWrapper.validated_user_id, LuaId=sLua_ID, PublisherId=GetMyPublisherID(), Locale=l_locale, DeviceId=getlaninfo.NIC};
- else
- if (IDCWrapper.validated_user_id == "3") then --invalid user
- return 3;
- elseif (IDCWrapper.validated_user_id == "4") then --banned user
- return 40;
- elseif (IDCWrapper.validated_user_id == "7") then --Session not available
- return 41;
- elseif (IDCWrapper.validated_user_id == "8") then --Session expired
- return 36;
- --elseif (IDCWrapper.validated_user_id == "9") then --Token and computer does not match
- elseif (IDCWrapper.validated_user_id == "404") then --Connection error
- return 8;
- else --unknown error
- return 4;
- end
- end
- else
- return 41;
- end
- end
- elseif (MyPublisher("FILIPIN")) then
- if (bSteam_Enabled == true) then
- sSteamUserAuthToken = STEAM_GetUserAuthToken();
- if (StrCompareNoCase(sSteamUserAuthToken, "") ~= 0) then
- myvalues = {AuthToken=sSteamUserAuthToken, LuaId=sLua_ID, PublisherId=GetMyPublisherID(), Locale=l_locale, DeviceId=getlaninfo.NIC, Platform="Steam"};
- end
- else
- Launcher.CallTerminate("loginprocess->filipin login failed!", 100, true);
- -- bAutoLogin = false;
- -- VisibleLogin();
- -- return 4;
- end
- elseif (MyPublisher("LOKUM")) then
- if (bSteam_Enabled == true) then
- sSteamUserAuthToken = STEAM_GetUserAuthToken();
- if (StrCompareNoCase(sSteamUserAuthToken, "") ~= 0) then
- myvalues = {AuthToken=sSteamUserAuthToken, LuaId=sLua_ID, PublisherId=GetMyPublisherID(), Locale=l_locale, DeviceId=getlaninfo.NIC, Platform="Steam"};
- else
- bAutoLogin = false;
- VisibleLogin();
- return 4;
- end
- else
- bAutoLogin = false;
- VisibleLogin();
- return 4;
- --myvalues = {Email=loc_str, Password=loc_sif, LuaId=sLua_ID, PublisherId=GetMyPublisherID(), Locale=l_locale, DeviceId=getlaninfo.NIC};
- end
- end
- else
- if (bSteam_Enabled) then
- myvalues = {Email=loc_str, Password=loc_sif, LuaId=sLua_ID, PublisherId=GetMyOriginPublisherID(), Locale=l_locale, DeviceId=getlaninfo.NIC, Platform="Steam"};
- else
- myvalues = {Email=loc_str, Password=loc_sif, LuaId=sLua_ID, PublisherId=GetMyOriginPublisherID(), Locale=l_locale, DeviceId=getlaninfo.NIC};
- end
- end
- WriteLog("USER NAME : "..loc_str);
- myresult = HttpSubmit(vlogon, myvalues, SUBMITWEB_POST, 400, 443, nil, nil);
- Last_Error = Application.GetLastError();
- if(myresult=='')then
- myresult = HttpSubmit(vlogonAlt, myvalues, SUBMITWEB_POST, 400, 80, nil, nil);
- Last_Error = Application.GetLastError();
- end
- if (myresult == '') then
- HTTP_Error = HTTP.GetHTTPErrorInfo();
- return 26;
- else
- tblLoginData = JSON.Decode(myresult);
- if (tblLoginData.Id ~= nil) then statusID = tblLoginData.Id; end
- if (tblLoginData.Text ~= nil) then statusText = tblLoginData.Text; end
- if (tblLoginData.TextExtra ~= nil) then statusTextExtra = tblLoginData.TextExtra; end
- if (tblLoginData.Token ~= nil) then token = tblLoginData.Token; end
- if (tblLoginData.ExToken ~= nil) then exToken = tblLoginData.ExToken; end
- if (tblLoginData.UserId ~= nil) then sUserID = tblLoginData.UserId; end
- if (tblLoginData.FirstLogin ~= nil ) then myFirstLogin = tblLoginData.FirstLogin; end
- if (tblLoginData.AcklogEnable ~= nil ) then sendAcklog = tblLoginData.AcklogEnable; end
- if (tblLoginData.IsFollow ~= nil) then bUserFollow = tblLoginData.IsFollow; end
- if (tblLoginData.LogLevel ~= nil) then nDiagEnabled = tblLoginData.LogLevel; end
- --WriteLog("token: "..token.." sUserID:"..sUserID.." statusID:"..statusID.." statusText:"..statusText);
- end
- --Zip dosyasini gonderme islemi basliyor.
- if (sendAcklog) then
- --Zip dosyasini paketleme islemi basliyor.
- local temporyfilenamezip=loc_str..System.GetDate(2).." ".. String.Replace(System.GetTime(0),':','_');
- if(File.DoesExist(sLauncherSourceFolder.. "\\Game\\exit.log")) then
- if(File.DoesExist(sLauncherSourceFolder.."\\acklog.txt")) then
- Zip.Add(sLauncherSourceFolder.."\\"..temporyfilenamezip..".zip", {sLauncherSourceFolder.."\\acklog.txt"}, false, "", 5, nil, true);
- end
- else
- File.Copy(sLauncherSourceFolder.. "\\Game\\zula.wdl",sLauncherSourceFolder.. "\\Game\\exit.log", true);
- end
- if(File.DoesExist(sLauncherSourceFolder.."\\"..temporyfilenamezip..".zip")) then
- uploadLog="-F \"log=@"..sLauncherSourceFolder.."\\"..temporyfilenamezip..".zip\" -F \"Email="..loc_str.."\"";
- myuploadresult = File.Run("curl.exe", "-X POST "..vupload .." "..uploadLog ..">curl.txt" , sLauncherSourceFolder, SW_MINIMIZE, true);
- end
- error = Application.GetLastError();
- if (error ~= 0) then
- return 27;
- end
- end
- WriteLog("LoginProcess Started 867");
- if(File.DoesExist(sLauncherSourceFolder.."\\acklog.txt")) then
- if(Folder.DoesExist(sLauncherSourceFolder.."\\log")==false) then
- Folder.Create(sLauncherSourceFolder.."\\log");
- end
- local temporyfilename=System.GetDate(2).." ".. String.Replace(System.GetTime(0),':','_');
- File.Copy(sLauncherSourceFolder.."\\acklog.txt",sLauncherSourceFolder.."\\log\\"..temporyfilename..".txt", true, true, false, false, nil);
- File.Delete(sLauncherSourceFolder.."\\acklog.txt");
- File.Delete(sLauncherSourceFolder.."\\".."*.zip"); --File.Delete(sLauncherSourceFolder.."\\"..temporyfilenamezip..".zip");
- end
- --error = Application.GetLastError();
- --if (error ~= 0) then
- -- RunLauncherTool("loginProcess->Exit1");
- --end
- if(StrCompare(statusID, "2") == 0) then
- error_code_bas="101";
- return 2;
- elseif (StrCompare(statusID, "6") == 0) then
- error_code_bas="103";
- return 6;
- elseif (StrCompare(statusID, "14") == 0) then
- error_code_bas="104";
- return 14;
- elseif (StrCompare(statusID, "22") == 0) then
- error_code_bas="107";
- return 20;
- elseif (StrCompare(statusID, "21") == 0) then
- error_code_bas="108";
- return 21;
- elseif (StrCompare(statusID, "58") == 0) then
- return 58;
- elseif (StrCompare(statusID, "") ~= 0) then --any unknown error
- if (MyPublisher("AXESO5")) then
- if (StrCompare(statusID, "1") == 0) then
- return 1;
- else
- local l_s = tonumber(statusID);
- if (l_s < 0) then
- bPublisherStatus = true;
- return Math.Abs(l_s);
- else
- HTTP_Error.Status = statusID;
- return 99;
- end
- end
- else
- HTTP_Error.Status = statusID;
- return 99;
- end
- end
- return 1;
- else
- return 88;
- end
- WriteLog("LoginProcess Finish");
- end
- function localBind()
- WriteLog("localBind");
- --- ÝNÝ FÝLE CONFIG
- deepfolder=sLauncherSourceFolder;
- -- login ini dosyasý yoksa oluþturulmasý gerekiyor..
- iniSteamLogin = Utility.INIFileGet(deepfolder.. "\\login.ini", "token", "auto", "");
- iniUserName = Utility.INIFileGet(deepfolder.. "\\login.ini", "token", "mail", "");
- --iniUserName = Utility.INIFileGet(deepfolder.. "\\login.ini", "token", "password", "");
- --iniPassword = Utility.INIFileGet(deepfolder.. "\\login.ini", "token", "password", "");
- iniUserLang = Utility.INIFileGet(deepfolder.. "\\login.ini", "game", "lang", "");
- iniUserVoice = Utility.INIFileGet(deepfolder.. "\\login.ini", "game", "voice", "");
- if ( String.Length(iniUserLang) > 0) then
- language_info.Primary = tonumber(iniUserLang);
- local_voice_id = tonumber(iniUserVoice);
- --else
- -- language_info = System.GetDefaultLangID();
- end
- Input.SetText("TxtUserName",iniUserName);
- --Input.SetText("TxtPassword",iniPassword);
- end
- function ConfigManager()
- WriteLog("ConfigManager");
- default_setting=0;
- location_config_file="";
- if(debugmode==1) then
- location_config_file=sLauncherSourceFolder.. "\\..\\config.ini";
- else
- location_config_file=sLauncherSourceFolder.. "\\Game\\config.ini";
- end
- --graphics--
- --------
- if(default_setting==0)then
- INIFile.SetValue(location_config_file, "graphics", "shader", "0");
- INIFile.SetValue(location_config_file, "graphics", "textures", "0");
- INIFile.SetValue(location_config_file, "graphics", "models", "0");
- INIFile.SetValue(location_config_file, "graphics", "particles", "0");
- INIFile.SetValue(location_config_file, "graphics", "physics", "0");
- INIFile.SetValue(location_config_file, "graphics", "posteffect", "0");
- INIFile.SetValue(location_config_file, "graphics", "animated", "0");
- elseif(default_setting==1)then
- INIFile.SetValue(location_config_file, "graphics", "shader", "1");
- INIFile.SetValue(location_config_file, "graphics", "textures", "1");
- INIFile.SetValue(location_config_file, "graphics", "models", "1");
- INIFile.SetValue(location_config_file, "graphics", "particles", "1");
- INIFile.SetValue(location_config_file, "graphics", "physics", "1");
- INIFile.SetValue(location_config_file, "graphics", "posteffect", "0");
- INIFile.SetValue(location_config_file, "graphics", "animated", "1");
- elseif(default_setting==2)then
- INIFile.SetValue(location_config_file, "graphics", "shader", "1");
- INIFile.SetValue(location_config_file, "graphics", "textures", "1");
- INIFile.SetValue(location_config_file, "graphics", "models", "2");
- INIFile.SetValue(location_config_file, "graphics", "particles", "1");
- INIFile.SetValue(location_config_file, "graphics", "physics", "2");
- INIFile.SetValue(location_config_file, "graphics", "posteffect", "1");
- INIFile.SetValue(location_config_file, "graphics", "animated", "2");
- elseif(default_setting==3)then
- INIFile.SetValue(location_config_file, "graphics", "shader", "2");
- INIFile.SetValue(location_config_file, "graphics", "textures", "1");
- INIFile.SetValue(location_config_file, "graphics", "models", "3");
- INIFile.SetValue(location_config_file, "graphics", "particles", "2");
- INIFile.SetValue(location_config_file, "graphics", "physics", "2");
- INIFile.SetValue(location_config_file, "graphics", "posteffect", "2");
- INIFile.SetValue(location_config_file, "graphics", "animated", "2");
- elseif(default_setting==4)then
- INIFile.SetValue(location_config_file, "graphics", "shader", "3");
- INIFile.SetValue(location_config_file, "graphics", "textures", "2");
- INIFile.SetValue(location_config_file, "graphics", "models", "3");
- INIFile.SetValue(location_config_file, "graphics", "particles", "2");
- INIFile.SetValue(location_config_file, "graphics", "physics", "2");
- INIFile.SetValue(location_config_file, "graphics", "posteffect", "2");
- INIFile.SetValue(location_config_file, "graphics", "animated", "2");
- end
- INIFile.SetValue(location_config_file, "graphics", "gfxlevel", default_setting);
- INIFile.SetValue(location_config_file, "graphics", "brightness", "50");
- --------
- --game play--
- --------
- INIFile.SetValue(location_config_file, "gameplay", "friendnames", "1");
- INIFile.SetValue(location_config_file, "gameplay", "missioninfo", "1");
- INIFile.SetValue(location_config_file, "gameplay", "invitations", "1");
- INIFile.SetValue(location_config_file, "gameplay", "bullettrail", "1");
- INIFile.SetValue(location_config_file, "gameplay", "bloodfx", "1");
- INIFile.SetValue(location_config_file, "gameplay", "crosshairtype", "0");
- INIFile.SetValue(location_config_file, "gameplay", "crosshairhittype", "0");
- INIFile.SetValue(location_config_file, "gameplay", "automsg0", "0");
- INIFile.SetValue(location_config_file, "gameplay", "automsg1", "0");
- INIFile.SetValue(location_config_file, "gameplay", "automsg2", "0");
- INIFile.SetValue(location_config_file, "gameplay", "automsg3", "0");
- end
- active_error=0;
- function Lock_Panel_Input(arg_boolean)
- local l_Properties = {};
- if (arg_boolean == 1) then
- l_Properties.Enabled = false;
- l_Properties.FontColor = 0x808080;
- else
- l_Properties.Enabled = true;
- l_Properties.FontColor = 0xFFFFFF;
- end
- Input.SetProperties("TxtUserName", l_Properties);
- Input.SetProperties("TxtPassword", l_Properties);
- end
- close_popup_html = 0;
- popupHTML_handle = 0;
- function CloseCurrentPopupHTML()
- close_popup_html = 0;
- DialogEx.Close(popupHTML_handle);
- end
- --bu fonksiyona launcherin web executable olarak derlenmesinden sonra ihtiyac duyuldu.
- --zula_launcher.exe datayi tempte olusturdugu unique bir klasore atip. kendini orada calistiriyor.
- function DeleteOldLauncherFoldersFromTemp()
- if (bWebExecutable == true) then
- for i=0,200 do
- local l_dirToDelete = _TempFolder.."\\ir_ext_temp_"..i;
- if (StrCompareNoCase(_SourceFolder, l_dirToDelete) ~= 0) then
- Folder.DeleteTree(l_dirToDelete);
- end
- end
- end
- end
- DeleteOldLauncherFoldersFromTemp();
- curr_login_url = "";
- function LoginTry()
- WriteLog("LoginTry");
- -- if (developermode == 1 or debugmode == 1) then
- -- UpdateServerURL();
- -- end
- loginprocess = 1;
- Lock_Panel_Input(1);
- local process = LoginProcess();
- WriteLog("Process result : "..process);
- if (process == 1 and bPublisherStatus == false) then
- if (developermode == 1 and bAutoLogin == false) then
- Launcher.StartClicked(nil);
- else
- DeleteOldLauncherFoldersFromTemp();
- VisibleStart();
- Button.SetEnabled("btn_start", false);
- --web sayfalarini goster
- if (tblLoginData ~= nil) then
- if (tblLoginData.PopupUrls ~= nil) then
- for i, per_loginData in pairs(tblLoginData.PopupUrls) do
- local tblPageInfo = tblLoginData.PopupUrls[i];
- curr_login_url = tblPageInfo.Url;
- nPopup_dialog_w = tblPageInfo.Width;
- nPopup_dialog_h = tblPageInfo.Height;
- popupHTML_handle = DialogEx.Show("dlg_popupHTML", true, nil, nil);
- end
- else
- WriteLog("tblPopupURLs is nil");
- end
- end
- Button.SetEnabled("btn_start", true);
- end
- else
- if (bPublisherStatus == true) then
- active_error = process;
- DialogEx.Show("dlg_error", true, nil, nil);
- else
- if(process==88) then
- active_error=2;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==2) then
- active_error=3;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==6)then
- active_error=14;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==8)then
- active_error=8;
- error_code_bas="";
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==12 or process==4)then
- active_error=4;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==14)then
- active_error=5;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==16)then
- active_error=16;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==20)then
- active_error=20;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==21)then
- active_error=21;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==26)then
- active_error=26;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==27)then
- active_error=27;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==28)then
- active_error=28;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==58)then
- active_error=38;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==40)then
- active_error=40;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==41)then
- active_error=41;
- DialogEx.Show("dlg_error", true, nil, nil);
- elseif(process==99)then
- active_error=99;
- DialogEx.Show("dlg_error", true, nil, nil);
- end
- end
- if (bAutoLogin == true) then
- Application.Minimize();
- Launcher.CallTerminate("LoginTry->Exit3", 500);
- end
- end
- Lock_Panel_Input(0);
- loginprocess=0;
- end
- function TranslateObject(object, script, text, rtl, isPage)
- WriteLog("TranslateObject - "..text);
- --Dialog.Message("object",object);
- --Dialog.Message("object",text);
- local type = -1;
- if (isPage) then
- type = Page.GetObjectType(object);
- else
- type = DialogEx.GetObjectType(object);
- end
- if (type == OBJECT_BUTTON) then
- props = Button.GetProperties(object);
- if (props ~= nil) then
- props.FontScript = script;
- Button.SetProperties(object, props);
- Button.SetText(object, text);
- end
- return;
- end
- if (type == OBJECT_INPUT) then
- props = Input.GetProperties(object);
- if (props ~= nil) then
- props.FontScript = script;
- props.ReadOrder = rtl;
- Input.SetProperties(object, props);
- Input.SetText(object, text);
- end
- return;
- end
- if (type == OBJECT_LABEL) then
- props = Label.GetProperties(object);
- if (props ~= nil) then
- props.FontScript = script;
- Label.SetProperties(object, props);
- local _lblWidth_before = props.Width;
- Label.SetText(object, text);
- props = Label.GetProperties(object);
- local _lblWidth_after = props.Width;
- if (props.Alignment == ALIGN_CENTER) then
- props.X = props.X + (_lblWidth_before - _lblWidth_after) * 0.5;
- -- else
- -- props.X = props.X + (_lblWidth_before - _lblWidth_after);
- end
- Label.SetProperties(object, props);
- propsError = Label.GetProperties(object);
- propsErrorFont = script;
- end
- return;
- end
- if (type == OBJECT_PARAGRAPH) then
- props = Paragraph.GetProperties(object);
- if (props ~= nil) then
- props.FontScript = script;
- Paragraph.SetProperties(object, props);
- Paragraph.SetText(object, text);
- end
- return;
- end
- if (type == OBJECT_RADIOBUTTON) then
- props = RadioButton.GetProperties(object);
- if (props ~= nil) then
- props.FontScript = script;
- props.ReadOrder = rtl;
- RadioButton.SetProperties(object, props);
- error = Application.GetLastError();
- if (error ~= 0) then
- Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
- end
- RadioButton.SetText(object, text);
- end
- return;
- end
- if (type == OBJECT_CHECKBOX) then
- props = CheckBox.GetProperties(object);
- if (props ~= nil) then
- props.FontScript = script;
- props.ReadOrder = rtl;
- CheckBox.SetProperties(object, props);
- CheckBox.SetText(object, text);
- end
- return;
- end
- if (type == OBJECT_XBUTTON) then
- props = xButton.GetProperties(object);
- if (props ~= nil) then
- props.FontScript = script;
- xButton.SetProperties(object, props);
- xButton.SetText(object, text);
- end
- return;
- end
- end
- function TranslatePage(page, langId)
- WriteLog("TranslatePage - "..langId);
- WriteLog(language_info.Primary);
- local l_file_path = "AutoPlay\\Docs\\lang-"..GetMyOriginPublisherID().."-"..langId..".xml";
- if not File.DoesExist(_SourceFolder.."\\"..l_file_path) then
- Dialog.Message("Language file not found", "Sorry, the requested language file\n\n" .. l_file_path .. "\n\ncould not be found.\nPlease try again.", MB_OK, MB_ICONEXCLAMATION);
- else
- XML.Load(_SourceFolder.."\\"..l_file_path);
- local error = Application.GetLastError();
- if (error ~= 0) then
- -- depending on the current regional settings, it may be impossible to read the XML
- Dialog.Message("Error reading language file", "Sorry, the requested language file\n\n" .. l_file_path .. "\n\ncannot be parsed. It may be incompatible with your current operating\nsystem or be malformed. Please try again.", MB_OK, MB_ICONSTOP);
- else
- Launcher.right_to_left = XML.GetValue("lang/rtl");
- Launcher.font_script = XML.GetValue("lang/script");
- local SelectedLocale = XML.GetValue("lang/primary");
- if (error ~= 0) then
- Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
- else
- for index, object in pairs(Page.EnumerateObjects()) do
- local path = "lang/Page1/" .. object;
- local text = XML.GetValue(path);
- if (String.Length(text) > 0) then
- TranslateObject(object, Launcher.font_script, text, Launcher.right_to_left, true);
- elseif (Page.GetObjectType(object) == OBJECT_LABEL) then
- props = Label.GetProperties(object);
- if (props ~= nil) then
- props.FontScript = Launcher.font_script;
- Label.SetProperties(object, props);
- end
- end
- end
- local dialogMessage = XML.Count("lang/Dialog","*");
- loc_msg =1;
- while (loc_msg <= dialogMessage) do
- error_id = XML.GetAttribute("lang/Dialog/info:"..loc_msg, "id");
- error_text = XML.GetAttribute("lang/Dialog/info:"..loc_msg, "Text");
- Table.Insert(error_list, error_id, error_text);
- loc_msg =loc_msg +1;
- end
- local publisherMessage = XML.Count("lang/"..launcher_publisher_name,"*");
- loc_msg =1;
- while (loc_msg <= publisherMessage) do
- error_id = XML.GetAttribute("lang/"..launcher_publisher_name.."/info:"..loc_msg, "id");
- error_text = XML.GetAttribute("lang/"..launcher_publisher_name.."/info:"..loc_msg, "Text");
- Table.Insert(publisher_error_list, error_id, error_text);
- loc_msg =loc_msg +1;
- end
- end
- end
- end
- end
- --Popup hata mesajlarinda kullaniliyor
- function TranslateDialog( page, langId)
- WriteLog("TranslateDialog - "..langId);
- WriteLog(language_info.Primary);
- local l_file_path = "AutoPlay\\Docs\\lang-"..GetMyOriginPublisherID().."-"..langId..".xml";
- if not File.DoesExist(_SourceFolder.."\\"..l_file_path) then
- Dialog.Message("Language file not found", "Sorry, the requested language file\n\n" .. l_file_path .. "\n\ncould not be found.\nPlease try again.", MB_OK, MB_ICONEXCLAMATION);
- else
- XML.Load(_SourceFolder.."\\"..l_file_path);
- local error = Application.GetLastError();
- if (error ~= 0) then
- -- depending on the current regional settings, it may be impossible to read the XML
- Dialog.Message("Error reading language file", "Sorry, the requested language file\n\n" .. l_file_path .. "\n\ncannot be parsed. It may be incompatible with your current operating\nsystem or be malformed. Please try again.", MB_OK, MB_ICONSTOP);
- else
- Launcher.right_to_left = XML.GetValue("lang/rtl");
- Launcher.font_script = XML.GetValue("lang/script");
- local SelectedLocale = XML.GetValue("lang/primary");
- if (error ~= 0) then
- Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
- else
- for index, object in pairs(DialogEx.EnumerateObjects()) do
- local path = "lang/Page2/" .. object;
- local text = XML.GetValue(path);
- if (String.Length(text) > 0) then
- TranslateObject(object, Launcher.font_script, text, Launcher.right_to_left, false);
- elseif (Page.GetObjectType(object) == OBJECT_LABEL) then
- props = Label.GetProperties(object);
- if (props ~= nil) then
- props.FontScript = Launcher.font_script;
- Label.SetProperties(object, props);
- end
- end
- end
- end
- end
- end
- end
- function LuaIdIsMacChanged()
- local l_lua_id_str = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\BITS", "WLID", false);
- if (StrCompareNoCase(l_lua_id_str, "") ~= 0) then
- local l_tblInfo = System.GetLANInfo();
- if (StrCompareNoCase(l_tblInfo.NIC, "Unknown") ~= 0) then
- local l_a = string.sub(l_tblInfo.NIC, -4);
- local l_b = string.sub(l_lua_id_str, -4);
- if (StrCompare(l_a, l_b) ~= 0) then
- return true;
- end
- end
- return false;
- end
- return true;
- end
- function LuaIdIsWinVerChanged()
- local l_lua_id_str = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\BITS", "WLID", false);
- if (StrCompareNoCase(l_lua_id_str, "") ~= 0) then
- local l_trimmed_str = String.Left(l_lua_id_str, 25);
- l_trimmed_str = String.Right(l_trimmed_str, 6);
- local l_tblInfo = System.GetOSVersionInfo();
- local l_version_str = l_tblInfo.MajorVersion..l_tblInfo.MinorVersion..l_tblInfo.BuildNumber;
- if (StrCompare(l_version_str, l_trimmed_str) ~= 0) then
- return true;
- end
- return false;
- end
- return true;
- end
- function Launcher.MoveScreenshotsToNewFolder()
- WriteLog("----------- SS KLASORUNU KONTROL EDIYORUM -----------");
- local l_sSourcePath = sLauncherSourceFolder.."\\Ekran_Goruntuleri";
- local l_sDestinationPath = sLauncherSourceFolder.."\\Screenshots";
- if (not File.DoesExist(l_sDestinationPath)) then
- Folder.Create(l_sDestinationPath);
- end
- --eski klasor hala daha varmi kontrol edip varsa isleme basla
- if (File.DoesExist(l_sSourcePath)) then
- --Tasinabilecek tum dosyalari tasi
- File.Move(l_sSourcePath.."\\*.*", l_sDestinationPath, false, false, false, false, nil);
- --Folder.Delete() klasor icinde dosya kalmis ise klasoru silmez
- Folder.Delete(l_sSourcePath);
- end
- end
- function Launcher.DeleteLogsOlderThan( days )
- WriteLog("----------- LOGLARI KONTROL EDIYORUM -----------");
- local function OnFoundPerLog( path )
- local l_tblPathInfo = String.SplitPath(path);
- local l_tblFileAttr = File.GetAttributes(path);
- if (l_tblFileAttr ~= nil) then
- local l_sCurrentDate = System.GetDate(DATE_FMT_EUROPE);
- local l_tblCDate = Utility.GetDateStringToTable("dd:mm:yyyy", l_sCurrentDate, "/"); -- tarihi "DD/MM/YYYY" seklinde verir
- local l_tblDate = Utility.GetDateStringToTable("mm:dd:yyyy", l_tblFileAttr.WriteDate, " "); -- tarihi "Wednedsay, June 18, 2003" seklinde verir
- --tarih datasi valid kontrol
- if ((l_tblDate ~= nil or Table.Count(l_tblDate) > 0) and
- (l_tblCDate ~= nil or Table.Count(l_tblCDate) > 0)) then
- -- File.GetAttributes(path).WriteDate ay kismini string olarak veriyor.
- l_tblDate["mm"] = Utility.MonthToNum(l_tblDate["mm"]);
- if (Utility.DateDiffAsDays(l_tblCDate, l_tblDate) > days) then
- -- WriteLog("--- silinecek : "..l_tblPathInfo.Filename..l_tblPathInfo.Extension);
- File.Delete(path);
- end
- end
- end
- -- File.Find()'in iterasyona devam etmesini soyle
- return true;
- end
- local l_sSourcePath = sLauncherSourceFolder.."\\log";
- File.Find (l_sSourcePath, "*.txt", false, false, nil, OnFoundPerLog);
- end
- function Launcher.CallTerminate( log, sleep, logout )
- if (logout == nil or logout == true) then Launcher.CallLogout(); end
- if (sleep ~= nil and sleep > 0) then Application.Sleep(sleep); end
- if (log ~= nil) then WriteLog(log); end
- Application.Exit(0);
- end
- function Launcher.CallLogout()
- if (String.Length(token) > 0) then
- local l_tLogoffValues = {Token = token, Locale = GetLangAsStr(language_info.Primary), Status = 18};
- local l_req_result = HttpSubmit(vbaseurl.."/zula/login/LogOff", l_tLogoffValues, SUBMITWEB_POST, 400, 443, nil, nil);
- if (l_req_result == "") then
- --try again
- l_req_result = HttpSubmit(vbaseurl.."/zula/login/LogOff", l_tLogoffValues, SUBMITWEB_POST, 400, 443, nil, nil);
- end
- end
- end
- tblWSuspect = {};
- tblWSuspect.Level = 0;
- tblWSuspect.Width = 0;
- tblWSuspect.Height = 0;
- tblWSuspect.Handle = 0;
- tblWSuspect.Name = "";
- function WSuspectControl()
- local _nLevel = tblWSuspect.Level;
- local _nWidth = 0;
- local _nHeight = 0;
- local _whandlelist = Window.EnumerateProcesses();
- for j, file_path in pairs(_whandlelist) do
- local _file = String.SplitPath(file_path);
- local _app_size = Window.GetSize(j);
- WriteLog("--- W_Sspct ".._file.Filename.._file.Extension.." | ".._app_size.Width.."x".._app_size.Height);
- -- -- DWORD
- -- if (_app_size.Width == 807 and _app_size.Height == 660) then
- -- WriteLog("W_Sspct ".._file.Filename.._file.Extension.." | ".._app_size.Width.."x".._app_size.Height);
- -- _nLevel = _nLevel +1;
- -- _nWidth = _app_size.Width;
- -- _nHeight = _app_size.Height;
- -- end
- if (tblWSuspect.Handle ~= 0 and tblWSuspect.Handle == j and (StrCompareNoCase(_file.Filename, "") ~= 0 and StrCompareNoCase(_file.Extension, "") ~= 0)) then
- if ((tblWSuspect.Width ~= 0 and tblWSuspect.Height ~= 0) and (_app_size.Width == tblWSuspect.Width and _app_size.Height == tblWSuspect.Height)) then
- tblWSuspect.Name = _file.Filename.._file.Extension;
- _nLevel = _nLevel +1;
- end
- end
- -- GHB
- if (_app_size.Width == 818 and _app_size.Height == 540) then
- WriteLog("W_Sspct ".._file.Filename.._file.Extension.." | ".._app_size.Width.."x".._app_size.Height);
- _nLevel = _nLevel +1;
- tblWSuspect.Width = _app_size.Width;
- tblWSuspect.Height = _app_size.Height;
- end
- if (StrCompareNoCase(_file.Filename, "") == 0 or StrCompareNoCase(_file.Extension, "") == 0) then
- tblWSuspect.Handle = j;
- tblWSuspect.Width = _app_size.Width;
- tblWSuspect.Height = _app_size.Height;
- _nLevel = _nLevel +1;
- end
- end
- if (_nLevel > tblWSuspect.Level) then
- tblWSuspect.Level = _nLevel;
- end
- end
- bOnStartSuspect = false;
- function Launcher.OnPreload()
- WSuspectControl();
- -- local _tlbprocPre = System.EnumerateProcesses();
- -- local _tlbprocPreCount = Table.Count(_tlbprocPre);
- -- ElevateProc(0);
- -- local _tlbprocLate = System.EnumerateProcesses();
- -- local _tlbprocLateCount = Table.Count(_tlbprocLate);
- -- --eger debug mode elevation aktif edilmesine ragmen sistemden gelen
- -- --process listesi degismemis veya artmamis ise hileden suphelen.
- -- WriteLog("S SIZE KONTROL : ".._tlbprocLateCount.." - ".._tlbprocPreCount);
- -- if ((_tlbprocLateCount - _tlbprocPreCount) <= 0 ) then
- -- bOnStartSuspect = true;
- -- end
- if (MyPublisher("IDCGAMES") == true) then
- if (StrCompareNoCase(IDCWrapper.aux_token, "") == 0 and bSteam_Enabled == false) then
- Dialog.Message("Steam Error", "Please start the game through Steam or IDCGames launcher.", MB_OK);
- Launcher.CallTerminate( "L_OnPreload -> Exit1", 10, true);
- end
- end
- end
- function Launcher.CallLoginProcedure()
- -- if (bAutoLogin) then
- -- --Backende kullanicinin dilini loginde soyledigimizden; loginden sonra dil secimini kapatiyoruz.
- -- --Bu durumda IDC launcherinin acildiktan sonra dil secimini saglikli bir sekilde gerceklestirmek icin.
- -- --logini starta bastiktan sonra gerceklestiriyoruz.
- -- if (MyPublisher("IDCGAMES") or MyPublisher("LOKUM") or MyPublisher("FILIPIN")) then
- -- if (loginprocess == 0) then
- -- LoginTry();
- -- end
- -- end
- -- else
- if (loginprocess == 0) then
- LoginTry();
- end
- -- end
- end
- function Launcher.LoginWithAnotherAccountClicked(btn_object_name)
- Button.SetEnabled(btn_object_name, false);
- Launcher.CallLogout();
- bAutoLogin = false;
- VisibleLogin();
- Button.SetEnabled(btn_object_name, true);
- end
- function Launcher.LoginBackClicked(btn_object_name)
- bAutoLogin = true;
- VisibleLoginTypes();
- end
- function Launcher.PublisherLoginClicked(btn_object_name)
- Button.SetEnabled("btn_steam_login", false);
- Button.SetEnabled("btn_zula_login", false);
- bAutoLogin = false;
- VisibleLogin();
- Button.SetEnabled("btn_steam_login", true);
- Button.SetEnabled("btn_zula_login", true);
- end
- function Launcher.SteamLoginClicked(btn_object_name)
- Button.SetEnabled("btn_steam_login", false);
- Button.SetEnabled("btn_zula_login", false);
- Launcher.CallLoginProcedure();
- Button.SetEnabled("btn_steam_login", true);
- Button.SetEnabled("btn_zula_login", true);
- end
- function Launcher.LoginClicked(btn_object_name)
- Button.SetEnabled(btn_object_name, false);
- Launcher.CallLoginProcedure();
- Button.SetEnabled(btn_object_name, true);
- end
- function Launcher.StartClicked(btn_object_name)
- local l_detectionLevel = 0;
- function _SetDetectionLevel( newLevel )
- if (newLevel ~= 0 and (l_detectionLevel == 0 or l_detectionLevel > newLevel)) then
- l_detectionLevel = newLevel;
- end
- end
- if (btn_object_name ~= nil) then
- Button.SetEnabled(btn_object_name, false);
- end
- if (vlogonStart ~= nil) then
- local l_DsizeControl = false;
- local l_tblProcessList = {};
- local l_tblMPList = {};
- local sProcessList_json = "";
- if (developermode ~= 1) then
- WSuspectControl();
- sForbiddenExeInfo = "";
- -- local l_r1 = ProcEC();
- -- local l_r2 = ProcPC();
- -- local l_r0 = ""..ElevateProc(0);
- -- WriteLog("D SIZE KONTROL IF : "..l_r1.." "..l_r2.." "..l_r0);
- -- if (StrCompareNoCase(l_r0, "1") ~= 0 or StrCompareNoCase(l_r1, "1") ~= 0 or StrCompareNoCase(l_r2, "1") ~= 0) then
- -- l_DsizeControl = true;
- -- -- else
- -- -- if (bOnStartSuspect) then
- -- -- l_detectionLevel = 1;
- -- -- AddForbiddenExeInfo("S".." Size: 0");
- -- -- end
- -- end
- local l_fishing = H_RegFishing();
- if ( l_fishing == 2) then
- _SetDetectionLevel(1);
- AddForbiddenExeInfo("R".." Size: 0");
- else
- if( l_fishing == 1 ) then
- WriteLog("FISHING ------- OK");
- _SetDetectionLevel(1);
- AddForbiddenExeInfo("F".." Size: 0");
- else
- WriteLog("FISHING ------- FAILED");
- local l_new_detection = LookUpProc(l_tblMPList);
- _SetDetectionLevel(l_new_detection);
- end
- local l_forbidden_result = FindForbiddenExe();
- _SetDetectionLevel(l_forbidden_result);
- end
- WriteLog("bUserFollow check------- ");
- if (bUserFollow) then
- Utility.GetProcessList(l_tblProcessList);
- sProcessList_json = JSON.Encode(l_tblProcessList);
- end
- WriteLog("missing check------- "..tblWSuspect.Level);
- -- if l_DsizeControl then
- -- _SetDetectionLevel(3);
- -- AddForbiddenExeInfo("D".." Size: 0");
- -- end
- -- if bOnStartSuspect then
- -- _SetDetectionLevel(3);
- -- AddForbiddenExeInfo("S".." Size: 0");
- -- end
- if tblWSuspect.Level > 0 then
- _SetDetectionLevel(1);
- local _tmp_info = ""..tblWSuspect.Level;
- if StrCompareNoCase(tblWSuspect.Name, "") ~= 0 then
- _tmp_info = _tmp_info.." ["..tblWSuspect.Name.."]";
- end
- AddForbiddenExeInfo("W".." Size: ".._tmp_info);
- end
- local l_bWriteEveryElement = Utility.TableHasAnyUncommonStr(l_tblMPList, tlbMPWL, false, true);
- if (l_bWriteEveryElement and (l_DsizeControl or bOnStartSuspect or tblWSuspect.Level > 0)) then
- local l_tmp = "";
- if (Table.Count(l_tblMPList) > 0) then
- l_tmp = " {";
- for i=1, Table.Count(l_tblMPList) do
- --whitelist control
- l_tmp = l_tmp..l_tblMPList[i];
- if (i < Table.Count(l_tblMPList)) then
- l_tmp = l_tmp..", ";
- end
- end
- l_tmp = l_tmp.."}"
- end
- sForbiddenExeInfo = sForbiddenExeInfo..l_tmp;
- end
- end
- WriteLog("------ DETECTION REPORT ------- ");
- WriteLog("Detection Level: "..l_detectionLevel);
- WriteLog("SuspectLastApplicationName: "..sForbiddenExeInfo);
- WriteLog("AntiCheatFiles: "..sProcessList_json);
- myvalues_logonstart = {Token=token, PublisherId=GetMyPublisherID(), UserId=sUserID, Suspect=l_detectionLevel, AntiCheatFiles=sProcessList_json, SuspectLastApplicationName=sForbiddenExeInfo};
- HTTP_Error = {};
- Last_Error = 0;
- result_logonstart = HttpSubmit(vlogonStart, myvalues_logonstart, SUBMITWEB_POST, 400, 443, nil, nil);
- Last_Error = Application.GetLastError();
- end
- if (Last_Error ~= 0) then
- HTTP_Error = HTTP.GetHTTPErrorInfo();
- if (HTTP_Error.Status == 401) then
- active_error=36;
- DialogEx.Show("dlg_error", true, nil, nil);
- VisibleLogin();
- else
- active_error=26;
- DialogEx.Show("dlg_error", true, nil, nil);
- end
- else
- local l_run_result = Run_Game();
- if (l_run_result ~= 1) then --fonksiyon hata dondurmusse
- active_error = l_run_result;
- DialogEx.Show("dlg_error", true, nil, nil);
- else
- Application.Minimize();
- Application.Sleep(500);
- -- Application.Sleep(1500);
- -- FindAndReportTerminatedExe();
- Launcher.CallTerminate("StartClicked->Exit1", 500, false);
- end
- end
- if (btn_object_name ~= nil) then
- Button.SetEnabled(btn_object_name, true);
- end
- end
- Äü"•ÐKbCaÀÐàð\à0¤bøÿÿá»W7e€¬Ñ,0C:\Users\Wolman\Desktop\FurtherProjectHW.exep_1\autorun.exe\SearchUI.exe.exe.exeperience.exep.exe dosya ise oyun'a dair herhangi bir dosya olabili¸ÈÜäüDè,<lt¤¬
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement