|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Join Date: Oct 2003
Location: Scotland
Age: 30
Posts: 84
|
[code:1]
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 const string Address = "muppetlords.no-ip.com"; public const string ServerName = "HellSpawn Shard"; public static void Initialize() { Listener.Port = 2593; EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList ); } public const string Address = "muppetlords.no-ip.com"; public const string ServerName = "MuppetLords"; public static void Initialize() { Listener.Port = 2594; 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 ) ); e.AddServer("MuppetLords", new IPEndPoint( ipaddr, 2594); else e.Rejected = true; } catch { e.Rejected = true; } } public static bool Resolve( string addr, out IPAddress outValue ) { try { outValue = IPAddress.Parse( addr ); return true; } catch { try { IPHostEntry iphe = Dns.Resolve( 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.Resolve( Dns.GetHostName() ); for ( int i = 0; !contains && i < iphe.AddressList.Length; ++i ) contains = theirAddress.Equals( iphe.AddressList[i] ); return contains; } } } [/code:1] Okies I trying to make it so that 2 servers are listed on Login. This is the error i am getting [code:1] Scripts: Compiling C# scripts...failed (3 errors, 0 warnings) - Error: Scripts\Misc\ServerList.cs: CS0102: (line 34, column 23) The class 'Se rver.Misc.ServerList' already contains a definition for 'Address' - Error: Scripts\Misc\ServerList.cs: CS0102: (line 36, column 23) The class 'Se rver.Misc.ServerList' already contains a definition for 'ServerName' - Error: Scripts\Misc\ServerList.cs: CS0111: (line 38, column 22) Class 'Server .Misc.ServerList' already defines a member called 'Initialize' with the same par ameter types Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. [/code:1] If anyone can point me the Correct direction.
__________________
Possibly maybe thinking about a new shard, All depends on if i can be bothered. :p |
|
|
|
|
|
#2 (permalink) |
|
Join Date: Feb 2004
Posts: 45
|
i'm no expert, but it is my understanding that 2 shards cannot be listed at login. UOGateway launches the client with the login.cfg file configuered to a certain port. if the shards are different ports, then how does that work? and the shards have to have different ports.
i'd get a second opnion though, i'm still a noob |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|