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 08-14-2007, 05:32 AM   #1 (permalink)
Newbie
 
Join Date: Aug 2007
Posts: 29
Default Server Connection Problems *READ*

Quote:
[code]

ServerList.CS
-------------------------
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 = "MY IP ADDY FROM IPCHICKEN.COM";
*
* If you need to resolve a DNS host name, you can do that too:
* private const string Address = "uogamersx.bounceme.net";
*/

public static readonly string Address = null;

public const string ServerName = "(MY SERVER NAME)";

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;
}
}
}[code]
People can connect to the server and see the server... but when they click on the server it disconnects them...
so... for example

(Logs In With There Account And Pass)
Verifys
Connect
They See The Server Name
Click The Server To Join
They disconnect

Any Ideas?
Sinark is offline   Reply With Quote
Old 08-14-2007, 06:05 AM   #2 (permalink)
Newbie
 
Join Date: Aug 2007
Posts: 29
Default

problem fixed
Sinark is offline   Reply With Quote
Old 08-14-2007, 11:54 AM   #3 (permalink)
Lurker
 
Join Date: Jul 2007
Age: 23
Posts: 2
Default

I have the same problem. PLX say how you was repair this ??


my server is stucking after chose server from serverlist.

PLX HELP
BuuBuu is offline   Reply With Quote
Old 08-14-2007, 12:22 PM   #4 (permalink)
Forum Expert
 
Rosey1's Avatar
 
Join Date: Oct 2005
Location: Oklahoma
Age: 32
Posts: 890
Send a message via ICQ to Rosey1 Send a message via AIM to Rosey1 Send a message via MSN to Rosey1 Send a message via Yahoo to Rosey1
Default

normally this line:
public static readonly string Address = null;

needs to have your ip or your forwarding address you made with https://www.dyndns.com
Rosey1 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