Toemsel / Network

C# Network Library
https://push-force.dev
GNU Lesser General Public License v3.0
355 stars 65 forks source link

Can this library send and receive structs ? #80

Closed genaray closed 2 years ago

genaray commented 3 years ago

I basically search an c# network lib which is capable of sending data oriented structs from the server to the client. Im not making any useage of classes because im using an entity component system architecture.

Is it possible to send/receive structs with this lib in an easy way ?

Toemsel commented 3 years ago

Not yet - although technically possible with reflection already - but I will add it as a future feature.

Toemsel commented 2 years ago

I dug into this request. In order to support enums, we would require to support field serialization. This feature wouldn't be backward-compatible and might cause issues. I recommend to use "BeforeSend" and "AfterSend" to implement a custom logic for enum conversion. Or, even better, provide a custom packet converter by yourself. (Override the default packet converter)