|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Novice
|
I am having a login problem and after 2 days of searching through posts I can't find an answer that works....... I can either let people from our lan connect or people from the net but not both..... here is my serverlist.cs
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 = "Dragons End";
public static void Initialize()
{
Listener.Port = 2500;
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;
}
}
}
public static readonly string Address = null <---- I have changed this to "ourservername.no-ip.org" and "our.ip.number" Any help is appreciated........ If i have overlooked the probably obvious answer I am sorry. I also know the ports are open since people can connect and open port check tool shows them as open and when I ruin the port check it shows connecting in the server window.
__________________
The only stupid question is the one not asked........ Just don't ask me..... I don't know either........ :D |
|
|
|
|
|
#8 (permalink) |
|
Forum Novice
|
No, I am using 2.0 but it is an older build from '06........ build 2369.33426 and we all only patch to 5.0.9.1.
We used this shard until Nov of last year and the only changes have been our location, (we moved ) and the changes I listed on the serverlist.cs. Edit: Ok...... I put in the Serverlist.cs from the newest RunUO 2.0 RC2. It went in with no problems....... I changed The shard name and everything is working fine. Thanks for the help (even though I feel stupid now).
__________________
The only stupid question is the one not asked........ Just don't ask me..... I don't know either........ :D Last edited by penndragon; 05-11-2008 at 07:28 PM. Reason: Problem Resolved |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|