Development of Manasource and anything else related to the Mana Project.
#129894 by vatarus
Mon Jan 14, 2013 3:31 am
I think that it will help someone.

1. Install Git:
sudo apt-get install git
2. Install dependencies:
sudo apt-get install libsigc++-2.0-dev libxml2-dev liblua5.1-0-dev libphysfs-dev libsqlite3-dev zlib1g-dev
3. Install cmake:
sudo apt-get install cmake
4. Install build-essential:
sudo apt-get install build-essential
5. Install SQLite3:
sudo apt-get install sqlite3
6. Copy sourcecode from Git:
git clone git:// manaserv
7. Compile manaserv:
cmake .
make install
8. Setup database:
sqlite3 mana.db < ${ManaServ-dir}/src/sql/sqlite/createTables.sql
9. Configure the configuration file (manaserv.xml):
sudo nano {manaserv.xml-dir}manaserv.xml
10. Сreate and start script for run manaserv:
sudo touch RunServer
sudo nano RunServer
Code: Select all#!/bin/bash

sudo chmod +x RunServer
bash RunServer

Best regards,
#129896 by Ablu
Mon Jan 14, 2013 5:02 am
You can find further infos there:

But your script is not going to work. It will start the accountserver, wait until it shuts down some when and then starts the gameserver.
Either just starts both servers by hand, use a script wich starts them in screen or start then with & behind the executable to execute them in the background.

You also run the server as root. You should not do this. It is perfectly fine to run it as any local user.

#135720 by Ablu
Thu Jun 13, 2013 8:45 am
Siegfried wrote:In the howto for compiling on linux, in installing dependencies, there are 3 dependencies missing:
libsqlite3-dev lua5.1 lua5.1-dev

I hope, that's all :)

Yeah. The depedencies listed there are for the mana client. I will try to make it more clear this evening. Thanks for pointing out.

EDIT: Well if you talk about this forum thread there is nothing i can do of course :) I talk about
#136019 by Siegfried
Mon Jun 24, 2013 4:59 am
well, yes, i'm speaking of exactly this, too. On it says:

Code: Select allsudo apt-get install build-essential libcurl4-openssl-dev libguichan-dev libphysfs-dev libpng12-dev libpthread-stubs0-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev libxml2-dev zlib1g-dev libsdl-gfx1.2-dev

The 3 dependencies mentioned are missing here :)


Another question. I'm trying to set up a nlocal server. I downloaded and compiled. So far so good. Starting the account server gives nothing unusual. But starting the game server repeatedly spits out an error message in log file:

Code: Select all[ERR] Could not find callback for update function!

It is impossible to connect to the server.

The client log shows some interesting entries. The first remarkable part is this:
Code: Select all[06:21:56.49] Initializing SDL...
[06:21:56.50] Adding to PhysicsFS: /usr/share/games/manaplus/data/perserver/default (prepend)
[06:21:56.50] Adding to PhysicsFS: /usr/share/games/manaplus/data (prepend)
[06:21:56.50] Adding to PhysicsFS: data (prepend)
[06:21:56.50] Error: File not found

Which data directory is expected? Where do i get it from?

Code: Select all[06:21:56.83] State: CHOOSE SERVER
[06:21:56.83] Removing from PhysicsFS: /home/siegfried/.local/share/mana//local/
[06:21:56.83] Error: No such entry in search path

There is a '/' too much in the name.

Code: Select all[06:21:56.94] init 2
[06:21:56.94] Couldn't open configuration file:
[06:21:56.94] Network::Connecting to localhost:6901
[06:21:56.94] Configuration::write() writing configuration...
[06:21:56.94] Error in TcpNet::open(): Couldn't connect to remote host
[06:21:56.94] Network error: Couldn't connect to remote host
[06:21:56.94] State: CONNECT SERVER
[06:21:56.94] Window::Window("")
[06:21:56.94] Loaded /usr/share/games/manaplus/data/graphics/gui/window.xml
[06:21:56.95] can't find client data translation
[06:21:56.95] loading lang: de, file: help/de
[06:21:56.95] Loaded /usr/share/games/manaplus/data/translations/help/de.po
[06:21:56.97] Window::~Window("")
[06:21:56.97] Configuration::write() writing configuration...
[06:21:56.97] State: ERROR
[06:21:56.97] Error: Couldn't connect to remote host

Here we have the first communication problem. Everything is on tha same machine, and netstat -uan says (among others):

Code: Select allProto Recv-Q Send-Q Local Address           Foreign Address         State     
udp        0      0*                         
udp        0      0*                         
udp        0      0*                         
udp        0      0  *                         

So the servers are listening on the standard ports.

The remainder in hthe log file is just about outputting the error message. So what could be the reason? It obviously has something to do with something called "update function". And that may be related to something called client data. So how to solve this?

Regards and thanks,
#136020 by Ablu
Mon Jun 24, 2013 6:15 am
The missing update function most likely means that loading the default script library failed. Manaserv is unable to find this library if you do not install manaserv or you do not run the executable within the manaserv directory.

So either run make install (it will install the script library to /usr/local/share/manaserv/scripts/ by default) or run the manaserv executable in the repository root directory of manaserv (you can use --config <path> to set the path to your manaserv.xml). Manaserv is first looking for the scripts/lua/ directory in the current working directory and then in <prefix>/share/manaserv/.

However this does not explain why you cannot connect with your client.

The log snippet that you posted includes some manaplus paths. Are you trying to use manaplus? The manaserv git only works with the latest mana git (or daily build).

#136034 by Siegfried
Tue Jun 25, 2013 7:43 am
O.k., make install solved the problem with the not found hook. But still it is impossible to connect to the server. I tried both mana and manaplus. The server log reports the connect, and that was all. I'll try to get some more logs.

O.k., here is the account server log
Code: Select all[10:45:31] [INF] Using log file: /home/siegfried/log/manaserv-account.log
[10:45:31] [INF] Using statistics file: /home/siegfried/log/manaserv.stats
[10:45:31] [INF] Trying to connect with SQLite database file '/home/siegfried/prj/manaserv/example/mana.db'
[10:45:31] [INF] Connection to database successful.
[10:45:31] [INF] The Mana Account+Chat Server v0.1.0.0
[10:45:31] [INF] Manaserv Protocol version 3, Enet version 1.3.3, Database version 21
[10:45:31] [DBG] Character start points: 100 (Min: 1, Max: 20)
[10:45:31] [INF] Account handler started:
[10:45:31] [INF] Listening on port 9601...
[10:45:31] [INF] Loading map reference: maps.xml
[10:45:31] [INF] Game server handler started:
[10:45:31] [INF] Listening on port 9602...
[10:45:31] [INF] Chat handler started:
[10:45:31] [INF] Listening on port 9603...
[10:45:31] [DBG] Performing SQL query: UPDATE mana_world_states   SET value = '1372149931',        moddate = '1372149931'  WHERE state_name = 'accountserver_startup' AND map_id = '-1';
[10:45:32] [INF] A new client connected from to port 9602
[10:45:32] [DBG] Received message 0x0500 (41 B) from
[10:45:32] [INF] Game server uses itemsdatabase with version 0
[10:45:32] [DBG] Item databases between account server and gameserver are in sync
[10:45:32] [DBG] Preparing SQL statement: SELECT `state_name`, `value` FROM mana_world_states WHERE `map_id` = ?
[10:45:32] [DBG] Sending message 0x0501 (6 B) to
[10:45:32] [INF] Game server localhost:9604 asks for maps to activate.
[10:45:32] [DBG] Issued server example(localhost:9604) to enable map 1
[10:45:32] [DBG] Preparing SQL statement: SELECT `state_name`, `value` FROM mana_world_states WHERE `map_id` = ?
[10:45:32] [DBG] Performing SQL query: SELECT * FROM mana_floor_items WHERE map_id = 1
[10:45:32] [DBG] Sending message 0x0502 (8 B) to
[10:46:01] [DBG] Performing SQL query: update mana_accounts set level = 1, banned = 0 where level = 0 AND banned <= 1372149961;
[10:46:02] [DBG] Received message 0x0560 (10 B) from
[10:46:31] [DBG] Performing SQL query: update mana_accounts set level = 1, banned = 0 where level = 0 AND banned <= 1372149991;
[10:46:32] [DBG] Received message 0x0560 (10 B) from
[10:47:02] [DBG] Performing SQL query: update mana_accounts set level = 1, banned = 0 where level = 0 AND banned <= 1372150022;
[10:47:02] [DBG] Received message 0x0560 (10 B) from
[10:47:31] [DBG] Performing SQL query: update mana_accounts set level = 1, banned = 0 where level = 0 AND banned <= 1372150051;
[10:47:32] [DBG] Received message 0x0560 (10 B) from
[10:48:02] [DBG] Performing SQL query: update mana_accounts set level = 1, banned = 0 where level = 0 AND banned <= 1372150082;
[10:48:02] [DBG] Received message 0x0560 (10 B) from
[10:48:31] [DBG] Performing SQL query: update mana_accounts set level = 1, banned = 0 where level = 0 AND banned <= 1372150111;
[10:48:32] [DBG] Received message 0x0560 (10 B) from

As can be seen there is some communication between client and server. But still the client says "could not connect to server" and aborts.

Is it possible to get a log file from mana client, too? The help does not say so.
#136035 by Ablu
Tue Jun 25, 2013 8:00 am
The client you see connecting is most likely your gameserver.

You need to use the latest master of the mana client for manaserv. And you need to make sure that the server type is manaserv. Check this by connecting to (it is in the serverlist as "Source of Tales"). Manaplus will not work.

The client log is in ~/.local/share/mana/mana.log.

#136037 by Siegfried
Tue Jun 25, 2013 11:33 am
Testing server works. Connecting to my local server does still not work. I had a typo in the configuration, corrected it, but still no connect. Here is the mana.log snippet:

Code: Select all[12:26:00.57] State: CONNECT SERVER
[12:26:00.57] Network::Connecting to
[12:26:00.57] Window::Window("")
[12:26:00.57] Error in SDLNet_TCP_Open(): Couldn't connect to remote host
[12:26:00.57] Network error: Couldn't connect to remote host

netstat -uan gives:
Code: Select alludp        0      0*                         
udp        0      0*                         
udp        0      0*                         
udp        0      0  *                         

So the server is listening.

The servers are listening on udp only. Does SDLNet_TCP_Open use udp protocol? May this be related to some "update" function, downloading client data? What should be configured for a local installation?

P.S. i checked the account server log and found this older entry:
Code: Select all[10:45:32] [INF] A new client connected from to port 9602

This was the client. I know this because here we still have the typo in the port number. Interestingly i did the same typo in the configuration as well as in the client configuration :) So it seems the client at least _tried_ to connect.
#136081 by Siegfried
Thu Jun 27, 2013 3:08 pm
Don't worry about time :) This is a project i've scheduled for december this year. I do not have much time currently, so projects like these have to have lowest priority.

But this weekend i can post my configuration.

O.k. then, here ist the configuration. I deleted the comments to not flood the forum with unnecessary text, and of course changed the pw :)
Code: Select all<?xml version="1.0"?>
<option name="sqlite_database" value="/home/siegfried/prj/manaserv/example/mana.db"/>
<option name="worldDataPath" value="/home/siegfried/prj/manaserv/example" />

 <option name="log_statisticsFile" value="/home/siegfried/log/manaserv.stats"/>
 <option name="log_accountServerFile" value="/home/siegfried/log/manaserv-account.log"/>
 <option name="log_gameServerFile" value="/home/siegfried/log/manaserv-game.log"/>

 <option name="log_gameServerLogLevel" value="4"/>
 <option name="log_accountServerLogLevel" value="4"/>

 <option name="log_enableRotation" value="true"/>
 <option name="log_maxFileSize" value="1024"/>
 <option name="log_perDay" value="true"/>
 <option name="log_toStandardOutput" value="false"/>

 <option name="net_password" value="password"/>

 <option name="net_accountHost" value="localhost"/>
 <option name="net_accountListenToClientPort" value="6901"/>
 <option name="net_accountListenToGamePort" value="6902"/>

 <option name="net_chatHost" value="localhost"/>
 <option name="net_chatListenToClientPort" value="6903"/>
 <option name="net_gameHost" value="localhost"/>
 <option name="net_gameListenToClientPort" value="6904"/>
 <option name="net_gameServerName" value="example" />

 <option name="net_defaultUpdateHost" value="file:///home/siegfried/prj/manaserv/example" />

 <option name="net_clientDataUrl" value="" />

 <option name="net_maxClients" value="10"/>

 <option name="net_debugMode" value="false"/>

 <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" />
 <option name="account_maxGuildsPerCharacter" value="1" />

 <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" />

 <option name="char_startMap" value="1"/>
 <option name="char_startX" value="1024"/>
 <option name="char_startY" value="1024"/>

 <option name="char_respawnMap" value="1"/>
 <option name="char_respawnX" value="1024"/>
 <option name="char_respawnY" value="1024"/>

 <option name="char_defaultMap" value="1" />

 <option name="game_visualRange" value="448"/>
 <option name="game_floorItemDecayTime" value="0" />

 <option name="game_hpRegenBreakAfterHit" value="10" />

 <option name="game_defaultPvp" value="none" />

 <option name="command_defaultMuteLength" value="60" />

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

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

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


Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest