|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Hello?
|
I was wondering if anyone can explain to me how this works, I would like to merge to shards togather and have the OSI shard listing list the shards instead of UOG.
Code:
Shard A: Connect and play
/
UOG-Name
\
Shard B: Connect and play
__________________
Java House Gamers! Online gamers community Hosting our unique UO servers (down for hardware and shard construction) Proud sponsors of Personal Computer Builders Check us out!
|
|
|
|
|
#3 (permalink) |
|
Forum Novice
Join Date: Nov 2003
Location: USA, a small hick city in Missouri
Posts: 174
|
Jason, he means how do you get two shards into the connection screen, like
Daemon's World Test Center Local Server like that.. and have the TC and DW different servers with the same account.. err, you probably know what he means anyway.. |
|
|
|
|
#4 (permalink) |
|
Hello?
|
Yes, thats exactly what I mean. Any thoughts on how?
__________________
Java House Gamers! Online gamers community Hosting our unique UO servers (down for hardware and shard construction) Proud sponsors of Personal Computer Builders Check us out!
|
|
|
|
|
#5 (permalink) |
|
Join Date: Dec 2003
Posts: 67
|
Unfortunately I only have access to the B36 script right now (not going to try and install RC1 on my work computer), but I don;t think the file changed any.
Original script code: PHP Code:
PHP Code:
You should have this now: PHP Code:
|
|
|
|
|
#6 (permalink) | |
|
Forum Expert
|
How exactly does this work? If i want to have a Server that uses the normal 4 facets and also i want a Server that uses a Custom Map, How would i do this?
Quote:
ie... if i run the primary server and it compiles fine then i run the second server and if also compiles fine, but when i run the client program it only detects the primary server. How does the client know that there is more than one server to choose from? this is the primary server 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 const string Address = null;
public const string Address = "127.0.0.1";
public const string ServerName = "Roadmaster's Abyss";
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 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 )
{
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:
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 = null;
public const string Address = "127.0.0.1";
public const string ServerName = "Roadie's Test Center";
public static void Initialize()
{
Listener.Port = 2592;
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 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 )
{
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;
}
}
}
roadmaster |
|
|
|
|
|
#7 (permalink) |
|
Join Date: Dec 2003
Posts: 67
|
The problem you are having is that each server list is trying to add itself twice. You have to have the IP/Port/Name information for each server in your serverlist.cs file.
In this file, I have changes the Address and ServerName variables to Address1 & ServerName1, as well as added a Port1. I have also made another copy of those varables but changed the 1 to a 2 (Address2, ServerName2, Port2). Then I modified the two if statments to each make a server entry (see code). PHP Code:
However, one thing you will need to know is that since your primary server will be handling the logins, any accounts you have on the secondary server MUST exist on the primary server. |
|
|
|
|
#8 (permalink) |
|
Save the Mongbats!
Join Date: Mar 2003
Location: Mongbatville
Age: 33
Posts: 1,042
|
Have you actually proven this to work?
With the if and else if statements, the moment the first if is deemed true, it doesn't execute the else if. Therefore only the first server shows in the server list. If you change the else if to an if, then both show up, but you can only connect successfully to the first one. If you attempt to connect to the secondary shard, it displays an error on the console that an "Invalid client detected, disconnecting". |
|
|
|
|
#11 (permalink) |
|
Forum Expert
|
i have a host....on my host i can make up to 4 shards....same computer they r on...how do i do it?i kno like changing the port an shit
i got 2593 2592 2591 i just dont know how 2 set up the serverlist.cs
__________________
I Still Play OSI UO, Feel free to ICQ or post with any questions between RUNUO and OSI. |
|
|
|
|
#13 (permalink) | |
|
Join Date: Dec 2003
Posts: 67
|
Quote:
How embarassing that is for me. hehe. That is what I get for making a quick script from work where I can't test it. I know you CAN have two servers show up in the list as I have done that before. I will try to make that again tonight when I get home (and CAN test it). *hides in shame* |
|
|
|
|
|
#15 (permalink) |
|
Forum Expert
|
this is what me and a friend got so far. And it does show them both in the shard listing but when u click on the Test Center one the test cent client shows that they r connecting but disconnects them
here is the 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 const string Address = null; public const string ServerName = "Ultima AoS"; 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( "Ultima AoS", new IPEndPoint( ipAddr, 2593 ) ); e.AddServer( "Test Center", new IPEndPoint( ipAddr, 2592 ) ); } 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; } } }
__________________
I Still Play OSI UO, Feel free to ICQ or post with any questions between RUNUO and OSI. |
|
|
|
|
#16 (permalink) |
|
Forum Expert
|
Yes always seem to get "Invalide cliented detected: Disconecting" error when you try to pass it from one server to another, even if i Reset the EventSinks the error is still there which means that there must have been something changed somewhere important and im not quite clever enough to figure out where :P
|
|
|
|
|
#19 (permalink) |
|
Save the Mongbats!
Join Date: Mar 2003
Location: Mongbatville
Age: 33
Posts: 1,042
|
Well all we have to do to find out is wait. He'll either succeed and post the working script, or fail and not post a working script. Can't do much else than wait unless you have a better idea?
![]() |
|
|