Age | Commit message (Collapse) | Author | Files | Lines |
|
Rather than relying on the availability of global functions with certain
predefined names, the Lua script now calls API functions to set which
function should be called on these global events.
This mechanism should make it easier to avoid name collisions in the global
namespace, which is important now that there is only a single script state.
For these global events this was not likely to become a problem, but this
solution can also be used for callbacks on specific item or monster types,
or even allow setting callbacks on certain instances.
Reviewed-by: Erik Schilling
Reviewed-by: Yohann Ferreira
|
|
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
|
|
It's not nice to use ++ on an iterator that may be std::map::end(),
in my case this caused it to hang indefinitely.
Reviewed-by: Yohann Ferreira
|
|
Reviewed-by: bjorn.
|
|
I did some cleanup but i had a wrong path set inside qtcreator.
So i recompiled old versions and it all worked fine.
But when i recompiled from console i got a whole bunch of errors.
Sorry for pushing broken commits.
Reviewed-by: bjorn.
|
|
Moved a code comment about syncmessages to the bugtracker: #473.
Reviewed-by: bjorn.
|
|
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
|
|
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
|
|
Reviewed-by: Bertram
|
|
- Added announcements having senders now.
- Removed /announcement support.
Reviewed-by: Bjorn.
|
|
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
|
|
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.
|
|
You can unequip using the slot or an item id.
+ Fixes from Ablu's review.
Resolves: Mana-Mantis #350.
Reviewed-by: Ablu.
|
|
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.
|
|
Reviewed-by: o11c.
|
|
Reviewed-by: o11c, bjorn, Bertram.
|
|
Reviewed-by: o11c.
|
|
Reviewed-by: Thorbjorn Lindeijer.
|
|
Reviewed-by: Erik Schilling
|
|
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
|
|
* 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
|
|
Added @permissions <character> which lists the permissions of a player.
Made @givepermission giving feedback on success.
Reviewed-by: Thorbjørn Lindeijer.
|
|
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
|
|
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
|
|
Conflicts:
src/game-server/character.cpp
src/scripting/lua.cpp
|
|
Reviewed-by: Thorbjørn Lindeijer.
|
|
Reviewed-by: Bjorn, Bertram.
|
|
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.
|
|
Reviewed-by: o11c.
|
|
|
|
|
|
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
|
|
Conflicts:
src/game-server/accountconnection.cpp
|
|
log_accountToStandardOutput and log_gameToStandardOutput have been
merged together as log_toStandardOutput.
Reviewed-by: Yohann Ferreira
|
|
The map reader is now only concerned with parsing the XML, whereas the
MapComposite turns some of the objects into Warps, Spawns and NPCs.
Reviewed-by: Yohann Ferreira
|
|
Being::findPath doesn't change the position of a being, and so should
not be syncing mOld to the current position. When invoked on the wrong
moment, this could cause MapComposite::update to fail to realize that a
being has moved into another zone.
Also removed some other usages of mOld that were not necessary, to make
its purpose clearer and make a potential cleanup easier.
Reviewed-by: Yohann Ferreira
|
|
map_get_objects([string filter]): returns all object of the current map optionally filtered by type.
map_get_object_property(handle object, string key): returns the value of the property of the object.
map_get_object_bounds(handle object): returns x, y, width, height of an object.
map_get_object_name(handle object): returns name of an object.
map_get_object_type(handle object): returns type of an object.
Mantis-issue: 397
Reviewed-by: Thorbjørn Lindeijer
|
|
I simply made the default autoattack look for the default skill
and add exp to it when killing monsters.
Now the player can earn xp again even if it's not well handled
between two logins.
|
|
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.
|
|
|
|
Conflicts:
src/game-server/inventory.cpp
src/game-server/inventory.h
src/game-server/item.h
src/game-server/main-game.cpp
src/game-server/skillmanager.cpp
src/utils/point.h
|
|
and item managers.
ack-by: o11c.
note: The managers still need to auto deinit when already loaded.
This will be done in another trivial commit.
|
|
Reviewed-by: o11c.
Note: the initialize/reload() api problem will be fixed in another
commit.
|
|
TriggerArea::update() function.
|
|
This will permit better handling of both skills names and id.
This is needed to start reworking on the auto-attack system.
|
|
Ack-by: o11c.
|
|
The bug was pretty generic, as the contains() method
of the Rectangle class wasn't checking against left and top
sides according to the client view point.
I also documented the call site.
Resolves: Mana-Mantis #317.
Reviewed-by: o11c.
|
|
This doesn't change anything yet.
Reviewed-by: o11c.
|
|
Add chatcommand @getpos <character> which return the mapid and location of the character.
Part of: Mana-Mantis: #385.
Reviewed-by: Bertram.
|
|
Resolves: Mana-Mantis #386
Reviewed-by: o11c.
|