Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
Minor other fixes.
Trivial.
|
|
This reflects much more what the function does IMHO.
Trivial.
|
|
Creation of monsters shouldn't be done during game state
update. So we delay their insertion after the update
to avoid a crash in debug builds and weird stuff happening
in release builds.
Reviewed-by: Thorbjorn.
|
|
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
|
|
This permits to handle such operation after the object locking,
thus avoiding to fail on the assertion: assert(!dbgLockObjects);
when inserting a npc.
Reviewed-by: Ablu.
|
|
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.
|
|
Reviewed-by: Freeyorp.
|
|
Reviewed-by: Freeyorp.
|
|
|
|
The function is named mana.chr_get_gender. It returns 0 for male
and 1 for female. libmana-constants.lua defines the variables
GENDER_MALE and GENDER_FEMALE with these values. Also made the
banker NPC refer to the gender of the player character.
Reviewed-by: Jaxad0127
|
|
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 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.
|
|
Yeah, I know Jaxad, we're not releasing but as agreed with
Thorbjorn, the protocol is incompatible even when moving, so
better get rid of old clients early.
|
|
Reviewed-by: Cody.
Resolves: Mana-Mantis #284.
|
|
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.
|
|
Reviewed-by: CodyMartin.
|
|
We've got DEFAULT_TILE_LENGTH in defines.h for that.
Trivial fix.
|
|
Trivial.
|
|
Trivial.
|
|
Trivial fix.
|
|
Trivial.
|
|
Trivial fix.
|
|
Resolves: Mana-Mantis #278.
|
|
Trivial fix.
|
|
I turned the vector storing character data into a map,
keeping the character's slot.
Fixed a memleak along the way.
Reviewed-by: Crush.
|