NetSerializer Methods

LiteNetLib

NetSerializer Methods

LiteNetLib

The NetSerializer type exposes the following members.

Methods

  NameDescription
Public methodReadAllPackets(NetDataReader)
Reads all available data from NetDataReader and calls OnReceive delegates
Public methodReadAllPacketsT(NetDataReader, T)
Reads all available data from NetDataReader and calls OnReceive delegates
Public methodReadKnownPacketT(NetDataReader)
Reads packet with known type
Public methodReadKnownPacketT(NetDataReader, T)
Reads packet with known type (non alloc variant)
Public methodReadPacket(NetDataReader)
Reads one packet from NetDataReader and calls OnReceive delegate
Public methodReadPacket(NetDataReader, Object)
Reads one packet from NetDataReader and calls OnReceive delegate
Public methodRegisterT
Register packet type for direct reading (ReadKnownPacket)
Public methodRegisterCustomTypeT
Register custom property type
Public methodRegisterCustomTypeT(FuncT)
Register custom property type
Public methodRegisterCustomTypeT(ActionNetDataWriter, T, FuncNetDataReader, T)
Register custom property type
Public methodSerializeT(T)
Serialize struct to byte array
Public methodSerializeT(NetDataWriter, T)
Serialize struct to NetDataWriter (fast)
Public methodSubscribeT(ActionT, FuncT)
Register and subscribe to packet receive event
Public methodSubscribeT, TUserData(ActionT, TUserData, FuncT)
Register and subscribe to packet receive event (with userData)
Public methodSubscribeReusableT(ActionT)
Register and subscribe to packet receive event This metod will overwrite last received packet class on receive (less garbage)
Public methodSubscribeReusableT, TUserData(ActionT, TUserData)
Register and subscribe to packet receive event This metod will overwrite last received packet class on receive (less garbage)
Top
See Also

Reference