summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2011-03-12Removed a bunch of silly documentationThorbjørn Lindeijer32-203/+14
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. :)
2011-03-11Moved freeing of map position to Actor destructorThorbjørn Lindeijer6-30/+22
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
2011-03-11Split path finding out of the Map classThorbjørn Lindeijer7-176/+176
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
2011-03-11Fixed Actor::setPosition to update the blockmask correctlyThorbjørn Lindeijer1-8/+6
It was freeing the new tile rather than the previous tile. Reviewed-by: Stefan Dombrowski
2011-03-11Avoid sqrt and double in circle-to-circle collision detectionThorbjørn Lindeijer1-4/+6
We can just stick with integers by trading a sqrt for a multiplication. Reviewed-by: Bertram
2011-03-10Removed two superfluous semicolonsThorbjørn Lindeijer2-2/+2
2011-03-10Server-Wrap the open and closed list members in path finding.Yohann Ferreira2-76/+43
This prevents some weird things happening especially on crowded maps. I also removed the unused findSimplePath() function. Reviewed-by: Thorbjorn.
2011-03-09Prevented a potential crash in storage::getAllWorldStateVars()Yohann Ferreira1-2/+10
Minor other fixes. Trivial.
2011-03-09Renamed GameState::insertSafe() to inserOrDelete.Yohann Ferreira5-8/+8
This reflects much more what the function does IMHO. Trivial.
2011-03-09Made the monster creation delayed, to avoid crashing.Yohann Ferreira1-5/+1
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.
2011-03-06Small fixes coming from my comment on issue #77.Yohann Ferreira5-19/+22
Trivial.
2011-03-04Implemented persistent world and map variablesPhilipp Sehmisch12-22/+370
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
2011-02-24Fixing dead born monstersStefan Dombrowski1-2/+5
Reviewed-by: Bertram
2011-02-22Implementing @killmonstersStefan Dombrowski1-0/+26
Reviewed-by: Crush
2011-02-21Remove obsolete reset of SIGSEGV handlingStefan Dombrowski2-6/+0
Reviewed-by: Thorbjorn
2011-02-20Fixed enabling/disabling npcs by enqueuing the insertion.Yohann Ferreira1-2/+1
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.
2011-02-20Adding CSV support from Jaxad's client implementation.Yohann Ferreira1-8/+45
Reviewed-by: Jaxad0127. Resolves: Mana-Mantis #286.
2011-02-19Removing dublicate deinitialize of enetStefan Dombrowski2-6/+3
Both servers deinitialize enet now from deinitializeServer(). Reviewed-by: Bertram, Jaxad0127
2011-02-19Add support for zlib map layer compression.Yohann Ferreira1-3/+6
Trivial fix.
2011-02-16Removing unused variable configPathChangedStefan Dombrowski2-6/+0
2011-02-16Fixed doc about stroll range, which is coded in pixels.Yohann Ferreira1-2/+2
Not in tiles, as suggested by the header. Trivial fix.
2011-02-15Fixed registering the players items to the buysell handler.Yohann Ferreira1-24/+46
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.
2011-02-11Fix the GP base and mod values for newly created characters.Yohann Ferreira1-0/+11
Reviewed-by: Freeyorp.
2011-02-11Fix basic money handling using the ATTR_GP attribute.Yohann Ferreira1-4/+18
Reviewed-by: Freeyorp.
2011-02-11Added lua attributes getters/setters thanks to Freeyorp.Yohann Ferreira1-68/+155
2011-02-08Implemented LUA binding to get the gender of a characterPhilipp Sehmisch1-0/+17
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
2011-01-30Revert "Fixed the money handling."Jared Adams5-34/+7
This reverts commit b2209cbe93aa12dcd4e4e3b9a7cd8b13ed5713e9. Money should be handled through attributes, not magic numbers.
2011-01-31Fixed the money handling.Yohann Ferreira5-7/+34
- At character's attributes recalculation when necessary. - In the lua scripting functions.
2011-01-30Made the code tell a bit more when a monster is lacking values.Yohann Ferreira1-14/+30
2011-01-30Trivial code format fixes in monstermanager.cpp.Yohann Ferreira1-28/+45
2011-01-30Added the missing Magical dodge monster property.Yohann Ferreira1-0/+2
Now this can be loaded with the 'magic-evade' xml tag.
2011-01-30Made the monsters' attributes compute fine again.Yohann Ferreira3-10/+59
As a consequence, the monsters can spawn again. Reviewed-by: Freeyorp.
2011-01-26Add an heartbeat time flag in the statistics file.Yohann Ferreira4-58/+101
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.
2011-01-25Upgraded the manaserv protocol version to 1.Yohann Ferreira1-1/+1
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.
2011-01-22Fix the default slot values when upgrading the database to version 14.Yohann Ferreira2-2/+2
Reviewed-by: Cody. Resolves: Mana-Mantis #284.
2011-01-22Made the being direction be updated only at the end of the movement.Yohann Ferreira1-3/+3
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.
2011-01-11Made the servers report their protocol version.Yohann Ferreira5-5/+13
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-10Removing default argument values from Map definitionStefan Dombrowski1-2/+1
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
2011-01-09Fix being direction discrepancies by syncing the BeingDirection.Yohann Ferreira7-21/+118
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.
2011-01-09Removed the superfluous point struct.Yohann Ferreira15-39/+29
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.
2011-01-06Get rid of the server tick magic number.Yohann Ferreira6-15/+19
Reviewed-by: CodyMartin.
2011-01-03Got rid of the superfluous DEFAULT_TILE_HEIGHT/WIDTH.Yohann Ferreira4-10/+10
We've got DEFAULT_TILE_LENGTH in defines.h for that. Trivial fix.
2011-01-03Change Actor::mActionTime to mMoveTime member to reflect more its actual use.Yohann Ferreira3-12/+14
Trivial.
2011-01-03Added missing using namespace clauses. Cmake's fault, I guess. ;)Yohann Ferreira3-0/+6
Trivial.
2011-01-03Cleaned up and document a bit more the speed conversion functions.Yohann Ferreira5-13/+28
Trivial fix.
2011-01-03Namespaced the manaserv protocol to ease the porting of the enums.Yohann Ferreira6-0/+12
Trivial.
2010-12-29Corrected the database version of newly created databases.Yohann Ferreira2-2/+2
Trivial fix.
2010-12-29protocol.h -> manaserv_protocol.h to avoid conflicts with mysql files.Yohann Ferreira11-10/+10
Resolves: Mana-Mantis #278.
2010-12-29Moved parts needing to be in sync with the client in protocol.h.Yohann Ferreira7-65/+70
Trivial fix.
2010-12-29Made the server handle properly the characters slots.Yohann Ferreira12-73/+241
I turned the vector storing character data into a map, keeping the character's slot. Fixed a memleak along the way. Reviewed-by: Crush.