Skip to main content

Module net

Module net 

Source
Expand description

Sending over the network. To a player (server side) always; to the server (client side) only when the mod says so in yog.toml:

[network]
to_server = true

Then it needs Yog on the server, and yog build builds it with this crate’s to-server feature. A mod that sends without saying so doesn’t compile: the channel it names isn’t a ServerChannel.

ⓘ
// Without `to-server`: "this mod sends to the server without saying so".
yog_api::net::send_to_server("mymod:hello", vec![1u8]);

Structs§

SendToPlayer
Sends payload on channel to player (server side).

Traits§

ServerChannel
A channel the mod sends to the server on: any name, once the mod says it sends there ([network] to_server = true, the to-server feature).

Functions§

send_to_player
Sends payload on channel to player (server side).
send_to_server
Sends payload on channel to the server (client side): whether it went (a server without Yog has no channel to take it).