summaryrefslogtreecommitdiff
path: root/src/game-server/state.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-02-01Added emote support.Yohann Ferreira1-0/+13
2013-01-29Silenced some eclipse warningsErik Schilling1-0/+3
2013-01-09Replaced EventListener with signals based on libsigc++Thorbjørn Lindeijer1-3/+3
This replaces the rather hard to understand event dispatcher with a probably even harder to understand templated library, but fortunately we can rely on the available documentation. Hopefully it will also help with the readability of our code and with adding additional signals to other classes. Added libsigc++ to README and Travis CI configuration. Reviewed-by: Erik Schilling
2013-01-09Replaced 'unsigned int' with 'unsigned'Thorbjørn Lindeijer1-5/+5
Same thing, but shorter.
2012-10-11Moved order of sending genderErik Schilling1-3/+1
Gender is shared. There is no reason in duplicating code *Breaks compatbility with old clients* *Requires clientside patch* Reviewed-by: Stefan Beller.
2012-04-14Introduced a Timeout class for counting down without countingThorbjørn Lindeijer1-8/+20
The timeout remembers a reference point of time against which it can check how much time is remaining. Reviewed-by: Erik Schilling Reviewed-by: Yohann Ferreira
2012-04-04Renamed Thing to EntityThorbjørn Lindeijer1-5/+5
In preparation for using an entity/component system for the entities in the game world, this name will be more recognizable and easier to talk about. Reviewed-by: Yohann Ferreira
2012-03-17Added map update function, moved schedules there to keep map contextErik Schilling1-29/+1
Reviewed-by: bjorn.
2012-03-11Added callbacks for map/worldvar changesErik Schilling1-0/+17
Reviewed-by: bjorn.
2012-03-10Removed space before ;Erik Schilling1-1/+1
Reviewed-by: PjotrOrial.
2012-03-02Merged all the different Lua states into oneThorbjørn Lindeijer1-11/+6
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
2012-02-27Fixed compilation again + some more code cleanupErik Schilling1-1/+1
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.
2012-02-26Some random code cleanupErik Schilling1-33/+25
Moved a code comment about syncmessages to the bugtracker: #473. Reviewed-by: bjorn.
2012-01-10Made the game server execute the chr_respawn_accept script evenYohann Ferreira1-0/+13
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-02Made all beings capable of having a genderErik Schilling1-0/+2
Reviewed-by: o11c, bjorn, Bertram.
2011-08-19Changed the sprite layer protocol to supportYohann Ferreira1-45/+36
an arbitrary number of layers. (up to 255).
2011-07-27Reworked the way equip slot info are loaded in a more logical way.Yohann Ferreira1-1/+1
2011-07-27Begun Applying the new equipment slot handling design.Yohann Ferreira1-4/+4
now, the equipment slots are independant from the inventory slots according to the inventory and equipment data. This will permit to avoid checking the equipment each time one touches the inventory and vice versa, and make the former delayed mode useless. Also, note that equipped items will be removed from inventory and readded once unequipped. The design will permit the following, even if not implemented yet: - To make equipment items stackable again, if wanted. - Have more than one item with the same id equipped on different slots using the itemInstance field. Note: I didn't add the database structure updates yet, to see whether other changes may later go along with those.
2011-06-17Changed the attack message to send the attack id.Yohann Ferreira1-1/+1
This is more precise than sending the attack type, that can be guessed by the client anyway when the type parameter will be added in the <attack> tag. This is the server part of Mana issue: #363. Reviewed-by: Bjorn.
2011-04-18Made the server send the being position each 5 seconds.Yohann Ferreira1-3/+13
This will permit the client the make position resyncs when necessary, and make use of the MOVING_POSITION and DESTINATION where relevant. Reviewed-by: Thorbjorn.
2011-03-09Renamed GameState::insertSafe() to inserOrDelete.Yohann Ferreira1-2/+2
This reflects much more what the function does IMHO. Trivial.
2011-03-06Small fixes coming from my comment on issue #77.Yohann Ferreira1-5/+5
Trivial.
2011-03-04Implemented persistent world and map variablesPhilipp Sehmisch1-0/+29
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-01-09Fix being direction discrepancies by syncing the BeingDirection.Yohann Ferreira1-0/+1
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 Ferreira1-1/+1
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.
2010-11-14Renamed .hpp files into .h for consistency.Yohann Ferreira1-17/+17
Also added an header to the autoattack.{h,cpp} files. Big but trivial fix.
2010-11-03Renamed write{Byte,Short,Long} to writeInt{8,16,32}Thorbjørn Lindeijer1-56/+56
Mainly for consistency with the client, and the general consensus was that these numbered versions were clearer.
2010-11-02Some random code cleanups.Yohann Ferreira1-16/+31
Also renamed MonsterClass::getType() to getId() since it was misleading with the use of ThingType::getType() and didn't represent the actual meaning, IMHO. Trivial.
2010-10-17Dehardcode the tileWidth and height, except for the speed conversion.Yohann Ferreira1-5/+8
The speed conversion needs a standard tile length anyway and can be improved later once the movement code will start to handle beings size. Reviewed-by: Crush.
2010-09-15Reordered the manaserv.xml.example file and made related code cleanups.Yohann Ferreira1-3/+3
Reviewed-by: Thorbjorn.
2010-07-10New attribute system and major changes to many low-level areas.Freeyorp1-18/+17
Attribute system: Structure is no longer completely hardcoded. Attributes and structure is defined by new xml file (defaulting to stats.xml) Structure defines non-base modifications to an attribute, to be used by modifiers from items, effects, etc. Calculating the base value for core attributes is still done in C++ (and for such fundamental elements the only reason I can think of to do it any other way is perhaps being able to quickly change scripts without a compile could be useful for testing, but such things are a low priority anyway) Item structure: Modifiers are now through triggers rather than single events. This also removes hardcoded types - an item could be both able to be equipped and be able to be activated. Item activation no longer consumes by default, this must be specified by the property <consumes /> inside the trigger. Currently only attribute modifications, autoattacks, and consumes are defined as effects, but stubs for others do exist. Autoattacks are currently non-functional, and this should be rectified with some urgency. Auto Attacks: AutoAttacks are now separate entities, though not fully complete, nor fully integrated with all beings yet. Integration with the Character class is urgent, integration with other Being children less so. When fully integrated this will allow for multiple autoattacks, through equipping multiple items with this as an equip effect or even through other means if needed. Equipment structure: As ItemClass types are no longer hardcoded, so too are equip types. An item have multiple ways to be equipped across multiple equipment slots with any number in each slot. Character maximums are global but configurable. Miscellaneous: Speed, money, and weight are now attributes. Some managers have been changed into classes such that their associated classes can have them as friends, to avoid (ab)use of public accessors. The serialise procedure should also be set as a friend of Character (both in the account- and game- server) as well; having public accessors returning iterators is simply ridiculous. Some start for such cleanups have been made, but this is not the primary focus here. Significant work will need to be done before this is resolved completely, but the start is there. BuySell::registerPlayerItems() has been completely disabled temporarily. The previous function iterated through equipment, yet in the context I think it is intended to fill items? I have been unable to update this function to fit the modifications made to the Inventory/Equipment/Possessions, as I am unsure what exactly what it should be doing. ItemClass::mSpriteId was previously unused, so had been removed, but I notice that it was used when transmitting equipment to nearby clients. Experimentation showed that this value was never set to anything other than 0, and so has been left out of the ItemManager rewrite. I am not entirely sure what is happening here, but it should be worth looking into at a later time, as I am not sure how equipment appearences would be sent otherwise.
2010-02-07Update Copyright date for Manaserv.Bertram1-1/+1
2009-12-06Fixed name of the project in copyright headersThorbjørn Lindeijer1-7/+6
Also updated the headers to refer to the GPL by URL instead of suggesting to contact the FSF by snail mail, as per the latest GPL usage instructions.
2009-10-15Speed code unification part 1: Made the server accept speed values in tiles ↵Bertram1-1/+4
per second.
2009-10-09Synced the protocol file with client in protocol.h, letting other defines in ↵Bertram1-1/+0
defines.h, and removing some overheading along the way.
2009-09-27Added script bindings and netcode for creating being-bound effects.Philipp Sehmisch1-5/+14
2009-08-01Simplifies Movement to not send path destinations, but rather just the ↵Chuck Miller1-25/+5
current pos
2009-05-24Fixed a few code style issuesBjørn Lindeijer1-1/+2
Also renamed Guild::totalMembers to Guild::memberCount
2009-04-26Standardize on the position of the const keywordBjørn Lindeijer1-8/+8
Same as for the client.
2009-04-26Merged MovingObject into the Being classBjørn Lindeijer1-32/+39
Also renamed Object to Actor, to make it sound a little less generic. Cleans up a bit the rather big hierarchy of different object types we have.
2009-04-23OBJECT_ACTOR no longer treated as item in debug info.David Athay1-2/+2
2009-04-22Fixed non combat beings taking damage. Added some debugging info on ↵David Athay1-0/+58
inserting and removing objects.
2009-02-24Made a lot of hard-coded values configuration optionsPhilipp Sehmisch1-12/+16
2009-02-15send hair and gender information in update look messages, set looks change ↵Roderic Morris1-1/+5
flag when changing hair
2009-01-12Added @announceDavid Athay1-0/+12
2008-12-01Added new table to store online users. See mantis #553Andreas Habel1-0/+9
This upgrade will be the first, we provide database installation scripts and update scripts to upgrade from the previous version. For more details about database upgrades see http://wiki.themanaworld.org/index.php/Upgrade_Database and feel free to comment.
2008-11-30Add sync Buffer according to mantis #550Andreas Habel1-0/+6
The game server buffers all changes made to a character in a sync buffer. The buffer is sent to the account server if the buffer contains more then 20 message, reaches size of 1kb or at least every 10 seconds. ATM Character attributes, corr points and attribute points and skills are synchronized. TODO: items, location, money...
2008-11-19Added bandwidth monitoringDavid Athay1-1/+5
2008-11-16Got rid of CVS/Subversion $Id$ markersBjørn Lindeijer1-2/+0
2008-11-04Added updating party member health.David Athay1-0/+23