(VBS скрипты)
Запуск Warface с аккаунтом НЕ mail.ru
Dim o, WFLogin, WFPassword, WFToken, WFUid, WFSessionKey, WFPersId, WFKey, wsh
WFLogin = "login@gmail.com"
WFPassword = "pass"
Set o = CreateObject("Microsoft.XMLHTTP")
o.open "POST", "https://authdl.mail.ru/ec.php?hint=GcAuth", False
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.setRequestHeader "Content-Length", Len("<?xml version=""1.0"" encoding=""UTF-8""?><GcAuth Username="""&WFLogin&""" Password="""&WFPassword&""" ChannelId=""0""/>")
o.setRequestHeader "User-Agent","Downloader/4300"
o.send "<?xml version=""1.0"" encoding=""UTF-8""?><GcAuth Username="""&WFLogin&""" Password="""&WFPassword&""" ChannelId=""0""/>"
Set xmlParser = CreateObject("Msxml2.DOMDocument")
xmlParser.loadXML(o.responsetext)
WFToken = xmlParser.getElementsByTagName("GcAuth").Item(0).getAttribute("Token")
WFUid = xmlParser.getElementsByTagName("GcAuth").Item(0).getAttribute("Uid")
WFSessionKey = xmlParser.getElementsByTagName("GcAuth").Item(0).getAttribute("SessionKey")
o.open "POST", "https://authdl.mail.ru/ec.php?hint=EnazaGetOrdersList", False
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.setRequestHeader "Content-Length", Len("<?xml version=""1.0"" encoding=""UTF-8""?><EnazaGetOrdersList Uid="""&WFUid&""" SessionKey="""&WFSessionKey&""" UidType=""3""/>")
o.setRequestHeader "User-Agent","Downloader/4300"
o.send "<?xml version=""1.0"" encoding=""UTF-8""?><EnazaGetOrdersList Uid="""&WFUid&""" SessionKey="""&WFSessionKey&""" UidType=""3""/>"
o.open "POST", "https://authdl.mail.ru/sz.php?hint=AutoLogin", False
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.setRequestHeader "Content-Length", Len("<?xml version=""1.0"" encoding=""UTF-8""?><AutoLogin ProjectId=""1177"" SubProjectId=""0"" ShardId=""1"" GcToken="""&WFToken&"""/>")
o.setRequestHeader "User-Agent","Downloader/4300"
o.send "<?xml version=""1.0"" encoding=""UTF-8""?><AutoLogin ProjectId=""1177"" SubProjectId=""0"" ShardId=""1"" GcToken="""&WFToken&"""/>"
xmlParser.loadXML(o.responsetext)
WFPersid = xmlParser.getElementsByTagName("AutoLogin").Item(0).getAttribute("PersId")
WFKey = xmlParser.getElementsByTagName("AutoLogin").Item(0).getAttribute("Key")
Set wsh = WScript.CreateObject("WScript.Shell")
wsh.Exec("Game.exe --shard_id=0 +online_server s0.warface.ru -uid "&WFPersid&" -token "&WFKey&" ")
Запуск Warface с аккаунтом mail.ru
Dim o, o2, accesstoken, uid, token, wsh, location, str, mpop, str2,a1,a2
Set o = CreateObject("Microsoft.XMLHTTP")
o.open "POST", "https://o2.mail.ru/token", False
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.setRequestHeader "Content-Length", Len("client_id=gamecenter.mail.ru&grant_type=password&username=login@mail.ru&password=pass")
o.setRequestHeader "User-Agent","Downloader/4300"
o.send "client_id=gamecenter.mail.ru&grant_type=password&username=login@mail.ru&password=pass"
Set xmlParser = CreateObject("Msxml2.DOMDocument")
xmlParser.loadXML(o.responsetext)
str = right(o.responsetext,50)
accesstoken = left (str, 48)
o.open "POST", "https://authdl.mail.ru/ec.php?hint=MrPage2", False
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.setRequestHeader "Content-Length", Len("<?xml version=""1.0"" encoding=""UTF-8""?><MrPage2 SessionKey="""&accesstoken&""" Page=""http://dl.mail.ru/robots.txt""/>")
o.setRequestHeader "User-Agent","Downloader/4300"
o.send "<?xml version=""1.0"" encoding=""UTF-8""?><MrPage2 SessionKey="""&accesstoken&""" Page=""http://dl.mail.ru/robots.txt""/>"
xmlParser.loadXML(o.responsetext)
str2 = o.responsetext
location = xmlParser.getElementsByTagName("MrPage2").Item(0).getAttribute("Location")
Replace location, "&", "&"
o.open "GET", location, false
o.setRequestHeader "User-Agent","Downloader/4300"
o.send
mpop=o.getResponseHeader ("Set-Cookie")
a1=instr (mpop,"Mpop")
a2=instr (mpop,"ru:")
mpop=mid (mpop,a1+5, a2+3-a1-5)
o.open "POST", "https://authdl.mail.ru/sz.php?hint=AutoLogin", False
o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
o.setRequestHeader "Content-Length", Len("<?xml version=""1.0"" encoding=""UTF-8""?><AutoLogin ProjectId=""1177"" SubProjectId=""0"" ShardId=""1"" Mpop="""&mpop&"""/>")
o.setRequestHeader "User-Agent","Downloader/4300"
o.send "<?xml version=""1.0"" encoding=""UTF-8""?><AutoLogin ProjectId=""1177"" SubProjectId=""0"" ShardId=""1"" Mpop="""&mpop&"""/>"
xmlParser.loadXML(o.responsetext)
uid = xmlParser.getElementsByTagName("AutoLogin").Item(0).getAttribute("PersId")
token = xmlParser.getElementsByTagName("AutoLogin").Item(0).getAttribute("Key")
Set wsh = WScript.CreateObject("WScript.Shell")
wsh.Exec("Game.exe --shard_id=0 +online_server s2.warface.ru -uid "&uid&" -token "&token&" ")
То же самое для аккаунта mail.ru на делфи. Специально старался написать минимум кода, чтобы желающим было проще разобраться.
uses comobj,windows,sysutils,activex;
var
o,xmlparser:OleVariant;
accesstoken,str,location,mpop,uid,token:string;
a1,a2:Integer;
begin
CoInitialize(0); ;
o:=CreateOleObject('Microsoft.XMLHTTP');
xmlparser:=CreateOleObject('Msxml2.DOMDocument');
o.open ('POST', 'https://o2.mail.ru/token', False);
o.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
o.setRequestHeader ('Content-Length', Length('client_id=gamecenter.mail.ru&grant_type=password&username=login@mail.ru&password=pass'));
o.setRequestHeader('User-Agent','Downloader/4300');
o.send ('client_id=gamecenter.mail.ru&grant_type=password&username=login@mail.ru&password=pass');
xmlParser.loadXML(o.responsetext);
accesstoken := copy (o.responsetext, (Length(o.responsetext)-49),48 );
o.open ('POST', 'https://authdl.mail.ru/ec.php?hint=MrPage2', False);
o.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
o.setRequestHeader('Content-Length', Length('<?xml version="1.0" encoding="UTF-8"?><MrPage2 SessionKey="'+accesstoken+'" Page="http://dl.mail.ru/robots.txt"/>'));
o.setRequestHeader('User-Agent','Downloader/4300');
o.send ('<?xml version="1.0" encoding="UTF-8"?><MrPage2 SessionKey="'+accesstoken+'" Page="http://dl.mail.ru/robots.txt"/>');
xmlParser.loadXML(o.responsetext);
location := xmlParser.getElementsByTagName('MrPage2').Item(0).getAttribute('Location');
StringReplace (location, 'amp;', '&',[rfreplaceall,rfignorecase]);
o.open ('GET', location, false);
o.setRequestHeader ('User-Agent','Downloader/4300');
o.send;
str:=o.getResponseHeader ('Set-Cookie');
a1:= pos('Mpop=',str); a2:= Pos('ru:;',str);
mpop:= copy (str, a1+5, a2-a1-2);
o.open ('POST', 'https://authdl.mail.ru/sz.php?hint=AutoLogin', False);
o.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
o.setRequestHeader ('Content-Length', Length('<?xml version="1.0" encoding="UTF-8"?><AutoLogin ProjectId="1177" SubProjectId="0" ShardId="1" Mpop="'+mpop+'"/>'));
o.setRequestHeader ('User-Agent','Downloader/4300');
o.send ('<?xml version="1.0" encoding="UTF-8"?><AutoLogin ProjectId="1177" SubProjectId="0" ShardId="1" Mpop="'+mpop+'"/>');
xmlParser.loadXML(o.responsetext);
uid := xmlParser.getElementsByTagName('AutoLogin').Item(0).getAttribute('PersId');
token := xmlParser.getElementsByTagName('AutoLogin').Item(0).getAttribute('Key');
WinExec(PAnsiChar('Game.exe '+'--shard_id=0 +online_server s2.warface.ru -uid '+pansichar(uid)+' -token '+pansichar(token)),1);
end.