Sharky

Citizen
The centralized database sql Runuo link is broken, even if you found it a lot or core edits.

Someone released a ServUO using database system but I think that is in early stage not only that but not the latest. Publish 53 from what I recall.

As for Mr Fixits serverlist.cs using one IP only use would be production server and test centre as without creating a account on the production server your find the test centre server will freeze on trying to make a account.

The only other way round it for multiple servers is either purchasing another which be costly, or the other option ordering another IP and setting the second server to run on that IP.

Kinda long but it’s late and doing all this via phone.

Hope this gives you some insight.
 

Sharky

Citizen
I submitted the cs couple weeks ago but yeah that did not work so i will submit the serverlist.cs that i have a maybe someone can share some light on how to configure it properly.

Assuming you need to copy the serverlist.cs on server 1 and server 2 and configure accordingly.
 

Attachments

  • ServerList.cs
    20.2 KB · Views: 48

Aschnyder26

Citizen
I used your Serverlist.cs and was able to get this working. I ran 2 servers at once one on port 2593 and the other on 2594. Both have the modified Serverlist.cs. I was able to log into either server using one client connected to 2593 through the server selection at login. The first server was configured in this way:
Code:
        public static string Address = "127.0.0.1";        // Server Address Goes Here
        public static string AddressA = "127.0.0.1";
        public const int Port = 2593;
        public const int PortA = 2594;    //Only one port listing.....????
Then further down the same port config:
Code:
                if (ipAddr != null)
                {
                    e.AddServer(ServerName, new IPEndPoint(ipAddr, 2593 ));//  Place the port that you are using here.
                    e.AddServer(ServerNameA, new IPEndPoint(ipAddr, 2594));
                }
                else
                {
                    e.Rejected = true;
                }

Now on the second server you use the same settings, you only need to change the lower part of the script and swap the ports to reflect the port server 2 is using:
Code:
                if (ipAddr != null)
                {
                    e.AddServer(ServerName, new IPEndPoint(ipAddr, 2594 ));//  Place the port that you are using here.
                    e.AddServer(ServerNameA, new IPEndPoint(ipAddr, 2593));
                }
                else
                {
                    e.Rejected = true;
                }

Finally change the port on server 2 to reflect the correct port in SocketOptions.cs (2594) in this case:
Code:
        private static IPEndPoint[] m_ListenerEndPoints = new IPEndPoint[]
		{
			new IPEndPoint( IPAddress.Any, 2594 ),
			
		};

I am using RunUO but if you are using ServUO you can probably just change the socket in the config file. I only tested this locally and results may vary if you are using an outside server address.

Edit: I did test this on a remote server and it works just fine. You can check the result @ 131.153.100.69, 2593 for a short time until the IP goes down. lol The server is setup for client 4.0.6 but you should still be able to log in with modern clients it may just look weird.
 
Last edited:
Hi there,
First of all I am trying to learn c# thats bacause i am trying to make a custom uo shard to do some practice.
I believe i did exactly the same as it is explained here but the second server still says Listener Failed: 0.0.0.0:2593 (In Use)
Is it because of my miscorrection or because of the version?

Any help is appreciated :)
 

Attachments

  • ServerList.cs
    20.2 KB · Views: 16
  • ServerList.cs
    20.2 KB · Views: 15
  • SocketOptions.cs
    1.4 KB · Views: 16

Voxpire

Vita-Nex: Core
Administrator
Just a tip for deciding configurations... If you detect which server you're launching based on the path to the exe, you can determine which settings to use for that server.

Server A in C:/UO/Shard A/
Server B in C:/UO/Shard B/

In code you can do something like (purely example);
Code:
string ip;
int port;

if( Core.BaseDirectory.Contains("Shard A") )
{
    ip = "192.168.0.2";
    port = 2593;
}
else if( Core.BaseDirectory.Contains("Shard B") )
{
    ip = "192.168.0.3";
    port = 2593;
}
else
{
    ip = "127.0.0.1";
    port = 2593;
}

This way, Shard A and B can both use the *same* code-base.

Note that the ip changes in the 3 examples, but the port doesn't. This will work if you have multiple ip's on your server and resolve them properly. Each individual ip has its own set of ports allocated, so they never "cross over" or "conflict". They are seen as being like different computers, but its really just multiple network interfaces on the same computer.

Ideally you'd want a stand-alone shard running that literally only handles login requests and redirects players to either Shard A or B. In this case, the "login" server needs to be able to communicate with A and B in order to push a login request and retrieve the login seed for use with forwarding to the correct shard (once a shard is selected from the list).
 
I believe i couldnt explain my problem clear enough sorry about that.
I am trying to make 2 servers with 2 different uo directory and 2 different server side files which both can be shown with the same login info.
But thanks either way for your help in advance :)
 

Aschnyder26

Citizen
Ideally you'd want a stand-alone shard running that literally only handles login requests and redirects players to either Shard A or B. In this case, the "login" server needs to be able to communicate with A and B in order to push a login request and retrieve the login seed for use with forwarding to the correct shard (once a shard is selected from the list).

That is exactly how OSI had it setup when they separated the servers into shards. They probably still have it setup that way. LOL Watch at 24:50 below.

 
Last edited:

yayafan

Citizen
Did any one try this multiple server with latest ServUO and client ? I did exactly same modification as above , I can see the second server when I login, but after I choose the second server in server list, then my client stuck before show character list.
 

squ1sh

Citizen
Is there any interest in this problem still? I ran into the same issue and have been looking at the root cause and it is quite extensive. If others still want this then I will attempt to package this in such a way that I can make a pull request to the github. otherwise I may just "get it working" for my own local uses.

To be clear there are 2 issues:

1. The UI is not connecting to the other shards listed in the shard selection UI - you get some sort of connection error
2. The ability to have one shared list of accounts so that all the shards use the same account login info and any change to password or anything else is kept in a single place.
 

Wetnoodles

Citizen
So funny story.... My friend was logged into his account on my computer when I posted the above message. So that message from Squ1sh is actually from me. Sorry for the confusion.
 

Iomega0318

Vita-Nex Sponsor
So funny story.... My friend was logged into his account on my computer when I posted the above message. So that message from Squ1sh is actually from me. Sorry for the confusion.
I would definitely still be interested in seeing this work fully.
 

Wetnoodles

Citizen
Thank you lomeaga, I needed to know that this would be helpful to someone else. I am not used to socket programming and it has been a bit brutal for me so I appreciate the interest.

Right now here is where I am at:

1 - I was finally able to get a connection to another target server after selecting it on the source server's list. I am doing this by putting a break point in and waiting for the communication between the two servers resolves before sending the acknowledge to the client. This is obviously not acceptable but I have proven to myself I understand the problem and will be able to solve it.

2 - I have code for using a common account file. The account file also has character info in it which presents a problem that I solved by adding code and putting the name of the server the character belongs to in the shared account file. This works great if you are starting fresh servers. If you are not, the way I wrote it is any characters without a server name will have the current server written to the file on the first server save. This means that before trying to merge accounts on existing servers you should boot the individual servers up and give the save command. But that means you will have two account files with server info on all the characters so I am thinking I need to add a merge account utility that can be invoked on the server to load in the account info of another server to allow for a migration path for existing servers. This also means that changing the server names in the server config file with make all the characters disappear so I am also thinking of making a command that moves all characters from an old server name to the current server name.

Well anyway that's where I am at right now. More to come.
 

Iomega0318

Vita-Nex Sponsor
Sounds pretty awesome so far :)
I'll merge your changes into my branch if I can get some time this week so I can play around with it myself.
 

Voxpire

Vita-Nex: Core
Administrator
I created a pull request on my friend's fork for this functionality. It works locally for me for both issues but would not mind some more eyes on it before I make a pull request to the main github.

Here is a link to the PR: Multi shard changes by noodleses · Pull Request #9 · squ1sh/ServUO
I appreciate it! However, I can't approve a PR for this feature as it adds a lot more complexity that the average user won't need.
It would be better off as a new tutorial submission for the minority that want to achieve this goal.