Author Topic: NWN Gamespy Server Replacement Project  (Read 11102 times)

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #45 on: December 08, 2012, 11:30:37 pm »


               I just want to say how impressed I am at how quickly you guys have come together with ideas and even implementations. And to say thanks. '<img'>

Baaleos, is your C# project one that I could compile with the .NET Framework SDK? I just want to recompile with ServerBrowser.cs altered to point to a server list to which I have added a row for the server I've been playing on.

BTW, one potential fly in the changing-the-hosts-file ointment is that it may cause trouble with other (newer) games that still use gamespy... Perhaps the wrapper approach would allow use of the in-game server list without that issue?
               
               

               
            

Legacy_Visavant

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #46 on: December 09, 2012, 12:03:38 am »


               Unless the new game is also called nwn, it won't conflict.

nwn.master.gamespy.com
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #47 on: December 09, 2012, 12:17:02 am »


               

MrZork wrote...

I just want to say how impressed I am at how quickly you guys have come together with ideas and even implementations. And to say thanks. '<img'>

Baaleos, is your C# project one that I could compile with the .NET Framework SDK? I just want to recompile with ServerBrowser.cs altered to point to a server list to which I have added a row for the server I've been playing on.

BTW, one potential fly in the changing-the-hosts-file ointment is that it may cause trouble with other (newer) games that still use gamespy... Perhaps the wrapper approach would allow use of the in-game server list without that issue?


Im not all the familiar with the .Net Framework SDK

The project on vault was compiled in VS 2010 - 
but should also compile in VS2010 Express


The Contents of the datagrid are come from an external website (a cached version of the master server list)


In theory, you could modify the DelayedStart method inside the class.



private void DelayedStart()
{
Thread.Sleep(2000); //Delayed Start to give windows time to get the form to display
string sText = GetMasterServerList();
string[] sSpliter = { "<tr>" };
string[] sRows = sText.Split(sSpliter, StringSplitOptions.RemoveEmptyEntries);
//MessageBox.Show(sRows.Length.ToString());
int i = 8;
string[] sSplit2 = { "<td class=\\"td1\\">" };
for (i = 8; i < sRows.Length - 1; i++)
{
string sRow = sRows[i];
string[] sColumns = sRow.Split(sSplit2, StringSplitOptions.RemoveEmptyEntries);
string sIP = sColumns[0].Replace("</td>", "");
string sPort = sColumns[1].Replace("</td>", "");
string sName = sColumns[5].Replace("</td>", "");
string[] sRowToAdd = { sName, sIP, sPort };
AddRow(dgServers,sRowToAdd);
}
//MessageBox.Show("Done");
ProcessList();
}

If you dont care about the master server list, and just want your own server in there.
Just change
string[] sRowToAdd = {"Your Server Name", "Your IP", "Your Port"};

Also - u can take it out of the loop, if you dont care about the rest.



private void DelayedStart()
{
Thread.Sleep(2000); //Delayed Start to give windows time to get the form to display
string sRow = {"ServerNameHere","IP Here","PORT HERE"};
AddRow(dgServers,sRow);
}

               
               

               
            

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #48 on: December 09, 2012, 02:30:01 am »


               Visavant: Cool, I didn't know GameSpy had things broken down into per-game subdomains. Good to know.

Baaleos: Thanks. I will give VS Express a shot. '<img'>
               
               

               
            

Legacy_Melkior_King

  • Full Member
  • ***
  • Posts: 234
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #49 on: December 09, 2012, 02:37:54 pm »


               

tzaeru wrote...

Melkior_King wrote...

The simplest solution (from the player/server point of view) is for someone to make a server which does the same thing as GameSpy (except only for nwn) and give us the IP address.  We can then enter that IP address along with the name of the GameSpy nwn server into our local "hosts" file to redirect the nwn GameSpy calls to the new site.

The adding of the IP address and server name to the local "hosts" file could easily be automated.  Distributors such as gog.com could add the code to the installer for nwn Diamond Edition.


Is the GameSpy IP in a data file? If it's directly in the executable, then the closest to a legal way to achieve that is to intercept the connection attempt to GameSpy's server and modify the IP on the fly.. But even that might fall under reverse engineering and be promptly illict, except if you happen to live in a country where reverse engineering for the purpose of maintaining compatibility and functionality is legal.


The GameSpy server base address is saved as a hard-coded string (master.gamespy.com) inside the exe files (nwmain.exe and nwserver.exe).  Changing that string will change the site which the game tries to access.

The game adds the nwn prefix to the base address before doing the dns enquiry so it ends up as nwn.master.gamespy.com

You can either edit the string inside each exe file so that the DNS servers resove to a different site, or you can enter the IP address along with the above site address into your local hosts file in order to redirect the game to a different site.

In short, this makes it fairly easy to redirect the GameSpy requests to a different site.
               
               

               
            

Legacy_tzaeru

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #50 on: December 09, 2012, 05:55:39 pm »


               

Melkior_King wrote...

tzaeru wrote...

Melkior_King wrote...

The simplest solution (from the player/server point of view) is for someone to make a server which does the same thing as GameSpy (except only for nwn) and give us the IP address.  We can then enter that IP address along with the name of the GameSpy nwn server into our local "hosts" file to redirect the nwn GameSpy calls to the new site.

The adding of the IP address and server name to the local "hosts" file could easily be automated.  Distributors such as gog.com could add the code to the installer for nwn Diamond Edition.


Is the GameSpy IP in a data file? If it's directly in the executable, then the closest to a legal way to achieve that is to intercept the connection attempt to GameSpy's server and modify the IP on the fly.. But even that might fall under reverse engineering and be promptly illict, except if you happen to live in a country where reverse engineering for the purpose of maintaining compatibility and functionality is legal.


The GameSpy server base address is saved as a hard-coded string (master.gamespy.com) inside the exe files (nwmain.exe and nwserver.exe).  Changing that string will change the site which the game tries to access.

The game adds the nwn prefix to the base address before doing the dns enquiry so it ends up as nwn.master.gamespy.com

You can either edit the string inside each exe file so that the DNS servers resove to a different site, or you can enter the IP address along with the above site address into your local hosts file in order to redirect the game to a different site.

In short, this makes it fairly easy to redirect the GameSpy requests to a different site.


Ah, yeah, changing the domain resolvement would be handy. I was mostly worried of how directly modifying the executables works with the EULA - however, I'd figure it falls under the interoperability clause in any case.
               
               

               
            

Legacy_Visavant

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #51 on: December 09, 2012, 06:42:56 pm »


               I'm leaving it up to the player to decide what they want to do about it, giving them the option of modifying the binary, or make a change to the hosts file instead.
               
               

               
            

Legacy_Guest_orizvi_*

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #52 on: December 09, 2012, 07:59:25 pm »


               I just want to point out - if we stick with only the hosts file change to implement the fix and an actual gamespy server emulator. Our fix would also help out the other games affected (NWN2 primarily but even ones like SWAT4 or whatever else lost their Gamespy servers).
               
               

               
            

Legacy_Melkior_King

  • Full Member
  • ***
  • Posts: 234
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #53 on: December 10, 2012, 10:03:50 am »


               Visavant is currently doing this out of the goodness of his heart.  If he opens up a real equivalent to gamespy for all older games, he deserves to be paid for it.

So I suggest that Visavant should put a "Donate" button on the nwncore site so people can express their gratitude in a more substantial form.  I know I'd donate.
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #54 on: December 10, 2012, 01:14:24 pm »


               I advocate ONLY changing the hosts file. It is easer, and much safer.

Be well. Game on.
GM_ODA
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #55 on: December 10, 2012, 01:22:40 pm »


               I dont like the idea of changing the hosts file.
Granted - I know it can work cross platform - eg a version can be done for linux and macOS etc

But it does constitute a change to the users operating system, vs a change to the application.

Changing a single binary, is safer than changing the operating system or dependancies.

With so many Operating System and Network setups out there, the only thing we can be assured of, is that they are using 1.69 nwn, with or without modifications.
Even if they are using modifications, a binary patcher can be setup to find the correct memory location by using pattern recognition inside the binary - so patching wouldnt be a problem.

If we start releasing changes to the users operating system, can the community give a 100% guarantee that it wont break the hypothetical someones obscure computer/network setup?
The Rhetorical answer there is - No, simply because we cannot test everyones PC/Network setup.

Can we test and provide a level of assurance for a binary, or linux/macOS application?
Yes - Testing a single binary per OS, is easier than testing different Operating System setups.

Also - it should be noted that the hosts file is often the first thing to get deleted/restored from backup, in many networking debug scenarios.
eg- My internet doesnt work -
Then someone suggests a change/replacement to the hosts file.

So - there are some scenarios there, where any changes we make to hosts file, would need to re-done.

Once a binary is patched, its patched, and never needs touched.
               
               

               
            

Legacy_Borrie BoBaka

  • Jr. Member
  • **
  • Posts: 59
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #56 on: December 10, 2012, 01:34:09 pm »


               I have already suggested to Visavant to automatically create a backup copy of any files the patcher alters so that the changes could be easily reverted if the need should ever arise.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #57 on: December 10, 2012, 01:44:55 pm »


               

Borrie BoBaka wrote...

I have already suggested to Visavant to automatically create a backup copy of any files the patcher alters so that the changes could be easily reverted if the need should ever arise.


Backup and Restore isnt so much a problem.
Merging with other peoples existing configurations is a little more complicated.

However, with signature scanning/pattern recognition - its easier to merge/patch the binary, than it is to effect changes to peoples hosts files, while preserving whatever customizations may already be there.

Its basic Software testing methodology here.
We cannot exhaustively test everyones different configurations -
so the thing we should probably focus on, is what we can effect changes on, and test.

If the community releases a hosts file change - gives it to person A, and then person A says = Hey... it aint working on my Computer.

How does the community help that person?

We can patch, test, and debug a binary, we cannot do the same for peoples operating systems.
               
               

               
            

Legacy_Zarathustra217

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #58 on: December 10, 2012, 09:49:32 pm »


               I generally tend to agree - at least it's not a very ideal design approach. Not to mention the very notion of going into your OS and editing files is bound to make some people sceptical.
               
               

               
            

Legacy_Visavant

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +0/-0
NWN Gamespy Server Replacement Project
« Reply #59 on: December 11, 2012, 03:04:54 am »


               

Borrie BoBaka wrote...

I have already suggested to Visavant to automatically create a backup copy of any files the patcher alters so that the changes could be easily reverted if the need should ever arise.


Decided against creating backups, the executibles can be regained from the critical rebuild if it's that corrupted, though seeing how many writes I've made in my tests, it's pretty hardy. The patcher acts as a toggle, reverting changes if it detects the changes on the next attempt to patch the binary.

Baaleos wrote...

However, with signature scanning/pattern recognition - its easier to merge/patch the binary, than it is to effect changes to peoples hosts files, while preserving whatever customizations may already be there.

Not really, I've written fewer lines to support hosts file edits than I have trying to handle the binary modifications. This includes support for modifying protected hosts files from applications like spybot.

Baaleos wrote...
Its basic Software testing methodology here.
We cannot exhaustively test everyones different configurations -

Thankfully Windows has the .net solution, and OSX / *nix are fairly static across the board to support. I'll patch in an option to send me the exception errors if someone runs into it so I can update later versions. 

Zarathustra217 wrote...

I generally tend to agree - at least it's not a very ideal design approach. Not to mention the very notion of going into your OS and editing files is bound to make some people sceptical.

That's why there's options! ':ph34r:'

Melkior_King wrote...

Visavant is currently doing this out of the goodness of his heart. If he opens up a real equivalent to gamespy for all older games, he deserves to be paid for it. So I suggest that Visavant should put a "Donate" button on the nwncore site so people can express their gratitude in a more substantial form. I know I'd donate.


As awesome as that sounds, I'd rather keep under the litigation radar of GS / Glu. NWN/NWN2 will get their matchmaking services from services from Skywing, myself, and anyone else offering alternatives, but if I decide to take a stab at the other gamespy2 based games of the era, I'll probably kickstarter it to have it pay for 10+ years of infrastructure bills and cluster the thing up hardcore.
               
               

               


                     Modifié par Visavant, 11 décembre 2012 - 03:10 .