-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert betraying Reactor's rpc for anti-anti-cheat purposes
- Loading branch information
1 parent
7b007aa
commit 8add273
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace CrowdedMod.Net; | ||
|
||
public enum CustomRpcCalls | ||
{ | ||
SetColor | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Hazel; | ||
using Reactor; | ||
using Reactor.Networking; | ||
|
||
namespace CrowdedMod.Net; | ||
|
||
[RegisterCustomRpc((uint) CustomRpcCalls.SetColor)] | ||
public class SetColorRpc : PlayerCustomRpc<CrowdedModPlugin, byte> | ||
{ | ||
public SetColorRpc(CrowdedModPlugin plugin, uint id) : base(plugin, id) | ||
{ | ||
} | ||
|
||
public override RpcLocalHandling LocalHandling => RpcLocalHandling.After; | ||
public override void Write(MessageWriter writer, byte data) | ||
{ | ||
writer.Write(data); | ||
} | ||
|
||
public override byte Read(MessageReader reader) | ||
{ | ||
return reader.ReadByte(); | ||
} | ||
|
||
public override void Handle(PlayerControl player, byte data) | ||
{ | ||
player.SetColor(data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters