Go Back   RunUO - Ultima Online Emulation > RunUO > Server Support on Mono

Server Support on Mono Forum dedicated to RunUO 2.0 on Mono.

Reply
 
Thread Tools Display Modes
Old 10-19-2007, 04:33 PM   #1 (permalink)
Newbie
 
Ice-Rocker101's Avatar
 
Join Date: Jun 2007
Age: 16
Posts: 9
Send a message via MSN to Ice-Rocker101
Default Troubles with people connecting

Having problems with people connecting
Quote:
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 = "192.168.1.101";

public const string ServerName = "Apocalypse-Uo";

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;
}
}
}
Ice-Rocker101 is offline   Reply With Quote
Old 10-19-2007, 04:46 PM   #2 (permalink)
Forum Expert
 
Join Date: Mar 2004
Location: Germany
Age: 22
Posts: 300
Default

Quote:
public static readonly string Address = "192.168.1.101";
Are you sure you want a local IP in there? If you server is to be accessed from outside, you should of course put your external IP in there.
__________________
RunUO RemoteAdmin - Control your shard remotely and keep an eye on the page queue
MulEditor - Modify gump, art, tiledata, multimap, localization files and map/statics.
CentrED - A Client/Server based multi-user map editor.
floppydisc is offline   Reply With Quote
Old 10-19-2007, 04:51 PM   #3 (permalink)
Newbie
 
Ice-Rocker101's Avatar
 
Join Date: Jun 2007
Age: 16
Posts: 9
Send a message via MSN to Ice-Rocker101
Default

I put my external ip in now when i enter my user name and pass word it says sorry could'nt connect to uo please try again in a few moments

Last edited by Ice-Rocker101; 10-19-2007 at 04:55 PM.
Ice-Rocker101 is offline   Reply With Quote
Old 10-19-2007, 05:03 PM   #4 (permalink)
Newbie
 
Ice-Rocker101's Avatar
 
Join Date: Jun 2007
Age: 16
Posts: 9
Send a message via MSN to Ice-Rocker101
Default

I put my external ip in and then loaded up uog and when i try in log in it says "could not connect to uo please try again in a few minutes"
Ice-Rocker101 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