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!

Setting up for WAN Play [v1]

Newbie Spellweaver
Joined
Jan 23, 2011
Messages
44
Reaction score
6
This is a guide on how to properly set up your Pangya private server to play on a WAN (Wide Area Network) Configuration. Before we continue, you'll need all the tools that were required in your initial setup, as we'll be hexing your Pangya client and changing some .ini files.



Quick Guide:​

Section 1: ROUTERS AND ALLOWING ACCESS TO YOUR COMPUTER OVER THE INTERNET
Section 2: SETTING UP YOUR SERVER SOFTWARE FOR EXTERNAL CONNECTION
Section 3: PREPARING YOUR CLIENT TO CONNECT




AN UNDERSTANDING OF YOUR ROUTER'S CONNECTION ABILITIES IS VERY HELPFUL. You'll need to set your computer up so that you can broadcast and recieve information to your potential clients without a firewall denying access. If you have a router in your household, but you are not the administrator of it (say, your parents or roommate operate the router and connectivity) and you cannot gain access to it or instruct the owner of it, you will be unable to produce a working Internet-accessible server. Being able to bypass a router's firewall is essential in all forms of server hosting. Section 1 is all about your router, ignore it if you have understanding how to forward ports, or do not need to.



-- SECTION 1: ROUTERS AND ALLOWING ACCESS TO YOUR COMPUTER OVER THE INTERNET --

[Note before the Section goes on. There are port forwarding tutorials also located here. If my guide cannot or does not assist you, I highly recommend giving this website a visit to learn more about your router. ]

Let's start with analyzing your router, if you have one.

Check your connection to the internet. If you go through a router (a device which allows multiple computers and devices to connect over one wired connection to your Internet Service Provider), you more than likely have whats called a hardware firewall that keeps your computer safe from a myriad of possible attacks. If you do not have a router and are POSITIVE that you have a DIRECT CONNECTION to your internet, you can skip this section. If your connection is wireless (meaning you are not using a CAT cable to give your computer internet, and Windows tells you that you are on a Wireless Internet Connection, you are definitely on a router.)

Routed connections typically end up in a configuration where your computer is connected to a small box which is connected to another. The first connection is your router. Usual suspect routers would be something along the lines of Linksys, D-Link, Netgear, Belkin etc. Unfortunately I am only versed in the administration of a Linksys (model WRT54GS, but Linksys nonetheless) router.

The following instructions are specifically for the WRT54GS Router, which, if that's your router as well; you're in luck. IF NOT, don't worry. I'll be trying to also generalize it in a fashion that would apply to general networking.

> Step 1: Connecting To Your Router

You'll need to know your router's access address. Mine would be 192.168.1.1 , and I know this from experience in dealing with mine. Your access address should be listed on a technical information sheet that belongs to your router, or available online (or sometimes, printed on a sticker on the device itself). I know some D-Link routers are 192.168.0.1 . Should yours be nonstandard, then it's obviously already been changed by someone who knows how to operate the router, or yourself.

Pop this address straight into your internet browser. (Where you would connect to any old website.) In fact, go ahead and use the following to attempt a connection. (Open in a new tab or window, you'll want to keep this one open.)






If you were prompted by your browser to enter a name and password, you've successfully attempted a connection to your router! Again, going by standards, most routers are pre-registered with "admin" as one, or both credentials. For a default Linksys WRT54GS Router, simply entering "admin" as the username and password will allow you to authenticate yourself. Keep playing with combinations of "admin" as the username / password or both until it allows you access. If none of those work, you'll need to look online for a guide contoured to your router; or talk to your network administrator.

There are technically two options we can take, depending on your router. One is somewhat tedious, but more secure; the other is pretty dangerous, but easy - as long as your router supports and and you want to allow it. If you want to take the safe route, we'll be doing Port Forwarding, below. If you would like to take the other route, that is called entering your router's DMZ. DMZ will be discussed at the bottom of Section 1 (Step 3).

Now that you're inside your router's home page, you should see a lot of options, and fields and such. You can explore what all these do at a later date, and at your own risk. Generally speaking, we're going to look for a series of options called "PORT FORWARDING" or something similar. What Port Forwarding allows us to do is open specific access ports through a hardware firewall. For my router, I first have to click on Applications & Gaming, located at the top. I'll then be instantly on a page called "Port Range Forward".

> Step 2: Port Forwarding

Now we've hopefully ended up on the Port Forwarding page.

You'll need to play around with your router's abilities first, and if you don't know how, you'll need to (as has been said a few times already) look up a guide focused on your router. We need to add some Port Configurations. Now the default ports are as follows, according to each server's .ini file.

Authentication Server 7911
Login Server 10103
Gameserver 20201

Bindserver 10101
Rankserver 10105

The Bind and Rankserver don't need to be added if you don't plan on using them, however and conversely, if you DO use the Bind and Rank server, you'll also need to add those.

These port configurations may be changed in the respective server .ini files, if you'd like them to match more closely. (Make sure that if you change the Auth Server port, that you also change the port that the Gameserver's Server.ini calls to for the Auth server. It is under the field [SERVER_AUTH]. All ports in all files are referenced by the value PORT=[Number])

For the default ports, you'll need to add (sometimes referenced as user-define) your own ports. If it calls for a range (which most Port Forwarding does, a range being a series of ports between the Front/Start Port and the Final/End Port.), you may define it as singular or in a group.

> Step 2.5: Getting your Internal IP Address

The Port Forward page WILL call for a IP Address to allow the ported connection to. These IPs are fairly commonly under the number 192.168.x.x . To find out what yours is specifically, you need to run a command prompt. On Vista or Windows 7, just hit Start and in the "Search Programs and Files" area, type "cmd" (no quotes) and hit enter. On XP, hit Start, then hit Run...

In your command prompt type "ipconfig" (no quotes) and hit enter. A lot of numbers should pop up. We should see something along the lines of "Ethernet adapter Local Area Connection:" For a header. For me, mine will say something along the lines of:

IPv4 Address. . . . . . . . . . . : 192.168.1.100


underneath it. Whatever the IP address is that follows is the IP address you'll need to enter in when your rotuer asks for one during port forwarding. Back to forwarding ports, and now that you know your internal IP address, set it up as follows. If you have the option of selecting "TCP", "UDP", or "Both (TCP/UDP)", then select Both, for maximum connectivity (Or if you're not sure which you should use.)

At the end of the process, you should have three ranges set up, if it asks for a name or description, use the servername to help remind you. At the end you should have something like the following:

AuthServer : 7911 - 7911 TCP/UDP
GameServer : 20201 - 20201 TCP/UDP
LoginServer : 10103 - 10103 TCP/UDP [Or, alternatively, if you plan on using Bind and Rank: LoginBindRank : 10101 - 10105 TCP/UDP]


> Step 3: DMZ

SKIP THIS STEP IF YOU HAVE COMPLETED 1 and 2 (and 2.5).

If you are sure you want to take the risk of opening your computer to the De-Militarized Zone, understanding this carries the risk of having your IP address succeptible to ALL forms of connection available, then we will continue with this. (Safety Tip: You can turn off your router's DMZ again once it's been activated; if you plan on not running anything, make sure to turn it off.)

You must also know how to access your router's DMZ provided you router supports it. Simply insert your local IP address that belongs to your computer into the field. To discover your own computer's internal IP address, read up to Step 2.5.

ALL ports will be and are now forwarded to your computer once doing this. I don't recommend it, personally, but it is simpler than all the port-work.



-- SECTION 2: SETTING UP YOUR SERVER SOFTWARE FOR EXTERNAL CONNECTION --

We need now to discover your external IP address. Please go to . Copy and paste (or leave this tab open) the IP address that is boldly printed at the top of the screen, this is your external IP address.

We will be eventually opening all of your .ini files, those would be located wherever you placed them all from the initial installation.

Open PANGYA_SRV Repack.v2, then open Auth, then open Auth.ini (Open with Notepad, if Windows does not know how to open it.) Locate:

[SERVERINFO]
SERVERGUID=10100
SERVERNAME="AuthServer"
IP="127.0.0.1"


Change the IP value to the one you discovered from the website, leaving the quotes in place. Save and exit the file.

Now go back, and open the folder Login, then Login.ini. Locate:

[SERVERINFO]
IP="127.0.0.1"
PORT=10103
MAXUSER=1000
SERVERGUID=10101
SERVERNAME="LoginServer"


Change the IP value again to the one you have on the website (or copy and pasted somewhere), leaving the quotes in place.

Then Locate:

[SERVER_AUTH]
IP="127.0.0.1"
PORT=7911


And change the IP address here as well. Save and exit.

Go back, and open the folder Py_Gameserver, then Server.ini. Locate:

[SERVERINFO]
SERVERGUID=20201
SERVERNAME="Lolo"
VERSION="1.0"
LOCALIP="127.0.0.1"
PORT=20201
MAXUSER=1000
ICONINDEX=4
;PROPERTY=32


Change the LOCALIP value one more time to the IP address that you have, leaving the quotes in place. Save and exit the file.

The following two entries are not required if you do not plan on using the Rank and Bind server, but if you are going to, then also do the following two modifications.

Open BINDSERVER, then bindmsgsserver.ini. Locate:

[SERVERINFO]
SERVERGUID=40401
SERVERNAME="BindMSGServer"
IP="127.0.0.1"
MAXUSERS=1000


Change the IP value address to your external IP with quotes, save and exit.

Open MSG SERVER, then messenger.ini. Locate:

[SERVERINFO]
LOCALIP="127.0.0.1"
PORT=10102
MAXUSER=1000
SERVERGUID=30301
SERVERNAME="MessengerServer"
PROPERTY=4096


Change the LOCALIP to the IP address you have with the quotes intact. Before you save an exit, also switch the IP address in this section of the same file.

[BROADCAST_SERVER]
IP="127.0.0.1"
PORT=10101


Do the same thing you have been doing, and save and exit. However, because a previous file references the Bind and Msg server, we need to reopen your Server.ini located in Py_GameServer. Locate (near the bottom):

[CONFIG]
REFRESHTIME=10
MSNSERVER="127.0.0.1"
MSNPORT=10103
;MSNLOCALPORT="127.0.0.1"
;MSNLOCALIP=10102

[SERVER_AUTH]
IP="127.0.0.1"
PORT=7911

[RANK]
RANKIP="127.0.0.1"
RANKPORT=10105


Replace all instances of "127.0.0.1" with your IP address, in quotes. You can opt out of the MSNLOCALPORT="127.0.0.1" as it has been commented out, which means, it will not be processed by the program anyway. Save and exit.

You should be almost ready, now we just need a client.




-- SECTION 3: PREPARING YOUR CLIENT TO CONNECT --

A quick note before we attempt to Hex your IP address into your ProjectG.exe. Your IP address length bears relevance on whether or not we take Step 1 or Step 2.

If your IP address is longer than 8 numerical digits (for example, 192.168.1.1 has 8 numbers in it, but 192.168.1.100 has 10 numbers in it) skip Step 1 and use Step 2. If you have 8 digits or less that compose your IP Address, we can use Step 1.

> Step 1: Hexing your Client

This is pretty simple, we first need a program that can edit the Hex of an exe, I use a program called XVI32, but there are many out there, like Hex Workshop, HexEdit, etc. Find your favorite one, then open ProjectG.exe.

Search out (the text string) 127.0.0.1 in your ProjectG.exe. When it has been found, starting at the first number, replace it with your IP address. For example, say your IP address is 24.234.26.9, starting with the place of the first digit of the original IP, it should read your new one in the same spot when finished. (If you followed terrorofdeath's Complete Pangya Setup, you've already hexed it once, providing you've followed it completely. Make sure to search for the IP address you put in the first time.) Run the search again and you should have another area with the IP address. Replace that as well. Save the program, then exit.

Everything should work! Run the executable and enjoy the server!

> Step 2: Alternate Options for Long IP Addresses

For me, I use a Hamachi network with my friends. I won't explain how to do that, it's pretty simple though. Unfortunately, your Hamachi IP address could end up too long also.

You can use Hamachi* as well; or you can use chreadie's pangyaLauncher, located here. http://forum.ragezone.com/f513/release-pangyalauncher-721951/

You can also use Tsukasa's PyRoute, located here. http://forum.ragezone.com/f513/pyroute-723102/

After using one of these options, everything should work out just fine.

*A note about Hamachi, if you use it and your IP address is sufficient, make sure to change the Login server IP value to your HAMACHI IP ADDRESS. Everything else will work just fine as long as you're port forwarded. (Also remember to hex edit the client to use your HAMACHI IP ADDRESS.)


Well, there it is. Hope everything works for you! If you have questions feel free to contact me or any of the helpful people around here.
 
Last edited:
Initiate Mage
Joined
Feb 9, 2011
Messages
4
Reaction score
1
'Port Mapping'and'DMZ Host',great!
Thanks for sharing!
 
Newbie Spellweaver
Joined
Jul 6, 2010
Messages
55
Reaction score
10
Good job doing the single subject I absolutely refused to try and tackle. ;3 If I ever get around to editing my guide, you'll be the reference. :eek:
 
Newbie Spellweaver
Joined
Jan 23, 2011
Messages
44
Reaction score
6
Thank you everyone for thanking my work :)

It was just the perfect opportunity (as I write often, hoping to become an author in the future :p) to help out, I hate feeling like a leech and it will help someone somewhere. :)
 
Last edited:
Initiate Mage
Joined
Feb 9, 2011
Messages
4
Reaction score
1
In my opinion,use a DDNS is more simple.Registered a dynamic domain name,download the DDNS client,install it , run it (on the computer which is processing the game server) and log in. Hexing the client,replace the IP address with a domain name(16 chars limited).The other is the same as malcomtidus teaching us.After this , when your IP address is changing , only you need is to modify the IP address in the \Py_GameServer\server.ini file.Needn't to do other.
 
Deny everything.
Joined
Jun 17, 2005
Messages
488
Reaction score
110
Except for the fact that you can't hex the client to use domain names, the resolver is using Winsock's inet_addr which only accepts dotted IPv4 addresses.

That's what you need chreadie's pangyaLauncher or my PyRoute for. Both programs will resolve the current address of a specified domain name and either hex it into the executable (pangyaLauncher) or patch the calls in memory (PyRoute). That also means you can use domain names longer than 16 characters. :)

I do agree though, DynDNS is the best solution for dial-up users (if you should live in a third world country like Germany where static IP addresses are rarely offered to consumers).

Edit: Nonsense, see this post.
 
Last edited:
Newbie Spellweaver
Joined
Jan 23, 2011
Messages
44
Reaction score
6
I can amend the DynDNS option into the guide, should we see it fit for dial-up users and those with often-changing IP addresses.
 
Initiate Mage
Joined
Feb 9, 2011
Messages
4
Reaction score
1
Hello,Tsukasa.
I just know a little dynamic debug.I found that after the function inet_addr()returned a '-1' value,the client process called a DNSAPI to resolve the domain name.Is this means my method is OK? I have actually tested , it works.
 
Back
Top