Go Back   RunUO - Ultima Online Emulation > RunUO > Server Support on Windows

Server Support on Windows Get (and give) support on general questions related to the RunUO server itself.

Reply
 
Thread Tools Display Modes
Old 06-21-2008, 07:46 AM   #1 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default Issue with connection over network

Ok, in serverlist.cs I have made the IP my external IP, allowing people to connect to my runuo 2.0 RC1 server over the INTERNET. but how do people connect when on the same NETWORK as me

EG: when friends / family are on the same adsl internet router as me, how do they connect to server

its giving me the following problem:

when they try connect, it lets them into the shard selection window, but when selecting shard - their client is instantly disconnected.

any thoughts of what I can do ?

my thought was to define the local IP in serverlist.cs as well, however I'm not entirely sure of how to do this...


thanks for help in advanced

regards.
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 06-21-2008, 09:44 PM   #2 (permalink)
Account Terminated
 
Join Date: Jul 2006
Age: 29
Posts: 240
Default

believe what your looking for is

Code:
		private static bool IsPrivateNetwork( IPAddress ip )
		{
			// 10.0.0.0/8
			// 172.16.0.0/12
			// 192.168.0.0/16

			if ( Utility.IPMatch( "192.168.*", ip ) )
				return true;
			else if ( Utility.IPMatch( "10.*", ip ) )
				return true;
			else if ( Utility.IPMatch( "172.16-31.*", ip ) )
				return true;
			else
				return false;
		}
in the serverlist.cs --- you also could use no-ip.com, setting up that usually works for connections coming from internal and external connections.. routing the info from your pc to noip to your server machine..
Zaphieon is offline   Reply With Quote
Old 06-22-2008, 10:33 AM   #3 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default

Hey, thanks for the reply

I have done the following to my serverlist.cs:

Quote:
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 = 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 = "196.209.59.127";
*/

public static readonly string Address = "legend.zapto.org";
private static bool IsPrivateNetwork( IPAddress ip )
{
// 10.0.0.0/8
// 172.16.0.0/12
// 192.168.0.0/16

if ( Utility.IPMatch( "192.168.*", ip ) )
return true;
else if ( Utility.IPMatch( "10.*", ip ) )
return true;
else if ( Utility.IPMatch( "172.16-31.*", ip ) )
return true;
else
return false;
}

public const string ServerName = "Legends of Kaine";

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

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 )
{

if ( IPAddress.TryParse( addr, out outValue ) )
return true;

try
{
IPHostEntry iphe = Dns.GetHostEntry( 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.GetHostEntry( Dns.GetHostName() );

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

return contains;
}
}
}
however, it is still not working - my local IP is 10.0.0.4 (this is the ip another computer on my network is putting into razor to connect.

btw I am using no-ip legend.zapto.org is the ip that no-ip is forwarding to my ex IP

the same problem is occuring - as people on my network login - they are taken to shard selection and as soon as they select shard - it kicks them...

regards
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 06-26-2008, 07:10 AM   #4 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default

yo Zaphieon, is what I did with that code you gave me wrong ?

(see post above)
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 06-26-2008, 02:59 PM   #5 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default

Could someone do me a favour please...

if there is anyone here who KNOWS their server (run off PC) can be accessed through both the INTERNET and the NETWORK, please post your serverlist.cs script for me

thanks a lot
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 07-04-2008, 04:54 PM   #6 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default

I know we are not supposed to bump threads, I have read the rules - but what if the thread was last posted on days ago, and I am still awaiting some help on the topic ?

so im sorry for doing this, but seriously I need to get this issue sorted out, so my family / friends at my house can also connect to the shard...

any suggestions or help at all is great appreciated

and MODS have some sympathy - please dont all flame and pwn me O-0

thanks
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 07-04-2008, 05:56 PM   #7 (permalink)
Forum Expert
 
Join Date: Dec 2005
Posts: 272
Default

I would have responded sooner, but been away for a while. I use the serverlist.cd from mr. fixit, and ill try to attach that one to this reply.

Here is a section of that file:

Code:
namespace Server.Misc
{
	public class ServerList
	{
		 
		// ==================================================================================
		// YOUR SERVERS NAME
		// ==================================================================================
        public const string ServerName = "Shard Live";    // Server Name Goes Here

		// ==================================================================================
		// YOUR INTERNET IP OR DNS NAME
		// Here you can select to autodetect your internet ip, or manualy specify
		// Examples:
		// public static string Address = "12.34.56.78";
		// public static string Address = "shard.host.com";
		// ==================================================================================
		public const bool InternetIPAutodetect = true;
		public const int MinutesBetweenIPAutodetect = 14400;
        public static string Address = "metashard.servegame.com";      // Server Address Goes Here
		
		// ==================================================================================
		// Here are some values stored
		// ==================================================================================
		private static LocalLanIPRange[] LocalLanIPRanges = new LocalLanIPRange[10];		
		private static UInt32 LocalLanIPRangesCount;
		private static AutoIPMirror[] AutoIPMirrors = new AutoIPMirror[10];	
		private static UInt32 AutoIPMirrorsCount;
		private static DateTime InternetIPAutodetectLast;
		
		// ==================================================================================
		// Initialization
		// ==================================================================================
		public static void Initialize()
		{
			// ----------------------------------------------------
			// Load the local LAN ip ranges. 
            // Remove the // on section you need or create your own
			// ----------------------------------------------------
			//AddLocalLANIPRange("10.0.0.0", "10.255.255.255");
			AddLocalLANIPRange("192.168.0.100", "192.168.255.255");
			//AddLocalLANIPRange("172.16.0.0", "172.32.255.255");
			//AddLocalLANIPRange("169.254.0.0", "169.254.255.255");
The line in red needs to be un-commented for your network (remove the two //). I use a domain name from no-ip.com so i let my external number to be auto detected. If you dont have such a domain name, fill in your external address in the blue line, and remove the two // Put two // befor the line in yellow, and done!

Edit: If you put in your external ip number, set InternetIPAutodetect = false.

Good luck!
Attached Files
File Type: cs ServerList.cs (15.0 KB, 4 views)

Last edited by Melchior; 07-04-2008 at 06:00 PM. Reason: Forgot
Melchior is offline   Reply With Quote
Old 07-04-2008, 06:46 PM   #8 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default

Hey - thanks so much for the reply...

Okay. I did exactly what you told me to (I also use no-ip btw - it makes my ex IP "legend.zapto.org")

This is how that section of my serverlist looks now:

Code:
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using Server;
using Server.Misc;
using Server.Network;

namespace Server.Misc
{
	public class ServerList
	{
		 
		// ==================================================================================
		// YOUR SERVERS NAME
		// ==================================================================================
        public const string ServerName = "Shard Live";    // Server Name Goes Here

		// ==================================================================================
		// YOUR INTERNET IP OR DNS NAME
		// Here you can select to autodetect your internet ip, or manualy specify
		// Examples:
		// public static string Address = "12.34.56.78";
		// public static string Address = "shard.host.com";
		// ==================================================================================
		public const bool InternetIPAutodetect = true;
		public const int MinutesBetweenIPAutodetect = 14400;
        public static string Address = "legend.zapto.org";      // Server Address Goes Here
		
		// ==================================================================================
		// Here are some values stored
		// ==================================================================================
		private static LocalLanIPRange[] LocalLanIPRanges = new LocalLanIPRange[10];		
		private static UInt32 LocalLanIPRangesCount;
		private static AutoIPMirror[] AutoIPMirrors = new AutoIPMirror[10];	
		private static UInt32 AutoIPMirrorsCount;
		private static DateTime InternetIPAutodetectLast;
		
		// ==================================================================================
		// Initialization
		// ==================================================================================
		public static void Initialize()
		{
			// ----------------------------------------------------
			// Load the local LAN ip ranges. 
            // Remove the // on section you need or create your own
			// ----------------------------------------------------
			AddLocalLANIPRange("10.0.0.0", "10.255.255.255");
			//AddLocalLANIPRange("192.168.0.100", "192.168.255.255");
			//AddLocalLANIPRange("172.16.0.0", "172.32.255.255");
			//AddLocalLANIPRange("169.254.0.0", "169.254.255.255");

this is the issue it gives:

Client: 196.38.218.24: Connected. [1 Online]
Login: 196.38.218.24: Valid credentials for 'Wolverine'
Player is reconnecting to 196.209.251.3
Client: 196.38.218.24: Disconnected. [0 Online] [wolverine]


PS: Connection over the NETWORK works absolutely perfectly now, just the connection over the internet giving problems...
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 07-04-2008, 07:17 PM   #9 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default

Nevermind, I made some adjustments - its all working 100% perfectly now

thanks so much for the help - really appreciate

regards
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Reply

Bookmarks

Tags
connection, issues, network


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5