Skip to content

Matis-Projects/TNetLibrarySystem

Repository files navigation

TNetLibrarySystem GitHub GitHub Repo stars GitHub all releases GitHub tag (latest SemVer)

A package for make a Networking system easy to use.


TNetLibrarySystem is a packages for make your Networking scripts more readable and support parameters!



Warning! The current version is not stable and the latest one!

This readme file need to be reviewed, this is an very old version and some stuff aren't updated today!


How to install TNetLibrarySystem

Prerequisites:

  1. Download fr.tismatis.tnetlibrarysystem.zip from here
  2. Unpack the .zip somewhere
  3. In VRChat Creator Companion, navigate to Settings > User Packages > Add
  4. Navigate to the unpacked folder, fr.tismatis.tnetlibrarysystem and click Select Folder
  5. TNetLibrarySystem should now be visible under Local User Packages in the project view in VRChat Creator Companion
  6. Click Add
  1. In the Unity toolbar, select Window > Package Manager > [+] > Add package from git URL...
  2. Paste the following link: https://github.com/Matis-Projects/TNetLibrarySystem.git

Why use TNetLibrarySystem

  • TODO: Remake this part

How to use TNetLibrarySystem

Preparation of the world

  1. Select in the Menu Bar TNetLibrarySystem.
  2. Click on Import prefab in the scene and select the line count.
  • We recommends to use 16 lines.

Coding with TNLS.

  • Warning, all old method for adding the script automaticly to TNLS is outdated, that include AssignNewScriptToNetwork due to the new update.
  1. Import Tismatis.TNetLibrarySystem.Coding in the class.
  2. Just put the inherent class as NetworkedClass and not UdonSharpBehaviour by default.
  3. Set by the Inspector in Unity to modify the scriptName value.
  • You can set scriptName by overriding void Start() but you need to change the value before the base.Start();.
  • When you use the void Start(), make sure you override the one of NetworkedClass and you added base.Start(); at the first line.

Call a method

  • In the case the script where you start the call is in a NetworkedClass:
    • You call the script himself: SendNetworkedEvent("All/Local", "<Your Void Name>", "<The ScriptName destination>", <parameters>);
    • You call another script than the one you use to call: SendExternalNetworkedEvent("All/Local", "<Your Void Name>", "<The ScriptName destination>", <parameters>);
  • In the case the script where you start the call is not in a NetworkedClass: TNLSManager.CallNamedNetworkedScript("All/Local", "<Your Void Name>", "<The ScriptName destination>", <parameters>);

Call method by UI Button with arguments

  • Currently, only the string is supported.
  1. Create your button and select it on Unity.
  2. Add the component TNLS Custom Button Sender.
  3. Configuration of the component:
    1. Insert your TNLS Manager.
    2. Write your Target.
    3. Write the original ScriptName.
    4. Write the original MethodName.
  4. Add an action on the button and insert the TNLS Custom Button Sender component.
  5. Select the event UdonBehaviour.SendCustomEvent and write the event CallTheCustomEvent.

Receive Parameters

  • Now you need to declare ddirectly in yours parameters an array of object like this: void MyNetworkedMethod(object[] parameters).

Parameters

  • Limits of the system

    • Parameters can be null or a array of object[]!
    • You have at maximum 25 parameters!* Can be modified in the TNLS Settings but not recommended
  • Supported types Some types aren't compatible for now, they will be compatible after.

    • If you get any error from one type listed, please create a issue for report it.
    Keyword Aliased Type Base Support Array Support Full Support Note
    short Int16 ✔️ ✔️ ✔️
    ushort UInt16 ✔️ ✔️ ✔️
    int Int32 ✔️ ✔️ ✔️
    uint UInt32 ✔️ ✔️ ✔️
    long Int64 ✔️ ✔️ ✔️
    ulong UInt64 ✔️ ✔️ ✔️
    float Single ✔️ ✔️ ✔️
    double Double ✔️ ✔️ ✔️
    bool Boolean ✔️ ✔️ ✔️
    byte Byte ✔️ ✔️ ✔️
    sbyte SByte ✔️ ✔️ ✔️
    ~ Color ✔️ ✔️ ✔️
    ~ Color32 ✔️ ✔️ ✔️
    ~ Quarternion ✔️ ✔️ ✔️
    ~ Vector2 ✔️ ✔️ ✔️
    ~ Vector2Int ✔️ ✔️ ✔️
    ~ Vector3 ✔️ ✔️ ✔️
    ~ Vector3Int ✔️ ✔️ ✔️
    ~ Vector4 ✔️ ✔️ ✔️
    decimal Decimal ✔️ ✔️ ✔️
    ~ VRCPlayerApi ✔️ ✔️ ✔️
    string String ✔️ ✔️ ✔️
    char Char ✔️ ✔️ ✔️

Debug

  • Now you need to enable enableLog in Debug Mode!
  • To put in a text:
    1. Create a 2D Text
    2. Assign this 2D Text to the TNLS Logging System, a child of TNLS Manager.
    3. Activate debug mode in TNLS Manager.
  • To activate the debug mode: (for get more detail)
    1. Activate the Debug Mode in the TNLS Settings, a child of TNLS Manager.

About

This is a new Networking system for UdonSharp.

Resources

License

GPL-3.0, Unknown licenses found

Licenses found

GPL-3.0
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages