Skip to content

[Question] can this able to detect chat ID spoofing? #8

Answered by Charlese2
CoolLKKPS asked this question in Q&A
Discussion options

You must be logged in to vote

It does check that the ID used to chat matches the player that sent the RPC.
If the host has the mod installed it will prevent clients from sending messages that look like it is from someone else.

if (playerId == SenderPlayerId)
{
Traverse.Create(HUDManager.Instance).Method("AddPlayerChatMessageServerRpc", [sanitizedChatMessage, playerId]).GetValue();
}
else
{
Log.LogWarning($"Player #{SenderPlayerId} ({username}) tried to send message as another player #({playerId}) Message: ({chatMessage})");
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Charlese2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #7 on February 23, 2024 22:59.