RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Getting RunUO 2.0 to work on Vista

mordero

Knight
Getting RunUO 2.0 to work on Vista

With the latest SVN of RunUO (286) you no longer need to make any changes to the core of the server for it to work on Microsoft Vista. The only change that needs to be made is in Scripts/Misc/ServerList.cs.

Find this line in the file (it is located right after the larger comment/header):
Code:
public static readonly string Address = null;

You will need to change this to either a host name or IP address. If you want people outside of your LAN to connect to your server, I recommend using No-IP (No-IP - Dynamic DNS, Static DNS for Your Dynamic IP) to set up a dynamic DNS for your server. So then the line should look something like this:

Code:
public static readonly string Address = "hostname.no-ip.org";

And that's all there is to it! :D


The following quote is just the old instructions on getting RunUO to work. **These no longer work, I am only keeping them here for archival sake**
Intro

If you have tried using the RunUO 2.0 server on Vista, you know that there are some problems. One of the fixes is to go through and disable some of the functions in Vista, but I find this to be a temperary fix that does really solve the problem. Instead, you can change a few things in the core to get it working.** This fix I show here is what I posted in this thread: http://www.runuo.com/forums/server-support/80069-2-0-vista.html?highlight=solution plus a couple of things to make the server work on both Vista and XP. Since I will be walking you through every change you need to make, you only need a basic knowledge of C#.net, how RunUO works, and such. However, I reccomend you only do this if you understand what you are doing.

I also recommend you read the following articles on wikipedia.org:
IPv4 - Wikipedia, the free encyclopedia
IPv6 - Wikipedia, the free encyclopedia


**Disclaimer: Once you make any changes to your core, you can no longer receive any script support from these forums. So, if you have any problems with scripts, etc you need to test them on the version available for download here: http://www.runuo.com/forums/downloads.php?do=cat&id=1 or one of the SVN versions.

Distro Scripts Change
The first thing you need to do is use a custom ServerList.cs in the distro scripts. The default version tries to determine you IP address itself which causes some problems for clients trying to connect. This is because the server will attempt to use a IPv6 address instead of IPv4. Since the client does not yet support IPv6 we need to force the server to use a IPv4 for connections.

Doing this is simple, you need to change the Address to to specific IP or DNS host name.

Examples:
Code:
public [SIZE=2]static [/SIZE][SIZE=2]readonly [/SIZE][SIZE=2]string[/SIZE][SIZE=2] Address = [/SIZE][SIZE=2]"192.168.1.65";[/SIZE]

or for a DNS host name:
Code:
public [SIZE=2]static [/SIZE][SIZE=2]readonly [/SIZE][SIZE=2]string[/SIZE][SIZE=2] Address = [/SIZE][SIZE=2]"blah.someserver.com";[/SIZE]

From what I can tell, this fix will allow connections from clients on Windows XP but not Windows Vista, this is where the required core modifications are needed.

Core Modifications

The other class we need to edit inside of the core is the Listener.cs. The first change is made in its constructor. We need to find
Code:
[SIZE=2]m_Listener = Bind([/SIZE][SIZE=2][COLOR=#2b91af]IPAddress[/COLOR][/SIZE][SIZE=2].Any, port);[/SIZE]

and change it to

Code:
[SIZE=2][COLOR=#0000ff]if [/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#2b91af]Socket[/COLOR][/SIZE][SIZE=2].OSSupportsIPv6)[/SIZE]
[SIZE=2]m_Listener = Bind([/SIZE][SIZE=2][COLOR=#2b91af]IPAddress[/COLOR][/SIZE][SIZE=2].IPv6Any, port);[/SIZE]
[SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE]
[SIZE=2]m_Listener = Bind([/SIZE][SIZE=2][COLOR=#2b91af]IPAddress[/COLOR][/SIZE][SIZE=2].Any, port);[/SIZE]

Next, we need to change the Bind method that is used. So, find:
Code:
[SIZE=2]s = [/SIZE][SIZE=2][COLOR=#0000ff]new [/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]Socket[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#2b91af]AddressFamily[/COLOR][/SIZE][SIZE=2].InterNetwork, [/SIZE][SIZE=2][COLOR=#2b91af]SocketType[/COLOR][/SIZE][SIZE=2].Stream, [/SIZE][SIZE=2][COLOR=#2b91af]ProtocolType[/COLOR][/SIZE][SIZE=2].Tcp);[/SIZE]

and change it to this:
Code:
[SIZE=2][COLOR=#2b91af]Socket[/COLOR][/SIZE][SIZE=2] s;[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#2b91af]Socket[/COLOR][/SIZE][SIZE=2].OSSupportsIPv6)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]s = [/SIZE][SIZE=2][COLOR=#0000ff]new [/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]Socket[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#2b91af]AddressFamily[/COLOR][/SIZE][SIZE=2].InterNetworkV6, [/SIZE][SIZE=2][COLOR=#2b91af]SocketType[/COLOR][/SIZE][SIZE=2].Stream, [/SIZE][SIZE=2][COLOR=#2b91af]ProtocolType[/COLOR][/SIZE][SIZE=2].Tcp);[/SIZE]
[SIZE=2]s.SetSocketOption([/SIZE][SIZE=2][COLOR=#2b91af]SocketOptionLevel[/COLOR][/SIZE][SIZE=2].IPv6, ([/SIZE][SIZE=2][COLOR=#2b91af]SocketOptionName[/COLOR][/SIZE][SIZE=2])27, 0);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE]
[SIZE=2]s = [/SIZE][SIZE=2][COLOR=#0000ff]new [/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]Socket[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#2b91af]AddressFamily[/COLOR][/SIZE][SIZE=2].InterNetwork, [/SIZE][SIZE=2][COLOR=#2b91af]SocketType[/COLOR][/SIZE][SIZE=2].Stream, [/SIZE][SIZE=2][COLOR=#2b91af]ProtocolType[/COLOR][/SIZE][SIZE=2].Tcp);[/SIZE]

This should enable connections from both Windows XP and Windows Vista by allowing IPv4 connections that are required to be used by the client.

If you have any problems with these changes running on either version of Windows, please contact me so I can figure out what else needs to be fixed for it to work.

Thanks to:

Erica for testing the original fix,
noobie for this article: Windows Core Networking : Creating IP Agnostic Applications - Part 2 (Dual Mode Sockets), and
Zippy for pointing out the needed change in ServerList.cs
 
Top