Is there anyway i can have multiple shards on one server or under same ip so that they show up like on OSI with their full list?
 
Code:
scripts
Failed with: 1 errors, 0 warnings                     
Errors:                       
+ Misc/ServerList.cs:
  CS1729: Line 412: The type `Server.Network.CharacterList' does not contain a
constructor that takes `2' arguments                         
Scripts: One or more scripts failed to compile or no script files were found.
...??

Code:
state.Send(new CharacterList(state.Account, state.CityInfo));
 
Ok, i read the link above:
http://www.runuo.com/community/threads/running-two-runuo-servers-on-one-computer.517745/

From Voxpire:
I'll just throw this in as it doesn't seem to be noted in that linked thread;
It is highly recommended that each instance of RunUO has it's own dedicated set of UO files, or full UO installation.
For example;
Server 1: C:/Program Files (x86)/EA Games/Ultima Online Classic/Server1
Server 2: C:/Program Files (x86)/EA Games/Ultima Online Classic/Server2
This will stop any file access violation issues that may occur now or in the future when you've developed your shard a bit.
You will need to modify DataPath.cs and provide the relevant path for that server instance.
You don't have to do this, but it's better to be safe than sorry.

** I don't find any reference to how this needs modified **

Initially what i tried seemed to work, everything loaded fine, but then switched my local ip address to something else. So the server came up, but would not let me log into either of the shards. When i tried to figure out a way to keep it to the same ip address, i get the error below:
ServerList2.png

Will keep trying to figure it out, but if anyone could make some recommendations, would be great.

** the initial try that seemed to work, but would not let me log onto either shard, ends with saying that i have Listening on both my pc ip and my local network ip, but then lists that
Listener Failed: 0.0.0.0.2593 (In Use)

thanks
 
Last edited:
Looking at it now, thx - hope it shows me what i missed

**Ok, i read before that you needed to make sure you had two different UO files, not servUO files?**
Ok Now make a Second copy of this to replace the ServerList.cs in your second Servers Scripts/Misc folder
This Time when you change the Server Names it should look like this
RunUO Siege Perilous Build
RunUO ML Build
**So i need two different ServUO servers?**

This also says nothing in regards to the DataPath.cs file?
 
Last edited:
Since you want one login for 2 servers- yes you need 2 servers - which ever you plan on using or connecting to
be it Runuo or ServUO , etc.
you will need to set the datapath on each server (as usual) Maybe other's who have completed this will help out :)
 
ok, i have the two servers, and two uo files. i start up both server instances, they both come up no issues. I even have it now where i am able to log in, but only if i use the ip for my pc 127.0.0.1. when i do log in using this ip, no matter which of the two shards i log into, it loads my gm account on the first created server. (so its still pulling info from the initial server, it even has added custom scripts - and it should be blank)

if i try to use my normal ip for network 192.168.1.116, once i enter password and enter for login, it freezes. (image)

(also, the server load has all this jacked up html code, for trying to find my ip address, i just want it on a local network)
Login_Network IP.png
 
I've used the above script in the past to run 2 servers on one computer and have them in a common shard list on login. It works. But there is an additional issue with it (which I never even attempted to solve).

Let's say you have shard 1 and 2. Shard 1 is handling the login and forwarding players onto shard 2 if they select it from the shard list. But the account is created on shard 1, now once you pick shard 2, the account information isn't there and the process halts. IIRC this process will only work if the account exists on both shards and has the same password on both shards.

So if someone creates a new account, then selects shard 2, the login info doesn't exist and the process will halt.

You would need some process where the login data is checked on shard 2, if the account doesn't exist, it is created, and then the player logs directly into the character screen from there. However it has additional problems: what happens if someone uses the port of shard 2 to log directly into that one? What happens if someone changes their account password on one of the shards? The changes are not shared between the two shards, and can lead to the passwords conflicting between the two, making it impossible to log into one of them through the shard list screen. So unless I'm missing something, there needs to be a rewrite of how accounting is handled for this to work effectively.
 
Last edited:
I've used the above script in the past to run 2 servers on one computer and have them in a common shard list on login. It works. But there is an additional issue with it (which I never even attempted to solve).

Let's say you have shard 1 and 2. Shard 1 is handling the login and forwarding players onto shard 2 if they select it from the shard list. But the account is created on shard 1, now once you pick shard 2, the account information isn't there and the process halts. IIRC this process will only work if the account exists on both shards and has the same password on both shards.

So if someone creates a new account, then selects shard 2, the login info doesn't exist and the process will halt.

You would need some process where the login data is checked on shard 2, if the account doesn't exist, it is created, and then the player logs directly into the character screen from there. However it has additional problems: what happens if someone uses the port of shard 2 to log directly into that one? What happens if someone changes their account password on one of the shards? The changes are not shared between the two shards, and can lead to the passwords conflicting between the two, making it impossible to log into one of them through the shard list screen. So unless I'm missing something, there needs to be a rewrite of how accounting is handled for this to work effectively.
This is why you need a central account database, that both servers connect to. Zippy released this a really long time ago, not even sure it still works, but essentially this would solve that issue (http://www.runuo.com/community/threads/mysql-php-account-management.487386/). You can see my comment on that page about how it has a SQL Injection vulnerability, so you would have to fix that, but you can just use this as an example of how sql account management would work.
 
Thanks for the feedback all - I have this shard for my family at home to play, and a couple friends from time to time, that is my only purpose. Its fun, but very new at the modification bit. I think at this point, im better off just having a second server to test stuff in, when needed. I want to experiment with custom maps, and was thinking this would be a method to prevent screwing it all up. Seems i have achieved the opposite.

Thanks again
 
if your running a live shard and a test shard 1 needs to be on a different port I run 2 a tester and a live and have 6 ports forwarded for everthing to connect in both and be separate 1 is Neshobas World(liveshard) listening on port 2593 UOA is listening on 2394 ,,, other is a tester(testshard) listening on 2595 uao on port 2596 not sure if this will help much as I am running on JustUo
 
if your running a live shard and a test shard 1 needs to be on a different port I run 2 a tester and a live and have 6 ports forwarded for everthing to connect in both and be separate 1 is Neshobas World(liveshard) listening on port 2593 UOA is listening on 2394 ,,, other is a tester(testshard) listening on 2595 uao on port 2596 not sure if this will help much as I am running on JustUo
I just have 2 test shards and so for test1 I have on port 2593 but no matter what I try to do I can't seem to get the test2 to listen to any other port. oh and just to be clear I have each test shard running on their own virtual machine so the UO server files are completely isolated from each other unless they are connected through a script file like the one posted above.
 
Last edited:
Code:
scripts
Failed with: 1 errors, 0 warnings                    
Errors:                      
+ Misc/ServerList.cs:
  CS1729: Line 412: The type `Server.Network.CharacterList' does not contain a
constructor that takes `2' arguments                        
Scripts: One or more scripts failed to compile or no script files were found.
...??

Code:
state.Send(new CharacterList(state.Account, state.CityInfo));

//state.Send(new CharacterList(state.Account, state.CityInfo));
state.Send(new CharacterList(state.Account, state.CityInfo, state.IsEnhancedClient));
 
This is why you need a central account database, that both servers connect to. Zippy released this a really long time ago, not even sure it still works, but essentially this would solve that issue (http://www.runuo.com/community/threads/mysql-php-account-management.487386/). You can see my comment on that page about how it has a SQL Injection vulnerability, so you would have to fix that, but you can just use this as an example of how sql account management would work.
Run UO is not responding. Can you post the file for those of us with that problem?
 
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.
 
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: 63
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: 23
  • ServerList.cs
    20.2 KB · Views: 20
  • SocketOptions.cs
    1.4 KB · Views: 21
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 :)
 
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.

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
 
Last edited:
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
Back