Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

Basic Authentication

Peter Halasz edited this page Jun 17, 2019 · 3 revisions

[WORK IN PROGRESS] This page is a work in progress.

  • Implement IUserAuthenticator.
  • Add the new authenticator before calling Connect on the networker.
    • use the SetAuthenticator method
public void IssueChallenge(NetWorker networker, NetworkingPlayer player, Action<NetworkingPlayer, BMSByte> issueChallengeAction, Action<NetworkingPlayer> skipAuthAction)
{
    issueChallengeAction(player, new BMSByte());
}
public void AcceptChallenge(NetWorker networker, BMSByte challenge, Action<BMSByte> authServerAction, Action rejectServerAction)
{
    Ticket = Client.Instance.Auth.GetAuthSessionTicket();
    var data = ObjectMapper.BMSByte(Client.Instance.SteamId, Ticket.Data);
    authServerAction(data);
}
public void VerifyResponse(NetWorker networker, NetworkingPlayer player, BMSByte response, Action<NetworkingPlayer> authUserAction, Action<NetworkingPlayer> rejectUserAction)
{
    ulong steamid = response.GetBasicType<ulong>();
    byte[] ticketBinary = response.GetByteArray(response.StartIndex());

    if (AuthUser(steamid, ticketBinary))
    {
        authUserAction();
    } else {
        rejectUserAction();
    }
}

Home

Getting Started
Network Contract Wizard (NCW)
Network Object
Remote Procedure Calls (RPCs)
Unity Integration
Basic Network Samples
Scene Navigation
NetWorker
Master Server
Web Server
Netcoding Design Patterns
Troubleshooting
Miscellaneous
Forge Networking Alloy
Steamworks

Clone this wiki locally