Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Manual Patcher .NET [Source Included]

Master Summoner
Joined
Nov 9, 2009
Messages
579
Reaction score
238
@torstmn: i know its messy and not complying to any standards but you need to know this was a 5 minute copy&aste project, copied from my launcher
regarding the snippet you posted .. when reading the bytes of a file bytes that are below (hex)10 will be written without a leading 0. inside the patch maker i append the leading 0 to it but when writing those bytes to file again with leading 0 it'll throw an exception (cant remember which one) so im removing the leading 0 again inside the manual patcher ... yes i know it sounds silly but i dont like it when byte strings contain bytes without leading 0 :D if you want to you can put that part into a function called AppendZero/RemoveZero or sth like that .. as i said already i copied this code from my launcher and didnt put much effort into it, just wanted to release something thats using my PK2Writer.dll ^^

@karemsame: yeah i know zszc patcher been using it for myself some time ago it works fine most of the times but sometimes it doesnt work for every on .. i had it several times that the patch had an error in step 1 or step 2 of loading the gfx file manager dll on some players' computers but on others it worked just fine .. thats why ive written something similar inside my launcher
 
Master Summoner
Joined
Nov 9, 2009
Messages
579
Reaction score
238
you have to put the sv.t with the new version into Media folder and include it inside the patch, automatic version update isnt implemented in this small program
 
Experienced Elementalist
Joined
Feb 13, 2012
Messages
220
Reaction score
31
@lemoniscool
Bro i wont ask you for thing if you can help me
i need When any Players open The Client Get the Msg You need install the New Manual patch Like silkroad Online
this msg on the file " textuisystem.txt " and have Code " UILM_MSG_DETECTED_PATCH_MANUAL "
if you can help me Please ask me about this
ty
Sory For My Bad English
 
Master Summoner
Joined
Nov 9, 2009
Messages
579
Reaction score
238
@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 ^^
 
Experienced Elementalist
Joined
Feb 13, 2012
Messages
220
Reaction score
31
@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
 
Master Summoner
Joined
Nov 9, 2009
Messages
579
Reaction score
238
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
 
Experienced Elementalist
Joined
Feb 13, 2012
Messages
220
Reaction score
31
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
 
Master Summoner
Joined
Nov 9, 2009
Messages
579
Reaction score
238
im not programming in c++ sorry, and the php script is for securely reading the line from server.cfg
 
Junior Spellweaver
Joined
Jun 3, 2008
Messages
161
Reaction score
3
This is Great im implementing it and working on a launcher i will release in the future once im satisfied with it. :D
 
Back
Top