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 04-19-2006, 09:23 PM   #1 (permalink)
 
Join Date: Apr 2006
Posts: 16
Unhappy Server Connection Problems

Okay, I have read the sticky on how to set up the server and have done so. I have also set up the port forwarding and a DNS. My problem is that still I cannot connect to the server.

Some help will be much appreciated.
Loser is offline   Reply With Quote
Old 04-19-2006, 09:43 PM   #2 (permalink)
Forum Novice
 
Join Date: Feb 2006
Location: at my computer
Posts: 117
Send a message via ICQ to tindin156 Send a message via MSN to tindin156
Default

post your serverlist.cs or try this one http://www.runuo.com/forums/showthread.php?t=56860
__________________
some peaple search for what they want others have it handed to them....

Yes i know my spelling sucks.....
tindin156 is offline   Reply With Quote
Old 04-19-2006, 09:48 PM   #3 (permalink)
Forum Expert
 
Asmir3's Avatar
 
Join Date: Sep 2005
Location: A-Town Baby
Age: 19
Posts: 620
Default

make sure your port is 2593 and your ip is right go too http://www.ipchicken.com/ it tell you the ip and port.
__________________

Now open - uo15.net - The best in Publish 15 emulation
Asmir3 is offline   Reply With Quote
Old 04-19-2006, 10:22 PM   #4 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

Should I be able to connect to the game using my ip address? Or do I have to use 127.0.0.1?
Loser is offline   Reply With Quote
Old 04-19-2006, 10:37 PM   #5 (permalink)
Forum Expert
 
Asmir3's Avatar
 
Join Date: Sep 2005
Location: A-Town Baby
Age: 19
Posts: 620
Default

you should be able to use both
Quote:
Originally Posted by Loser
Should I be able to connect to the game using my ip address? Or do I have to use 127.0.0.1?
__________________

Now open - uo15.net - The best in Publish 15 emulation
Asmir3 is offline   Reply With Quote
Old 04-19-2006, 10:46 PM   #6 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

Okay, well here is my serverlist file.

Code:
// ==================================================================================================
// ServerList.cs
// ==================================================================================================
//    	1.0 	RunUO Beta 36	Initial version
//    	1.1 	Mr Fixit	Now automaticly detects if you are connecting localy and uses the
//				servers local ip in the client serverlist.
//	1.2	Mr Fixit	Internet IP autodetection using www.whatismyip.com.
//  	1.3	Mr Fixit	If script fails to find the internet ip, keep the old one and try
//				again in # minutes.
//      1.4	Mr Fixit	You can now add AutoIP mirrors. Added whatismyip.com and myip.com.
//      1.5	Mr Fixit	Adjusted the AutoIP mirror engine so it supports more mirrors.
//				Added findmyip.com and ipaddy.com.
//      1.6	Mr Fixit	IP is now trimmed (Just in case). Added simflex.com, edpsciences.com,
//				ipid.shat.net and checkip.dyndns.org.
//      1.7     Mr Fixit        Removed www.whatismyip.com is it seems to be out of buisness.
//      1.8     Mr Fixit        Added a message to the console with ServerList.cs version when server loads.
//				Now detects the internet ip when the server starts.
//				Now checks if the ip has changed every 60 minutes instead of 30 minutes.
//      1.9     Mr Fixit        Removed noip.com mirror as it isnt working anymore.
//      2.0     Mr Fixit        Now only renews the ip every 24 hours (1440 minutes).
// ==================================================================================================

using System;
using System.Net;
using System.Net.Sockets;
using Server;
using Server.Network;

namespace Server.Misc
{
	public class ServerList
	{

		// ==================================================================================
		// YOUR SERVERS NAME
		// ==================================================================================
		public const string ServerName = "RunUO Test Center";

		// ==================================================================================
		// 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 = 1440;
		public static string Address = "huff.no-ip.org";
		
		// ==================================================================================
		// 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()
		{
			// ----------------------------------------------------
			// Select what port to use
			// ----------------------------------------------------
			Listener.Port = 2593;

			// ----------------------------------------------------
			// Load the local LAN ip ranges
			// ----------------------------------------------------
			AddLocalLANIPRange("10.0.0.0", "10.255.255.255");
			AddLocalLANIPRange("192.168.0.0", "192.168.255.255");
			AddLocalLANIPRange("172.16.0.0", "172.32.255.255");
			AddLocalLANIPRange("169.254.0.0", "169.254.255.255");

			// ----------------------------------------------------
			// Load the Auto IP mirros
			// ----------------------------------------------------
			AddAutoIPMirror("http://www.findmyip.com/", "Your IP address is:<br>", "</FONT>");
			AddAutoIPMirror("http://www.ipaddy.com/", "Your IP address is: ", "<br>");
			AddAutoIPMirror("http://checkip.dyndns.org/", "Current IP Address: ", "</body>");
			AddAutoIPMirror("http://ipid.shat.net/iponly/", "<title>", "</title>");
			AddAutoIPMirror("http://www.edpsciences.com/htbin/ipaddress", "Your IP address is  <B> ", " </B>");
			AddAutoIPMirror("http://www2.simflex.com/ip.shtml", "Your IP address is <BR>", "<BR>");
			
			// ----------------------------------------------------
			// Create the event
			// ----------------------------------------------------
			EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList );
			
			// ----------------------------------------------------
			// Show info in console
			// ----------------------------------------------------
			Console.WriteLine("Serverlist.cs: 2.0");
			
			// ----------------------------------------------------
			// Lets find internet ip
			// ----------------------------------------------------
			DetectInternetIP();
			
			
		}
		

		// ==================================================================================
		// Add a range of local lan ips
		// ==================================================================================
		private static void AddLocalLANIPRange(string RangeFrom, string	RangeTo)
		{
			LocalLanIPRanges[LocalLanIPRangesCount] = new LocalLanIPRange();
			LocalLanIPRanges[LocalLanIPRangesCount].RangeFrom = StringIPToUInt32IP(RangeFrom);
			LocalLanIPRanges[LocalLanIPRangesCount].RangeTo = StringIPToUInt32IP(RangeTo);
			LocalLanIPRangesCount = LocalLanIPRangesCount + 1;
		}
		
		
		// ==================================================================================
		// Convert a ip string to a binary unsigned int
		// ==================================================================================
		private static UInt32 StringIPToUInt32IP(string addr)
		{
			byte[] byteArray1 = IPAddress.Parse(addr).GetAddressBytes();
			byte[] byteArray2 = IPAddress.Parse(addr).GetAddressBytes();
			byteArray1[0] = byteArray2[3];
			byteArray1[1] = byteArray2[2];
			byteArray1[2] = byteArray2[1];
			byteArray1[3] = byteArray2[0];
			return  BitConverter.ToUInt32( byteArray1, 0);
		}
		

		// ==================================================================================
		// Used to store the local lan ip ranges
		// ==================================================================================
		private class LocalLanIPRange
		{
			public UInt32			RangeFrom;
			public UInt32			RangeTo;
		}	


		// ==================================================================================
		// Add a AutoIP mirror
		// ==================================================================================
		private static void AddAutoIPMirror(string sURL, string	sStart, string sEnd)
		{
			AutoIPMirrors[AutoIPMirrorsCount] = new AutoIPMirror();
			AutoIPMirrors[AutoIPMirrorsCount].sURL = sURL;
			AutoIPMirrors[AutoIPMirrorsCount].sStart = sStart;
			AutoIPMirrors[AutoIPMirrorsCount].sEnd = sEnd;
			AutoIPMirrorsCount = AutoIPMirrorsCount + 1;
		}


		// ==================================================================================
		// Used to store the Auto IP mirrors
		// ==================================================================================
		private class AutoIPMirror
		{
			public string			sURL;
			public string			sStart;
			public string			sEnd;
			public UInt32			iFailures;
		}	


		// ==================================================================================
		// Detect ip
		// ==================================================================================
		public static void DetectInternetIP()
		{

			// ----------------------------------------------------
			// Autodetect the Internet IP
			// ----------------------------------------------------
			if (InternetIPAutodetect) {
				DateTime UpdateTime = InternetIPAutodetectLast;
				UpdateTime = UpdateTime.AddMinutes(MinutesBetweenIPAutodetect);
				if (UpdateTime<DateTime.Now) {
					string NewAddress = null;
					NewAddress = FindInternetIP();
					InternetIPAutodetectLast = DateTime.Now;
					if (NewAddress!=null) 
					{
						Address = NewAddress;
					}
				}
			}
			
		}

		// ==================================================================================
		// The serverlist event
		// ==================================================================================
		public static void EventSink_ServerList( ServerListEventArgs e )
		{
			try
			{

				// ----------------------------------------------------
				// Lets find internet ip
				// ----------------------------------------------------
				DetectInternetIP();
				
				// ----------------------------------------------------
				// Find the server ip to use for this user
				// ----------------------------------------------------
				IPAddress ipAddr = FindMachineIP(e);
				
				// ----------------------------------------------------
				// Send serverlist
				// ----------------------------------------------------
				if (ipAddr != null)
				{
					e.AddServer( ServerName, new IPEndPoint( ipAddr, Listener.Port ) );
				} else {
					e.Rejected = true;
				}
			}
			catch
			{
				e.Rejected = true;
			}
		}
		
		
		// ==================================================================================
		// Connects to a webserver that gives you your internet ip
		// ==================================================================================
                public static string FindInternetIP( )
		{

			// ----------------------------------------------------
			// Pick a random mirror
			// ----------------------------------------------------
			Random rnd = new Random();
			int UseMirror = (int)( rnd.NextDouble() * AutoIPMirrorsCount);
			string MyIP = "";
			
			// ----------------------------------------------------
			// Catch if the mirror is down
			// ----------------------------------------------------
			try
			{
				// ----------------------------------------------------
				// Get the webpage
				// ----------------------------------------------------
        	    		WebClient client = new WebClient();
            			byte[] pageData = client.DownloadData(AutoIPMirrors[UseMirror].sURL);
            			MyIP = System.Text.Encoding.ASCII.GetString(pageData);
            		
				// ----------------------------------------------------
				// Find the string
				// ----------------------------------------------------
                        	int iStart = MyIP.LastIndexOf(AutoIPMirrors[UseMirror].sStart);   
                        	int iEnd = MyIP.IndexOf(AutoIPMirrors[UseMirror].sEnd, iStart+AutoIPMirrors[UseMirror].sStart.Length);
                        	MyIP = MyIP.Substring(iStart+AutoIPMirrors[UseMirror].sStart.Length, iEnd-iStart-AutoIPMirrors[UseMirror].sStart.Length );
                        	MyIP = MyIP.Trim();
                        	
				// ----------------------------------------------------
				// Return value
				// ----------------------------------------------------
                        	Console.WriteLine("Internet IP: {0} ({1})", MyIP, AutoIPMirrors[UseMirror].sURL);
        	                return MyIP;
			}
			catch
			{
				Console.WriteLine("Unable to autoupdate the Internet IP from {0}!", AutoIPMirrors[UseMirror].sURL);
				Console.WriteLine("----------------------------------------------------------------------");
				Console.WriteLine(MyIP);
				Console.WriteLine("----------------------------------------------------------------------");
				return null;
			}
        	}
		
		
		// ==================================================================================
		// Calculates what server IP to use
		// ==================================================================================
                public static IPAddress FindMachineIP( ServerListEventArgs e )
		{
			// ----------------------------------------------------
			// Find the IP of the connecting user
			// ----------------------------------------------------
			Socket sock = e.State.Socket;
			IPAddress theirAddress = ((IPEndPoint)sock.RemoteEndPoint).Address;				
			IPAddress serverAddress;

			// ----------------------------------------------------
			// Is it Loopback?
			// ----------------------------------------------------
			if ( IPAddress.IsLoopback( theirAddress ) )
			{
				return IPAddress.Parse( "127.0.0.1" );
			}

			// ----------------------------------------------------
			// Local
			// ----------------------------------------------------
			UInt32 uint32Address = StringIPToUInt32IP(theirAddress.ToString());
			for (UInt32 LocalLanIPRangesLoop = 0 ; LocalLanIPRangesLoop < LocalLanIPRangesCount; LocalLanIPRangesLoop++)
			{	
				if ( (LocalLanIPRanges[LocalLanIPRangesLoop].RangeFrom <= uint32Address) && (LocalLanIPRanges[LocalLanIPRangesLoop].RangeTo >= uint32Address) )
				{
					Resolve(Dns.GetHostName(), out serverAddress);
					
					Console.WriteLine("Player is reconnecting to " + serverAddress.ToString());
					return serverAddress;
				}
			}

			// ----------------------------------------------------
			// Internet addresses
			// ----------------------------------------------------
			if (Address!=null)
			{
				Resolve(Address, out serverAddress);	
			} else {
				Resolve(Dns.GetHostName(), out serverAddress);	
			}
			
			Console.WriteLine("Player is reconnecting to " + serverAddress.ToString());
			return serverAddress;
		}
		

		// ==================================================================================
		// Resolves dns names
		// ==================================================================================
		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;
		}

	}
}

The no-ip is set to the ip address 69.21.139.87.
Port Forwarding is set to: 2593-2593 tcp 69.21.139.87.
And UOGateway is set to: huff.no-ip.org 2593
Loser is offline   Reply With Quote
Old 04-19-2006, 11:04 PM   #7 (permalink)
Forum Expert
 
Asmir3's Avatar
 
Join Date: Sep 2005
Location: A-Town Baby
Age: 19
Posts: 620
Talking

try this one and tell me if it works
Attached Files
File Type: cs ServerList.CS (2.2 KB, 20 views)
__________________

Now open - uo15.net - The best in Publish 15 emulation
Asmir3 is offline   Reply With Quote
Old 04-19-2006, 11:26 PM   #8 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

Nope...here is a screen shot of when the server shows.
Attached Images
File Type: bmp RunUO1.0screenshot001.bmp (675.8 KB, 54 views)
Loser is offline   Reply With Quote
Old 04-19-2006, 11:31 PM   #9 (permalink)
Master of the Internet
 
TMSTKSBK's Avatar
 
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
Default

Looks right to me...if you did modify the serverlist correctly, that should be what it shows...methinks...
(make sure you forward your router)
__________________
Goodbye, folks.
TMSTKSBK is offline   Reply With Quote
Old 04-19-2006, 11:42 PM   #10 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

Quote:
Originally Posted by Loser
The no-ip is set to the ip address 69.21.139.87.
Port Forwarding is set to: 2593-2593 tcp 69.21.139.87.
And UOGateway is set to: huff.no-ip.org 2593
I did do the Port Forwarding.
Loser is offline   Reply With Quote
Old 04-20-2006, 12:13 AM   #11 (permalink)
Forum Expert
 
Thistle's Avatar
 
Join Date: Mar 2005
Posts: 1,155
Default

You have to port forward to your internal IP, the 192.168.x.x IP.
Thistle is offline   Reply With Quote
Old 04-20-2006, 08:54 AM   #12 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

Where do I find my internal IP address?
Loser is offline   Reply With Quote
Old 04-20-2006, 03:25 PM   #13 (permalink)
Forum Expert
 
PappaSmurf's Avatar
 
Join Date: Mar 2005
Location: Polishing my Lightsaber
Age: 31
Posts: 2,428
Send a message via ICQ to PappaSmurf Send a message via AIM to PappaSmurf Send a message via MSN to PappaSmurf Send a message via Yahoo to PappaSmurf
Default

Here's your console screen shot with the internal IP marked.

__________________

For Updated Scripts from my Releases http://smurfscsharp.googlecode.com/svn/trunk/
PappaSmurf is online now   Reply With Quote
Old 04-21-2006, 01:01 AM   #14 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

<--Feels really stupid. >.<

Okay, thanks.
Loser is offline   Reply With Quote
Old 04-21-2006, 03:02 PM   #15 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

Well, I just put in what the server thing said and what you highlited, but still it did not work.
Loser is offline   Reply With Quote
Old 04-21-2006, 03:26 PM   #16 (permalink)
Forum Expert
 
PappaSmurf's Avatar
 
Join Date: Mar 2005
Location: Polishing my Lightsaber
Age: 31
Posts: 2,428
Send a message via ICQ to PappaSmurf Send a message via AIM to PappaSmurf Send a message via MSN to PappaSmurf Send a message via Yahoo to PappaSmurf
Default

Which IP is your no-ip pointing at?
__________________

For Updated Scripts from my Releases http://smurfscsharp.googlecode.com/svn/trunk/
PappaSmurf is online now   Reply With Quote
Old 04-21-2006, 03:33 PM   #17 (permalink)
 
Join Date: Dec 2005
Posts: 1
Red face This might help you

I had the same problem for the longest time leave everything you have donw so far as it is the attached serverlist is mrfixits serverlist 2.0 the shard name is modified all you gotta do is remove mine and put your shard name in its place the name for my shard is Alludra just remove that and place yours in then save it and drop it in your Runuo folder in place of your current serverlist.cs it should show an ip nexttime you start the server refer to the screen shot to see what im talking about that is what players should use when logging in to your server not the two addresses i found this out by accident one night i hope it helps you thanks for your time
Attached Images
File Type: bmp IP help.bmp (1.08 MB, 25 views)
Attached Files
File Type: cs ServerList.cs (14.2 KB, 13 views)
blackdragon911 is offline   Reply With Quote
Old 04-21-2006, 08:21 PM   #18 (permalink)
Forum Newbie
 
Join Date: Nov 2004
Age: 30
Posts: 62
Default

With my shard, I have my No-IP set to a domain, not an IP address. Since I have a dynamic IP, the domain name never changes.

You can go to No-IP's website and register one there for free. And make sure your No-IP DUC is working properly.

CHeck your internal IP, and your public IP. Try the internal one first, since that one is the correct one. The public IP is because of your router. Also, in your router, make sure the TCP box is checked.

If you have any questions, let me know.
Tanis_moonblade is offline   Reply With Quote
Old 04-21-2006, 10:53 PM   #19 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

Okay, here it is. You can click on the pic for a direct link to the pics.

This is my server.


My Port Forwarding thing.


A pic of my ServerList.cs file.


A pic of UOGatway settings.


And finally a pic of the message I get when I try to connect.


Knock yourselves out. I can't figure out what is wrong.

Last edited by Loser; 04-21-2006 at 10:57 PM.
Loser is offline   Reply With Quote
Old 04-22-2006, 12:29 AM   #20 (permalink)
Account Terminated
 
Join Date: Oct 2005
Location: Louisiana
Age: 36
Posts: 247
Default

That lil checkbox on that No-IP proggie you're running has to be checked

btw. Those images are way too small mate. Couldnt read em if I tried. But the checkbox was the very first thing I noticed. if it's not checked, it wont work.
Arcanus is offline   Reply With Quote
Old 04-22-2006, 10:11 AM   #21 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

Here I'll upload some pics.
Attached Images
File Type: bmp No-IP Pic.bmp (505.2 KB, 13 views)
File Type: bmp Port Forwarded Pic.bmp (85.0 KB, 14 views)
File Type: bmp RunUO 1.0 Server Pic.bmp (655.0 KB, 11 views)
File Type: bmp ServerList.cs Pic.bmp (405.4 KB, 8 views)
File Type: bmp UO Pic.bmp (948.8 KB, 9 views)
File Type: bmp UOGateway Pic.bmp (529.2 KB, 6 views)
Loser is offline   Reply With Quote
Old 04-22-2006, 10:12 AM   #22 (permalink)
 
Join Date: Apr 2006
Posts: 16
Default

Here is what the server says when I click the No-IP box. And it still does not work.
Attached Images
File Type: jpg RunUO 1.0 Server Pic.JPG (31.8 KB, 16 views)
Loser is offline   Reply With Quote
Old 04-23-2006, 12:29 AM   #23 (permalink)
Forum Expert
 
kethoth's Avatar
 
Join Date: Jul 2003
Age: 22
Posts: 253
Send a message via AIM to kethoth Send a message via Yahoo to kethoth
Default

i had to get a serverlist.cs that auto detected my external ip...
change the server and pubic string address
Attached Files
File Type: cs ServerList.cs (14.2 KB, 12 views)
kethoth is offline   Reply With Quote
Old 04-23-2006, 12:29 AM   #24 (permalink)
Account Terminated
 
Join Date: Oct 2005
Location: Louisiana
Age: 36
Posts: 247
Default

Your ports are forwarded correctly, but the ip isnt. It should be 192.168.0.4, the same as your server address. Everytime your system IP that is given by your router changes, you must update the forwarding address to reflect it. Mine tends to change now and then when I shut off my computer for anything more than a few minutes. That can be fixed also, but that's a whole new can of worms.


Everything else "looks" correct. Your serverlist.cs is correct. Make sure your no-ip program stays checked and when your system's IP changes (turned off for any length of time) you should uncheck and recheck and reboot your system. UOGateway looks good too.
Arcanus is offline   Reply With Quote
Old 04-23-2006, 12:31 AM   #25 (permalink)
Account Terminated
 
Join Date: Oct 2005
Location: Louisiana
Age: 36
Posts: 247
Default

Quote:
Originally Posted by kethoth
i had to get a serverlist.cs that auto detected my external ip...
change the server and pubic string address
You just went an opened a whole new can of worms mate.
Arcanus is offline   Reply With Quote
Reply