summaryrefslogtreecommitdiff
path: root/src/account-server/accounthandler.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2023-04-21 11:36:47 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2023-05-05 16:03:23 +0000
commitee4624e7904f37c411fc7215d7c41d7a1b6b7d4f (patch)
tree0af36a4da03b7372dc34f9b08f7ee5ed958da90b /src/account-server/accounthandler.h
parentd9ae7419ab16d6e91469fcdc6a89dbc3afc5a030 (diff)
downloadmanaserv-ee4624e7904f37c411fc7215d7c41d7a1b6b7d4f.tar.gz
manaserv-ee4624e7904f37c411fc7215d7c41d7a1b6b7d4f.tar.bz2
manaserv-ee4624e7904f37c411fc7215d7c41d7a1b6b7d4f.tar.xz
manaserv-ee4624e7904f37c411fc7215d7c41d7a1b6b7d4f.zip
Added support for logging in with Stellar
* 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.
Diffstat (limited to 'src/account-server/accounthandler.h')
-rw-r--r--src/account-server/accounthandler.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/account-server/accounthandler.h b/src/account-server/accounthandler.h
index f1ffcfe2..c27b00ed 100644
--- a/src/account-server/accounthandler.h
+++ b/src/account-server/accounthandler.h
@@ -23,6 +23,8 @@
#include <string>
+class ConnectionHandler;
+
namespace AccountClientHandler
{
/**
@@ -37,14 +39,18 @@ namespace AccountClientHandler
void deinitialize();
/**
+ * Returns the connection handler.
+ */
+ ConnectionHandler *getConnectionHandler();
+
+ /**
* Prepares a connection for a client coming from a game server.
*/
void prepareReconnect(const std::string &token, int accountID);
/**
- * Processes messages received by the connection handler.
*/
- void process();
+ void handleStellarLogin(const std::string &token, const std::string &pubKey);
}
#endif // ACCOUNTHANDLER_H