summaryrefslogtreecommitdiff
path: root/src/game-server/main-game.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-08-26Removed skillsErik Schilling1-2/+0
This removes support for skills. The plan is to allow to implement the skills as they were implemented before via attributes. This adds a lot more flexibility to the server creators while also removing the confusion about skills and attributes. So this change does: - Remove the skillmanager with all its calls, the skill xml file, etc - Move exp giving to the script engine: --> Allows to implement the old behaviour (and more) in the scripts - Remove the exp tag from the monster definition: + Since the server itself does not require it anymore it feels wrong to require it for EVERY monster. TODO: Add a system to add properties to the monsters/items.xml which allow defining things like the exp and allows to read the value from the script engine. + Small drawback, but it should not be hard to implement this property system. - Drop the level networking and calculation. + level calculation will happen via the attribute system later but i would prefer to do this in a seperate patch since this patch already got longer than expected especially since this requires to make setting correction points and available status points scriptable. + The level would be simply set as a attribute, the int number of it will be the level, the remaining digits will be the % number till the next levelup. - NOT remove any existing skill tables in the database update scripts. + There is no way to move them into the attribute table in a unified way (there are too many different way they could have been used). So server admins have to care about moving theirs skills to attributes themselves. + Keeping the old tables does not hurt for existing databases. So removing does not give any advantage/is required anyway. The now obsolote info about the EXP transaction is not removed for updated databases either. (The update script basically only bumps the version number without doing anything else. - bump the network protocol version --> old clients won't be able to connect. - bump the database version --> serveradmins need to update their db.
2013-08-26[Abilities] Renamed specials to abilitiesErik Schilling1-3/+3
2013-07-28Allow -v for setting verbosityErik Schilling1-2/+2
I am really bad at spelling verbosity :->
2013-05-03Maps are now configured in settings.xml tooPrzemysław Grzywacz1-5/+0
2013-04-29Single xml solutionPrzemysław Grzywacz1-13/+15
Mana-mantis: #506.
2013-04-27Use nullptr instead of NULL everywhereErik Schilling1-2/+2
2013-03-25Changed Item to a component of ActorThorbjørn Lindeijer1-1/+1
Items also have positions, so the ItemComponent only makes sense as part of an Actor. Later on it will probably be part of an entity that also has an ActorComponent. Since it was annoying to update all the places where items were created, I've introduced a function for this. The component types are now prefixed with "CT_" because I wanted to introduce an 'Item' namespace which would otherwise be conflicting. The component types enum isn't used much in the code so it can look a bit ugly. Reviewed-by: Yohann Ferreira
2013-02-24Added possibility to reserve mapsErik Schilling1-11/+1
If you set net_gameServerName you can now reserve maps in the maps.xml. There you have to add the servername - property to the <map> tag. Then the map will only be activated by that server. Also changed the activate sequence that the account server now tells the game server what maps to activate (previously the server requested all maps and the account server said yes or no). TODO: Fix general inter server map switching.
2013-02-03Modifications to allow crosscompiling with mingwErik Schilling1-0/+1
Reviewed-by: bjorn.
2013-02-01Added emote support.Yohann Ferreira1-0/+5
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-04-14Introduced a Timeout class for counting down without countingThorbjørn Lindeijer1-40/+42
The timeout remembers a reference point of time against which it can check how much time is remaining. Reviewed-by: Erik Schilling Reviewed-by: Yohann Ferreira
2012-04-04Enhanced special supportErik Schilling1-1/+5
- Made the current charge being saved. - Added script binds: - chr_set_special_recharge_speed - chr_get_special_recharge_speed - chr_set_special_mana - chr_get_special_mana - get_special_info - Added special info lua class. Functions: - name - needed_mana - rechargeable - on_use - on_recharged - category Further the engine no longer sets charge to 0 after using of specials this allows more flexbilillity (like failing specials). Changes on the xml database: - recharge renamed to rechargeable (needed by client and server) - needed - the needed mana to trigger a special (server only) - rechargespeed - the defailt recharge speed in mana per tick (server only) - target - the type of target (either being or point) (server and client) I also made the lua engine pushing nil instead of a 0 light userdata when the pointer was 0. Database update needed. Change is tested. Mana-Mantis: #167, #156 Reviewed-by: bjorn.
2012-03-02Merged all the different Lua states into oneThorbjørn Lindeijer1-6/+7
No more Lua state for each status effect, monster, item effect or map. All scripts are loaded into the same state. This should be more efficient overall and make it easier to implement dynamic reloading of the scripts in the future. Now, this introduces the problem of name collisions between different Lua scripts. For now this is solved by using more specific function names, like 'tick_plague' and 'tick_jump' rather than just 'tick'. The plan is however to get rid of these globals, and register these callbacks from the script, so that they can be local functions without the danger of colliding with other scripts. Reviewed-by: Erik Schilling Reviewed-by: Yohann Ferreira
2011-11-07Merged three global script states into oneThorbjørn Lindeijer1-6/+5
These scripts could trivially share one script state, since the methods called on them from the server are not overlapping. This does leave them open to access each other's global variables, but that's the problem with global variables. The one remaining global script file name is now configurable, so that it may also be set to a script in a different scripting language. The two related script options are: script_mainFile (default: scripts/main.lua) script_defaultEngine (default: lua) - renamed from defaultScriptEngine Reviewed-by: jurkan Reviewed-by: Yohann Ferreira
2011-11-07Small cleanups in utils::TimerThorbjørn Lindeijer1-1/+1
* 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-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-09-28Fixed mem leak on the item and monster manager unloading processYohann Ferreira1-7/+7
Reviewed-by: o11c. Note: the initialize/reload() api problem will be fixed in another commit.
2011-09-28Turned the skill manager into a class.Yohann Ferreira1-1/+3
Ack-by: o11c.
2011-05-01Renamed the mana-status-effects.xml to status-effects.xmlYohann Ferreira1-1/+1
In fact, the client never prefixed that file. Hence, the server doesn't have to.
2011-05-01Changed the server to look for the skills.xml file.Yohann Ferreira1-1/+1
This, instead of the mana-skills.xml file, to follow latest client changes.
2011-04-27Added a simple crafting systemPhilipp Sehmisch1-0/+2
A client can craft something using the @craft command. The command needs a list of item names and amounts. The gameserver checks if the character has these items in the inventory and then passes the list together with the character handle to the lua script function on_craft in the script file scripts/crafting.lua. This function can then be used to evaluate if the list is a valid crafting combination and when this is the case take or give items. Implemented two example crafting scripts there, one which enforces exact item order and amount and one which doesn't. Both are disabled per default and one needs to be enabled by uncommenting a line. Also gave the player group permission to use the @craft command in permissions.xml and added two new items (wood and iron) required for the example crafting combination. Resolves: #333 Reviewed-by: bcs86, Bertram
2011-04-16Set log verbosity earlier in game server to actually help debug.Yohann Ferreira1-6/+6
Before that, all the loading information were kept at info level. Trivial.
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/+3
Both servers deinitialize enet now from deinitializeServer(). Reviewed-by: Bertram, Jaxad0127
2011-02-16Removing unused variable configPathChangedStefan Dombrowski1-3/+0
2011-01-11Made the servers report their protocol version.Yohann Ferreira1-0/+3
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.
2011-01-06Get rid of the server tick magic number.Yohann Ferreira1-2/+3
Reviewed-by: CodyMartin.
2010-12-16Deharcoded the host and port options for each servers.Yohann Ferreira1-1/+13
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-18/+18
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-9/+13
Also made some small cleanups. Resolves: Mana-Mantis #241 Reviewed-by: Jaxad0127.
2010-09-22Centralized the servers' exit values.Yohann Ferreira1-6/+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-9/+10
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/+71
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/+12
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-22Rename some stuff to conform to naming conventionsThorbjørn Lindeijer1-4/+3
2010-08-22Changed the location of configuration, logs and statsThorbjørn Lindeijer1-49/+18
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-1/+1
I also made it required to start properly since it's now the case. Reviewed-by: Jaxad0127.
2010-07-10New attribute system and major changes to many low-level areas.Freeyorp1-4/+12
Attribute system: Structure is no longer completely hardcoded. Attributes and structure is defined by new xml file (defaulting to stats.xml) Structure defines non-base modifications to an attribute, to be used by modifiers from items, effects, etc. Calculating the base value for core attributes is still done in C++ (and for such fundamental elements the only reason I can think of to do it any other way is perhaps being able to quickly change scripts without a compile could be useful for testing, but such things are a low priority anyway) Item structure: Modifiers are now through triggers rather than single events. This also removes hardcoded types - an item could be both able to be equipped and be able to be activated. Item activation no longer consumes by default, this must be specified by the property <consumes /> inside the trigger. Currently only attribute modifications, autoattacks, and consumes are defined as effects, but stubs for others do exist. Autoattacks are currently non-functional, and this should be rectified with some urgency. Auto Attacks: AutoAttacks are now separate entities, though not fully complete, nor fully integrated with all beings yet. Integration with the Character class is urgent, integration with other Being children less so. When fully integrated this will allow for multiple autoattacks, through equipping multiple items with this as an equip effect or even through other means if needed. Equipment structure: As ItemClass types are no longer hardcoded, so too are equip types. An item have multiple ways to be equipped across multiple equipment slots with any number in each slot. Character maximums are global but configurable. Miscellaneous: Speed, money, and weight are now attributes. Some managers have been changed into classes such that their associated classes can have them as friends, to avoid (ab)use of public accessors. The serialise procedure should also be set as a friend of Character (both in the account- and game- server) as well; having public accessors returning iterators is simply ridiculous. Some start for such cleanups have been made, but this is not the primary focus here. Significant work will need to be done before this is resolved completely, but the start is there. BuySell::registerPlayerItems() has been completely disabled temporarily. The previous function iterated through equipment, yet in the context I think it is intended to fill items? I have been unable to update this function to fit the modifications made to the Inventory/Equipment/Possessions, as I am unsure what exactly what it should be doing. ItemClass::mSpriteId was previously unused, so had been removed, but I notice that it was used when transmitting equipment to nearby clients. Experimentation showed that this value was never set to anything other than 0, and so has been left out of the ItemManager rewrite. I am not entirely sure what is happening here, but it should be worth looking into at a later time, as I am not sure how equipment appearences would be sent otherwise.
2010-07-09Added LUA script bindings for manipulating the specials available to a ↵Philipp Sehmisch1-0/+3
character. Added script call for getting the cost of a special (recharge only for now) Deleting specials works server-sided but the client isn't informed about it properly. Specials without recharge cost don't appear for the player. Both of these features require an additional netcode message. Reviewed-by: Freeyorp
2010-05-30Use XML::Document to automate memory cleanupThorbjørn Lindeijer1-2/+2
Makes the code a little nicer.
2010-05-29Made the logLevel be taken from configuration for both servers.Yohann Ferreira1-24/+35
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-1/+7
Reviewed-by: Thorbjorn, Jaxad0127
2010-05-16Changed and split up the default location for loading dataThorbjørn Lindeijer1-1/+1
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-04-11Implemented handler for on_chr_death and put the loading of the global ↵Philipp Sehmisch1-13/+10
script into a method of class LuaScript Reviewed-by: Jared Adams <Jaxad0127@gmail.com>
2010-04-11Added global lua event script (only on_being_death_accept for now)Philipp Sehmisch1-0/+7
Reviewed-by: Jared Adams <Jaxad0127@gmail.com>