ENET V1.0 🛜
ENET is a package that I have made that makes networking harder for exploiters!
In the past exploiters use a script called “Remote Spy” to watch all the remotes that the client sent to the server so they could call them to make exploits. An example of this would be:
→ Player pressed button for coin and a remote is sent to the server
clickRemoteEvent:FireServer()
An exploiter could see this remote and fire it like 100 times per second.
Note: you should already be implementing server checks so this can’t happen
What ENET aims to do is prevent exploiters from knowing anything about your networking.
How it works:
When you use ENET can send a publish request to the server a remote event is created and fired with a topic. Let’s use the example from before:
NetworkController:Publish("CoinButtonClicked", arguments)
This would create a remote event with a random id. Then it would fire that remote event with the topic of “CoinButtonClicked”. But wait, wouldn’t that defeat the purpose if the exploiters knew which topic we are firing? Yes, that’s why the topic is encrypted with MurmurHash3. Now the only thing the exploiter knows about are the arguments and a hash for the topic.
Note: Hash seed is synced when player joins.
Hash used.
When the client publishes a remote event is created (like i said before). Then the server starts listening for that remote and when it receives a event it is destroyed and all of the subscription callbacks with the matching hashed topic are called with player and the arguments passed.
local subscription = NetworkService:Subscribe("CoinButtonClicked", function()
print("Coins!")
end)
Note: This system is pretty much the same from the server to the client as well.
Documentation:
How to require ENet:
-- Server would be ENetServer.ENet
local ENet = require(ENetClient.ENet)
Client Methods:
ENet:Publish(topic: string, arguments: table) -> nil
ENet:Subscribe(topic: string, callback: function) -> Subscription
Server Methods:
ENet:Publish(player: player, topic: string, arguments: table) -> nil
ENet:PublishAll(topic: string, arguments: table) -> nil
ENet:Subscribe(topic: string, callback: function) -> Subscription
In both of the modules (server and client) you can enable/disable the option to print out network publishing.
Here is what it looks like:
Sending packet to server:
Topic: ToggleBuilding[1848782386]
Remote Id: 453B87AB-8BED-45B6-A3F3-98A773AA1B4F
Data Size: 0.002KB -- Might not be accurate as it's using length of encoded JSON
Data: table: 0xb9ddb79222680c3b {}
You can also change the lifetime of the remote event in case it never gets fired (default is 1s).
Download
Github
Note: Using ENet will be sending more data to the server(hashed topic) and 2 remotes every publish. This is meant for security and not performance.
Last Updated: 2024-03-19T05:00:00Z
Thanks for reading and if you have any feedback please let me know!