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!

Yet another connecting problem

Yet another connecting problem

Well connecting problems.. where to start:
Port 2593 is propperly forwarded.
Here is my orginal Serverlist.cs: general pastebin - Unnamed - post number 588275
which works fine for local clients (network + local)

So then i got a friend of mine to connect using the above Serverlist.cs, this resulted in:
Client: *IP* Connected [1 online]
Login: *IP* Valid credentials for 'Player'
Client: *IP* Disconnected [0 online] [Player]
all within a second. This is after the remote player entered his Username and password and was opted to select server, where he pressed DEMONSWARM(which is the name of my server) Then it hangs, saying connecting. However he never reached the char creation screen.

Ok so i figured it must be something with the autodetecting because i never inserted my IPadress because it is supposed to find it itself. So The thread underneath here was about some guy also having problems with people connecting, he posted his Serverlist.cs and the error was obvious. LocalIP + no qoutes.. so i copied HIS serverlist.cs and edited it with my IP and then used it as my own. NEW SERVERLIST.CS >> general pastebin - Stuff - post number 588276

Ok so now my friend is currently gone, but now i cannot connect to my server with networked clients. I get the same messages in the runuo terminal:
Client: *IP* Connected [1 online]
Login: *IP* Valid credentials for 'Admin'
Client: *IP* Disconnected [0 online] [Admin]

In the end i want local + remote clients to play.. so i can play from home with some friends.
 

Flats

Page
I have had the same problem [the first one] and in my case it was because i was being dumb. I had written the DNS and added an extra r at the end of the DNS name so it would get them to the shard selection screen then do the same thing. So make sure you are using the right IP Address. To check try going to IP Chicken and here is a copy of my ServerList.cs file which people other than my LAN can connect to the shard with just replace the server name and ip. Hope that helps :)

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";
		 */

        private const string Address = "Your Ip Here";

		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;
		}
	}
}
 
Flats will this also allouw local + networked connections to connect? Because with my current setup people outside of my LAN can play, but i cannot :p
 

Flats

Page
Heroin-demise;693002 said:
Flats will this also allouw local + networked connections to connect? Because with my current setup people outside of my LAN can play, but i cannot :p

Yeah i can log in my shard with no problems :) It allows both LAN + WAN To play and access your shard :)
 

Flats

Page
Heroin-demise;693307 said:
well it works now.. iam using mr fixits thing i believe.. dont ask why and how it just started working

Hehe good to hear it finally worked for you :)
 
Top