summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-02-26Renamed some iterators + fixed one TODO (stored guilds in a map)Erik Schilling2-46/+23
Reviewed-by: bjorn.
2012-02-25Merged the example client and server dataThorbjørn Lindeijer1-6/+3
It's easier to just talk about world data and to modify it as a whole. If there is really a need to separate it, a project can still choose to do that (and in whatever suitable way). There is no need to enforce this separation or to do it in our example. Reviewed-by: Erik Schilling
2012-02-03Added a generic Lua user data cacheThorbjørn Lindeijer3-9/+106
Based on a native Lua table with weak values, so that the user data objects that are created can be garbage collected when no longer referenced. Reviewed-by: Yohann Ferreira
2012-02-03Clear the gid flags before processing themThorbjørn Lindeijer3-13/+22
Also read the gids as unsigned integers since that's how Tiled writes them to prevent the number going negative when the highest flag is used. Reviewed-by: Yohann Ferreira
2012-02-02Added a way to specify the min and max attributes values.Yohann Ferreira9-81/+129
This can now be done in attributes.xml through the minimum and maximum attribute parameters. I also changed the AttributeInfo struct as requested by bjorn. Reviewed-by: Erik Schilling, Thorbjørn Lindeijer
2012-01-31Use a full user data object for MapObject referencesThorbjørn Lindeijer3-53/+84
Based on a templated helper class, MapObject references in Lua scripts are now full user data objects. Using the '__index' member of their metatable, a library is associated with it so that member functions can be called directly on the object. Reviewed-by: Yohann Ferreira Reviewed-by: Erik Schilling
2012-01-30Fixed some lua_newtable/createtable usageThorbjørn Lindeijer2-5/+5
When creating a Lua table, it is possible to specify in advance how many array elements and how many non-array elements this table will contain, to avoid dynamic reallocations while filling the table. This wasn't used optimally by the pushSTLContainer helper methods and some other cases. Reviewed-by: Erik Schilling Reviewed-by: Yohann Ferreira
2012-01-29Removed unused createRandomPassword functionThorbjørn Lindeijer3-99/+0
Reviewed-by: Erik Schilling
2012-01-25Fixed use of checkstring method in the script functionsErik Schilling1-4/+7
luaL_checkstring might not return so the destructor of string will not be called. Reviewed-by: Bjorn.
2012-01-22Added announce(text [, sender]) lua functionErik Schilling1-4/+18
The function will cause a global announcement. If no sender ist set "Server" will be used. Reviewed-by: Bjorn.
2012-01-22Removed logging of chatErik Schilling2-15/+0
Reviewed-by: Bertram
2012-01-21Made @announce fully functionalErik Schilling5-47/+40
- Added announcements having senders now. - Removed /announcement support. Reviewed-by: Bjorn.
2012-01-18Added the chr_get_inventory and chr_get_equipment functions.Yohann Ferreira1-0/+137
Those will make the scripters able to get a full view of the current player's possessions. Use with care. + Fixes following Ablu's review. Resolves: Mana-Mantis #207. Reviewed-by: Ablu
2012-01-18Fixed the chr_inv_count function to handle equipment.Yohann Ferreira3-16/+48
the function can now count in the inventory and/or the player's equipment. I also fixed the script function and added a use case in the example map. + Fixes after Ablu's review. + 2nd fix after Ablu's review: Fix the inventory remove behaviour. Resolves: Mana-Mantis #288 Reviewed-by: Ablu
2012-01-16Made the lua item_drop script function returns whether it succeeded.Yohann Ferreira1-4/+4
Part of Mana-Mantis #339. Reviewed-by: Ablu
2012-01-16Added several script warnings on errors.Yohann Ferreira1-7/+10
As requested by Ablu. Reviewed-by: Ablu.
2012-01-10Made the game server execute the chr_respawn_accept script evenYohann Ferreira4-19/+52
in case of disconnection. I made the Character::disconnected() function handle that case, permitting also to centralize GameState::remove() calls there. I also made the GameState::enqueueWarp() function test whether the Character pointer is about to be deleted, so that the warp can be handled directly to avoid a crash. Last but not least, I also made the Character::update() function not update the Character specials and hp to avoid discrepancies seen in the client. Resolves: Mana-Mantis #309. Reviewed-by: Ablu.
2012-01-10Random small fixes linked to lua c++ scripting functions.Yohann Ferreira1-10/+39
Reviewed-by: Ablu
2012-01-10Added unequip lua script functions.Yohann Ferreira3-0/+111
You can unequip using the slot or an item id. + Fixes from Ablu's review. Resolves: Mana-Mantis #350. Reviewed-by: Ablu.
2012-01-10Added equip lua script functions.Yohann Ferreira3-1/+87
One per inventory slot, one per item id or name. + Fixes from 2 Ablu's reviews. Reviewed-by: Ablu. 1st part of Mana-Mantis #339, 350.
2012-01-03Fixed code not getting executed since it was behind a returnErik Schilling1-1/+1
Reviewed-by: o11c.
2012-01-02Made all beings capable of having a genderErik Schilling12-44/+91
Reviewed-by: o11c, bjorn, Bertram.
2011-12-04Added @skills command which lists all skillsErik Schilling1-0/+41
Reviewed-by: o11c.
2011-12-03Allowed larger item amounts for mysql database.Erik Schilling5-4/+20
Changed range of amount to unsigned int(10). Sqlite update scripts is empty since no change was required here. Reviewed-by: Bertram.
2011-11-21Allow includes in configuration file.Erik Schilling1-6/+35
You can now use <include file="myconfig.xml" /> to include a configuration file into the main configuration. Reviewed-by: Bjorn.
2011-11-12Prevented the equipment to remove the item when something went wrong.Yohann Ferreira1-10/+12
Reviewed-by: Thorbjorn Lindeijer.
2011-11-12Made the server warn the player when equip/unequip failed.Yohann Ferreira1-4/+15
Reviewed-by: Erik Schilling
2011-11-07Removed unused singleton templateThorbjørn Lindeijer1-71/+0
Looks unlikely that we'll be using this. Anyway, it can be found in the git history if so. Reviewed-by: Yohann Ferreira
2011-11-07Merged three global script states into oneThorbjørn Lindeijer7-68/+38
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 Lindeijer4-21/+21
* 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-02Added @permissions commandErik Schilling1-18/+47
Added @permissions <character> which lists the permissions of a player. Made @givepermission giving feedback on success. Reviewed-by: Thorbjørn Lindeijer.
2011-11-01Removed some superfluous new character initializationsThorbjørn Lindeijer1-13/+0
The level, character points and correction points are already initialized by the Character constructor. The ATTR_GP attribute is either not present, or obtained default value from mDefaultAttributes. In both cases it makes no sense to set it to 0. Reviewed-by: Yohann Ferreira
2011-11-01Removed the inventory checkThorbjørn Lindeijer1-46/+0
We can't arbitrarily remove inventory items on initialization, and shouldn't have to, because what's in the DB was correct when it was stored. Also, there should be no need to check the inventory after inserting items, since the insert method should already make sure not to insert items when there is no space. Reviewed-by: Yohann Ferreira
2011-11-01Have one place where the Configuration is initializedThorbjørn Lindeijer4-94/+39
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-11-01Renamed the db update 15 to 18 as requested by Bjorn.Yohann Ferreira5-6/+6
2011-11-01Merge github.com:mana/manaservYohann Ferreira12-23/+71
Conflicts: src/game-server/character.cpp src/scripting/lua.cpp
2011-11-01dos2unix src/common/manaserv_protocol.hYohann Ferreira1-448/+448
2011-10-26End the confusion about the missing upgrade scriptThorbjørn Lindeijer2-0/+0
Version 15 was skipped, and we'll never go back. Renamed the 15_to_16 update scripts to 14_to_16 to avoid confusing everybody who wants to update their DBs. Reviewed-by: Yohann Ferreira
2011-10-23Made @money functional again.Erik Schilling1-6/+5
Reviewed-by: Thorbjørn Lindeijer.
2011-10-23Added function to determine the script engine by the file name extensionjurkan6-11/+60
Reviewed-by: Bjorn, Bertram.
2011-10-22Added a default skill id getter in the skill manager.Yohann Ferreira1-0/+4
I also added a link to the skillmanager object in its header file. This will later be used to get info from elsewhere than the server main loop. Reviewed-by: Bjorn.
2011-10-22Fixed the get_level doxygen documentation.Yohann Ferreira1-1/+1
Thanks to Ablu.
2011-10-22Officially added the being gender to the protocol.Yohann Ferreira3-6/+32
Reviewed-by: o11c.
2011-10-22Added the chr_get_level script function.Yohann Ferreira1-0/+18
Reviewed-by: Ablu.
2011-10-22Added the chr_set_gender() script function.Yohann Ferreira1-0/+20
Reviewed-by: Ablu.
2011-10-22.find() -> .value due to recent API changes.Yohann Ferreira1-1/+1
2011-10-22Merge branch 'master' of github.com:mana/manaservYohann Ferreira5-7/+13
2011-10-20Return a const & from NameMap to avoid potential deep copiesThorbjørn Lindeijer5-7/+13
When I introduced NameMap it was only used with pointers, but now it is also used with std::string so it probably makes sense to keep a default- constructed value around so that a reference can be returned rather than a copy. NameMap::find was renamed to NameMap::value to make it more clear that it doesn't return an iterator, like std::map::find. Reviewed-by: Yohann Ferreira Reviewed-by: Ben Longbons
2011-10-19Merge branch 'master' of github.com:mana/manaservYohann Ferreira18-381/+493
Conflicts: src/game-server/accountconnection.cpp
2011-10-19Have one place where the Logger is initializedThorbjørn Lindeijer4-38/+21
log_accountToStandardOutput and log_gameToStandardOutput have been merged together as log_toStandardOutput. Reviewed-by: Yohann Ferreira