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 05-07-2008, 06:39 PM   #1 (permalink)
Forum Novice
 
penndragon's Avatar
 
Join Date: Apr 2004
Location: Tennessee
Age: 41
Posts: 119
Send a message via Yahoo to penndragon
Default another login problem......

I am having a login problem and after 2 days of searching through posts I can't find an answer that works....... I can either let people from our lan connect or people from the net but not both..... here is my serverlist.cs

Code:
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 = "shard.host.com";
		 */

		public static readonly string Address = null;

		public const string ServerName = "Dragons End";

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

			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;
		}
	}
}

public static readonly string Address = null <---- I have changed this to

"ourservername.no-ip.org" and "our.ip.number"

Any help is appreciated........ If i have overlooked the probably obvious answer I am sorry.

I also know the ports are open since people can connect and open port check tool shows them as open and when I ruin the port check it shows connecting in the server window.
__________________
The only stupid question is the one not asked........ Just don't ask me..... I don't know either........ :D
penndragon is offline   Reply With Quote
Old 05-08-2008, 08:59 AM   #2 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,424
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

If you are on a LAN, then you probably have a public IP address AND a private IP address. Which one are you entering in your ServerList file?
Lokai is offline   Reply With Quote
Old 05-08-2008, 01:54 PM   #3 (permalink)
Forum Novice
 
penndragon's Avatar
 
Join Date: Apr 2004
Location: Tennessee
Age: 41
Posts: 119
Send a message via Yahoo to penndragon
Default

I have been using the public addy.......
__________________
The only stupid question is the one not asked........ Just don't ask me..... I don't know either........ :D
penndragon is offline   Reply With Quote
Old 05-08-2008, 04:36 PM   #4 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,424
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Then, I am guessing when you use the Public IP, nobody on your LAN can connect, yes?
Lokai is offline   Reply With Quote
Old 05-08-2008, 09:11 PM   #5 (permalink)
Forum Novice
 
penndragon's Avatar
 
Join Date: Apr 2004
Location: Tennessee
Age: 41
Posts: 119
Send a message via Yahoo to penndragon
Default

right...... and if I put in the lan ip........
lan can connect but not other...........
__________________
The only stupid question is the one not asked........ Just don't ask me..... I don't know either........ :D
penndragon is offline   Reply With Quote
Old 05-09-2008, 09:02 AM   #6 (permalink)
Forum Novice
 
Join Date: Feb 2007
Location: Tennessee - Big Orange Country
Age: 37
Posts: 125
Default

You should have both in there. I'd show you, but I'm at work atm.
Jasonntn is offline   Reply With Quote
Old 05-09-2008, 11:12 AM   #7 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,424
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

You should use as much code from the newest version of ServerList.cs (from RunUO v2.0) as you can. It will automatically add public IP addresses to your list of IPs, and works very well. You must be using RunUO v1.0 or something, yes?
Lokai is offline   Reply With Quote
Old 05-09-2008, 02:24 PM   #8 (permalink)
Forum Novice
 
penndragon's Avatar
 
Join Date: Apr 2004
Location: Tennessee
Age: 41
Posts: 119
Send a message via Yahoo to penndragon
Default

No, I am using 2.0 but it is an older build from '06........ build 2369.33426 and we all only patch to 5.0.9.1.

We used this shard until Nov of last year and the only changes have been our location, (we moved ) and the changes I listed on the serverlist.cs.

Edit:
Ok...... I put in the Serverlist.cs from the newest RunUO 2.0 RC2. It went in with no problems....... I changed The shard name and everything is working fine. Thanks for the help (even though I feel stupid now).
__________________
The only stupid question is the one not asked........ Just don't ask me..... I don't know either........ :D

Last edited by penndragon; 05-11-2008 at 07:28 PM. Reason: Problem Resolved
penndragon 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