fixed: additional data missed

This commit is contained in:
2022-10-15 18:48:48 +04:00
parent 783d2ce922
commit 9a22566f79
2 changed files with 3 additions and 3 deletions
@@ -25,7 +25,7 @@ public class AuthorizationManager : IAuthorizationManager
_playersByPeers = new Dictionary<uint, Player>(); _playersByPeers = new Dictionary<uint, Player>();
} }
public void OnAuthorization(uint peerId, string key, string name) public void OnAuthorization(uint peerId, string key, string name, ReadOnlySpan<byte> additionalData)
{ {
if (_playersByPeers.ContainsKey(peerId)) if (_playersByPeers.ContainsKey(peerId))
{ {
@@ -35,7 +35,7 @@ public class AuthorizationManager : IAuthorizationManager
var dispatcher = _gameThread.ThreadDispatcher; var dispatcher = _gameThread.ThreadDispatcher;
_provider.OnAuthorizationRequest(key, name, Array.Empty<byte>(), _provider.OnAuthorizationRequest(key, name, additionalData.ToArray(),
(playerId, playerName) => { dispatcher.Dispatch(() => Accepted(peerId, playerId, playerName)); }, (playerId, playerName) => { dispatcher.Dispatch(() => Accepted(peerId, playerId, playerName)); },
(errorCode) => { dispatcher.Dispatch(() => Rejected(peerId, errorCode)); }); (errorCode) => { dispatcher.Dispatch(() => Rejected(peerId, errorCode)); });
} }
+1 -1
View File
@@ -6,8 +6,8 @@ namespace Ragon.Core
public class Player public class Player
{ {
public string Id { get; set; } public string Id { get; set; }
public uint PeerId { get; set; }
public string PlayerName { get; set; } public string PlayerName { get; set; }
public uint PeerId { get; set; }
public bool IsLoaded { get; set; } public bool IsLoaded { get; set; }
public List<Entity> Entities; public List<Entity> Entities;