It is currently 16 Apr 2024, 18:10
   
Text Size

How to set up a (public) XMage server

by BetaSteward

Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins

How to set up a (public) XMage server

Postby LevelX » 22 Oct 2014, 18:52

This post shall help you to setup a server running the Xmage server application. As far as we know it’s neccessary that the server has a fixed IP adress. If you want to have it work behine a NAT/Router setup there are some hints near the end of this guide.

Which software has to be installed on the server

Java Runtime Environment JRE (bets most up to date java 8 version - Java 7 was only supported until 1.4.15v5)
Linux install example:
Code: Select all
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

XMage Server
Copy the Xmage server directory to the server (you use an FTP application for this or download and unpack it from XMage.info).
Linux directory: (e.g. to ../usr/game/mage-server1/ )

cpulimit (optional on Linux systems)
Used to limit the CPU resources the Xmage server process can assign. That can help in cases the XMage sever process runs into a bug that loops through code and tries to use all available CPU resources. Some providers of VPS don't like this and deactive servers that do that over a longer time. (http://cpulimit.sourceforge.net/).


How to configure the XMage server
There are mainly three files that control the server and also the command line parameter of the Java / XMage server start. All are included in the release and can be used nearly without a change to run a public server. The IP in config.xml is the only thing that has to be set to be able to start the server. Other parameters have only to be changed to size the server depending on the number of users that will use it or to configure special rules (e.g. like the allowed length of the user name or which formats are allowed to play on the server).

config.xml
This is the file that configures the most things for the server.
- located in the config sub directory of the XMage directory.

You can control a lot of network parameters but also which formats are allowed. Also if the usage of AI players is allowed.

serverAddress
The ip adress of the XMage server. Set it only to "0.0.0.0" for a local host with private use. If the server ought to be used from the internet set here the IP the server can be addressed.
serverName
The name of the server (I have to check where this is used).
port the port the primary server socket is bound to
secondaryBindPort
The port to which the secondary server socket is to be bound. if "-1" is set , an arbitrary port is selected. So if you don't want to open all ports set it to a fixed value.
backlogSize
The preferred number of unaccepted incoming connections allowed at a given time. The actual number may be greater than the specified backlog. When the queue is full, further connection requests are rejected. The JBoss default value is 200.
numAcceptThreads
The number of threads listening on the ServerSocket. The JBoss default value is 1.
maxPoolSize
The maximum number of ServerThreads that can exist at any given time. The JBoss default value is 300
leasePeriod
To turn on server side connection failure detection of remoting clients, it is necessary to satisfy two criteria. The first is that the client lease period is set and is a value greater than 0. The value is represented in milliseconds. The client lease period can be set by either the 'clientLeasePeriod' attribute within the Connector configuration or by calling the Connector method
maxGameThreads (default 10)
Number of games that can run simultanously on the server. If all threads are used, the game will wait at game start until another game ends to start. The CPU load of games is not very high. So this value can easily set to 40 games without a problem. Higer CPU load can sometimes happen from bugs, if e.g. exceptions get created in loops. But that's a different thing.
maxSecondsIdle (default=600)
Number of seconds after that a game is auto conceded by the player that was idle for such a time.
minUserNameLength
Minimal allowed length of a user name to connect to the server
maxUserNameLength
Maximal allowed length of a user name to connect to the server
userNamePattern pattern for user name validity check
maxAiOpponents
The number of allowed AI players on the server that can be used to create a tournament.
saveGameActivated
Activates game save and replay options (this is not working correctly yet, so don't set this to true).

Tag: player types Controls which player types are available on the server. Currently exist three different player types:
Human - I guess it's clear which kind of player this is :wink:.
Computer - draftbot - This kind of player can only draft cards in a draft tournament. It will quit the tournament as soon as the draft phase ends.
Computer - mad - This is the AI player type of XMage (not very smart as we know). On a public server that will server a lot of human players I recommend to deactivate this player type. He produces a lot of CPU load and will raise the probability of bugs that harm the functions of the XMage server.


This example is how the config.xml of the public server 1 is currently set:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Config.xsd">
     <server
            serverAddress="[IP ADRESS OF YOUR SERVER]"
            serverName="mage-server"
            port="17171"
            secondaryBindPort="17179"             
            backlogSize="800"
            numAcceptThreads="4"
            maxPoolSize="1000"
            leasePeriod="12000"                         
            maxGameThreads="40"
            maxSecondsIdle="600" 
            minUserNameLength="3"
            maxUserNameLength="14"
            userNamePattern="[^a-z0-9_]"
            maxAiOpponents="2"
            saveGameActivated="false"/>
    <playerTypes>
        <playerType name="Human" jar="mage-player-human-1.3.0.jar" className="mage.player.human.HumanPlayer"/>
        <playerType name="Computer - draftbot" jar="mage-player-ai-draftbot-1.3.0.jar" className="mage.player.ai.ComputerDraftPlayer"/>
<!-- don't activate this player type if you proved a public server that shall handle as much as possible human players
        <playerType name="Computer - mad" jar="mage-player-ai-ma.jar" className="mage.player.ai.ComputerPlayer7"/>
 -->
    </playerTypes>
    <gameTypes>
        <gameType name="Two Player Duel" jar="mage-game-twoplayerduel-1.3.0.jar" className="mage.game.TwoPlayerMatch" typeName="mage.game.TwoPlayerDuelType"/>
        <gameType name="Free For All" jar="mage-game-freeforall-1.3.0.jar" className="mage.game.FreeForAllMatch" typeName="mage.game.FreeForAllType"/>
        <!-- -->
        <gameType name="Commander Two Player Duel" jar="mage-game-commanderduel-1.3.0.jar" className="mage.game.CommanderDuelMatch" typeName="mage.game.CommanderDuelType"/>
        <gameType name="Commander Free For All" jar="mage-game-commanderfreeforall-1.3.0.jar" className="mage.game.CommanderFreeForAllMatch" typeName="mage.game.CommanderFreeForAllType"/>
        <!-- -->
    </gameTypes>
    <tournamentTypes>
        <tournamentType name="Constructed Elimination" jar="mage-tournament-constructed-1.3.0.jar" className="mage.tournament.ConstructedEliminationTournament" typeName="mage.tournament.ConstructedEliminationTournamentType"/>
        <tournamentType name="Constructed Swiss" jar="mage-tournament-constructed-1.3.0.jar" className="mage.tournament.ConstructedSwissTournament" typeName="mage.tournament.ConstructedSwissTournamentType"/>       
        <tournamentType name="Booster Draft Elimination" jar="mage-tournament-boosterdraft-1.3.0.jar" className="mage.tournament.BoosterDraftEliminationTournament" typeName="mage.tournament.BoosterDraftEliminationTournamentType"/>
        <tournamentType name="Booster Draft Elimination (Cube)" jar="mage-tournament-boosterdraft-1.3.0.jar" className="mage.tournament.BoosterDraftEliminationTournament" typeName="mage.tournament.BoosterDraftEliminationCubeTournamentType"/>
        <tournamentType name="Booster Draft Swiss" jar="mage-tournament-boosterdraft-1.3.0.jar" className="mage.tournament.BoosterDraftSwissTournament" typeName="mage.tournament.BoosterDraftSwissTournamentType"/>
        <tournamentType name="Booster Draft Swiss (Cube)" jar="mage-tournament-boosterdraft-1.3.0.jar" className="mage.tournament.BoosterDraftSwissTournament" typeName="mage.tournament.BoosterDraftSwissCubeTournamentType"/>
        <tournamentType name="Sealed Elimination" jar="mage-tournament-sealed-1.3.0.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationTournamentType"/>
        <tournamentType name="Sealed Elimination (Cube)" jar="mage-tournament-sealed-1.3.0.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationCubeTournamentType"/>
        <tournamentType name="Sealed Swiss" jar="mage-tournament-sealed-1.3.0.jar" className="mage.tournament.SealedSwissTournament" typeName="mage.tournament.SealedSwissTournamentType"/>
        <tournamentType name="Sealed Swiss (Cube)" jar="mage-tournament-sealed-1.3.0.jar" className="mage.tournament.SealedSwissTournament" typeName="mage.tournament.SealedSwissCubeTournamentType"/>
    </tournamentTypes>
    <draftCubes>
        <draftCube name="MTGO Holiday Cube 2013" jar="mage-tournament-booster-draft-1.3.0.jar" className="mage.tournament.cubes.HolidayCube2013"/>
        <draftCube name="MTGO Cube March 2014" jar="mage-tournament-booster-draft-1.3.0.jar" className="mage.tournament.cubes.MTGOMarchCube2014"/>
        <draftCube name="Cube Tutor 360 Pauper" jar="mage-tournament-booster-draft-1.3.0.jar" className="mage.tournament.cubes.CubeTutor360Pauper"/>
        <draftCube name="Cube Tutor 720" jar="mage-tournament-booster-draft-1.3.0.jar" className="mage.tournament.cubes.CubeTutor720"/>
        <draftCube name="Mono Blue Cube" jar="mage-tournament-booster-draft-1.3.0.jar" className="mage.tournament.cubes.MonoBlueCube"/>
    </draftCubes>
    <deckTypes>
        <deckType name="Constructed - Standard" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.Standard"/>
        <deckType name="Constructed - Extended" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.Extended"/>
        <deckType name="Constructed - Modern" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.Modern"/>
        <deckType name="Constructed - Vintage" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.Vintage"/>
        <deckType name="Constructed - Legacy" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.Legacy"/>
        <deckType name="Constructed - Pauper" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.Pauper"/>               
        <deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.InnistradBlock"/>
        <deckType name="Block Constructed - Kamigawa" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.KamigawaBlock"/>
        <deckType name="Block Constructed - Khans of Tarkir" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.KhansOfTarkirBlock"/>
        <deckType name="Block Constructed - Return to Ravnica" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.ReturnToRavnicaBlock"/>
        <deckType name="Block Constructed - Scars of Mirrodin" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.ScarsOfMirrodinBlock"/>
        <deckType name="Block Constructed - Shadowmoor" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.ShadowmoorBlock"/>
        <deckType name="Block Constructed - Shards of Alara" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.ShardsOfAlaraBlock"/>
        <deckType name="Block Constructed - Theros" jar="mage-deck-constructed.jar" className="mage.deck.TherosBlock"/>
        <deckType name="Block Constructed - Zendikar" jar="mage-deck-constructed-1.3.0.jar" className="mage.deck.ZendikarBlock"/>
        <!-- -->
        <deckType name="Variant Magic - Commander" jar="mage-deck-constructed.jar" className="mage.deck.Commander"/>
        <!-- -->
        <deckType name="Limited" jar="mage-deck-limited-1.3.0.jar" className="mage.deck.Limited"/>
    </deckTypes>
</config>


log4j.properties
This file controls what will be logged to the XMage log files. Xmage uses log4j to create the logs.
The file is located in the "config" sub directory.
This example causes XMage to log all messages from level info and above.
The here used appender creates for every past day a renamed separate file. So the single file does not get too big depending on the logging level. The log can help to better identify problems or fix existing bugs.

Code: Select all
#default levels (possible TRACE, DEBUG, INFO, WARN, ERROR and FATAL)
# Here you set the default level to info and the appender to use
log4j.rootLogger=info, RollingAppender
log4j.logger.com.j256.ormlite=warn

# You can control if the log level should be changed for certain areas
# If for example the classes located in 'mage.server' package should log on debug level uncomment this line
#log4j.logger.mage.server=debug

log4j.appender.RollingAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.RollingAppender.File=mageserver.log
log4j.appender.RollingAppender.DatePattern='.'yyyy-MM-dd
log4j.appender.RollingAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.RollingAppender.layout.ConversionPattern=[%p] %d %c %M - %m%n
log4j.appender.RollingAppender.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M%n


server.msg.txt
This file contains some text lines that will be shown in the info line at the button of the xmage window. It’s a simple text file and each line is used as textline to display. The lines can be switched manually with the “Next” button at the start of the line. But is also switched automatically to the next line after some time.


Some tips and tools to install the XMage server application on a Linux server

Cron jobs
A way under Linux to restart the XMage server process periodical.
Example file of two XMage server processes running on one server that are restarted once a day. Therefore the scripts mage-server1 and mage-server2 are used (see point Control scripts).
Located on the server: ../etc/cron.d/
Name: mageserver (or what ever you like)

Code: Select all
# m h dom mon dow user   command
0   7 *   *   *   root  [ -x /etc/init.d/mage-server1 ] && /etc/init.d/mage-server1 restart
0  19 *   *   *   root  [ -x /etc/init.d/mage-server2 ] && /etc/init.d/mage-server2 restart


Control script
A script to stop, start or restart the XMage server process on your server. This script will be used by the cron table for restarts or can also be used manually to control the server.
Located: in the etc/init.d directory.
Name: mage-server1
It also includes the memory sizes for the java virtual machine.
In this example the sized are set to large values and the server should be able to run more than 100 users and 50 games (without AI players) at the same time. So if your server servers less players/games you can also reduce this sizes.
You can start with values like this "-Xms512M -Xmx1024M -XX:MaxPermSize=256m". It can handle also more than 50 users.

Code: Select all
#!/bin/sh

### BEGIN INIT INFO
# Provides:          mage-server1
# Required-Start:    $local_fs $all apache2
# Required-Stop:
# Default-Start:     2
# Default-Stop:
# Short-Description: MTG Server
### END INIT INFO

case "$1" in
    start)
    base=/usr/games/mage-server1
    cd $base
    /usr/bin/cpulimit -l 50 -- \
        /usr/bin/java \
        -Xms1024M -Xmx2048M -XX:MaxPermSize=512m \
        -Djava.security.policy=./config/security.policy \
        -Djava.util.logging.config.file=./config/logging.config \
        -Dlog4j.configuration=file:./config/log4j.properties \
        -jar $base/lib/mage-server-1.3.0.jar \
        -adminPassword=[yourAdminPW] >/dev/null 2>/dev/null &
    ;;
    stop)
        pkill -f "/usr/bin/java.*"${base}"/lib/mage-server-"
     ;;
    restart)
    $0 stop
    sleep 1
    $0 start
    ;;
esac


Server startup
Also it's useful to start the XMage server process automatically as the server itself will be restarted.


Why is it currently a good idea to restart the XMage server process from time to time
There are different reasons that can harm the performance and the proveded services of the XMage server. Mostly caused by existing bugs that lead to cpu/memory/network load that reduces or prevents the availability of the server. Here are the most common problems that currently can happen. We're trying to fix this problems in the future but it will need for sure some more time.
1) Sometimes game threads are blocked because of occured bugs. You define the maximal number of game threads your server provides in the config.xml. If a game hangs, one of this game threads is blocked. You can see it in the head line of the user list. There is the number of active games shown. If the number of active threads is different it's shown behind like "5 (T:7 - limit 10)". That means 5 active games but 7 threads are used and max 10 threads are allowed. So 2 threads are not available in this situation.
2) Somtimes created tables hang in different states and pollute the list of waiting or active games. They stay fixed and only a server restart or a remove request from server console can fix that most of the time.
3) Sometimes the user handling has problems and users won't get removed from the list of users. You see it by the time they are disconnected in the list of users. This should be at maximum -1:00 minute. If it gets more negative, something in the user handling is blocked. Most of the time this resolves over time (it's caused by locked threads, multithreading can sometimes a tricky beast).
4) Sometimes a game gets mad and is running in a loop giving the server additional cpu load. Often this is only for a limited time span, but sometimes it seems to run infinite. I guess it depends from the different causes for this.
5) There are probably some memory leaks, so that memory usage will raise over time. Also this is a good reason to restart the server.


If you have any questions while trying to run your own (public) server don't hestitate to post the question here. If you think some information is missing here please let us know.
Have fun.



Running the server behind a NAT-like setup
1) get a domain name and point it to your public IP
2) On your server host, edit /etc/hosts to have the domain name point to your local ip
3) Forward the appropriate ports (e.g. 17171 and 17172)
4) in your config, set serverAddress to the domain name
5) connect using the domain name (if you're on the local network, you'll need to add the same entry to your /etc/hosts)

Thanks to bedlamp for checking and testing this out.

How much network traffic will be produced
Here you see an example about the network traffic from a server with over the day between 60 - 250 users online:
ServerTraffic.jpg
User avatar
LevelX
DEVELOPER
 
Posts: 1677
Joined: 08 Dec 2011, 15:08
Has thanked: 174 times
Been thanked: 374 times

Re: How to set up a (public) XMage server

Postby woogerboy21 » 22 Oct 2014, 20:08

What issue have you seen or troubleshooting steps have you taken for machines behind nat's? Java isn't doing the actual network communication and rely's on tcp/ip so I would expect that if your behind a nat you would need to properly port forward all the necessary ports to the machine internally to the nat.

I'm also seeing this when I attempt to fire the server up. Any idea's? Do you need JBoss installed along with java?
| Open
Code: Select all
INFO  2014-10-22 17:27:20,090 Starting MAGE server version 1.3.0dev2014-10-18                                            =>[main] Main.main
INFO  2014-10-22 17:27:20,103 Logging level: INFO                                                                        =>[main] Main.main
INFO  2014-10-22 17:27:20,103 Loading cards...                                                                           =>[main] Main.main
org.h2.jdbc.JdbcSQLException: IO Exception: "java.net.UnknownHostException: xmage.localhost.localdomain: xmage.localhost.localdomain: Name or service not known" [90028-178]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
....
Problem solved. If anyone is curious here is the solution:
| Open
Code: Select all
It seems that InetAddress.getLocalHost() ignores the /etc/resolv.conf but only looks at the /etc/hosts file (where I hadn't specified anything besides localhost). Adding the IP and hostname to this file solves the problem and the exception is gone.
User avatar
woogerboy21
HQ Team Member
 
Posts: 1136
Joined: 19 Jul 2009, 00:15
Location: USA
Has thanked: 21 times
Been thanked: 152 times

Re: How to set up a (public) XMage server

Postby woogerboy21 » 22 Oct 2014, 21:56

I also noticed in your sample startup commands that you define a password. Is there any type of guide that explains the administration functionality of the server?

Can anyone running a server give any advice to the upkeep / administration involved?
User avatar
woogerboy21
HQ Team Member
 
Posts: 1136
Joined: 19 Jul 2009, 00:15
Location: USA
Has thanked: 21 times
Been thanked: 152 times

The XMage server console

Postby LevelX » 22 Oct 2014, 22:38

It exists a server console with which you can sign on to the server and see the users and the tables.
It's sometimes useful to kill hanging tables to clear up the list of tables. But I guess it's functionality could/should be more imporoved in the future.

Overall you're not forced to do that. It's currently more cosmetic to handle still existing bugs. So I would prefer to fix the bugs.

Also you could send a message to all users on the server with the console.

The console is not provided with the release yet. It has to be added in the future. It can be started currently from IDE.

The password to connect to the XMage server as admin has to be defined as a parameter to the XMage server application start command.

Here's a screenshot how it looks connected to a XMage server:
Console.jpg
User avatar
LevelX
DEVELOPER
 
Posts: 1677
Joined: 08 Dec 2011, 15:08
Has thanked: 174 times
Been thanked: 374 times

Re: How to set up a (public) XMage server

Postby woogerboy21 » 23 Oct 2014, 19:21

Is there any information on logging options? Is the default enabled to show everything or is there a way to increase/decrease logging information?

Also, is the console you have pictured above available anywere in .jar form to simply run?
User avatar
woogerboy21
HQ Team Member
 
Posts: 1136
Joined: 19 Jul 2009, 00:15
Location: USA
Has thanked: 21 times
Been thanked: 152 times

Re: How to set up a (public) XMage server

Postby LevelX » 23 Oct 2014, 19:44

woogerboy21 wrote:Is there any information on logging options? Is the default enabled to show everything or is there a way to increase/decrease logging information?
I will tomorrow add information to the main post about how to control the logging. It's very flexible.

woogerboy21 wrote:Also, is the console you have pictured above available anywere in .jar form to simply run?
Not yet. I will try to add it to the next release. Currently you can only start it with the IDE. To add it to the release makes a lot of sense.
User avatar
LevelX
DEVELOPER
 
Posts: 1677
Joined: 08 Dec 2011, 15:08
Has thanked: 174 times
Been thanked: 374 times

Re: How to set up a (public) XMage server

Postby b4mb4m » 01 Nov 2014, 03:06

hi guys i try to create a server, and i create a domain in no-ip 'cause i dont have a fix ip here. and i do de config equal the example but when a start the server is failed,
and i dont know how it is problem. u guys can help me?
10xxx
b4mb4m
 
Posts: 4
Joined: 25 Jun 2012, 14:35
Has thanked: 0 time
Been thanked: 0 time

Re: How to set up a (public) XMage server

Postby LevelX » 01 Nov 2014, 11:32

b4mb4m wrote:hi guys i try to create a server, and i create a domain in no-ip 'cause i dont have a fix ip here. and i do de config equal the example but when a start the server is failed,
and i dont know how it is problem. u guys can help me?
10xxx
Probably not. Did you read the first sentence of post 1?
And please post exact error message you get.
User avatar
LevelX
DEVELOPER
 
Posts: 1677
Joined: 08 Dec 2011, 15:08
Has thanked: 174 times
Been thanked: 374 times

Re: How to set up a (public) XMage server

Postby b4mb4m » 02 Nov 2014, 00:15

LevelX wrote:
b4mb4m wrote:hi guys i try to create a server, and i create a domain in no-ip 'cause i dont have a fix ip here. and i do de config equal the example but when a start the server is failed,
and i dont know how it is problem. u guys can help me?
10xxx
Probably not. Did you read the first sentence of post 1?
And please post exact error message you get.
Sorry, follow the erro
i create a net a release the port 17171 to 17179
folow the two pics
http://nsae01.casimages.net/img/2014/11/02/141102011223277430.png
http://nsae01.casimages.net/img/2014/11/02/141102011224941184.png

www(dot)casimages(dot)com(dot)br / i/ 141102011223277430.png.html
www(dot)casimages(dot)com(dot)br / i / 141102011224941184.png.html
b4mb4m
 
Posts: 4
Joined: 25 Jun 2012, 14:35
Has thanked: 0 time
Been thanked: 0 time

Re: How to set up a (public) XMage server

Postby HammerFoe » 22 Jan 2015, 06:49

Hey all, love Xmage! I am trying to start my own server so my friends can connect and we can play on it. I changed the IP in the config file to my IP, and I forwarded the port on my router. I get this error message, which I don't understand. Can anyone help me figure out why the server won't start? Thanks!

Oh and I turned my firewall off... So i dunno...

INFO 2015-01-21 22:47:26,443 Starting MAGE server version 1.3.0dev2014-11-29v9 =>[main] Main.main
INFO 2015-01-21 22:47:26,445 Logging level: INFO =>[main] Main.main
INFO 2015-01-21 22:47:26,445 Loading cards... =>[main] Main.main
INFO 2015-01-21 22:47:36,807 Done. =>[main] Main.main
INFO 2015-01-21 22:47:36,994 Config - max seconds idle: 600 =>[main] Main.main
INFO 2015-01-21 22:47:36,994 Config - max game threads: 10 =>[main] Main.main
INFO 2015-01-21 22:47:36,995 Config - max AI opponents: 15 =>[main] Main.main
INFO 2015-01-21 22:47:36,995 Config - min user name l.: 3 =>[main] Main.main
INFO 2015-01-21 22:47:36,995 Config - max user name l.: 14 =>[main] Main.main
INFO 2015-01-21 22:47:36,996 Config - save game active: false =>[main] Main.main
INFO 2015-01-21 22:47:36,996 Config - backlog size : 200 =>[main] Main.main
INFO 2015-01-21 22:47:36,996 Config - lease period : 5000 =>[main] Main.main
INFO 2015-01-21 22:47:36,996 Config - max pool size : 300 =>[main] Main.main
INFO 2015-01-21 22:47:36,997 Config - num accp.threads: 2 =>[main] Main.main
INFO 2015-01-21 22:47:36,997 Config - second.bind port: -1 =>[main] Main.main
FATAL 2015-01-21 22:48:40,107 Failed to start server - 71.237.225.195:17171/?serializationtype=jboss&maxPoolSize=300 =>[main] Main.main
java.io.IOException: SocketServerInvoker[71.237.225.195:17171] error creating ServerSocket[71.237.225.195:17171]: Cannot assign requested address: JVM_Bind
at org.jboss.remoting.transport.socket.SocketServerInvoker.createServerSockets(SocketServerInvoker.java:375)
at org.jboss.remoting.transport.socket.SocketServerInvoker.start(SocketServerInvoker.java:251)
at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.start(BisocketServerInvoker.java:193)
at org.jboss.remoting.transport.Connector.start(Connector.java:376)
at org.jboss.remoting.transporter.TransporterServer.start(TransporterServer.java:198)
at mage.server.Main.main(Main.java:159)
HammerFoe
 
Posts: 1
Joined: 22 Jan 2015, 06:46
Has thanked: 0 time
Been thanked: 0 time

Re: How to set up a (public) XMage server

Postby LevelX » 22 Jan 2015, 10:40

HammerFoe wrote:Hey all, love Xmage! I am trying to start my own server so my friends can connect and we can play on it. I changed the IP in the config file to my IP, and I forwarded the port on my router. I get this error message, which I don't understand. Can anyone help me figure out why the server won't start? Thanks!
Behind a router I can't help you. At least I never got it to work. (read first sentence of first post in this thread).

I don't know if it's impossible but you probably need to be a network specialist.
User avatar
LevelX
DEVELOPER
 
Posts: 1677
Joined: 08 Dec 2011, 15:08
Has thanked: 174 times
Been thanked: 374 times

Re: How to set up a (public) XMage server

Postby bedlamp » 22 Jan 2015, 21:09

I managed to get it working on a NAT-like setup (linux)

The method appears to be:
1) get a domain name and point it to your public IP
2) On your server host, edit /etc/hosts to have the domain name point to your local ip
3) Forward the appropriate ports
4) in your config, set serverAddress to the domain name
5) connect using the domain name (if you're on the local network, you'll need to add the same entry to your /etc/hosts)

YMMV
bedlamp
 
Posts: 2
Joined: 22 Jan 2015, 20:57
Has thanked: 0 time
Been thanked: 2 times

Re: How to set up a (public) XMage server

Postby LevelX » 23 Jan 2015, 00:09

bedlamp wrote:I managed to get it working on a NAT-like setup (linux)

The method appears to be:
1) get a domain name and point it to your public IP
2) On your server host, edit /etc/hosts to have the domain name point to your local ip
3) Forward the appropriate ports
4) in your config, set serverAddress to the domain name
5) connect using the domain name (if you're on the local network, you'll need to add the same entry to your /etc/hosts)

YMMV
Thanks for you answer.
A question related to point 3), I guess you only forwarded the primary and secondary bindary port and you did set the secondary port to a fixed value?
User avatar
LevelX
DEVELOPER
 
Posts: 1677
Joined: 08 Dec 2011, 15:08
Has thanked: 174 times
Been thanked: 374 times

Re: How to set up a (public) XMage server

Postby bedlamp » 23 Jan 2015, 15:58

LevelX wrote:Thanks for you answer.
A question related to point 3), I guess you only forwarded the primary and secondary bindary port and you did set the secondary port to a fixed value?
Correct. I just bound the secondary port to 17172 and forwarded both
bedlamp
 
Posts: 2
Joined: 22 Jan 2015, 20:57
Has thanked: 0 time
Been thanked: 2 times

Re: How to set up a (public) XMage server

Postby felipejoys » 28 Jan 2015, 22:43

bedlamp wrote:I managed to get it working on a NAT-like setup (linux)

The method appears to be:
1) get a domain name and point it to your public IP
2) On your server host, edit /etc/hosts to have the domain name point to your local ip
3) Forward the appropriate ports
4) in your config, set serverAddress to the domain name
5) connect using the domain name (if you're on the local network, you'll need to add the same entry to your /etc/hosts)

YMMV
I can confirm this works.
felipejoys
 
Posts: 4
Joined: 15 Sep 2014, 01:05
Has thanked: 2 times
Been thanked: 1 time

Next

Return to XMage

Who is online

Users browsing this forum: Baidu [Spider] and 42 guests


Who is online

In total there are 43 users online :: 1 registered, 0 hidden and 42 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: Baidu [Spider] and 42 guests

Login Form