RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Here we go again....

Joeku

Lord
Try this:

1. Unplug your router from PC #2.
2. Reformat PC #2.
3. Put a fresh install of Windows XP on it.
4. Download all updates to a portable hard drive and transfer them to the computer, or just connect it directly to your modem and download them straight (this includes .Net 2.0).
5. Install RunUO and Razor.
6. Try to connect via 127.0.0.1:2593.

If that doesn't work, you're screwed.

P.S. can I see your ServerList.cs?
 

ratzerna

Sorceror
Okay, I see below the console from your new fresh installation. It's a great step to not get the socket error. The one thing I notice is the 2nd IP address (192.168.1.97) is the same IP address that you got when you were having problems with RunUO on the first computer. That would mean that both of those computers have the same IP address. Not that, that would be the end of the universe, but if you have them plugged into a switch/hub and they are on the same network you would end up with an IP conflict.


Original:
Code:
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...done (cached)
Scripts: Compiling VB.NET scripts...no files found.
Scripts: Verifying...done (2086 items, 497 mobiles)
Regions: Loading...done
World: Loading...done (99853 items, 2418 mobiles) (7.12 seconds)
Listener bind exception:
System.Net.Sockets.SocketException: Unknown error (0xffffffff)
   at System.Net.Sockets.Socket.DoBeginAccept(LazyAsyncResult asyncResult)
   at System.Net.Sockets.Socket.BeginAccept(AsyncCallback callback, Object state
)
   at Server.Network.Listener.Bind(IPAddress ip, Int32 port)
Address: 127.0.0.1:2593
Address: 192.168.1.97:2593
New Computer
Code:
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...done (cached)
Scripts: Compiling VB.NET scripts...no files found.
Scripts: Verifying...done (2086 items, 497 mobiles)
Regions: Loading...done
World: Loading...done (99859 items, 2418 mobiles) (6.56 seconds)
ServerList 2.2
Welcome to SERVER'S NAME
Internet IP: 68.212.243.240 (http://checkip.dyndns.org/)
Reports: Stats: Loading...done
Reports: Staff: Loading...done
Address: 127.0.0.1:2593
Address: 192.168.1.97:2593


When you are trying to connect to the new RunUO server, are you trying to connect using a copy of the UO Client on the same machine (New Server) as the server itself? or from your first machine? Or another computer from somewhere else on your network?

- You have 2 computers, both appear to have the same IP address (192.168.1.97). How are your computers getting this IP address? Is this something your hard-coding into your ServerList.cs file? The IP address you want to set is the one for your Local Area Connection of the computer:

Code:
C:\>ipconfig

Windows IP Configuration


Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : WORKGROUP
        IP Address. . . . . . . . . . . . : 192.168.1.101
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1

C:\>
-- Whatever you get when you run ipconfig at the Command prompt is what you need to set in your ServerList.cs.


What is the IP address of your Router?
How many network ports does your Router have? (besides the one going to the modem)
What is the IP address of Computer #1?
What is the IP address of Computer #2?
How are you setting the IP Address? Manually? or DHCP?
If Manually, is your Subnet Mask 255.255.255.0?
Your Default Gateway address on the PC's should be your Router IP.
Are there any other PC's connected to the Router? Or can you only connect one at a time?

I didn't see any posts saying which machine you used to try to connect to the new RunUO server with. What I would do is totally localize the new server and try to connect to itself with nothing else plugged in to the router.
First thing you want to do is put back your original default ServerList.cs that came with RunUO (at least temporarily). Let it figure out the IP address of the machine automatically (for this test).
Then manually set your IP address on the New computer under your Network Connections, Local Area Connection/Internet Protocol TCP/IP properties. Select "Use the following IP address" and set the IP address to something different like 192.168.1.100. Set a netmask of 255.255.255.0 and you dont' have to worry about a default gateway. Reboot, start RunUO and using UOGateway (on new computer) try connecting to your RunUO Server with either address it shows in the RunUO Console. It should only list 127.0.0.1 and 192.168.1.100 both listening on 2593 .. if you set that as your IP address. I would also recommend verifying your IP address before starting RunUO from the Command prompt like above with "ipconfig".

If that doesn't work .. something is really whacked
 

Slayer706

Sorceror
The reason the computers have the same IP is because they are in the same house and I am using the same modem. I don't have two modems, so I had to install the same modem on both computers so I could get online on both of them by just moving the modem between each computer.

The computer I am trying to get RunUO to work on now DOES have a fresh install of Windows XP, RunUO 2.0.0, .Net Framework 2.0, UO Gateway, and a now fully patched UO Gold. On this other computer I haven't set anything manually. I haven't even touched the computer since I installed Windows XP on it.

Now to answer as many of those questions as I can:
According to the links Phantom gave me, my router's IP is 192.168.1.254. That IP is also said to be my Default Gateway in Network Connections.
As far as I know, I haven't done anything to "set" the IP address besides install the modem.
My modem is also my router, and it is only connected to one computer at a time.
Yes, my Subnet Mask is 255.255.255.0.
In all cases where I run RunUO and I try to connect to it, it is always on the same computer that is running it, since it wouldn't be possible to run it on one computer and connect using the other.
The two computers aren't networked, there is nothing connecting either of them together. The only similarty between the two is their Operating System and the modem/router.
This is what Ipconfig gives me:
Code:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\tony>ipconfig

Windows IP Configuration


Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : launchmodem.com
        IP Address. . . . . . . . . . . . : 192.168.1.97
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.254

C:\Documents and Settings\tony>
This is my Serverlist.cs (This will change in a few minutes because I am going to put my IP in instead of letting it Auto Detect):
Code:
// ==================================================================================================================
// ServerList.cs Ver.2.0                                                              Mr.Fixit Version Releases
// ==================================================================================================================
//      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).
//===================================================================================================================
// ServerList.cs Ver.2.2                                                     Developer Landry Version Releases
//===================================================================================================================
//      2.1  Developer Landry        Its easyer to add multiple servers.
//                                                             The Home Server is where you enter the ip/port of the server this script is running on a.k.a the scripts home server.
//                                                             Servers/Ports A, B and C are the different values you can enter your multiple servers into.
//                                                             All servers that are listed must be running the same corresponding ServerList.cs for the list to work.
//                                                             NOTE: BY DEFAULT A. B AND C ARE COMMENTED OUT BY /*EXAMPLE*/ THE OUTSIDE COMMENTS.
//                                                             NOTE: ALL SERVERS MUST BE HOSTED BY THE SAME IP ADDRESS
//                                                             NOTE: ALL SERVERS MUST BE HOSTED BY DIFFERENT PORTS
//      2.2  Developer Landry        Added Account Packet Handler (APH).
//                                                             Enables the client to connect to multiple servers.
//                                                             Disables client checks allowing the client to login into multiple servers.
//                                                             The Disabling also allows the client to login into the same account twice.
// ===================================================================================================================
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 = "Home Server"; //Home Server's Name
                                /*//Server A
		public const string ServerNameA = "Server A"; //Server A's Name*/
                                /*//Server B
		public const string ServerNameB = "Server B"; //Server B's Name*/
                                /*//Server C
		public const string ServerNameC = "Server C"; //Server C's Name*/
		// ==================================================================================
		// 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 = null;  //Home Server's IP
                                /*//Server A
		public static string AddressA = "###.###.#.###";  //Server A's IP
		public const int PortA = ####;  //Server A's Port*/
                                /*//Server B
		public static string AddressB = "###.###.#.###"; //Server B's IP
		public const int PortB = ####;  //Server B's Port*/
                                /*//Server C
		public static string AddressB = "###.###.#.###"; //Server C's IP
		public const int PortB = ####;  //Server C's Port*/
		// ==================================================================================
		// 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 home port to use
			// ----------------------------------------------------
			Listener.Port = 2593;  //Home Server's Port

			// ----------------------------------------------------
			// 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 2.2");
			Console.WriteLine("Welcome to SERVER'S NAME");

			// ----------------------------------------------------
			// 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 ( Resolve( Address != null && !IsLocalMachine( e.State ) ? Address : Dns.GetHostName(), out ipAddr ) )
				{
					e.AddServer( ServerName, new IPEndPoint( ipAddr, Listener.Port ) );
					/*e.AddServer( ServerNameA, new IPEndPoint( ipAddr, PortA ) );*/
					/*e.AddServer( ServerNameB, new IPEndPoint( ipAddr, PortB ) );*/
					/*e.AddServer( ServerNameC, new IPEndPoint( ipAddr, PortC ) );*/
				} 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;
		}

		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;
		}
	}
}
namespace Server.Network
{
	public class APH
	{
		public static void Initialize()
		{
			PacketHandlers.Register( 145, 65, false, new OnPacketReceive( GameLogin ) );
		}

		public static void GameLogin(NetState state, PacketReader pvSrc)
		{
			if (state.SentFirstPacket)
			{
				state.Dispose();
				return;
			}
				state.SentFirstPacket = true;
				int SecurityID = pvSrc.ReadInt32();

			string un = pvSrc.ReadString(30);
			string pw = pvSrc.ReadString(30);
			GameLoginEventArgs loginevents = new GameLoginEventArgs(state, un, pw);
			EventSink.InvokeGameLogin( loginevents );
			if ( loginevents.Accepted )
			{
				state.CityInfo = loginevents.CityInfo;
				state.CompressionEnabled = true;
				if ( Core.AOS )
				{
					state.Send( SupportedFeatures.Instantiate() );
				}
				state.Send( new CharacterList( state.Account, state.CityInfo ) );
				return;
			}
			state.Dispose();
		}
	}
}

As for the original Serverlist.cs, can I ask someone to paste it in code tags? I didn't move the original copy to the other computer and I don't want to waste another CD (I don't have any usable floppy disks and my flash drive isn't working).

As for me BSing, TMSTKSBK, you can do a search. I am sure my old topic about my problem with RunUO 1.0.0 is still on here. Why else would I spend 4 days trying to solve a problem that doesn't exist?

Thanks ratzerna for being such a great help, I am going to try everything in your last post and post the results as soon as I get an original Serverlist.cs.
 

TMSTKSBK

Lord
I wasn't saying YOU were bsing...I was saying JOEKU was bsing.

Btw. Yeah. 192.168... is NOT your IP address...
Beyond that, you have a deeper problem. If you cannot connect on 127, you have trouble. Definitely attempt to reinstall UO. Preferably with an SE or ML client.
 

Slayer706

Sorceror
Yeah, I get a completely different number when I go to whatismyip.com. According to that site, the IP for the computer with the clean install of XP is 70.153.156.119. As for the reinstall, it is a fresh install already. The only thing I have done is patched, which everyone told me to do that.
 

Slayer706

Sorceror
I guess I will try that after I get an original Serverlist.cs and do a few of the tests ratzerna said. Anyone want to post theirs in code tags so I don't have to waste a CD or redownload RunUO 2.0.0 for one script?
 

TMSTKSBK

Lord
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 = "RunUO TC";

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

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

Slayer706

Sorceror
Thanks.

EDIT - I did exactly what ratzerna said, step by step. Still couldn't connect and the console didn't show any messages of anyone trying to connect. So now I guess I will install the ML client and try it....
 

Slayer706

Sorceror
Woot! It worked! After all this time it finally worked...... So apparently it was McAfee that was affecting it on this computer. And it was UO Gold affecting it on the other one.

Thanks for all the help everyone. I can finally test my own scripts.
 

Tannis

Knight
Slayer706 said:
Woot! It worked! After all this time it finally worked...... So apparently it was McAfee that was affecting it on this computer. And it was UO Gold affecting it on the other one.

Thanks for all the help everyone. I can finally test my own scripts.
Huzzah! McAfee is a great scan/firewall but sucks when used with RunUO...and I'd personally rather have RunUO.
 

ratzerna

Sorceror
Glad you got it to work .. There probably is a way to keep your McAfee and run UO, but it's gonna require some trial-n-error messing around with settings which could end up just rendering your system either useless or not protected. I had it on 5 computers at home and it's gone for good, now. Been a big fan for years and years too.

Right now I'm running free trial's of Trend Micro PC-cillin and plan to try the Zone Alarm Internet suite next.
 
Top