Unable to create an ENet Server.

Ask for help regarding any technical issue or report any bug or OS independent issues.
User avatar
visaboy
Peon
Peon
Posts: 29
Joined: 09 Jan 2011, 06:19

Unable to create an ENet Server.

Post by visaboy »

Greetings,

I compiled the manaserv from the repository given in the manasource.org documentation and the accountserver.exe runs fine when the host is set to "localhost" inside manaserv.xml.

But when I change localhost to an IP or Domain, the accountserver.exe doesn't open and shows the error of:
[23:05:52] [INF] Using log file: logs/accounts/server1-account.log
[23:05:52] [INF] Using statistics file: logs/manaserv.stats
[23:05:52] [INF] Trying to connect with mySQL database server 'localhost:3306' using 'xxxx' as user, and 'xxxx' as database.
[23:05:52] [INF] Connection to mySQL was sucessfull.
[23:05:52] [INF] The Mana Account+Chat Server v1st milestone
[23:05:52] [INF] Manaserv Protocol version 1, Enet version 1.3.2, Database version 18
[23:10:16] [INF] Unable to create ENet Server host.
manaserv.xml

Code: Select all

<?xml version="1.0"?>
<!--
	An example configuration file.

	Documentation: http://doc.manasource.org/manaserv.xml

	Developers:	If you add any new parameters read from this configuration file
	don't forget to update the wiki documentation!
-->
<configuration>

<!-- Database configuration ***************************************************
 Uncomment one of the following parts according to the database backend you
 would like to use.
-->

<!--
	SQLite specific configuration.

	sqlite_database:	name and path to the sqlite database file
						optional, default="mana.db"
-->
<!-- <option name="sqlite_database" value="mana.db"/> -->


<!--
	mySQL specific configuration.

	mysql_hostname:		ip or hostname of the database server
						optional, default="localhost"
	mysql_port:			the port where the mysql server listens to
						optional, default=3306
	mysql_database:		name of the installed database
						optional, default="mana"
	mysql_username:		name of the user to connect to the database server
						optional, default="mana"
	mysql_password:		password to use whith the mysql_username
						optional, default="mana"
-->

<option name="mysql_hostname" value="localhost"/>
<option name="mysql_port" value="3306"/>
<option name="mysql_database" value="xxxxxx"/>
<option name="mysql_username" value="xxxx"/>
<option name="mysql_password" value="xxxxx"/>



<!--
	PostgreSQL specific configuration.

	TODO!
-->

<!-- end of database configuration **************************************** -->

<!-- Paths configuration ******************************************************
 Set here the different paths used by both the server to find data.
-->
 <!-- Paths to data files -->
 <option name="serverPath" value="." />
 <option name="clientDataPath" value="clientdata" />
 <option name="serverDataPath" value="serverdata" />

<!-- end of paths configuration ******************************************* -->

<!-- Logs configuration *******************************************************
 Set here the different paths used by both the server
 to store statistics and log files.
-->

 <!--
 Log output configuration, relative to the folders where the servers were ran.
 -->
 <option name="log_statisticsFile" value="logs/manaserv.stats"/>
 <option name="log_accountServerFile" value="logs/accounts/server1-account.log"/>
 <option name="log_gameServerFile" value="logs/game/server1-game.log"/>

 <!--
 Log levels configuration.
 Available values are:
   0. Fatal Errors only.
   1. All Errors.
   2. Plus warnings.
   3. Plus standard information.
   4. Plus debugging information.
 -->
 <option name="log_gameServerLogLevel" value="2"/>
 <option name="log_accountServerLogLevel" value="2"/>

 <!--
 Enable log rotation when one log file reaches a max size
 and/or the current day has changed.
 -->
 <option name="log_enableRotation" value="false"/>
 <!--
 Set the max log file size. Disabled if set to 0.
 -->
 <option name="log_maxFileSize" value="1024"/>
 <!--
 Change the log file each day.
 -->
 <option name="log_perDay" value="true"/>
 
 <!--
 Set whether both servers will log also on the standard output.
 -->
 <option name="log_toStandardOutput" value="true"/>

<!-- end of logs configuration ****************************************** -->

<!-- Network options configuration ********************************************
 Set here the different network-related options to set up the servers
 hosts and ports, for instance.
-->

 <!--
 ATTENTION: This is a very important option!
 the net password is used to let the servers (game and account) speak to each
 other in a crypted way.
 This option is REQUIRED FOR THE SERVERS TO START.
 -->
 <option name="net_password" value="xxxxxxxx"/>

 <!--
 The game server uses this address to connect to the account server. Clients
 will also need to be able to connect to the account server through it.
 Don't use the 'localhost' value when running a public server,
 but rather the public name.

 The port options set the port to listen to clients and to game servers
 respectively.
 -->
 <option name="net_accountHost" value="localhost"/>
 <option name="net_accountListenToClientPort" value="9601"/>
 <option name="net_accountListenToGamePort" value="9602"/>

 <!--
 Host the chat server will listen to. Defaulted to 'localhost'.
 Don't use the 'localhost' value when running a public server,
 but rather the public name.
 -->
 <option name="net_chatHost" value="localhost"/>
 <option name="net_chatListenToClientPort" value="9603"/>

 <!--
 The clients use this address to connect to a game server on this machine.
 Don't use the 'localhost' value when running a public server,
 but rather the public name.
 -->
 <option name="net_gameHost" value="localhost"/>
 <option name="net_gameListenToClientPort" value="9604"/>

 <!--
 Update host url: E.g.: "http://updates.manasource.org/"
 It gives the http folder where the update files can be downloaded.
 -->
 <option name="net_defaultUpdateHost" value="" />

 <!--
 Client data url: E.g.: "http://data.manasource.org/"
 Example for local use: "file:///home/user/clientdata/"
 The base URL where the client will get its data from. This is a new update
 mechanism that replaces the update host, used by the Mana Mobile client.
 -->
 <option name="net_clientDataUrl" value="" />

 <!-- Max connected clients allowed. -->
 <option name="net_maxClients" value="1000"/>

<!-- end of network options configuration ********************************* -->

<!-- Accounts configuration ***************************************************
 Set here the different options related to players accounts
 and used at their creation.
-->

 <option name="account_allowRegister" value="1" />
 <option name="account_denyRegisterReason"
         value="The server administrator has disabled automatic registration!"/>
 <option name="account_minEmailLength" value="7" />
 <option name="account_maxEmailLength" value="128" />
 <option name="account_minNameLength" value="4" />
 <option name="account_maxNameLength" value="15" />
 <option name="account_minPasswordLength" value="6" />
 <option name="account_maxPasswordLength" value="25" />
 <option name="account_maxCharacters" value="3" />

<!-- end of accounts configuration **************************************** -->

<!-- Characters configuration *************************************************
 Set here the different options related to players characters.
-->

 <option name="char_numHairStyles" value="17" />
 <option name="char_numHairColors" value="11" />
 <option name="char_numGenders" value="2" />
 <option name="char_minNameLength" value="4" />
 <option name="char_maxNameLength" value="25" />

 <!--
 New player starting location. The map should be defined in data/maps.xml.
 -->
 <option name="char_startMap" value="1"/>
 <!--
     Respawn coordinates on the start map:
     In pixels, not in tiles.
 -->
 <option name="char_startX" value="1024"/>
 <option name="char_startY" value="1024"/>

 <!-- Respawn options -->
 <option name="char_respawnMap" value="1"/>
 <!--
     Respawn coordinates on the respawn map:
     In pixels, not in tiles.
 -->
 <option name="char_respawnX" value="1024"/>
 <option name="char_respawnY" value="1024"/>

 <!-- Default Map id at character loading -->
 <option name="char_defaultMap" value="1" />

<!-- end of characters configuration ************************************** -->

<!-- Game configuration *************************************************
 Set here the different options related to the gameplay.
-->

 <!--
 Set the player's character visual range around him in pixels.
 Monsters and other beings further than this value won't appear in its sight.
 -->
 <option name="game_visualRange" value="448"/>
 <!--
 The time in seconds an item standing on the floor will remain before vanishing.
 Set it to 0 to disable it.
 -->
 <option name="game_floorItemDecayTime" value="0" />

 <!--
 Set how much time the auto-regeneration is stopped when hurt.
 (in 1/10th seconds.)
 -->
 <option name="game_hpRegenBreakAfterHit" value="0" />

 <!--
 Default PVP (Player-versus-player) rule on a map not setting this property.
 Values available: none (No PVP), free (All PVP).
 -->
 <option name="game_defaultPvp" value="" />

<!-- end of game configuration ******************************************** -->

<!-- Commands configuration ***************************************************
 Set here the different options related to chat commands.
-->

 <!--
 Default mute command length (in seconds.)
 -->
 <option name="command_defaultMuteLength" value="60" />

<!-- end of commands configuration **************************************** -->

<!-- Chat configuration ***************************************************
 Set here the different options related to chat handling.
-->

 <option name="chat_maxChannelNameLength" value="15" />

 <!--
 TODO: Dehard-code those values, or redo the chat channeling system
 to not make use of them.
        MAX_PUBLIC_CHANNELS_RANGE  = 1000,
        MAX_PRIVATE_CHANNELS_RANGE = 10000,
        MAX_CHANNEL_ANNOUNCEMENT   = 150,
        MAX_CHANNEL_PASSWORD       = 12,
 -->

<!-- end of chat configuration ******************************************** -->

<!-- Mail configuration ***************************************************
 Set here the different options related to the mail system.
-->

 <option name="mail_maxAttachments" value="3" />
 <option name="mail_maxLetters" value="10" />

<!-- end of mail configuration ******************************************** -->

<!-- Scripting configuration ********************************************** -->

 <option name="script_defaultEngine" value="lua"/>
 <option name="script_mainFile" value="scripts/main.lua"/>

<!-- End of scripting configuration *************************************** -->

</configuration>
How can I fix this to get the server running with an IP address and/or a Domain?
“If it moves, fondle it - except porcupines, ball lightning, and policemen” :)
User avatar
visaboy
Peon
Peon
Posts: 29
Joined: 09 Jan 2011, 06:19

Re: Unable to create an ENet Server.

Post by visaboy »

Anyone here that can give some kind of advice?
“If it moves, fondle it - except porcupines, ball lightning, and policemen” :)
User avatar
yubabax116
Warrior
Warrior
Posts: 268
Joined: 05 Apr 2011, 21:20
Location: Elsewhere

Re: Unable to create an ENet Server.

Post by yubabax116 »

try going on irc on #tmw-support im sure there can be help given there for you :)
▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬
♩ ♪ ♫ ♬ ♭ ♮ ❤Quiet And Enj0:00Y The  Music ❤ ♩ ♪ ♫ ♬ ♭
Yubaba
Chicka-Maria
▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: Unable to create an ENet Server.

Post by o11c »

This would belong on irc.freenode.net #mana actually.
Former programmer for the TMWA server.
User avatar
visaboy
Peon
Peon
Posts: 29
Joined: 09 Jan 2011, 06:19

Re: Unable to create an ENet Server.

Post by visaboy »

Thank you, I will try that out now.
“If it moves, fondle it - except porcupines, ball lightning, and policemen” :)
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Unable to create an ENet Server.

Post by Crush »

I couldn't find any hostname or ip except localhost in the config file you posted. Are you sure you posted the right one?
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
visaboy
Peon
Peon
Posts: 29
Joined: 09 Jan 2011, 06:19

Re: Unable to create an ENet Server.

Post by visaboy »

Crush wrote:I couldn't find any hostname or ip except localhost in the config file you posted. Are you sure you posted the right one?
All I do is change "localhost" to my external home IP, and yes I have checked the port is not in use and also tried various port numbers as well.

Last night, o11c and and myself were in the IRC but couldn't fix it. Also debugged it and there's no errors coming up with the exception of:

Code: Select all

Building to ensure sources are up-to-date
Build succeeded
Selecting target: 
Windows (MySQL Support)
Adding source dir: E:\GAME_FILES\SERVER1\
Adding source dir: E:\GAME_FILES\SERVER1\
Adding file: accountserver.exe
Starting debugger: 
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.8
Child process PID: 1704
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Program exited with code 07.
Debugger finished with status 0
o11c said if there were no errors, it could be the loader? but I'm not really sure what he meant with it.

Any suggestion?
“If it moves, fondle it - except porcupines, ball lightning, and policemen” :)
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Unable to create an ENet Server.

Post by Crush »

visaboy wrote:All I do is change "localhost" to my external home IP
Are you behind a NAT router?
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
visaboy
Peon
Peon
Posts: 29
Joined: 09 Jan 2011, 06:19

Re: Unable to create an ENet Server.

Post by visaboy »

Crush wrote:
visaboy wrote:All I do is change "localhost" to my external home IP
Are you behind a NAT router?
Behind a router yes, but the ports are open.
Attachments
yup.png
yup.png (38.31 KiB) Viewed 5025 times
“If it moves, fondle it - except porcupines, ball lightning, and policemen” :)
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Unable to create an ENet Server.

Post by Crush »

visaboy wrote:Behind a router yes.
That could be the problem.

When you set Manaserv to use the outside IP of your router, it will try to bind to a network adapter with that IP address. But because the machine it runs on has no adapter with that address but only one with a LAN IP, it will fail to do so. You have to set it to an IP address assigned to the local machine.

I am not sure if it's even possible at the moment to run Manaserv behind a NAT and make it accessible to the outside. Maybe it could work when you run the gameserver and the accountserver with different config files where the own IP is the LAN IP and the IP of the other server is the external IP.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
visaboy
Peon
Peon
Posts: 29
Joined: 09 Jan 2011, 06:19

Re: Unable to create an ENet Server.

Post by visaboy »

Crush wrote:
visaboy wrote:Behind a router yes.
That could be the problem.

When you set Manaserv to use the outside IP of your router, it will try to bind to a network adapter with that IP address. But because the machine it runs on has no adapter with that address but only one with a LAN IP, it will fail to do so. You have to set it to an IP address assigned to the local machine.

I am not sure if it's even possible at the moment to run Manaserv behind a NAT and make it accessible to the outside. Maybe it could work when you run the gameserver and the accountserver with different config files where the own IP is the LAN IP and the IP of the other server is the external IP.
I tried launching the server outside of the router by connecting the machine directly to the internet and the problem still persists.

A few months ago being behind a router wasn't an issue as I was able to successfully open the account server and game server without issues and friends could connect.

What I have also noticed is when I set net_accountHost and/or net_chatHost to an external IP address, the account server crashes. But when I set net_gameHost to the external IP and leave net_accountHost and net_chatHost to localhost, the account server works but obviously can't connect remotely.

Hopefully that information can be useful.

I have tried using the same server files on windows 7 (64bit) and windows server 2008 (64bit), they are both different computers and the result is the same.
“If it moves, fondle it - except porcupines, ball lightning, and policemen” :)
User avatar
Bertram
Manasource
Manasource
Posts: 1026
Joined: 07 Sep 2004, 14:55
Location: France

Re: Unable to create an ENet Server.

Post by Bertram »

Hi,
But when I set net_gameHost to the external IP and leave net_accountHost and net_chatHost to localhost, the account server works but obviously can't connect remotely.
Taken from the doc:
http://doc.manasource.org/manaserv.xml
The IP or hostname the account server will listen to. Don't use the 'localhost' value when running a public server, but rather the public name or you won't be able to contact the game server when using MySQL for instance.
The localhost value won't work from outside in any case.
A few months ago being behind a router wasn't an issue as I was able to successfully open the account server and game server without issues and friends could connect.
--> Maybe you already found out how to fix it at the time.
What I have also noticed is when I set net_accountHost and/or net_chatHost to an external IP address, the account server crashes. But when I set net_gameHost to the external IP and leave net_accountHost and net_chatHost to localhost, the account server works but obviously can't connect remotely.
When you say it crashed, do you mean it can't setup an enet host instead or it really crashed?
When you put a public ip to the game server, does it "crash", too?
I am not sure if it's even possible at the moment to run Manaserv behind a NAT and make it accessible to the outside. Maybe it could work when you run the gameserver and the accountserver with different config files where the own IP is the LAN IP and the IP of the other server is the external IP.
I'm sure you can. You'll have at least to add a nat rule on the router telling to redirect external messages destined to the public ip with the given ports in use to the local computer ip actually running the servers. The servers should then listen to the router delivering the messages, as it would act as internet, or 'the clients' for them.

I will shortly re-run my local server publicly and open a page with the problems and the configuration I used, and post the link here. I hope it will help

Best regards,
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Unable to create an ENet Server.

Post by Crush »

Bertram wrote:
Crush wrote:I am not sure if it's even possible at the moment to run Manaserv behind a NAT and make it accessible to the outside. Maybe it could work when you run the gameserver and the accountserver with different config files where the own IP is the LAN IP and the IP of the other server is the external IP.
I'm sure you can. You'll have at least to add a nat rule on the router telling to redirect external messages destined to the public ip with the given ports in use to the local computer ip actually running the servers. The servers should then listen to the router delivering the messages, as it would act as internet, or 'the clients' for them.
The problem I anticipate is that the accountserver will report the wrong gameserver IP to the clients. When the gameserver connects to the accountserver via the private network, the accountserver might report the LAN IP of the gameserver to the client, which will be unusable for it.

This could be avoided by telling the gameserver to connect to the accountserver using the WAN IP. But the config key net_accountHost, which tells the gameserver to do this, is also used by the accountserver to determine the network interface it binds to. When this is the WAN IP, it will be "Unable to create an ENet Server".
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Bertram
Manasource
Manasource
Posts: 1026
Joined: 07 Sep 2004, 14:55
Location: France

Re: Unable to create an ENet Server.

Post by Bertram »

Hi,
The problem I anticipate is that the accountserver will report the wrong gameserver IP to the clients. When the gameserver connects to the accountserver via the private network, the accountserver might report the LAN IP of the gameserver to the client, which will be unusable for it.
Indeed. I'll have to figure out that anyway while doing the same thing.
Yet, visaboy didn't say whether the game server was able to start with a public ip.

Best regards,
User avatar
visaboy
Peon
Peon
Posts: 29
Joined: 09 Jan 2011, 06:19

Re: Unable to create an ENet Server.

Post by visaboy »

Bertram wrote:Hi,
The problem I anticipate is that the accountserver will report the wrong gameserver IP to the clients. When the gameserver connects to the accountserver via the private network, the accountserver might report the LAN IP of the gameserver to the client, which will be unusable for it.
Indeed. I'll have to figure out that anyway while doing the same thing.
Yet, visaboy didn't say whether the game server was able to start with a public ip.

Best regards,
Greetings,

The server is not able to start using a public IP, it only works when using localhost or the internal IP such as 192.168.0.xxx
I never got that error when I set up the server months ago and I'm still using the same internet.
“If it moves, fondle it - except porcupines, ball lightning, and policemen” :)
Post Reply