Age | Commit message (Collapse) | Author | Files | Lines |
|
One huge function that handles all the messages isn't very readable and
causes everything to be indented by several levels. Hence we generally
split this up.
It also exposed a missing 'break;' when handling the PGMSG_USE_SPECIAL
message, which would continue into the handling of PGMSG_ACTION_CHANGE.
Reviewed-by: Stefan Dombrowski
|
|
* Remove SYNC_END_OF_BUFFER since the end of a message can already be
identified by no more data being available.
* Consistently prefix ++ rather than postfix ++ when incrementing
mSyncMessages.
* Made SYNC_BUFFER_SIZE into constants rather than defines, and moved
them into the .cpp file since they're not used anywhere else.
* Just use 1 and 0 to indicate online status. No point in writing it
like 0x01 and 0x00.
* Merged some duplicated documentation for
AccountConnection::syncChanges.
Reviewed-by: Jared Adams
|
|
By default XML::Document will use the ResourceManager to resolve the
file name you pass to it. There is no point in disabling that
functionality only to resolve it manually.
Reviewed-by: Jared Adams
|
|
Introduced a template class NameMap, which provides a nice API for
mapping any custom types by their name.
This change also makes any duplicate item or monster definitions be
complete ignored, rather than being merged into the first definition.
Reviewed-by: Philipp Sehmisch
Reviewed-by: Yohann Ferreira
|
|
By using xmlParseFile instead of xmlParseMemory, the system-dependent
newlines should be handled automatically.
The .tmx.gz files should still be supported, but instead of manually
decompressing them the xmlParseFile function should take care of that.
It also fixes the leaking of XML documents in both the SkillManager as
well as the PermissionManager, since they now rely on XML::Document,
which cleans up automatically.
Reviewed-by: Stefan Dombrowski
|
|
|
|
This splits the huge ItemManager::reload() into readEquipSlotsFile() and
readItemsFile(), the latter of which is further split up into multiple
functions for reading the different elements.
Just to keep the amount of nesting down and increase the readability.
Removes the need for huge eye-catching comment blocks.
Reviewed-by: Freeyorp
|
|
Easier to understand than a std::pair<unsigned int, unsigned int>, or
functions like getTagFromInfo(unsigned int, unsigned int), which does
not make clear what that "info" actually is.
Now it's simply getTag(const ModifierLocation &location), documenting
itself and also allowing the name to be shorter.
Reviewed-by: Freeyorp
|
|
Keeps the code indentation within reasonable limits and makes the
structure easier to follow.
Reviewed-by: Freeyorp
|
|
SCOPE_TYPES -> ScopeType (plural was confusing)
ATTR_BEING -> BeingScope
ATTR_CHAR -> CharacterScope
ATTR_MOD -> MonsterScope
ATTR_MAX -> MaxScope
AttributeScopes -> AttributeScope
(A single scope seems to include multiple lists of attributes. Seems
wrong to me to name this type in plural form.)
getAttributeInfoForType -> getAttributeScope
(just naming it after what it is actually returning)
Reviewed-by: Freeyorp
|
|
Just seems a bit more organized to me.
|
|
AT_TY -> StackableType
TY_ST -> Stackable
TY_NST -> NonStackable
TY_NSTB -> NonStackableBonus
AME_TY -> ModifierEffectType
AME_MULT -> Multiplicative
AME_ADD -> Additive
Got rid of related documentation, which is now stating the obvious.
Also renamed many related variables.
Reviewed-by: Freeyorp
|
|
A bunch of variables that were continuously requested from the
configuration are now members of the AccountHandler.
Reviewed-by: Freeyorp
|
|
When banning a character, the game master now sets a time unit (m, h, d, w
or y for minutes, hours, days, weeks or years) after the duration.
Ban durations longer than 2^16 minutes are now possible.
The banned character is now kicked automatically and the banning character
receives a feedback chat message.
Reviewed-by: Thorbjorn
|
|
* 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
|
|
The F cost represents the estimate of the total cost from source to
destination. It is only relevant to sort the locations to be checked, so
there is no point in assigning it to each coordinate of the map.
With maps up to 200x200, the memory usage is reduced by 160 kB! :P
Reviewed-by: Bertram
|
|
The @drop and @item commands can now accept an item name instead of an
item ID. In addition the amount can be omitted to create a single item.
|
|
I rewrote the @spawn command to allow two new things:
1. The monster ID can be replaced with the name of the monster.
2. The amount of monsters can be omitted. In that case a single monster
is spawned.
Reviewed by: Jaxad and Thorbjorn
|
|
|
|
There was a version taking an attack range, but the range was always the
same as the one specified in the Damage class.
|
|
The monsters weren't respecting the end of the stroll time
before resetting their destination, which made them never
cease changing it and flooded the clients with movement messages.
Resolves: Mana-Mantis #315.
Reviewed-by: Jaxad0127.
|
|
A C++ developer should be able to recognize a constructor and a
destructor by just looking at it, so let's stop writing down the
obvious. :)
|
|
It was done in both the Character and the Monster destructors, but I
don't see how any Actor should be excluded from this. Now it also
happens for NPC, Effect and Item, though only NPC has a relevant
walkmask.
Also fixed a small issue introduced in 97e0a9eb170499 and added an
assert to freeTile. We should be able to assert that a tile can only be
freed if it was blocked.
Reviewed-by: Stefan Dombrowski
|
|
Extracted the path finding algorithm out of the Map class and introduced
a new class called PathInfo that has the path finding information that
used to be part of MetaTile.
This allows a single vector of path information to be shared between all
maps running on the server, significantly reducing the memory overhead
per map (for 200x200 maps, the memory reduction is about 1 MB per map).
Part of this change is some cleanup, like moving the 'occupation' counts
into MetaTile, inlining some methods for performance reasons, and using
STL to simplify memory management.
Mantis-issue: 106
Reviewed-by: Bertram
|
|
It was freeing the new tile rather than the previous tile.
Reviewed-by: Stefan Dombrowski
|
|
We can just stick with integers by trading a sqrt for a multiplication.
Reviewed-by: Bertram
|
|
This prevents some weird things happening especially on crowded
maps.
I also removed the unused findSimplePath() function.
Reviewed-by: Thorbjorn.
|
|
This reflects much more what the function does IMHO.
Trivial.
|
|
Trivial.
|
|
The gameserver now receive a copy of all world state variables when
they are accepted by the accountserver and receive a copy of all
map state variables of a map when they register it successfully.
Implemented LUA script bindings for getting and setting these variables.
When such a variable is set, the accountserver is notified about this
change. Changes to world state variables are then propagated to all
gameservers by the accountserver.
Be aware that when a gameserver is updating a map, there is no check if
it is actually responsible for said map. But I consider this not a
security flaw, because authenticated game servers are considered to be
trustworthy in a lot of other situations, too.
Also renamed "quest" to "character variable" in the sourcecode.
Reviewed-by: Bertram
|
|
Reviewed-by: Bertram
|
|
Reviewed-by: Crush
|
|
Reviewed-by: Thorbjorn
|
|
Reviewed-by: Jaxad0127.
Resolves: Mana-Mantis #286.
|
|
Both servers deinitialize enet now from deinitializeServer().
Reviewed-by: Bertram, Jaxad0127
|
|
Trivial fix.
|
|
|
|
Not in tiles, as suggested by the header.
Trivial fix.
|
|
Now buy/sell lua functions can access the player inventory
again.
This is not using the delayed mode, so it won't be a problem.
Reviewed-by: Freeyorp.
|
|
This reverts commit b2209cbe93aa12dcd4e4e3b9a7cd8b13ed5713e9.
Money should be handled through attributes, not magic numbers.
|
|
- At character's attributes recalculation when necessary.
- In the lua scripting functions.
|
|
|
|
|
|
Now this can be loaded with the 'magic-evade' xml tag.
|
|
As a consequence, the monsters can spawn again.
Reviewed-by: Freeyorp.
|
|
This saves a bit of cpu and make use of pixel points where
tile points where used before and could lead to discrepancies.
Reviewed-by: Thorbjorn.
|
|
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.
|
|
The default argument values had no effect, because they are
not in the declaration.
Updating the codeblock project, because protocol.h had been renamed.
Reviewed-by: Bertram
|
|
The server was actually using the bitmask enum while the the client
still sent another one, creating discrepancies.
A second problem is that the being direction was not properly
initialized and not updated while it was moving.
Reviewed-by: Jaxad.
|
|
It was too close from the Position class and it leads to
making the server handle one or another type through the
code. Still bugged me many times while making changes.
Reviewed-by: Jaxad.
|