An open API service indexing awesome lists of open source software.

https://github.com/alexanderlindholt/packetplus

An improved version of the Packet networking library.
https://github.com/alexanderlindholt/packetplus

efficiency luau networking optimization performance roblox simplicity

Last synced: 3 months ago
JSON representation

An improved version of the Packet networking library.

Awesome Lists containing this project

README

          


Packet+


An improved version of the Packet networking library.






# ✨ It’s just better!
This modified version of Packet offers simplified packet definitions and packet safety (early packets are still received). Additionally, it brings minor improvements regarding error messages and optimization.


# 🛠️ Setup and use it!
First and foremost, [learn the original Packet library](https://www.youtube.com/watch?v=WoIElUdj64A&ab_channel=SuphiKaner).


Then, for Packet+, you need to setup a signal library.

Signal+ is recommended because it’s the best.

Make sure to tag the module `Signal`.


The API is mostly identical to the original library, but there is a key difference, seen below:

## ❌ Packet:
Use a shared module:
```lua
local Packet = require(path.to.Packet)

return {
MyPacket = Packet("MyPacket", Packet.String),
MyCoolPacket = Packet("MyCoolPacket", Packet.Number)
}
```
Or put definitions in every script that uses the packets:
```lua
local Packet = require(path.to.Packet)

local myPacket = Packet("MyPacket", Packet.String)
local myCoolPacket = Packet("MyCoolPacket", Packet.Number)
```

## ✅ Packet+:
Use a shared module:
```lua
local Packet = require(path.to.Packet)

return {
MyPacket = Packet(Packet.String),
MyCoolPacket = Packet(Packet.Number)
}
```
Packet+ removes the name parameter, requiring packets to be defined in a shared module. The packet name is inferred from the table key, reducing repetition and keeping definitions centralized and efficient.