Home

Awesome

TurtlePass

Turtle Pass is an addon for Fishnet that allows you to send large byte arrays over several frames so it doesn't overwhelm more limiting transports like FishySteamworks and FishyUtp

Usage

Setup

Add Turtle Pass Manager component to the NetworkManager. The Debug bool can log relevant Turtle Pass messages to console when toggled.

image

Sending a message

To send a large byte array call:

TurtlePassManager.QueueSendBytes(int senderID, TurtlePassDataType dataType , byte[] data, int packedSize, bool sendToServer = false, int ToSpecificID = -1)

Receiving a message

On the script you want to receive the message implement the interface ITurtlePassReceiver

public interface ITurtlePassReceiver {
    public void ReceiveTurtlePassMessage(byte[] data,int packedSize, int senderId, TurtlePassDataType dataType);
}

Then add your receiver to the Receivers list in the Turtle Pass Manager

        TurtlePassManager.Receivers.Add(this);

It'll then call the ReceiveTurtlePassMessage method in your receiver when the message has been fully received.

Change sending rates

Sending rates are controlled by 3 const values in the beginning of Turtle Pass Manager

    public const int maxSize = 86000; //Maximum size of the message in bytes
    public const int maxSendPerAttempt = 1; //How many messages to send in a single pass.
    public const float sendInterval = 0.33f; //Time interval between passes.

These values worked well for me but feel free to play around with them.