Add player authentication backend.

This commit is contained in:
Paul Chote
2018-07-07 13:41:00 +00:00
committed by abcdefg30
parent 0965464148
commit c74159e549
12 changed files with 408 additions and 46 deletions

View File

@@ -9,9 +9,12 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using OpenRA.Traits;
namespace OpenRA.Network
@@ -175,14 +178,19 @@ namespace OpenRA.Network
State = Session.ClientState.Invalid
};
var localProfile = Game.LocalPlayerProfile;
var response = new HandshakeResponse()
{
Client = info,
Mod = mod.Id,
Version = mod.Metadata.Version,
Password = orderManager.Password
Password = orderManager.Password,
Fingerprint = localProfile.Fingerprint
};
if (request.AuthToken != null && response.Fingerprint != null)
response.AuthSignature = localProfile.Sign(request.AuthToken);
orderManager.IssueOrder(Order.HandshakeResponse(response.Serialize()));
break;
}