summaryrefslogtreecommitdiff
path: root/src/account-server/accounthandler.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-04-11Renamed Character -> CharacterData in the accountserverErik Schilling1-4/+5
2013-01-09Replaced 'unsigned int' with 'unsigned'Thorbjørn Lindeijer1-4/+4
Same thing, but shorter.
2012-04-12Fixed issues with server behind routerErik Schilling1-2/+2
Tested-by: jurkan. Reviewed-by: Bertram.
2012-03-16Fixed remaining compiler warningsThorbjørn Lindeijer1-1/+1
These were unused parameters and one return type with an ignored 'const' qualifier. Reviewed-by: Yohann Ferreira
2011-11-01Removed some superfluous new character initializationsThorbjørn Lindeijer1-13/+0
The level, character points and correction points are already initialized by the Character constructor. The ATTR_GP attribute is either not present, or obtained default value from mDefaultAttributes. In both cases it makes no sense to set it to 0. Reviewed-by: Yohann Ferreira
2011-08-10login with random hashStefan Beller1-3/+44
The account server sends out a random number, which is additionally used for hashing the password. Reviewed by Bertram
2011-03-30Fixing selection of a character if lower slots are emptyStefan Dombrowski1-1/+1
This resolves http://bugs.manasource.org/view.php?id=321 Reviewed-by: Jaxad0127, VUT
2011-03-24Rely more on the functionality in XML::DocumentThorbjørn Lindeijer1-9/+2
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
2011-03-20Moved defines.h and manaserv_protocol.h into 'common'Thorbjørn Lindeijer1-1/+1
Just seems a bit more organized to me.
2011-03-20General cleanups and code style fixesThorbjørn Lindeijer1-94/+80
A bunch of variables that were continuously requested from the configuration are now members of the AccountHandler. Reviewed-by: Freeyorp
2011-03-17Micro-optimizations related to std::stringThorbjørn Lindeijer1-4/+5
* 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
2011-03-15Moved some file-global variables into the AccountHandlerThorbjørn Lindeijer1-42/+40
Nicer as members where there is clear ownership, initialization and scope. Reviewed-by: Freeyorp
2011-03-15Introduced an AttributeValue class for convenience and readabilityThorbjørn Lindeijer1-13/+16
Easier to understand than a std::pair with its 'first' and 'second' members, and it also provides an implicit constructor so that AttributeValue is implicitly constructed from a double. Reviewed-by: Freeyorp
2011-03-14Made the "No game server for map" error message report the map IDPhilipp Sehmisch1-1/+1
(trivial patch)
2011-03-12Removed a bunch of silly documentationThorbjørn Lindeijer1-3/+0
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-02-11Fix the GP base and mod values for newly created characters.Yohann Ferreira1-0/+11
Reviewed-by: Freeyorp.
2011-01-11Made the servers report their protocol version.Yohann Ferreira1-3/+2
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-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.
2011-01-03Namespaced the manaserv protocol to ease the porting of the enums.Yohann Ferreira1-0/+2
Trivial.
2010-12-29protocol.h -> manaserv_protocol.h to avoid conflicts with mysql files.Yohann Ferreira1-1/+1
Resolves: Mana-Mantis #278.
2010-12-29Made the server handle properly the characters slots.Yohann Ferreira1-37/+51
I turned the vector storing character data into a map, keeping the character's slot. Fixed a memleak along the way. Reviewed-by: Crush.
2010-12-16Deharcoded the host and port options for each servers.Yohann Ferreira1-4/+12
Changes: ============================================================ For the account server: ------------------------------------------------------------ Old -> New ------------------------------------------------------------ net_accountServerAddress, net_listenHost -> net_accountHost net_accountServerPort -> net_accountListenToClientPort net_accountServerPort +1 -> net_accountListenToGamePort For the game server: ------------------------------------------------------------ Old -> New ------------------------------------------------------------ net_gameServerAddress -> net_gameHost net_gameServerPort -> net_gameListenToClientPort For the chat server: ------------------------------------------------------------ Old -> New ------------------------------------------------------------ -> net_chatHost net_accountServerPort + 2 -> net_chatListenToClientPort Special fallback feature, as requested by Freeyorp: When the net_accountListenToClientPort (default to 9601) is set, the 3 others ports will automatically offset from it, if they're not set, following this rule: net_accountListenToGamePort = net_accountListenToClientPort + 1 net_chatListenToClientPort = net_accountListenToClientPort + 2 net_gameListenToClientPort = net_accountListenToClientPort + 3 Resolves: Mana-Mantis #216. Reviewed-by: Jaxad0127.
2010-12-08Fix many compiler warnings.Freeyorp1-1/+1
Reviewed-by: Bertram
2010-11-18Made the server return the number of slots in the login/register responses.Yohann Ferreira1-3/+14
Reviewed-by: CodyMartin.
2010-11-14Renamed .hpp files into .h for consistency.Yohann Ferreira1-18/+18
Also added an header to the autoattack.{h,cpp} files. Big but trivial fix.
2010-11-09Fixed unregistering on the server-side.Yohann Ferreira1-3/+4
When registering or logging, The client is hashing the password for sending it safely. And the server is hashing it also to store it the same way. Hence, the password ends hashed twice, which is correct because the server can't trust the client anyway. At unregister attempt, the server wasn't hashing the password before comparing it. Also while on it, I made the corresponding SQL query use the try catch method and only delete the account in memory when it's also done on the Db. Reviewed-by: thorbjorn, Freeyorp.
2010-11-03Renamed write{Byte,Short,Long} to writeInt{8,16,32}Thorbjørn Lindeijer1-83/+83
Mainly for consistency with the client, and the general consensus was that these numbered versions were clearer.
2010-10-26Send a client data URL in addition to the update hostThorbjørn Lindeijer1-0/+7
This is for developing/testing an experimental new resource manager that downloads only the files it needs on demand. Currently only used by the Mana Mobile project. Regular Mana client ignores the setting. Reviewed-by: Jared Adams
2010-09-22Centralized the servers' exit values.Yohann Ferreira1-11/+11
Also made random code format clean-ups. Resolves: Mana-Mantis #217 Reviewed-by: Jaxad0127.
2010-09-15Reordered the manaserv.xml.example file and made related code cleanups.Yohann Ferreira1-4/+5
Reviewed-by: Thorbjorn.
2010-09-08Centralized stringToBool conversion.Yohann Ferreira1-19/+27
Also moved the trim() function into the utils namespace where it belongs more, and made some random code cleanups. Reviewed-by: Thorbjorn.
2010-09-06Added <points> tag handling in attributes.xml.Yohann Ferreira1-46/+89
Reviewed-by: Freeyorp, Thorbjorn.
2010-08-30Change primary and secondary tags in attributes.xml from stats and stat to ↵Freeyorp1-2/+2
attributes and attribute respectively.
2010-08-03Allow default values for attributes at character creation time.Freeyorp1-1/+23
TODO: The game-server also needs to keep track of this for when new attributes or attributes not in the default scope need to be created. Also hopefully fix attribute calculation order for derived attributes. Still hardcoded for now. Reviewed-by: Bertram.
2010-08-02Changed the stat file name to attributes.xml.Yohann Ferreira1-6/+7
I also made it required to start properly since it's now the case. Reviewed-by: Jaxad0127.
2010-07-10New attribute system and major changes to many low-level areas.Freeyorp1-17/+64
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-22Send update host also with registration responseThorbjørn Lindeijer1-3/+8
The client would otherwise not know which update host to use after registration. Also, the update host is now always sent, even if it is empty. This makes the message contents more deterministic. Reviewed-by: Jared Adams
2010-02-07Update Copyright date for Manaserv.Bertram1-1/+1
2010-01-18Reverted the accountserver-affecting changes of commits a9a87aea and ↵Philipp Sehmisch1-3/+2
dfc6875e - doesn't work out the way I planned.
2010-01-17Removed last traces of hardcoded access levels form game-server, begun with ↵Philipp Sehmisch1-2/+3
using the permission manager in the account-server.
2009-12-18Instead of sending http://update.manasource.org/ don't send any update host ↵Chuck Miller1-1/+3
if defaultUpdateHost is not set
2009-12-18Makes server send the update host from defaultUpdateHost config (defaults to ↵Chuck Miller1-0/+1
http://update.manasouce.org/ when non is set)
2009-12-06Renamed DALStorage to StorageThorbjørn Lindeijer1-1/+1
The only reason it was a DALStorage was because it used to implement the Storage interface, but that interface got removed a long time ago.
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-12-04Added server-sided SHA256 encryption of passwords as discussed.Philipp Sehmisch1-8/+4
2009-12-04Moved password hashing during registration to the client.Philipp Sehmisch1-3/+3
2009-12-04register credential information service and basic code structure for captcha ↵Philipp Sehmisch1-9/+46
support
2009-10-18Some random cleanupsThorbjørn Lindeijer1-1/+1
2009-10-09Synced the protocol file with client in protocol.h, letting other defines in ↵Bertram1-1/+1
defines.h, and removing some overheading along the way.
2009-10-03Limit login attempt frequency based on IP addressThorbjørn Lindeijer1-18/+24
The previous method was broken because it set the "last time" to the current time when the client connected. So login would fail when the username and password were sent within a second from connecting, which is not desirable. If I'd have fixed this by setting the "last time" to login time minus one second, then an attacker would just need to reconnect for each login attempt. So now it uses an IP address based approach, where each IP can only try to log in once per second.