-
Notifications
You must be signed in to change notification settings - Fork 1
Schemes
smokingplaya edited this page May 22, 2025
·
1 revision
Scheme is the minimum unit of information in AutumnNet.
Scheme is a description of the contents of a Package.
autumnnet.registration("exampleMesasge", {
server = {
-- field "admin" of type "Player"
{ "admin", "player" }
},
client = {
-- field "banReason" of type "String"
{ "banReason", "string" }
}
})This code registers a scheme named exampleMessage in memory.
The second argument passes a table of contents that will be used when sending/receiving a packet.
The server field is the content of the packet that will be sent to the client from the server.
That is, on the client when receiving the packet exampleMessage it will have the field admin with the type Player, and on the server when receiving the packet from the client it will have the field banReason with the type string (this is just an example).