summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-05-26Fixed login in case an account gets two pending tokens assignedHEADmasterThorbjørn Lindeijer5-89/+33
Not entirely sure if this is what was happening, but if a PAMSG_LOGIN_RNDTRGR was handled, a new pending account was always created and appended to mPendingAccounts. However, when handling the follow-up PAMSG_LOGIN, only the first pending account with matching username was checked, which could result in a failed login due to mismatching token. Resolved this issue by unifying the client-specific random token with the Stellar token stored on the AccountClient. This means the username value in PAMSG_LOGIN_RNDTRGR could be removed. Eventually it would also be nice to simplify this further such that the token is automatically sent to the client after connecting rather than being something that needs to be requested.
2023-05-16Allow account email to be null in the databaseThorbjørn Lindeijer5-33/+106
When using login with Stellar, the email address remains empty. This was causing issues since the email is also required to be unique, in effect only a single Stellar account could exist. Resolved this by allowing the email column to be null, since the unique requirement does not cover null values. An empty email will now be stored as null value. For non-Stellar logins, an email address is still required.
2023-05-16Added error handling to SqLiteDataProvider::processSqlThorbjørn Lindeijer2-3/+13
Previously errors would just cause it to return an empty set.
2023-05-16Added some info messages related to Stellar loginThorbjørn Lindeijer3-2/+6
Something doesn't seem to be working right...
2023-05-16Removed outdated filesThorbjørn Lindeijer4-3224/+0
ChangeLog, INSTALL, NEWS and TODO are all no longer relevant.
2023-05-15Manage CharacterData using std::unique_ptrThorbjørn Lindeijer16-198/+187
Fixes many memory leaks, but also made it clear that we're very often loading all the character data only to immediately throw it away again, even when most of the time all we really need is the database ID or the name.
2023-05-15General code cleanupsThorbjørn Lindeijer44-159/+145
* Overall includes cleanup * Use std::make_pair * Make some functions const
2023-05-05Updated Docker image to Fedora 38Thorbjørn Lindeijer1-2/+2
2023-05-05Added net_stellarLoginUrl configurationThorbjørn Lindeijer2-2/+5
The client needs to know the URL to open in the browser. The bare token is still sent as well, which might allow the client to directly interact with a Stellar wallet in the future.
2023-05-05Use std::make_uniqueThorbjørn Lindeijer2-10/+5
2023-05-05Avoid potential undefined behavior related to data raceThorbjørn Lindeijer1-3/+4
Using atomic operations to avoid a compiler potentially optimizing away the thread responsible for clean shutdown.
2023-05-05Fixed building of Docker imageThorbjørn Lindeijer2-3/+9
2023-05-05Added support for logging in with StellarThorbjørn Lindeijer12-72/+326
* Added PAMSG_STELLAR_LOGIN / PAMSG_STELLAR_LOGIN_RESPONSE, which is used by the client to request a login token that can be signed using a Stellar wallet. * Added uWebSockets dependency, used to listen for a separate server that verifies signed tokens (the Stellar Bridge). When a token is verified, it is sent to manaserv-account, which then sends a APMSG_LOGIN_RESPONSE to the client matching the token. * Added RapidJSON dependency to parse the JSON WebSocket messages. * To keep everything in a single thread, uWebSockets is now driving the event loop. Processing of ENet hosts, writing stats and expired bans have been moved to uSocket timers. * C++ standard updated to C++17, as required by uWebSockets. When Stellar is used to login, the public key is used as the username. It might be better to introduce an explicit field for this, especially when we want to enable an account to feature both Stellar login as well as login with username / password.
2023-05-02Fixed condition in compareStrIThorbjørn Lindeijer1-1/+1
The result of the first part of the condition, "itA < endA", was simply unused. Discovered thanks to attribute ‘nodiscard’ [-Wunused-result] in more recent C++ standard / compiler.
2023-05-01Use more cores when building the DockerfileThorbjørn Lindeijer1-1/+1
2023-05-01CMake: Use cmake-format to reformat all CMakeLists.txtThorbjørn Lindeijer4-215/+200
Especially to change them to lowercase.
2022-08-25Updated Docker image to Fedora 36Thorbjørn Lindeijer1-2/+2
Also reduces its size from 483MB to 296MB.
2022-08-25Reduced the size of the DockerfileThorbjørn Lindeijer1-2/+5
Went from 818MB to 483MB. Still rather large, but quite an improvement.
2022-08-25Removed Upstart filesThorbjørn Lindeijer2-33/+0
Upstart was replaced by systemd on all relevant systems. And running manaserv is now easiest by using Docker anyway.
2022-08-19Apply C++11 fixitsThorbjørn Lindeijer51-396/+272
modernize-loop-convert modernize-deprecated-headers
2022-08-19Apply C++11 fixitsThorbjørn Lindeijer107-507/+476
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2022-08-19Updated DALStorage -> Storage in error messagesThorbjørn Lindeijer3-78/+78
Finishing 213af0fbde3f198ad1ab2143d32fc6798b7f8f50.
2022-08-19Avoid some warning, iircThorbjørn Lindeijer1-2/+2
2022-08-19Premature optimization based on clazy hintThorbjørn Lindeijer1-1/+3
2022-08-19Added net_accountListenToGameHost config optionThorbjørn Lindeijer3-3/+6
This is because the network interface on which the account server listens to the game server does not need to match the one on which the account server listens to the client.
2022-08-19Fixed possible leak in AccountHandler::handleUnregisterMessageThorbjørn Lindeijer5-80/+85
Fixed by changing account instances to be managed by std::unique_ptr, so we don't forget to delete them somewhere, like in that function as well as during shutdown in AccountHandler.
2022-06-16Updated PhysFS usageThorbjørn Lindeijer1-6/+7
We now require at least PhysFS 2.1. Also no longer add the "current directory" to the search path and allow the "PKG_DATADIR" used to locate files shipping with the server to be overridden by the "serverPath" configuration variable. Closes #81
2022-06-16Removed usage of deprecated std::unary_functionThorbjørn Lindeijer1-4/+2
Appears to have been entirely unnecessary.
2022-05-25Check return value for enet_peer_sendThorbjørn Lindeijer2-6/+18
If it fails, we will need to destroy the packet ourselves rather than relying on enet to eventually destroy it.
2022-05-25Fixed compile against Lua 5.4Thorbjørn Lindeijer1-4/+9
Now lua_resume takes 4 arguments, and the number of result values is set on the 4th one.
2022-05-25Fixed compiler warnings about dynamic exception specificationsThorbjørn Lindeijer3-15/+6
"warning: dynamic exception specifications are deprecated in C++11" Fortunately, it's effectively the same thing as not mentioning anything at all. The fact that these functions can throw this exception is already in their documentation.
2018-10-03Build images into GitLab registryErik Schilling1-0/+19
2018-10-03Install sql scriptsErik Schilling1-0/+2
2018-10-03Properly install as part of the docker imageErik Schilling1-12/+8
2018-09-14Merge pull request #82 from Ablu/luafixErik Schilling1-1/+1
Do not search for old lua explicitly
2018-09-13Do not search for old lua explicitlyErik Schilling1-1/+1
We also support the newer versions and systems like Fedora do not ship the older lua versions.
2018-09-06Merge pull request #81 from Ablu/dockerErik Schilling2-0/+23
Added Dockerfile
2018-09-06Added DockerfileErik Schilling2-0/+23
2018-04-05Fixed socklen_t typedef conflict in enetErik Schilling1-0/+2
It is reported as https://github.com/lsalzman/enet/issues/90 but unfixed in upstream so far...
2015-06-07Updated enet to 1.3.13Thorbjørn Lindeijer16-472/+895
Updating enet was due since 3 years, but now we could skip 9 versions. Our CMakeLists.txt file was replaced with the one from enet.
2015-06-07Fixed compile when using Lua 5.3Thorbjørn Lindeijer2-5/+3
It seems like properly upgrading to Lua 5.3 would affect quite a few small function calls, but fortunately compatibility can be achieved with just a define for now.
2015-06-07Fixing some compilation issues when using GCC 5.1Thorbjørn Lindeijer2-4/+4
For whatever reason, GCC 5.1 no longer finds an operator<< overload for streaming a std::ostringstream into a std::ostringstream.
2015-04-25Do not pollute the context with the icu namespaceErik Schilling1-0/+3
2015-04-24Fix crash if the client sends garbage public id valuesErik Schilling1-1/+5
Indexing an array with a negative int as index is no good idea...
2014-05-05Make travis build with gcc 4.8Erik Schilling1-1/+3
2014-03-02IdManager tweaksThorbjørn Lindeijer1-4/+2
2014-02-03Fixed SQL InjectionErik Schilling1-3/+4
2013-12-29Small cleanupErik Schilling6-19/+11
- Deleted empty constructor rather than throwing, resulting in compiletime errors rather than runtime errors. - Removed some remainings of currentMana - Fixed some compiler warnings regarding structs getting forward declared as classes.
2013-12-08Restored copy constructor protection for mapcompositeErik Schilling1-0/+1
2013-12-08deleted copy constructors in Component rather than all the subclassesErik Schilling4-16/+11