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-23-2006, 06:06 PM   #1 (permalink)
 
Join Date: Nov 2005
Age: 22
Posts: 17
Default Serverlist.cs Troubles

ok i got help on UOGateway forums to tell me to edit around the serverlis.cs file. so i came here for help on what to do sicne UOG forums only deal with the Client and not Scripts so here i am ive edited around everything possible in my serverlist.cs file and im trying to make it so that people can connect to the shard and its not working so im in some Desperate need of help i will post what my Serverlist.cs file looks like now and can someone see waht i must change to get people to join up ive forwarded all my ports and on my firewall to so everythign should be fine well anyway heres what my serverlist.cs file looks like
Code:
using System;
using System.Net;
using System.Net.Sockets;
using Server;
using Server.Network;

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

		public const string Address = "207.161.7.101";

		public const string ServerName = "Shards of Blood";

		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[i] );

			return contains;
		}
	}
}
Sry about it being in Notepad but its all i got for now i can understand what to change in it but w/e can someone tell me what to change ? my ip in my Comand prompt for Runuo 1.0 is "207.161.0.101" (without the ") and its still not allowing anyone to come through the only thign i can see beign wrong with this is
Code:
* If you need to resolve a DNS host name, you can do that too:
		 * private const string Address = "sob.forumup.com";
plz someone tell me whats wrong with this
Trigin is offline   Reply With Quote
Old 06-23-2006, 06:25 PM   #2 (permalink)
Master of the Internet
 
Join Date: Oct 2005
Age: 45
Posts: 6,283
Default

Only thing I can think of is that the IP you think you have is not your real wide area network IP address. Go to whatsmyip.com and verify your IP to start with.
Malaperth is offline   Reply With Quote
Old 06-23-2006, 06:44 PM   #3 (permalink)
 
Join Date: Nov 2005
Age: 22
Posts: 17
Default

that doesnt really help me at all considering the fact that my ip in that file is the same as what it says in the Command Prompt any other editing wont dp anything i need to know what to add and how to or else i mscrwd over right now and thers nothign really i can do about it so please help me out here ive changed the IP now to my real computer s IP and its still messed up no one can get in so yea please help me out

Last edited by Trigin; 06-23-2006 at 09:45 PM.
Trigin is offline   Reply With Quote
Old 06-23-2006, 11:52 PM   #4 (permalink)
 
Join Date: Nov 2005
Age: 22
Posts: 17
Default

can anyone help me out here ?
Trigin is offline   Reply With Quote
Old 06-25-2006, 11:33 AM   #5 (permalink)
Master of the Internet
 
Join Date: Oct 2005
Age: 45
Posts: 6,283
Default

As I said. Checking your wide area network ip address is not something you can do from your command prompt in my admittedly small experience, which is why I suggested the website.

Since you seem to know for sure that I am incorrect, I can only assume that you should very easily be able to solve your own issue.
Malaperth is offline   Reply With Quote
Old 06-25-2006, 12:21 PM   #6 (permalink)
Forum Expert
 
Join Date: Nov 2004
Location: Southeast Missouri USA
Age: 35
Posts: 283
Default

If you are behind a router, then Malaperth is correct.
You cannot see your ip address unless you goto a website like www.whatsmyip.com.
The IP address you see if you are behind a router in the command prompt is the address that your router assigned to your computer not the Wan IP. (which is what is needed here)

From the ip you posted as being yours is 207.161.7.101...
I believe that you are behind a router since the last value 101 is commonly assigned to the first connected computer on the router.
However, if you do not have a router... You shouldn't have edited the IP address in the ServerList.cs

The serverlist.cs you posted is from a distro RunUO 1.0.
I recommend that you use Mr. Fixit's version of the Serverlist.cs
Many people have found it has helped with clearing up connection issues greatly.
Link: http://www.runuo.com/forums/showthre...+serverlist.cs

Hope this helps you.

Last edited by Ashlar; 06-25-2006 at 01:38 PM.
Ashlar is offline   Reply With Quote
Reply

Bookmarks


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