FServerAuthSession
The server side of the join handshake, apart from the socket so a test drives it without one. On connect it sends the peer a challenge (a fresh nonce, the issue time, and each configured provider with the identity a credential must be bound to); the peer answers with a credential for one provider, echoing the nonce. A credential whose nonce is not the one issued to THAT connection is refused before any verifier sees it, which is what stops a captured ticket being replayed on another connection. The verdict, duplicate-login check and the join deadline live here too.
- Module
- Networking
- Header
#include "Networking/Auth/ServerAuth.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
std::function<void(uint32_t peerId, uint64_t userId, const std::string& provider)> | OnAuthenticated | Fires on the game thread when a peer is admitted / refused. |
std::function<void(uint32_t peerId, const std::string& reason)> | OnRejected |
Public functions
| Returns | Name | Description |
|---|---|---|
void | Configure | |
void | Reset | |
bool | IsEnabled | True when at least one verifier is configured: peers must authenticate. |
void | PeerConnected | |
void | PeerDisconnected | |
bool | HandleFrame | True when the frame was a handshake frame (consumed whether or not it was accepted); the caller must not treat it as game traffic. |
void | Update | |
bool | IsAuthenticated | |
bool | IsPending | |
uint64_t | GetUserId | |
std::string | GetProvider | |
size_t | AuthenticatedCount | |
void | ResolvePeer | A verifier outside the session's own call chain (Steam's ban notice) resolves or revokes a peer through these. |
void | RevokePeer | |
bool | GetIssuedNonce | The nonce a peer was challenged with, for tests and diagnostics. |
Function details
Configure
void Configure(const FHooks& hooks, float timeoutSeconds)Reset
void Reset()IsEnabled
bool IsEnabled() constTrue when at least one verifier is configured: peers must authenticate.
PeerConnected
void PeerConnected(uint32_t peerId, const std::string& address)PeerDisconnected
void PeerDisconnected(uint32_t peerId)HandleFrame
bool HandleFrame(uint32_t peerId, const uint8_t* data, size_t size)True when the frame was a handshake frame (consumed whether or not it was accepted); the caller must not treat it as game traffic.
Update
void Update(float deltaSeconds)IsAuthenticated
bool IsAuthenticated(uint32_t peerId) constIsPending
bool IsPending(uint32_t peerId) constGetUserId
uint64_t GetUserId(uint32_t peerId) constGetProvider
std::string GetProvider(uint32_t peerId) constAuthenticatedCount
size_t AuthenticatedCount() constResolvePeer
void ResolvePeer(uint32_t peerId, const FServerAuthVerdict& verdict)A verifier outside the session's own call chain (Steam's ban notice) resolves or revokes a peer through these.
RevokePeer
void RevokePeer(uint32_t peerId, const std::string& reason)GetIssuedNonce
bool GetIssuedNonce(uint32_t peerId, FServerAuthNonce& outNonce) constThe nonce a peer was challenged with, for tests and diagnostics.