Re: Manual Patcher .NET [Source Included]
@karemsame: you would have to extract the sv.t (use torsmn's PK2Extractor dll) then decrypt it and compare the version inside it with the version inside your database, if database version is bigger than client version extract textuisystem.txt read it line by line and split the lines with tab -> chr(9) then compare the second index of that string array with "UILM_MSG_DETECTED_PATCH_MANUAL" if its the same use messagebox to print the message inside your split line array but thats a bit overcomplicated you can do this way easier if you dont use a string inside textuisystem.txt but a predefined static string inside the patcher code
i dont have time to write this for you now i have to fix a problem with my gateway server once i fixed that i might write this for you if you didnt do it already ^^
Re: Manual Patcher .NET [Source Included]
Quote:
Originally Posted by
lemoniscool
@karemsame: you would have to extract the sv.t (use torsmn's PK2Extractor dll) then decrypt it and compare the version inside it with the version inside your database, if database version is bigger than client version extract textuisystem.txt read it line by line and split the lines with tab -> chr(9) then compare the second index of that string array with "UILM_MSG_DETECTED_PATCH_MANUAL" if its the same use messagebox to print the message inside your split line array but thats a bit overcomplicated you can do this way easier if you dont use a string inside textuisystem.txt but a predefined static string inside the patcher code
i dont have time to write this for you now i have to fix a problem with my gateway server once i fixed that i might write this for you if you didnt do it already ^^
Ty bro but i maked it not on Media or Database this on Server.cfg
Re: Manual Patcher .NET [Source Included]
on server.cfg? well you would have to use a php gateway then, like useing httpwebrequest to open a .php script located on your server that echos the string inside server.cfg, you can use the function below to use the httpwebrequest easily
Code:
Private Function _GetServerResponse(ByVal Link As String, ByVal Post As String) As String
Dim Request As HttpWebRequest = CType(WebRequest.Create(Link), HttpWebRequest)
Request.Method = "POST"
Request.ContentType = "application/x-www-form-urlencoded"
Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post)
Request.ContentLength = byteArray.Length
Dim DataStream As Stream = Request.GetRequestStream()
DataStream.Write(byteArray, 0, byteArray.Length)
DataStream.Close()
Dim Response As HttpWebResponse = Request.GetResponse()
DataStream = Response.GetResponseStream()
Dim reader As New StreamReader(DataStream)
Dim ServerResponse As String = reader.ReadToEnd()
reader.Close()
DataStream.Close()
Response.Close()
Return ServerResponse
End Function
example for this function:
Code:
Dim response as string
response = _GetServerResponse("http://www.example.com/test.php", "")
messagebox.show(response)
the php script should look like this:
Code:
<?php
$handle = fopen('C:\Bin_Data\server.cfg', 'rb');
while($line = fgets($handle))
{
if(strstr($line, "REPLACE_THIS_WITH_CONFIG_STRING"))
{
$data = trim(preg_replace('/\s+/', ' ', $line));
$data = explode(" ", $data);
echo($data[1]);
break;
}
}
fclose($handle);
?>
if i got you right you want to set your client version inside server.cfg with this you can recieve it safely from anywhere you want
Re: Manual Patcher .NET [Source Included]
Quote:
Originally Posted by
lemoniscool
on server.cfg? well you would have to use a php gateway then, like useing httpwebrequest to open a .php script located on your server that echos the string inside server.cfg, you can use the function below to use the httpwebrequest easily
Code:
Private Function _GetServerResponse(ByVal Link As String, ByVal Post As String) As String
Dim Request As HttpWebRequest = CType(WebRequest.Create(Link), HttpWebRequest)
Request.Method = "POST"
Request.ContentType = "application/x-www-form-urlencoded"
Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post)
Request.ContentLength = byteArray.Length
Dim DataStream As Stream = Request.GetRequestStream()
DataStream.Write(byteArray, 0, byteArray.Length)
DataStream.Close()
Dim Response As HttpWebResponse = Request.GetResponse()
DataStream = Response.GetResponseStream()
Dim reader As New StreamReader(DataStream)
Dim ServerResponse As String = reader.ReadToEnd()
reader.Close()
DataStream.Close()
Response.Close()
Return ServerResponse
End Function
example for this function:
Code:
Dim response as string
response = _GetServerResponse("http://www.example.com/test.php", "")
messagebox.show(response)
the php script should look like this:
Code:
<?php
$handle = fopen('C:\Bin_Data\server.cfg', 'rb');
while($line = fgets($handle))
{
if(strstr($line, "REPLACE_THIS_WITH_CONFIG_STRING"))
{
$data = trim(preg_replace('/\s+/', ' ', $line));
$data = explode(" ", $data);
echo($data[1]);
break;
}
}
fclose($handle);
?>
if i got you right you want to set your client version inside server.cfg with this you can recieve it safely from anywhere you want
yeah bro it's is great
but i can do it on C++ for my Source Code Maked on C++
Sory For my English
sory bro but idk why i do the script For what
Ty
i know this to Read The Line on server.cfg
Re: Manual Patcher .NET [Source Included]
im not programming in c++ sorry, and the php script is for securely reading the line from server.cfg
Re: Manual Patcher .NET [Source Included]
This is Great im implementing it and working on a launcher i will release in the future once im satisfied with it. :D
Re: Manual Patcher .NET [Source Included]
My Game version is 3
So If Game Version ='1'
Print ' That manual Patch only for version 2'