LethalNetworkAPI
A library/API to allow developers to easily add networking to their mods.
Date uploaded | 3 months ago |
Version | 3.2.0 |
Download link | xilophor-LethalNetworkAPI-3.2.0.zip |
Downloads | 192275 |
Dependency string | xilophor-LethalNetworkAPI-3.2.0 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100Lordfirespeed-OdinSerializer
Fast, robust, powerful and extendible .NET serializer built for Unity
Preferred version: 2022.11.9README
LethalNetworkAPI
This mod is an API meant for mod developers.
Usage
See the GitHub Wiki for information on how to use this API in your mod.
Acknowledgements
Thank you @Lordfirespeed for helping set up the GitHub Actions, and continually being my rubber ducky!
Thank you @giosuel for helping me test the v3 major release of this API!
Thank you @Dreadrith for helping test and reform this API in the preview/release-candidate stage!
CHANGELOG
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
[v3.3.1]
Fixed
- Fixed error occuring when disconnecting from a lobby when you were previously a host in the game session.
[v3.3.0]
Added
LNetworkUtils.OnNetworkStartCallback
- This event will run when the server/client starts up.
Changed
- Minor Internal Refactoring
[v3.2.1]
Added
- Support for LobbyCompatibility; this will ensure that the server and clients are using the same version of this API.
Fixed
- Fixed
IsConnected
not working properly.
[v3.2.0]
Changed
- Improved error messages.
- Changed internal backend to be more optimal and only use Networking and Serialization when necessary.
Fixed
- Fixed
SendOtherClients
not sending to the server. - Fixed
LNetworkUtils.AllConnectedClients
not including the server.
[v3.1.1]
Fixed
- Fixed Shutdown error for
UnnamedMessageHandler
. - Fixed
LNetworkVariable
update error when the variable has not yet been created on the client.
[v3.1.0]
Added
- Added
LNetworkVariable
- replacesLethalNetworkVariable
.- Added
LNetworkVariableWritePerms
enum to control the write permissions of the variable. - Added
UpdateOwner
method to update the owner of the variable. - Added
Dispose
method to dispose of the variable.
- Added
Fixed
- Fixed clients not sending events/messages/variable updates to other clients.
[v3.0.3]
Fixed
- NGO
ConnectedClients should only be accessed on the server
error.
[v3.0.2]
Fixed
- Some built-in types not serializing properly.
- NGO
InvalidOperationException
during disconnecting if aLethalNetworkVariable
is used.
[v3.0.1]
Fixed
InvalidOperationException: Invalid binary data stream
error.
[v3.0.0]
Added
LNetworkMessage
- Simplifies sending/receiving messages between the server and clients by using a single class instead of multiple classes
- Replaces
LethalServerMessage
andLethalClientMessage
LNetworkEvent
- Simplifies sending/receiving events between the server and clients by using a single class instead of multiple classes
- Replaces
LethalServerEvent
andLethalClientEvent
- Added
LNetworkUtils
Changed
- Reworked the entire API
- Now uses Unity's new
CustomMessagingManager
to send messages - This allows for vanilla compatibility, though it is not recommended
- Added
LNetworkMessage
- Added
LNetworkEvent
- Now uses Unity's new
Deprecated
- The
LethalClientMessage
andLethalServerMessage
classes- Use
LNetworkMessage
instead
- Use
- The
LethalClientEvent
andLethalServerEvent
classes- Use
LNetworkEvent
instead
- Use
- The
LethalNetworkVariable
class- Currently, there is no replacement for this class. If you need to use it immediately, this class still will work but will receive no updates
[v2.1.7]
Added
ClearSubscriptions
method for messages & events
[v2.1.7]
Changed
- Added warning when using incorrect build - only for devs
Fixed
- Incompatibility with latest (preview) LLL versions
[v2.1.6]
Changed
- Reverted Serialization Changes from v2.1.5
Fixed
- Network Variable ownership ignored when joining a lobby
- Null Variables breaking loading into a server
[v2.1.5]
Changed
- Serialization of NetworkObjects/Behaviours
- Should now support collections
Fixed
- Error when setting a Network Variable's value before joining a lobby.
[v2.1.4]
Added
- NuGet Package Tags
Fixed
- Actually fixed issues with re-hosting.
[v2.1.3]
Changed
- Increased Harmony Patch priority
[v2.1.2]
Changed
- Minor internal refactoring.
- Better error messages.
[v2.1.1]
Fixed
- Issue with Network Variables causing error when re-hosting
[v2.1.0]
Added
- Ability to create network messages and events with a method to run instead of having to subscribe separately.
Changed
- Minor internal refactoring.
Fixed
- Issue with networking Network Variables
[v2.0.2]
Added
- Stack-traces to identifier errors.
[v2.0.1]
Fixed
- Extensions were not accessible.
- Identifiers were not mod-specific.
[v2.0.0]
Added
- Ability to create Network Variables specific to a Network Object.
[PublicNetworkVariable]
Attribute
Changed
- Network Variables
- Ownership
- By default, the server is now the owner.
- Using the
[PublicNetworkVariable]
Attribute, you can allow any client to modify the variable. - Client-owned variables can only be made by creating one specific to a Network Object.
- A great choice is
PlayerControllerB
- A great choice is
- Ownership
- Internal Refactoring
Removed
- LethalNetworkVariable.SetOwnership()
- Removed in favor of the newly reworked Network Variable ownership system.
[LethalNetworkProtected]
Attribute- Removed in favor of the newly reworked Network Variable ownership system.
Fixed
- Errors when re-hosting a server
[v1.1.3]
Changed
- Updated NuGet Package License
[v1.1.2]
Changed
- Updated Changelog
[v1.1.1]
Changed
- Internal GitHub Workflow Shenanigans
[v1.1.0]
Changed
- Backend NetworkHandler Rework
- May not be compatible with v1.0.0
[v1.0.0]
Added
- Network Messages
- Network Events
- Network Variables
- Network Utils/Extensions