View Single Post
Old 08-02-2008, 12:41 PM   #3 (permalink)
Mockhazzard
Newbie
 
Join Date: Jul 2008
Posts: 68
Default

SERVERLIST.cs

the only change is to that one ip address. "public cont string address". and we tried using multiple ips for it and no success. im not sure exactly which ip to put in there.

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 const string Address = "127.0.0.1";

		public const string ServerName = "Warriors Haven";

		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;
		}
	}
}
in ipconfig/all there was no Lan IP. but this is what there was. Nothing else had an ip address beside it.
IPV4 ADDRESS
Subnet MASK
Default Gateway
DHCP Server
DNS servers

There was also no customer defined service rule. I looked for anything that redirects ip's but no. My interface is also strange (ive never used it). its called ZyXEL. i have a linksys WRT54GL. it didn't ask me to log in or anything. i used 192.168.1.1 to get to it (i think thats right).

Here is what it gives me.

HOME

REGISTRATION

NETWORK
LAN
WAN
DMZ
WLAN
WIRELESS CARD

SECURITY
FIREWALL
IDP
ANTI-VIRUS
ANTI-SPAM
CONTENT FILTER
VPN
CERTIFICATES
AUTH SERVER

ADVANCED
NAT
STATIC ROUTE
POLICY ROUTE
BW MGMT
DNS
REMOTE MGMT
UPnP
ALG

REPORTS
SYSTEM REPORTS
THREAT REPORTS

LOGS

MAINTENANCE


LOGOUT

you pinged my ip? (im kinda wondering how you did that. seems useful to test for open ports and firewalls). yes my No ip was setup INCORRECTLY. it has been fixed and is now "Warriorshaven.servegame.com"

thanks for the help.
Mockhazzard is offline   Reply With Quote