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!

Found router- possibly why players can not connect ?

NOCTUR

Wanderer
router

PSZ,

Here is what I have done:

1. Verrified what my DNS number is on the router DNS: xx.xx.xxx.xxx

2. Placed that number in the serverlist.cs as follows

namespace Server.Misc
{
public class ServerList
{
/* Address:
*
* The default setting, a value of 'null', will attempt to detect your IP address automatically:
* private const string Address = null;
*
* This detection, however, does not work for servers behind routers. If you're running behind a router, put in your IP:
* private const string Address = "12.34.56.78";
*
* If you need to resolve a DNS host name, you can do that too:
* private const string Address = "shard.host.com";
*/

//public const string Address = null;
public const string Address = "xx.xx.xxx.xxx";

public const string ServerName = "NOCTUR";

3. Set IP address in UOGateway to this DNS number also. When this did not work I also tried the local ip address here to. 127.0.0.1 and 198.162.0.102

4. When I start up RunUO I receive the following messages:

"Blah - Blah"
World: Loading...."Blah"
Regions: Loading..."Blah"
Address: 127.0.0.1:2593
Address: 192.168.1.101:2593
Warning: 58 bad spawns detected, logged: 'badspawn.log'

And it seems I can not connect to this server unles it is through the machine I am running it on???

I have verrified port forwarding for the ip address of this machine xxx.xxx.x.102 and I was using the DNS for this machine as well. There are 3 different DNS numbers, I presume one for each machine.

Any ideas?

Thanks for the help, NOCTUR
 

Jakkin

Wanderer
Good job !

Good job so far ! I have someone playing on my shard. But I'm still having problems connecting.
 

psz

Administrator
Recap time, boys and girls! ;->

127.0.0.1 is ALWAYS whatever machine you are on... Technically ALL machines are 127.0.0.1... It just means "LocalHost" (That is The machine your are on)

192.168.<anything>.<anything> is ALWAYS a LAN IP. Prolly best to have the LAN computers use this number to connect with.

The DNS and it's IP are the Internet numbers. This is the number you get via www.whatsmyip.com. This is the number you want in serverlist.cs and in the UOGateway of people connecting from the internet

The number your computer uses as "Default Gateway" should also be a 192.168.###.### number. This is your router. This is what needs port 2593 forwarded to YOUR computer's IP address (The LAN one running RunUO).

If all that is set correctly... Then it SHOULD work.

I've more or less burned out my brain in the last 4 hours from remembering all this fun network stuff I've not touched in a year, as well as spawning an entire world section by section via the spawnmap on stratics, so I think I'll have to bow out now, as I cannot think. Thowwy!
 

psz

Administrator
Muah >->

No problem.


Hrm... I should put this thread onna website somewhere or sticky it or something... I dun wanna hafta re-write it later ;->
 

NOCTUR

Wanderer
router

Thanks psz! I will keep working it. I will post once I figure it out. Again thanks for the help.

Noctur
 

Jakkin

Wanderer
Shard name

If anyone is interested for the shard- Hearts Destiny - is its name, on Public Servers on UOGateway
 

psz

Administrator
Jakkin, do me a favour? Post your serverlist.cs here (edit out anything you don't want people to see). This way people can see what you did ->
 

NOCTUR

Wanderer
router

Well, I have made some progress. Now instead of the typical "unable to connect" message. It just hangs on the "Connecting"

Still working it.

Noctur
 

Jakkin

Wanderer
Ok Here we are

To those of you who are having problems set your serverlist.cs up like this
using System;
using System.Net;
using System.Net.Sockets;
using Server;
using Server.Network;

namespace Server.Misc
{
public class ServerList
{
/* Address:
*
* The default setting, a value of 'null', will attempt to detect your IP address automatically:
* private const string Address = "your_ip_goes_here_";
*
* This detection, however, does not work for servers behind routers. If you're running behind a router, put in your IP:
* private const string Address = "your_ip_goes_here_";
*
* If you need to resolve a DNS host name, you can do that too:
* private const string Address = "your_dns_server_goes_here";
*/

public const string Address = "ip_goes_here";

public const string ServerName = "your_shardname_goes_here";

public static void Initialize()
{
Listener.Port = 2593;

EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList );
}

public static void EventSink_ServerList( ServerListEventArgs e )
{
try
{
IPAddress ipAddr;

if ( Resolve( Address != null && !IsLocalMachine( e.State ) ? Address : Dns.GetHostName(), out ipAddr ) )
e.AddServer( ServerName, new IPEndPoint( ipAddr, Listener.Port ) );
else
e.Rejected = true;
}
catch
{
e.Rejected = true;
}
}

public static bool Resolve( string addr, out IPAddress outValue )
{
try
{
outValue = IPAddress.Parse( addr );
return true;
}
catch
{
try
{
IPHostEntry iphe = Dns.Resolve( addr );

if ( iphe.AddressList.Length > 0 )
{
outValue = iphe.AddressList[iphe.AddressList.Length - 1];
return true;
}
}
catch
{
}
}

outValue = IPAddress.None;
return false;
}

private static bool IsLocalMachine( NetState state )
{
Socket sock = state.Socket;

IPAddress theirAddress = ((IPEndPoint)sock.RemoteEndPoint).Address;

if ( IPAddress.IsLoopback( theirAddress ) )
return true;

bool contains = false;
IPHostEntry iphe = Dns.Resolve( Dns.GetHostName() );

for ( int i = 0; !contains && i < iphe.AddressList.Length; ++i )
contains = theirAddress.Equals( iphe.AddressList );

return contains;
}
}
}
 

Kennyd

Sorceror
The number your computer uses as "Default Gateway" should also be a 192.168.###.### number. This is your router. This is what needs port 2593 forwarded to YOUR computer's IP address (The LAN one running RunUO).

If all that is set correctly... Then it SHOULD work.


And uhm sorry but I still don't quite get it.. HOW do you forward port 2593 from the router to the LAN PC?
 

Jakkin

Wanderer
Contact ISp

Please contact your ISP/ Router Manufactuerer for more information on this, all routers way of port forwarding vary
 

Kennyd

Sorceror
but I don't have a router.. my "router" computer simply has direct acces to the internet and shares it over lan..

I don't have an actual HARDWARE router
 

Kennyd

Sorceror
so I have a comp wich has direct internet connection with a cable modem, that comp shares my internet connection with all the other comps on the local network. Now what do I how do I make that computer forward port 2593 (or whatever u have to do) to my computer on the LAN?
 

psz

Administrator
If a computer is acting as a router, then it is MOST LIKELY running a firewall. If you're using ICS, this can be painful. If it's Norton or MacAffee or BlackIce, you should be able to open specific ports.
 
Top