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!

Please help wont let me get in

O

OA7DAB4

Guest
Please help wont let me get in

It wont let me get into my server at all I have no clue why. Here's what i have so far

I've opened port 2593 on my router and Firewall

I have DHCP, do I need static?

we can't even connect locally.

Any ideas?


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 = "shard.host.com";
*
* If you need to resolve a DNS host name, you can do that too:
* private const string Address = "My external IP";
*/

public static readonly string Address = null;

public const string ServerName = "UO:Corruption";

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

return contains;
}
}
 
Top