Skip to content

Commit

Permalink
style: fixing typos
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Apr 19, 2024
1 parent c755d74 commit 2dc5df2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Assets/Mirage/Runtime/MessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void HandleMessage(INetworkPlayer player, ArraySegment<byte> packet)
LogAndCheckDisconnect(player, e);

if (_rethrowException)
// note, dont add Exception here, otherwise strack trace will be overritten
// note, dont add Exception here, otherwise stack trace will be overwritten
throw;
}
}
Expand All @@ -117,7 +117,7 @@ internal void InvokeHandler(INetworkPlayer player, int msgType, NetworkReader re
{
if (_messageHandlers.TryGetValue(msgType, out var handler))
{
if (CheckAuthenticaiton(player, msgType, handler))
if (CheckAuthentication(player, msgType, handler))
handler.Delegate.Invoke(player, reader);
}
else
Expand All @@ -136,7 +136,7 @@ internal void InvokeHandler(INetworkPlayer player, int msgType, NetworkReader re
}
}

private bool CheckAuthenticaiton(INetworkPlayer player, int msgType, Handler handler)
private bool CheckAuthentication(INetworkPlayer player, int msgType, Handler handler)
{
// always allowed
if (handler.AllowUnauthenticated)
Expand All @@ -146,14 +146,14 @@ private bool CheckAuthenticaiton(INetworkPlayer player, int msgType, Handler han
if (player.Authentication != null)
return true;

// not authenciated
// not authenticated
// log and disconnect

// player is Unauthenticated so we dont trust them
// info log only, so attacker can force server to spam logs
if (logger.LogEnabled())
{
// we know msgType is found (because we have hanlder), so we dont need if check for tryGet
// we know msgType is found (because we have handler), so we dont need if check for tryGet
MessagePacker.MessageTypes.TryGetValue(msgType, out var type);
logger.Log($"Unauthenticated Message {type} received from {player}, player is not Authenticated so handler will not be invoked");
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Mirage/Runtime/NetworkSceneManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ private void HostPlayerAuthenticated()
// nornal client invokes start, then finish, even if scene is already loaded
OnClientStartedSceneChange?.Invoke(ActiveScenePath, SceneOperation.Normal);

// server server and client copy of hoost player as ready
// server server and client copy of host player as ready
Server.LocalClient.Player.SceneIsReady = true;
Server.LocalPlayer.SceneIsReady = true;

Expand Down

0 comments on commit 2dc5df2

Please sign in to comment.