Network overhaul
Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins
Network overhaul
by BetaSteward » 19 Aug 2015, 18:25
Hi XMage Team,
I am finally done with the initial development for the network overhaul. I think that I have gotten most of the existing functionality working using Netty. I have run some tests simulating network outages and it seems to handle brief outages with no loss. Extended outages will disconnect the client and then will resume existing games on reconnect.
However I don't feel entirely confident in releasing the changes to the public just yet so it might be a good idea to setup a beta test server so that adventurous players can take a crack at breaking it. If anyone has a spare server to host the beta that would be great.
There are still a few outstanding pieces such as:
expanding the test coverage
finish work on the server console
finish the load testing pieces
BetaSteward
I am finally done with the initial development for the network overhaul. I think that I have gotten most of the existing functionality working using Netty. I have run some tests simulating network outages and it seems to handle brief outages with no loss. Extended outages will disconnect the client and then will resume existing games on reconnect.
However I don't feel entirely confident in releasing the changes to the public just yet so it might be a good idea to setup a beta test server so that adventurous players can take a crack at breaking it. If anyone has a spare server to host the beta that would be great.
There are still a few outstanding pieces such as:
expanding the test coverage
finish work on the server console
finish the load testing pieces
BetaSteward
- BetaSteward
- DEVELOPER
- Posts: 129
- Joined: 28 Mar 2010, 13:15
- Has thanked: 6 times
- Been thanked: 29 times
Re: Network overhaul
by LevelX » 20 Aug 2015, 06:29
Hi BetaSteward,
that are great news. Thanks for your outstanding work.
Is the user identification by UUID we talked about in the past already included? So that a user disconnected by a provider because of IP change will be able to reconnect to previous XMage games?
I can install the xmage netty version to the old xmage.info1 (it's still in the server list, not fast and not connection reliable but that should be a good environment to test the reconnect feature).
I'm going to do this later today and will then also post links to use this version with a special launcher xmage home.
LevelX
that are great news. Thanks for your outstanding work.
Is the user identification by UUID we talked about in the past already included? So that a user disconnected by a provider because of IP change will be able to reconnect to previous XMage games?
I can install the xmage netty version to the old xmage.info1 (it's still in the server list, not fast and not connection reliable but that should be a good environment to test the reconnect feature).
I'm going to do this later today and will then also post links to use this version with a special launcher xmage home.
LevelX
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Network overhaul
by LevelX » 20 Aug 2015, 07:13
Mage Server Tests project seems to have some issues during build.
Maybe you can have a look.
Maybe you can have a look.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Network overhaul
by BetaSteward » 20 Aug 2015, 12:40
I think the problem with the Server Test project is not the build but that the tests are failing. The test suite first starts up a server and then attempts to connect a client to it. I needed to have the server start up within a known amount of time so I used the "-fastDbMode=true" setting.
I now remember that I had to copy over a card database so that the test deck that the client uses could be loaded by the server. I guess I could include a card database in the repo since the tests will run with a known set of cards. I'm cloning the repo right now to a new directory to verify that the missing db is the problem.
Regarding the user UUID: I tried to make as few changes as possible to the existing logic so no I haven't included this change. Once the build has stabilized and we are confident that it is working reliably I can start making broader changes.
I now remember that I had to copy over a card database so that the test deck that the client uses could be loaded by the server. I guess I could include a card database in the repo since the tests will run with a known set of cards. I'm cloning the repo right now to a new directory to verify that the missing db is the problem.
Regarding the user UUID: I tried to make as few changes as possible to the existing logic so no I haven't included this change. Once the build has stabilized and we are confident that it is working reliably I can start making broader changes.
- BetaSteward
- DEVELOPER
- Posts: 129
- Joined: 28 Mar 2010, 13:15
- Has thanked: 6 times
- Been thanked: 29 times
Re: Network overhaul
by LevelX » 20 Aug 2015, 15:48
What about the config.xml settings for this version?
Are there any added config settings for netty?
Or is there a new file to handle this?
Still used I guess:
serverAddress="0.0.0.0"
serverName="mage-server"
port="17171"
No longer needed and can be removed?
secondaryBindPort="-1"
backlogSize="200"
numAcceptThreads="2"
maxPoolSize="300"
leasePeriod="5000"
maxGameThreads="10"
maxSecondsIdle="600"
New setting:
useSSL="true"
Are there any added config settings for netty?
Or is there a new file to handle this?
Still used I guess:
serverAddress="0.0.0.0"
serverName="mage-server"
port="17171"
No longer needed and can be removed?
secondaryBindPort="-1"
backlogSize="200"
numAcceptThreads="2"
maxPoolSize="300"
leasePeriod="5000"
maxGameThreads="10"
maxSecondsIdle="600"
New setting:
useSSL="true"
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Network overhaul
by BetaSteward » 20 Aug 2015, 18:40
The config.xml at Mage.Server/release/config is working for me. I think it should be fine on another server as well.
You are correct that there are several settings that can now be removed. The only new one added was (as you identified) "useSSL".
Netty really doesn't require very many parameters to function. In fact it just requires a port #. But I also added the useSSL parameter so that encryption can be turned on/off.
If we find that encryption is causing too much overhead it can be switched off easily.
I tested with a fresh clone and the Server Tests project did fail during the test phase. It looks like I didn't update pom.xml with the latest version. So it was running against old versions on my machine.
You are correct that there are several settings that can now be removed. The only new one added was (as you identified) "useSSL".
Netty really doesn't require very many parameters to function. In fact it just requires a port #. But I also added the useSSL parameter so that encryption can be turned on/off.
If we find that encryption is causing too much overhead it can be switched off easily.
I tested with a fresh clone and the Server Tests project did fail during the test phase. It looks like I didn't update pom.xml with the latest version. So it was running against old versions on my machine.
- BetaSteward
- DEVELOPER
- Posts: 129
- Joined: 28 Mar 2010, 13:15
- Has thanked: 6 times
- Been thanked: 29 times
Re: Network overhaul
by BetaSteward » 20 Aug 2015, 19:34
Fixed the Server Test project. In addition to the old version I added some code to monitor the server log for a startup message before attempting to connect. This way the server has plenty of time to load cards.
- BetaSteward
- DEVELOPER
- Posts: 129
- Joined: 28 Mar 2010, 13:15
- Has thanked: 6 times
- Been thanked: 29 times
Re: Network overhaul
by LevelX » 20 Aug 2015, 21:02
The xmage server with the updated network code is online now.
Server: 176.31.186.181:17171
It's also in the list of servers (xmage.info).
To download the netty version use this link:
http://bit.ly/xmage_1_4_4a1w
Or use the xmage launcher with this xmage home setting to update/install the related version on your system:
http://xmage.de/xmage1.4.4a1
Server: 176.31.186.181:17171
It's also in the list of servers (xmage.info).
To download the netty version use this link:
http://bit.ly/xmage_1_4_4a1w
Or use the xmage launcher with this xmage home setting to update/install the related version on your system:
http://xmage.de/xmage1.4.4a1
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Network overhaul
by LevelX » 20 Aug 2015, 21:50
One bug I found:
The server version the client is connected to will not be shown in the client title bar.
LevelX: Fixed this in network branch
The server version the client is connected to will not be shown in the client title bar.
- DoesNotShowServerVersionInTitleLine.jpg (10.06 KiB) Viewed 4285 times
LevelX: Fixed this in network branch
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Network overhaul
by LevelX » 20 Aug 2015, 21:55
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Network overhaul
by LevelX » 21 Aug 2015, 07:15
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Network overhaul
by Simown » 22 Aug 2015, 17:35
Great work BetaSteward, thank you for doing it. Refactoring the network code can't have been that easy.
Hopefully I'll get some time to test out the build with this server version over the weekend.
Hopefully I'll get some time to test out the build with this server version over the weekend.
~Simown
Re: Network overhaul
by BetaSteward » 26 Aug 2015, 12:17
Thanks everyone for taking the time to test the network upgrade changes. I believe that I have resolved all the issues found so far.
I also added a load test that fires up a server and then connects 200 clients. It handled it without blinking an eye. Although this is a very simple load test it is encouraging. I will try to setup a few more load tests today.
If anyone else finds any additional issues please let me know.
Thanks,
BetaSteward
I also added a load test that fires up a server and then connects 200 clients. It handled it without blinking an eye. Although this is a very simple load test it is encouraging. I will try to setup a few more load tests today.
If anyone else finds any additional issues please let me know.
Thanks,
BetaSteward
- BetaSteward
- DEVELOPER
- Posts: 129
- Joined: 28 Mar 2010, 13:15
- Has thanked: 6 times
- Been thanked: 29 times
Re: Network overhaul
by LevelX » 26 Aug 2015, 15:22
In your branch still some changes from the master are missing.
E.g. line 116 of mage/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java what for example prevents to create a tournament in the network overhaul version.
cbSkillLevel.setModel(new DefaultComboBoxModel(SkillLevel.values()));
I guess it's cuased from a merging mistake?
Can you merge the missing statements/changes from the master branch?
I do not dare to do such things with git because I know I probably be lost very soon.
LevelX: Fixed this in network branch
E.g. line 116 of mage/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java what for example prevents to create a tournament in the network overhaul version.
cbSkillLevel.setModel(new DefaultComboBoxModel(SkillLevel.values()));
I guess it's cuased from a merging mistake?
Can you merge the missing statements/changes from the master branch?
I do not dare to do such things with git because I know I probably be lost very soon.
LevelX: Fixed this in network branch
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
Re: Network overhaul
by LevelX » 27 Aug 2015, 14:19
Another problem:
The cards database of the client will no longer be updated from the server.
The updateDatabase method moved from Session to MageFrame.
The class names were taken from the server before to check which card names are missing in client database.
Class names have to be fetched again from the server.
The cards database of the client will no longer be updated from the server.
The updateDatabase method moved from Session to MageFrame.
The class names were taken from the server before to check which card names are missing in client database.
- Code: Select all
List<String> classNames = CardRepository.instance.getClassNames();
Class names have to be fetched again from the server.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
29 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 4 guests