You are viewing a potentially older version of this package.
View all versions.
CodeYapper
A simple library to abstract away networking
| Date uploaded | a week ago |
| Version | 2.0.1 |
| Download link | Soggy_Pancake-CodeYapper-2.0.1.zip |
| Downloads | 3666 |
| Dependency string | Soggy_Pancake-CodeYapper-2.0.1 |
README
CodeYapper
CodeYapper is a lightweight C# networking library designed to simplify sending and receiving custom packets in Atlyss. It allows you to create your own packet types and register callbacks that are automatically invoked when matching packets are received.
- Fork of CodeTalker originaly made by Robyn.
Special Thanks: ButteredLilly for initial inspiration for the delivery method, thanks!
Warning
Whenever a packet version update is applied you will be unable to communicate with clients not running the same version as you. If you are not seeing other user's packets then ensure you are running the latest version of CodeTalker!
Features
- Define custom packet classes by inheriting from
PacketBaseorBinaryPacketBase. - Easily register listeners for specific packet types.
- Deserialize incoming messages and dispatch them to the appropriate listener.
- Packets are serialized into Steam lobby chat messages, avoiding the need for new RPCs that could disrupt multiplayer or clutter the in-game chat.
How it works
Json Packets
- Create your packet classes by inheriting from
PacketBase. - Register listeners for your packet types using
CodeTalkerNetwork.RegisterListener<T>(). - Send packets using
CodeTalkerNetwork.SendNetworkPacket(). - Incoming messages are deserialized and routed automatically to the registered listeners.
PacketHeaderinformation is included with each payload, providing useful data such as the sender's identity and whether the sender is the host.
Binary Packets
- Create your packet classes by inheriting from
BinaryPacketBase. - Register listeners for your packet types using
CodeTalkerNetwork.RegisterBinaryListener<T>(). - Send packets using
CodeTalkerNetwork.SendBinaryNetworkPacket(). - Incoming messages are serialized and deserialized using a custom function defined by the packet, then routed automatically to the registered listeners.
PacketHeaderinformation is included with each payload, providing useful data such as the sender's identity and whether the sender is the host.
For a full example, see the example folder in the repo.
CHANGELOG
Changelog
Version 2.0.1
- Marked
SendBinaryNetworkPacketas obsolete in favor ofSendNetworkPacketwith an overload. - Attempting to send a packet that would result in a buffer larger than 4096 bytes will log an error and fail to send.
Version 2.0.0
- New author ig
- Update package info
- new icon to differentiate from original
- just a frame from rosedoMeow emote (artist is @roseDoodle, this is just a silly mod icon but figured ig at least gib credit/sauce)
- Still uses the same mod GUID so it will replace existing installs during loading
- new icon to differentiate from original
- BREAKING changes to json packets
- Type handling is now done by linking the packet type to the packet handler
- Should fix a potential exploit (by Marioalexsan)
- Existing code won't need to update, just the library
- Updated packet version to 3
- MetaInf removed from json packets
- Type handling is now done by linking the packet type to the packet handler
- Binary packet support!
- New binary classes for sending and receiving binary data
- You MUST deserialize and serialize binary packets yourself
- This is for ADVANCED users only
- Allows for much denser packets for the same info
- You MUST deserialize and serialize binary packets yourself
- New example files have been included
- New binary classes for sending and receiving binary data
- Debugging improvements
- Doesn't print packet if the packet is not registered
- Doesn't print that the packet was ignored if the type matches the last ignored packet
Version 1.2.0
- Adds a packet wrapper to graceful handle when the client does not have the same mods installed as the sender.
- Adds a MetaInf table to the packet wrapper for use later without breaking the packet version each time
- BREAKING Changes packet version to 2, clients on older versions will not be able to communicate with version 2 or higher clients.
Version 1.1.4
- Adds a config file option for Packet Debugging. This is meant for developers to see all traffic and debug packet issues. It is
FALSEby default. Please only enable if you need it, because it is likely slow
Version 1.1.3
- Exception logging will ignore type load errors for the sake of debugging. This is a minor change aimed at developers
Version 1.1.2
- Adds much smarter exception handling to help users understand where networking errors occur and what mod is to blame
- Lowers network buffer to 4kb from 10kb for better memory usage