Interface IServerNetworkChannel
- Namespace
- Vintagestory.API.Server
- Assembly
- VintagestoryAPI.dll
Represent a custom network channel for sending messages between client and server
public interface IServerNetworkChannel : INetworkChannel
- Inherited Members
- Extension Methods
Methods
BroadcastPacket<T>(T, params IServerPlayer[])
When called on Sends a packet to all connected player, except given players
void BroadcastPacket<T>(T message, params IServerPlayer[] exceptPlayers)
Parameters
message
TexceptPlayers
IServerPlayer[]
Type Parameters
T
RegisterMessageType(Type)
Registers a handler for when you send a packet with given messageId. Must be registered in the same order as on the server.
IServerNetworkChannel RegisterMessageType(Type type)
Parameters
type
Type
Returns
RegisterMessageType<T>()
Registers a handler for when you send a packet with given messageId. Must be registered in the same order as on the server.
IServerNetworkChannel RegisterMessageType<T>()
Returns
Type Parameters
T
SendPacket<T>(T, byte[], params IServerPlayer[])
Sends a packet to given player, where the byte[] data has already been serialized
void SendPacket<T>(T message, byte[] data, params IServerPlayer[] players)
Parameters
message
Tdata
byte[]players
IServerPlayer[]
Type Parameters
T
SendPacket<T>(T, params IServerPlayer[])
Sends a packet to given player
void SendPacket<T>(T message, params IServerPlayer[] players)
Parameters
message
Tplayers
IServerPlayer[]
Type Parameters
T
SetMessageHandler<T>(NetworkClientMessageHandler<T>)
Registers a handler for when you send a packet with given messageId
IServerNetworkChannel SetMessageHandler<T>(NetworkClientMessageHandler<T> messageHandler)
Parameters
messageHandler
NetworkClientMessageHandler<T>
Returns
Type Parameters
T