Running Link4 without Internet Access.
Two Methods:
There are two methods to run Link4 without Internet access. The first method, which I will call the “Name Server-less” method is easy to setup, but involves a little extra work each time you want to connect to your server. The other method is the “Local Name Server” method and is harder to setup, might involve an additional software install, but will allow you to use the interface in the same way you normally use it. I will describe the two methods bellow.
Name Server-less:
1. Change
the line of code at the top of your program from
Link4Server l4Interface(nameServerAddress);
to
Link4Server l4Interface(NULL);
2. Open
the “Link4.exe.config” file in notepad or some other text editor and remove (or
comment out) these lines before running the Link4.exe.
<add key="Solar.cs" value="solar.cs.siue.edu:9579" />
<add key="Pro.cs" value="pro.cs.siue.edu:9579" />
3. When you start your server it should say “Status: server bound to ####” The number (####) is the local port number used by that instance of the server. You will need this.
4. When you click on a “Player…” button you should only see Human as a choice.
5. Instead of making a choice you should enter “localhost:####” into the text box at the bottom of the form. The #### should be the port number you got from your server.
6. You will need to perform steps 3-5 each time you run your server.
Notes:
1. You will need a Java Virtual Machine on your computer (not just a plug-in) Windows used to come with one called javaw.exe, but it is not included at this time so your best option is to get one from Sun by downloading the JRE or (since you are all developers) you could get the SDK. (http://java.sun.com/j2se/1.4.1/download.html)
2. Get a copy of the LamonicaNameServer.jar from Dr. Yu’s folder.
3. Open
the “Link4.exe.config” file in notepad or some other text editor and remove (or
comment out) these lines before running the Link4.exe.
<add key="Solar.cs" value="solar.cs.siue.edu:9579" />
<add key="Pro.cs" value="pro.cs.siue.edu:9579" />
4. Uncomment
the line that says
<add
key="Local Computer" value="127.0.0.1:9579"/>
5. Change
the line at the top of your program from
char nameServerAddress[]
= "solar.cs.siue.edu";
to
char nameServerAddress[]
= "localhost";
6. Double Click on the LamonicaNameServer.jar to run it. NOTE: This program was not intended to be used by anyone but me so it does not have a GUI and therefore is hard to stop. The easiest way to stop it is to reboot your computer, however, you can also stop it using the Windows Task Manager and stopping javaw.exe. More proficient java users can extract the classes out of the jar file and execute the lamonicaNS class in a console window if they want to see the log information displayed by it.
Note: