summaryrefslogtreecommitdiff
path: root/src/account-server/main-account.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-02-03Modifications to allow crosscompiling with mingwErik Schilling1-0/+4
Reviewed-by: bjorn.
2012-08-05Cleaned up some world state variable testing codeThorbjørn Lindeijer1-10/+2
Kept the accountserver_startup time for now, since it could be useful. Reviewed-by: Stefan Beller
2012-05-05Added debugging mode to the protocolThorbjørn Lindeijer1-0/+3
Allows inspection of message data. It is off by default since it consumes additional bandwidth, but it can be turned on using the net_debugMode option in manaserv.xml. Currently the option only affects outgoing data for each host individually. In particular, enabling this debug mode for the server does not automatically make the client annotate its messages. Reviewed-by: Erik Schilling
2012-03-13Fixed problems with map-bound world state variablesThorbjørn Lindeijer1-2/+4
Due to a wrong primary key, which covered only the state name, it was impossible to use the same state name on different maps. This has now been fixed. Another problem was that the map variables were being included in the global variables, because the related database query did not filter on the map_id column properly. While fixing that, the map_id column now allows explicitly marking a state variable as global (with the value 0) or system variables (with the value -1). System variables are currently not accessible from scripts, but that could be changed later. Reviewed-by: Yohann Ferreira Reviewed-by: Erik Schilling
2011-11-07Small cleanups in utils::TimerThorbjørn Lindeijer1-0/+3
* Not nice to pass boolean parameter to constructor for preventing the timer from running on creation. Just call 'start' on it explicitly. * getTimeInMillisec could be made static. Reviewed-by: Yohann Ferreira
2011-11-01Have one place where the Configuration is initializedThorbjørn Lindeijer1-44/+12
Also, removed the fallback to the standard config file path when a config file path is specified on the command line. Surely that's not what you would want to happen. Reviewed-by: Yohann Ferreira
2011-10-19Merge branch 'master' of github.com:mana/manaservYohann Ferreira1-18/+1
Conflicts: src/game-server/accountconnection.cpp
2011-10-19Have one place where the Logger is initializedThorbjørn Lindeijer1-18/+1
log_accountToStandardOutput and log_gameToStandardOutput have been merged together as log_toStandardOutput. Reviewed-by: Yohann Ferreira
2011-08-30Made the db version an official pre-requisite.Yohann Ferreira1-2/+3
It was uneasy to not miss something when updating the db. And as the db version is somewhat corresponding to a certain protocol version, adding it in the protocol file sounds relevant to me, and helps when updating it.
2011-03-20Moved defines.h and manaserv_protocol.h into 'common'Thorbjørn Lindeijer1-2/+2
Just seems a bit more organized to me.
2011-03-17Micro-optimizations related to std::stringThorbjørn Lindeijer1-1/+1
* Rely on the fact that a std::string is empty by default * Use std::string::empty() rather than comparing to "" * Construct with std::string() rather than from "" Reviewed-by: Bertram
2011-02-21Remove obsolete reset of SIGSEGV handlingStefan Dombrowski1-3/+0
Reviewed-by: Thorbjorn
2011-02-19Removing dublicate deinitialize of enetStefan Dombrowski1-3/+0
Both servers deinitialize enet now from deinitializeServer(). Reviewed-by: Bertram, Jaxad0127
2011-02-16Removing unused variable configPathChangedStefan Dombrowski1-3/+0
2011-01-26Add an heartbeat time flag in the statistics file.Yohann Ferreira1-2/+13
This way, any kind of external service can know about the running state of each servers, even if only the account server is updating the statistics because: 1. When the account server is running, each <gameserver> tag is a running game server. Otherwise, it's not listed. 2. Whenever the account server stops running, the stat file isn't updated anymore and so the <heartbeat> tag isn't. 3. Game servers without any contact with an account server will try to reconnect to the account server and kick out every players so they aren't considered as running in that case. Reviewed-by: Crush. Resolves: Mana-mantis #270.
2011-01-11Made the servers report their protocol version.Yohann Ferreira1-0/+4
As the protocol version isn't something the maintainers should set, I removed the net_clientVersion irrelevant option, replaced by the corresponding define PROTOCOL_VERSION in the manaserv_protocol.h file. A corresponding change in the client will be made. N.B.: Now, the Enet version is also reported in the log. Reviewed-by: Jaxad.
2010-12-16Deharcoded the host and port options for each servers.Yohann Ferreira1-5/+20
Changes: ============================================================ For the account server: ------------------------------------------------------------ Old -> New ------------------------------------------------------------ net_accountServerAddress, net_listenHost -> net_accountHost net_accountServerPort -> net_accountListenToClientPort net_accountServerPort +1 -> net_accountListenToGamePort For the game server: ------------------------------------------------------------ Old -> New ------------------------------------------------------------ net_gameServerAddress -> net_gameHost net_gameServerPort -> net_gameListenToClientPort For the chat server: ------------------------------------------------------------ Old -> New ------------------------------------------------------------ -> net_chatHost net_accountServerPort + 2 -> net_chatListenToClientPort Special fallback feature, as requested by Freeyorp: When the net_accountListenToClientPort (default to 9601) is set, the 3 others ports will automatically offset from it, if they're not set, following this rule: net_accountListenToGamePort = net_accountListenToClientPort + 1 net_chatListenToClientPort = net_accountListenToClientPort + 2 net_gameListenToClientPort = net_accountListenToClientPort + 3 Resolves: Mana-Mantis #216. Reviewed-by: Jaxad0127.
2010-11-14Renamed .hpp files into .h for consistency.Yohann Ferreira1-13/+13
Also added an header to the autoattack.{h,cpp} files. Big but trivial fix.
2010-10-20Fixed the append behaviour of logger::setLogFile().Yohann Ferreira1-1/+1
Also made both servers appends on the main log at start if they aren't empty. This permits not to lose the previous logs when quicky restarting the servers. Trivial fix.
2010-09-29Add log file rotation support based on ExceptionFault's work.Yohann Ferreira1-0/+10
This patch adds options to enable log rotations base on files size and or change of date. Note: Zip support will be added in a second commit. Reviewed-by: CodyMartin, Thorbjorn.
2010-09-22Added options to disable the server log to standard output to the minimum.Yohann Ferreira1-10/+13
Also made some small cleanups. Resolves: Mana-Mantis #241 Reviewed-by: Jaxad0127.
2010-09-22Centralized the servers' exit values.Yohann Ferreira1-7/+8
Also made random code format clean-ups. Resolves: Mana-Mantis #217 Reviewed-by: Jaxad0127.
2010-09-07Added config options to set stats and log files and paths.Yohann Ferreira1-18/+24
Also turned the absence of an inter-server password into a fatal error while documenting it in the manaserv.xml example file. Reviewed-by: Jaxad0127.
2010-08-31Added a --config manaserv.xml file path options to both servers.Yohann Ferreira1-24/+69
Now, it's possible to set a different config filename and path on the command line. Reviewed-by: Jaxad, Kage.
2010-08-29Merge branch 'testing'Freeyorp1-4/+6
Conflicts: src/account-server/storage.cpp src/game-server/being.cpp src/game-server/being.hpp src/game-server/character.cpp src/game-server/character.hpp src/game-server/gamehandler.cpp src/game-server/inventory.cpp src/scripting/lua.cpp src/sql/mysql/createTables.sql src/sql/sqlite/createTables.sql
2010-08-22Changed the location of configuration, logs and statsThorbjørn Lindeijer1-45/+13
Instead of searching for the configuration file in ~/.manaserv.xml, the file is now expected to be in the working directory of the server. The logs and statistics will also be written there. This should make it easier to run differently configured servers on the same machine, and should also be a bit more straight-forward to setup. Reviewed-by: Yohann Ferreira
2010-08-02Changed the stat file name to attributes.xml.Yohann Ferreira1-4/+6
I also made it required to start properly since it's now the case. Reviewed-by: Jaxad0127.
2010-05-29Made the logLevel be taken from configuration for both servers.Yohann Ferreira1-27/+38
The new parameters in the manaserv.xml file can be used to do so: log_accountServerLogLevel log_gameServerLogLevel Also, updated the sample manaserv.xml accordingly. Reviewed-by: Thorbjorn.
2010-05-28Added some more log infos, and made small cleanups.Yohann Ferreira1-0/+5
Reviewed-by: Thorbjorn, Jaxad0127
2010-05-16Changed and split up the default location for loading dataThorbjørn Lindeijer1-21/+12
Instead of loading data from a 'data' directory in the current working directory, the server now uses clientDataPath and serverDataPath as specified in the configuration. This removes the need to set up symbolic links in order to merge these two types of data. The default values point to example/clientdata and example/serverdata, where a minimal example world can be developed to make setting up an initial server quick and easy. The XML::Document convenience class was copied over from the client. Also, the ResourceManager is now shared between both servers, since the account client is reading items.xml. Reviewed-by: Jared Adams
2010-02-07Update Copyright date for Manaserv.Bertram1-1/+1
2010-01-29Rename enum elements to avoid clashing with macrosBernd Wachter1-1/+1
2009-12-06Renamed DALStorage to StorageThorbjørn Lindeijer1-3/+3
The only reason it was a DALStorage was because it used to implement the Storage interface, but that interface got removed a long time ago.
2009-12-06Fixed name of the project in copyright headersThorbjørn Lindeijer1-14/+14
Also updated the headers to refer to the GPL by URL instead of suggesting to contact the FSF by snail mail, as per the latest GPL usage instructions.
2009-10-24Rebranding tmwserv to manaservThorbjørn Lindeijer1-4/+4
Includes a database update. Use update_6_to_7.sql to update existing sqlite databases.
2009-10-17Also close gracefully on receiving the TERM signalThorbjørn Lindeijer1-0/+1
Probably the most important signal to handle gracefully...
2009-10-07Added a warning to accountserver when using the default inter-server password.Philipp Sehmisch1-0/+7
2009-05-24Stopped tmwserv from writing to its configuration fileBjørn Lindeijer1-26/+41
This was confusing, since changes made to the config file while the server is running are lost once the server exists. Also, XML comments were being stripped by the server. The command line option to set the port now only applies to a single run, and isn't saved in the configuration. There shouldn't be a need for the server to write to its configuration file, it might not even have the rights to do so.
2009-05-24Made it possible to specify the host to listen onBjørn Lindeijer1-3/+4
Needed when the server has multiple network interfaces and the one you want to use isn't the default one for localhost. The host to listen on can be set in config file with 'net_listenHost'.
2009-02-24Forgot two config key renames and a little style fixPhilipp Sehmisch1-1/+1
2008-12-12Fixed game server crash and code styleBjørn Lindeijer1-2/+2
The game server crashed when it was closed while it still hadn't been able to connect to the account server, due to an uninitialized pointer. Code style fixes. Don't use 'const' for arguments that are passed by value and start variable names with lowercase.
2008-11-21Added bandwidth monitor to account server. Fixes compile errors.David Athay1-0/+7
2008-11-16Got rid of CVS/Subversion $Id$ markersBjørn Lindeijer1-2/+0
2008-11-15Properly handle exceptions when opening databaseBjørn Lindeijer1-4/+8
It was throwing a std::string but nobody was dealing with it. The actual problem still needs to be fixed. It seems to be having problems with getting some database version.
2008-09-19Added post communication between chat and game servers.David Athay1-0/+7
2008-09-15* Added doxygen file, docu will be generated under docs/api/htmlAndreas Habel1-0/+13
* Added table definition "tmw_world_states" to store map and world-specific variables * Extended DALStorage to set and get those new variables * Applied Kess's diff file from mantis #424 with modifications for PostgreSQL support
2008-08-28Added checking for expired bans.David Athay1-0/+3
2008-04-23Updated documentation a bit.Bjørn Lindeijer1-1/+0
2008-03-05Fixed guild creation.David Athay1-1/+2
2008-03-04Changed Makefile.am so server now builds, added initialising guild managerDavid Athay1-1/+3