diff --git a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer.meta b/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer.meta deleted file mode 100644 index c4ab1d9f..00000000 --- a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 801a5a4a36c283c4d95572aa3a82e376 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/MessageExtensions.cs b/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/MessageExtensions.cs deleted file mode 100644 index 35f0d575..00000000 --- a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/MessageExtensions.cs +++ /dev/null @@ -1,70 +0,0 @@ -using UnityEngine; - -namespace Riptide.Demos.DedicatedClient -{ - public static class MessageExtensions - { - #region Vector2 - /// - /// This method is simply an alternative way of calling . - public static Message Add(this Message message, Vector2 value) => AddVector2(message, value); - - /// Adds a to the message. - /// The to add. - /// The message that the was added to. - public static Message AddVector2(this Message message, Vector2 value) - { - return message.AddFloat(value.x).AddFloat(value.y); - } - - /// Retrieves a from the message. - /// The that was retrieved. - public static Vector2 GetVector2(this Message message) - { - return new Vector2(message.GetFloat(), message.GetFloat()); - } - #endregion - - #region Vector3 - /// - /// This method is simply an alternative way of calling . - public static Message Add(this Message message, Vector3 value) => AddVector3(message, value); - - /// Adds a to the message. - /// The to add. - /// The message that the was added to. - public static Message AddVector3(this Message message, Vector3 value) - { - return message.AddFloat(value.x).AddFloat(value.y).AddFloat(value.z); - } - - /// Retrieves a from the message. - /// The that was retrieved. - public static Vector3 GetVector3(this Message message) - { - return new Vector3(message.GetFloat(), message.GetFloat(), message.GetFloat()); - } - #endregion - - #region Quaternion - /// - /// This method is simply an alternative way of calling . - public static Message Add(this Message message, Quaternion value) => AddQuaternion(message, value); - - /// Adds a to the message. - /// The to add. - /// The message that the was added to. - public static Message AddQuaternion(this Message message, Quaternion value) - { - return message.AddFloat(value.x).AddFloat(value.y).AddFloat(value.z).AddFloat(value.w); - } - - /// Retrieves a from the message. - /// The that was retrieved. - public static Quaternion GetQuaternion(this Message message) - { - return new Quaternion(message.GetFloat(), message.GetFloat(), message.GetFloat(), message.GetFloat()); - } - #endregion - } -} diff --git a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/MessageExtensions.cs.meta b/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/MessageExtensions.cs.meta deleted file mode 100644 index cefdbd38..00000000 --- a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/MessageExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e994a35be988bef40b7d7f7b27508092 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.dll b/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.dll deleted file mode 100644 index 48e9c081..00000000 Binary files a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.dll and /dev/null differ diff --git a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.dll.meta b/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.dll.meta deleted file mode 100644 index 0eb4fc80..00000000 --- a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: a2a64e903ba3c4e4b844c46575e8bcd1 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.xml b/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.xml deleted file mode 100644 index 1cd4d0cf..00000000 --- a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.xml +++ /dev/null @@ -1,2678 +0,0 @@ - - - - RiptideNetworking - - - - A client that can connect to a . - - - Invoked when a connection to the server is established. - - - Invoked when a connection to the server fails to be established. - - - Invoked when a message is received. - - - Invoked when disconnected from the server. - - - Invoked when another non-local client connects. - - - Invoked when another non-local client disconnects. - - - The client's numeric ID. - - - - - - - This value is slower to accurately represent lasting changes in latency than , but it is less susceptible to changing drastically due to significant—but temporary—jumps in latency. - - - Whether or not the client is currently not connected nor trying to connect. - - - Whether or not the client is currently in the process of connecting. - - - Whether or not the client's connection is currently pending (will only be when a server doesn't immediately accept the connection request). - - - Whether or not the client is currently connected. - - - - - - Encapsulates a method that handles a message from a server. - The message that was received. - - - The client's connection to a server. - - - How many connection attempts have been made so far. - - - How many connection attempts to make before giving up. - - - - - - The underlying transport's client that is used for sending and receiving data. - - - Custom data to include when connecting. - - - - - - - - - Disconnects the client if it's connected and swaps out the transport it's using. - The new transport to use for sending and receiving data. - This method does not automatically reconnect to the server. To continue communicating with the server, must be called again. - - - Attempts to connect to a server at the given host address. - The host address to connect to. - How many connection attempts to make before giving up. - The ID of the group of message handler methods to use when building . - Data that should be sent to the server with the connection attempt. Use to get an empty message instance. - Riptide's default transport expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777. If you are using a different transport, check the relevant documentation for what information it requires in the host address. - if a connection attempt will be made. if an issue occurred (such as being in an invalid format) and a connection attempt will not be made. - - - Subscribes appropriate methods to the transport's events. - - - Unsubscribes methods from all of the transport's events. - - - - - - - - - - - - - - - Sends a message to the server. - The message to send. - Whether or not to return the message to the pool after it is sent. - - - - Disconnects from the server. - - - Cleans up the local side of the connection. - The reason why the client has disconnected. - The disconnection or rejection message, potentially containing extra data to be handled externally. - TData that should be sent to the client being disconnected. Use to get an empty message instance. Unused if the connection wasn't rejected. - - - What to do when the transport establishes a connection. - - - What to do when the transport fails to connect. - - - What to do when the transport disconnects. - - - Invokes the event. - - - Invokes the event. - The reason for the connection failure. - Additional data related to the failed connection attempt. - - - Invokes the event and initiates handling of the received message. - The received message. - - - Invokes the event. - The reason for the disconnection. - Additional data related to the disconnection. - - - Invokes the event. - The numeric ID of the client that connected. - - - Invokes the event. - The numeric ID of the client that disconnected. - - - The state of a connection. - - - Not connected. No connection has been established or the connection has been closed. - - - Connecting. Still trying to establish a connection. - - - Connection is pending. The server is still determining whether or not the connection should be allowed. - - - Connected. A connection has been established successfully. - - - Represents a connection to a or . - - - The connection's numeric ID. - - - Whether or not the connection is currently not connected nor trying to connect. - - - Whether or not the connection is currently in the process of connecting. - - - Whether or not the connection is currently pending (will only be when a server doesn't immediately accept the connection request). - - - Whether or not the connection is currently connected. - - - The round trip time (ping) of the connection, in milliseconds. -1 if not calculated yet. - - - The smoothed round trip time (ping) of the connection, in milliseconds. -1 if not calculated yet. - This value is slower to accurately represent lasting changes in latency than , but it is less susceptible to changing drastically due to significant—but temporary—jumps in latency. - - - Whether or not the connection can time out. - - - The local peer this connection is associated with. - - - Whether or not the connection has timed out. - - - Whether or not the connection attempt has timed out. Uses a multiple of and ignores the value of . - - - The currently pending reliably sent messages whose delivery has not been acknowledged yet. Stored by sequence ID. - - - The sequence ID of the latest message that we want to acknowledge. - - - Messages that we have received and want to acknowledge. - - - Messages that we have received whose sequence IDs no longer fall into 's range. Used to improve duplicate message filtering capabilities. - - - The sequence ID of the latest message that we've received an ack for. - - - Messages that we sent which have been acknoweledged. - - - A with the left-most bit set to 1. - - - The next sequence ID to use. - - - The connection's current state. - - - The time at which the last heartbeat was received from the other end. - - - The ID of the last ping that was sent. - - - The ID of the currently pending ping. - - - The stopwatch that tracks the time since the currently pending ping was sent. - - - Initializes the connection. - - - Resets the connection's timeout time. - - - Sends a message. - The message to send. - Whether or not to return the message to the pool after it is sent. - - If you intend to continue using the message instance after calling this method, you must set - to . can be used to manually return the message to the pool at a later time. - - - - Sends data. - The array containing the data. - The number of bytes in the array which should be sent. - - - Updates acks and determines whether the message is a duplicate. - The message's sequence ID. - Whether or not the message should be handled. - - - Cleans up the local side of the connection. - - - Updates the acks bitfield and determines whether or not to handle the message. - The gap between the newly received sequence ID and the previously last received sequence ID. - Whether or not the message should be handled, based on whether or not it's a duplicate. - - - Updates the duplicate filter bitfield and determines whether or not to handle the message. - The gap between the newly received sequence ID and the previously last received sequence ID. - Whether or not the message should be handled, based on whether or not it's a duplicate. - - - Updates which messages we've received acks for. - The latest sequence ID that the other end has received. - A redundant list of sequence IDs that the other end has (or has not) received. - - - Check the ack status of the given sequence ID. - The sequence ID whose ack status to check. - The bit corresponding to the sequence ID's position in the bit field. - - - Immediately marks the of a given sequence ID as delivered. - The sequence ID that was acknowledged. - - - Puts the connection in the pending state. - - - Sends an ack message for the given sequence ID. - The sequence ID to acknowledge. - - - Handles an ack message. - The ack message to handle. - - - Handles an ack message for a sequence ID other than the last received one. - The ack message to handle. - - - Sends a welcome message. - - - Handles a welcome message on the server. - The welcome message to handle. - - - Handles a heartbeat message. - The heartbeat message to handle. - - - Sends a heartbeat message. - - - Handles a welcome message on the client. - The welcome message to handle. - - - Sends a welcome response message. - - - Sends a heartbeat message. - - - Handles a heartbeat message. - The heartbeat message to handle. - - - Contains event data for when a client connects to the server. - - - The newly connected client. - - - Initializes event data. - The newly connected client. - - - Contains event data for when a client disconnects from the server. - - - The client that disconnected. - - - The reason for the disconnection. - - - Initializes event data. - The client that disconnected. - The reason for the disconnection. - - - Contains event data for when a message is received. - - - The connection from which the message was received. - - - The ID of the message. - - - The received message. - - - Initializes event data. - The connection from which the message was received. - The ID of the message. - The received message. - - - Contains event data for when a connection attempt to a server fails. - - - Additional data related to the failed connection attempt (if any). - - - Initializes event data. - Additional data related to the failed connection attempt (if any). - - - Contains event data for when the client disconnects from a server. - - - The reason for the disconnection. - - - Additional data related to the disconnection (if any). - - - Initializes event data. - The reason for the disconnection. - Additional data related to the disconnection (if any). - - - Contains event data for when a non-local client connects to the server. - - - The numeric ID of the client that connected. - - - Initializes event data. - The numeric ID of the client that connected. - - - Contains event data for when a non-local client disconnects from the server. - - - The numeric ID of the client that disconnected. - - - Initializes event data. - The numeric ID of the client that disconnected. - - - The exception that is thrown when a does not contain enough unread bytes to add a certain value. - - - The message with insufficient remaining capacity. - - - The name of the type which could not be added to the message. - - - The number of available bytes the type requires in order to be added successfully. - - - Initializes a new instance. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The message with insufficient remaining capacity. - The name of the type which could not be added to the message. - The number of available bytes required for the type to be added successfully. - - - Initializes a new instance and constructs an error message from the given information. - The message with insufficient remaining capacity. - The length of the array which could not be added to the message. - The name of the array's type. - The number of available bytes required for a single element of the array to be added successfully. - The number of available bytes required for the entire array to be added successfully. If left as -1, this will be set to * . - - - Constructs the error message from the given information. - The error message. - - - Constructs the error message from the given information. - The error message. - - - The exception that is thrown when a method with a is not marked as . - - - The type containing the handler method. - - - The name of the handler method. - - - Initializes a new instance. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The type containing the handler method. - The name of the handler method. - - - Constructs the error message from the given information. - The error message. - - - The exception that is thrown when a method with a does not have an acceptable message handler method signature (either or ). - - - The type containing the handler method. - - - The name of the handler method. - - - Initializes a new instance. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The type containing the handler method. - The name of the handler method. - - - Constructs the error message from the given information. - The error message. - - - The exception that is thrown when multiple methods with s are set to handle messages with the same ID and have the same method signature. - - - The message ID with multiple handler methods. - - - The type containing the first handler method. - - - The name of the first handler method. - - - The type containing the second handler method. - - - The name of the second handler method. - - - Initializes a new instance with a specified error message. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The message ID with multiple handler methods. - The first handler method's info. - The second handler method's info. - - - Constructs the error message from the given information. - The error message. - - - Represents a type that can be added to and retrieved from messages using the and methods. - - - Adds the type to the message. - The message to add the type to. - - - Retrieves the type from the message. - The message to retrieve the type from. - - - The send mode of a . - - - Unreliable send mode. - - - Reliable send mode. - - - Provides functionality for converting data to bytes and vice versa. - - - The maximum number of bytes required for a message's header. - 1 byte for the actual header, 2 bytes for the sequence ID (only for reliable messages), 2 bytes for the message ID. Messages sent unreliably will use 2 bytes less than this value for the header. - - - The maximum number of bytes that a message can contain, including the . - - - The maximum number of bytes of payload data that a message can contain. This value represents how many bytes can be added to a message on top of the . - - - How many messages to add to the pool for each or instance that is started. - Changes will not affect and instances which are already running until they are restarted. - - - A pool of reusable message instances. - - - The message's send mode. - - - The length in bytes of the unread data contained in the message. - - - The length in bytes of the data that has been written to the message. - - - How many more bytes can be written into the packet. - - - The message's data. - - - The position in the byte array that the next bytes will be written to. - - - The position in the byte array that the next bytes will be read from. - - - Initializes a reusable instance. - The maximum amount of bytes the message can contain. - - - Trims the message pool to a more appropriate size for how many and/or instances are currently running. - - - Gets a usable message instance. - A message instance ready to be used. - - - Gets a message instance that can be used for sending. - The mode in which the message should be sent. - The message ID. - A message instance ready to be used for sending. - - - - NOTE: will be cast to a . You should ensure that its value never exceeds that of , otherwise you'll encounter unexpected behaviour when handling messages. - - - Gets a message instance that can be used for sending. - The message's header type. - A message instance ready to be used for sending. - - - Gets a message instance directly from the pool without doing any extra setup. - As this message instance is returned straight from the pool, it will contain all previous data and settings. Using this instance without preparing it properly will likely result in unexpected behaviour. - A message instance. - - - Retrieves a message instance from the pool. If none is available, a new instance is created. - A message instance ready to be used for sending or handling. - - - Returns the message instance to the internal pool so it can be reused. - - - Prepares the message to be used. - The message, ready to be used. - - - Prepares the message to be used for sending. - The header of the message. - The message, ready to be used for sending. - - - Prepares the message to be used for handling. - The header of the message. - The number of bytes that this message contains and which can be retrieved. - The message, ready to be used for handling. - - - Sets the message's header byte to the given and determines the appropriate and read/write positions. - The header to use for this message. - - - Adds a single to the message. - The to add. - The message that the was added to. - - - Adds a single to the message. - The to add. - The message that the was added to. - - - Retrieves a single from the message. - The that was retrieved. - - - Retrieves a single from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds an array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of bytes to retrieve. - The array that was retrieved. - - - Populates a array with bytes retrieved from the message. - The amount of bytes to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves an array from the message. - The array that was retrieved. - - - Retrieves an array from the message. - The amount of sbytes to retrieve. - The array that was retrieved. - - - Populates a array with bytes retrieved from the message. - The amount of sbytes to retrieve. - The array to populate. - The position at which to start populating . - - - Reads a number of bytes from the message and writes them into the given array. - The amount of bytes to read. - The array to write the bytes into. - The position at which to start writing into the array. - - - Reads a number of sbytes from the message and writes them into the given array. - The amount of sbytes to read. - The array to write the sbytes into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of bools to retrieve. - The array that was retrieved. - - - Populates a array with bools retrieved from the message. - The amount of bools to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of bools from the message and writes them into the given array. - The number of bytes the bools are being stored in. - The array to write the bools into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of shorts to retrieve. - The array that was retrieved. - - - Populates a array with shorts retrieved from the message. - The amount of shorts to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of ushorts to retrieve. - The array that was retrieved. - - - Populates a array with ushorts retrieved from the message. - The amount of ushorts to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of shorts from the message and writes them into the given array. - The amount of shorts to read. - The array to write the shorts into. - The position at which to start writing into the array. - - - Reads a number of ushorts from the message and writes them into the given array. - The amount of ushorts to read. - The array to write the ushorts into. - The position at which to start writing into the array. - - - Adds an to the message. - The to add. - The message that the was added to. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves an from the message. - The that was retrieved. - - - Retrieves a from the message. - The that was retrieved. - - - Adds an array message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves an array from the message. - The array that was retrieved. - - - Retrieves an array from the message. - The amount of ints to retrieve. - The array that was retrieved. - - - Populates an array with ints retrieved from the message. - The amount of ints to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of uints to retrieve. - The array that was retrieved. - - - Populates a array with uints retrieved from the message. - The amount of uints to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of ints from the message and writes them into the given array. - The amount of ints to read. - The array to write the ints into. - The position at which to start writing into the array. - - - Reads a number of uints from the message and writes them into the given array. - The amount of uints to read. - The array to write the uints into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of longs to retrieve. - The array that was retrieved. - - - Populates a array with longs retrieved from the message. - The amount of longs to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of ulongs to retrieve. - The array that was retrieved. - - - Populates a array with ulongs retrieved from the message. - The amount of ulongs to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of longs from the message and writes them into the given array. - The amount of longs to read. - The array to write the longs into. - The position at which to start writing into the array. - - - Reads a number of ulongs from the message and writes them into the given array. - The amount of ulongs to read. - The array to write the ulongs into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of floats to retrieve. - The array that was retrieved. - - - Populates a array with floats retrieved from the message. - The amount of floats to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of floats from the message and writes them into the given array. - The amount of floats to read. - The array to write the floats into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of doubles to retrieve. - The array that was retrieved. - - - Populates a array with doubles retrieved from the message. - The amount of doubles to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of doubles from the message and writes them into the given array. - The amount of doubles to read. - The array to write the doubles into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of strings to retrieve. - The array that was retrieved. - - - Populates a array with strings retrieved from the message. - The amount of strings to retrieve. - The array to populate. - The position at which to start populating the array. - - - The maximum number of elements an array can contain where the length still fits into a single byte. - - - The maximum number of elements an array can contain where the length still fits into two byte2. - - - Adds the length of an array to the message, using either 1 or 2 bytes depending on how large the array is. Does not support arrays with more than 32,767 elements. - The length of the array. - - - Retrieves the length of an array from the message, using either 1 or 2 bytes depending on how large the array is. - The length of the array. - - - Adds a serializable to the message. - The serializable to add. - The message that the serializable was added to. - - - Retrieves a serializable from the message. - The serializable that was retrieved. - - - Adds an array of serializables to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves an array of serializables from the message. - The array that was retrieved. - - - Retrieves an array of serializables from the message. - The amount of serializables to retrieve. - The array that was retrieved. - - - Populates an array of serializables retrieved from the message. - The amount of serializables to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of serializables from the message and writes them into the given array. - The amount of serializables to read. - The array to write the serializables into. - The position at which to start writing into . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of an value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of an array length value. - - - Constructs an error message for when a message contains insufficient unread bytes to retrieve a certain value. - The name of the value type for which the retrieval attempt failed. - Text describing the value which will be returned. - The error message. - - - Constructs an error message for when a message contains insufficient unread bytes to retrieve an array of values. - The expected length of the array. - The name of the value type for which the retrieval attempt failed. - The error message. - - - Constructs an error message for when a number of retrieved values do not fit inside the bounds of the provided array. - The number of values being retrieved. - The length of the provided array. - The position in the array at which to begin writing values. - The name of the value type which is being retrieved. - The name of the value type in plural form. If left empty, this will be set to with an s appended to it. - The error message. - - - Specifies a method as the message handler for messages with the given ID. - - - In order for a method to qualify as a message handler, it must match a valid message handler method signature. s - will only use methods marked with this attribute if they match the signature, and s - will only use methods marked with this attribute if they match the signature. - - - Methods marked with this attribute which match neither of the valid message handler signatures will not be used by s - or s and will cause warnings at runtime. - - - If you want a or to only use a subset of all message handler methods, you can do so by setting up - custom message handler groups. Simply set the group ID in the constructor and pass the - same value to the or method. This - will make that or only use message handlers which have the same group ID. - - - - - The ID of the message type which this method is meant to handle. - - - The ID of the group of message handlers which this method belongs to. - - - Initializes a new instance of the class with the and values. - The ID of the message type which this method is meant to handle. - The ID of the group of message handlers which this method belongs to. - - s will only use this method if its signature matches the signature. - s will only use this method if its signature matches the signature. - This method will be ignored if its signature matches neither of the valid message handler signatures. - - - - Provides functionality for enabling/disabling automatic message relaying by message type. - - - The number of bits an int consists of. - - - An array storing all the bits which represent whether messages of a given ID should be relayed or not. - - - Creates a filter of a given size. - How big to make the filter. - - should be set to the value of the largest message ID, plus 1. For example, if a server will - handle messages with IDs 1, 2, 3, 7, and 8, should be set to 9 (8 is the largest possible value, - and 8 + 1 = 9) despite the fact that there are only 5 unique message IDs the server will ever handle. - - - - Creates a filter based on an enum of message IDs. - The enum type. - - - Creates a filter of a given size and enables relaying for the given message IDs. - How big to make the filter. - Message IDs to enable auto relaying for. - - - - Creates a filter based on an enum of message IDs and enables relaying for the given message IDs. - The enum type. - Message IDs to enable relaying for. - - - Enables auto relaying for the given message IDs. - Message IDs to enable relaying for. - - - Calculate the filter size necessary to manage all message IDs in the given enum. - The enum type. - The appropriate filter size. - is not an . - - - Sets the filter size. - How big to make the filter. - - - Enables auto relaying for the given message ID. - The message ID to enable relaying for. - - - - - - Disables auto relaying for the given message ID. - The message ID to enable relaying for. - - - - - - Checks whether or not messages with the given ID should be relayed. - The message ID to check. - Whether or not messages with the given ID should be relayed. - - - The reason the connection attempt was rejected. - - - No response was received from the server (because the client has no internet connection, the server is offline, no server is listening on the target endpoint, etc.). - - - The client is already connected. - - - A connection attempt is already pending. - - - The server is full. - - - The connection attempt was rejected. - - - The connection attempt was rejected and custom data may have been included with the rejection message. - - - The reason for a disconnection. - - - No connection was ever established. - - - The connection attempt was rejected by the server. - - - The active transport detected a problem with the connection. - - - The connection timed out. - - This also acts as the fallback reason—if a client disconnects and the message containing the real reason is lost - in transmission, it can't be resent as the connection will have already been closed. As a result, the other end will time - out the connection after a short period of time and this will be used as the reason. - - - - The client was forcibly disconnected by the server. - - - The server shut down. - - - The disconnection was initiated by the client. - - - Provides base functionality for and . - - - The name to use when logging messages via . - - - The time (in milliseconds) after which to disconnect if no heartbeats are received. - - - The interval (in milliseconds) at which to send and expect heartbeats to be received. - Changes to this value will only take effect after the next heartbeat is executed. - - - The number of currently active and instances. - - - The current time. - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected or rejected due to an unknown reason. - - - The text to log when the connection failed due to . - - - The text to log when the connection failed due to . - - - The text to log when the connection failed due to . - - - The text to log when the connection failed due to . - - - A stopwatch used to track how much time has passed. - - - Received messages which need to be handled. - - - A queue of events to execute, ordered by how soon they need to be executed. - - - Initializes the peer. - The name to use when logging messages via . - - - Retrieves methods marked with . - An array containing message handler methods. - - - Builds a dictionary of message IDs and their corresponding message handler methods. - The ID of the group of message handler methods to include in the dictionary. - - - Starts tracking how much time has passed. - - - Stops tracking how much time has passed. - - - Beats the heart. - - - Handles any received messages and invokes any delayed events which need to be invoked. - - - Sets up a delayed event to be executed after the given time has passed. - How long from now to execute the delayed event, in milliseconds. - The delayed event to execute later. - - - Handles all queued messages. - - - Handles data received by the transport. - - - Handles a message. - The message to handle. - The message's header type. - The connection which the message was received on. - - - Increases . For use when a new or is started. - - - Decreases . For use when a or is stopped. - - - Stores information about a message that needs to be handled. - - - The message that needs to be handled. - - - The message's header type. - - - The connection on which the message was received. - - - Handles initialization. - The message that needs to be handled. - The message's header type. - The connection on which the message was received. - - - Represents a currently pending reliably sent message whose delivery has not been acknowledged yet. - - - The time of the latest send attempt. - - - The multiplier used to determine how long to wait before resending a pending message. - - - How often to try sending the message before giving up. - - - A pool of reusable instances. - - - The to use to send (and resend) the pending message. - - - The sequence ID of the message. - - - The contents of the message. - - - The length in bytes of the data that has been written to the message. - - - How many send attempts have been made so far. - - - Whether the pending message has been cleared or not. - - - Handles initial setup. - - - Retrieves a instance, initializes it and then sends it. - The sequence ID of the message. - The message that is being sent reliably. - The to use to send (and resend) the pending message. - - - Retrieves a instance from the pool. If none is available, a new instance is created. - A instance. - - - Returns the instance to the pool so it can be reused. - - - Resends the message. - - - Attempts to send the message. - - - Clears the message. - Whether or not to remove the message from . - - - A server that can accept connections from s. - - - Invoked when a client connects. - - - Invoked when a message is received. - - - Invoked when a client disconnects. - - - Whether or not the server is currently running. - - - The local port that the server is running on. - - - The maximum number of concurrent connections. - - - The number of currently connected clients. - - - An array of all the currently connected clients. - The position of each instance in the array does not correspond to that client's numeric ID (except by coincidence). - - - Encapsulates a method that handles a message from a client. - The numeric ID of the client from whom the message was received. - The message that was received. - - - Encapsulates a method that determines whether or not to accept a client's connection attempt. - - - An optional method which determines whether or not to accept a client's connection attempt. - The parameter is the pending connection and the parameter is a message containing any additional data the client included with the connection attempt. - - - Stores which message IDs have auto relaying enabled. Relaying is disabled entirely when this is . - - - Currently pending connections which are waiting to be accepted or rejected. - - - Currently connected clients. - - - Clients that have timed out and need to be removed from . - - - Methods used to handle messages, accessible by their corresponding message IDs. - - - The underlying transport's server that is used for sending and receiving data. - - - All currently unused client IDs. - - - Handles initial setup. - The transport to use for sending and receiving data. - The name to use when logging messages via . - - - Handles initial setup using the built-in UDP transport. - The name to use when logging messages via . - - - Stops the server if it's running and swaps out the transport it's using. - The new underlying transport server to use for sending and receiving data. - This method does not automatically restart the server. To continue accepting connections, must be called again. - - - Starts the server. - The local port on which to start the server. - The maximum number of concurrent connections to allow. - The ID of the group of message handler methods to use when building . - - - Subscribes appropriate methods to the transport's events. - - - Unsubscribes methods from all of the transport's events. - - - - - - Handles an incoming connection attempt. - - - Handles a connect message. - The client that sent the connect message. - The connect message. - - - Accepts the given pending connection. - The connection to accept. - - - Rejects the given pending connection. - The connection to reject. - Data that should be sent to the client being rejected. Use to get an empty message instance. - - - Accepts the given pending connection. - The connection to accept. - - - Rejects the given pending connection. - The connection to reject. - The reason why the connection is being rejected. - Data that should be sent to the client being rejected - - - Checks if clients have timed out. - - - - - - - - - Sends a message to a given client. - The message to send. - The numeric ID of the client to send the message to. - Whether or not to return the message to the pool after it is sent. - - - - Sends a message to a given client. - The message to send. - The client to send the message to. - Whether or not to return the message to the pool after it is sent. - - - - Sends a message to all connected clients. - The message to send. - Whether or not to return the message to the pool after it is sent. - - - - Sends a message to all connected clients except the given one. - The message to send. - The numeric ID of the client to not send the message to. - Whether or not to return the message to the pool after it is sent. - - - - Retrieves the client with the given ID, if a client with that ID is currently connected. - The ID of the client to retrieve. - The retrieved client. - if a client with the given ID was connected; otherwise . - - - Disconnects a specific client. - The numeric ID of the client to disconnect. - Data that should be sent to the client being disconnected. Use to get an empty message instance. - - - Disconnects the given client. - The client to disconnect. - Data that should be sent to the client being disconnected. Use to get an empty message instance. - - - Cleans up the local side of the given connection. - The client to disconnect. - The reason why the client is being disconnected. - - - What to do when the transport disconnects a client. - - - Stops the server. - - - Initializes available client IDs. - - - Retrieves an available client ID. - The client ID. 0 if none were available. - - - Sends a disconnect message. - The client to send the disconnect message to. - Why the client is being disconnected. - Optional custom data that should be sent to the client being disconnected. - - - Sends a client connected message. - The newly connected client. - - - Sends a client disconnected message. - The numeric ID of the client that disconnected. - - - Invokes the event. - The newly connected client. - - - Invokes the event and initiates handling of the received message. - The received message. - The client from which the message was received. - - - Invokes the event. - The client that disconnected. - The reason for the disconnection. - - - Contains event data for when a server's transport successfully establishes a connection to a client. - - - The newly established connection. - - - Initializes event data. - The newly established connection. - - - Contains event data for when a server's or client's transport receives data. - - - An array containing the received data. - - - The number of bytes that were received. - - - The connection which the data was received from. - - - Initializes event data. - An array containing the received data. - The number of bytes that were received. - The connection which the data was received from. - - - Contains event data for when a server's or client's transport initiates or detects a disconnection. - - - The closed connection. - - - The reason for the disconnection. - - - Initializes event data. - The closed connection. - The reason for the disconnection. - - - Defines methods, properties, and events which every transport's client must implement. - - - Invoked when a connection is established at the transport level. - - - Invoked when a connection attempt fails at the transport level. - - - Starts the transport and attempts to connect to the given host address. - The host address to connect to. - The pending connection. if an issue occurred. - The error message associated with the issue that occurred, if any. - if a connection attempt will be made. if an issue occurred (such as being in an invalid format) and a connection attempt will not be made. - - - Closes the connection to the server. - - - The header type of a . - - - An unreliable user message. - - - An internal unreliable ack message. - - - An internal unreliable ack message, used when acknowledging a sequence ID other than the last received one. - - - An internal unreliable connect message. - - - An internal unreliable connection rejection message. - - - An internal unreliable heartbeat message. - - - An internal unreliable disconnect message. - - - A reliable user message. - - - An internal reliable welcome message. - - - An internal reliable client connected message. - - - An internal reliable client disconnected message. - - - Defines methods, properties, and events which every transport's server and client must implement. - - - Invoked when data is received by the transport. - - - Invoked when a disconnection is initiated or detected by the transport. - - - Initiates handling of any received messages. - - - Defines methods, properties, and events which every transport's server must implement. - - - Invoked when a connection is established at the transport level. - - - - - - Starts the transport and begins listening for incoming connections. - The local port on which to listen for connections. - - - Closes an active connection. - The connection to close. - - - Closes all existing connections and stops listening for new connections. - - - A client which can connect to a . - - - - - - - - - - - - The connection to the server. - - - - Expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777. - - - Parses into and , if possible. - The host address to parse. - The retrieved IP. - The retrieved port. - Whether or not was in a valid format. - - - - - - - - - Invokes the event. - - - Invokes the event. - - - - - - Represents a connection to a or . - - - The endpoint representing the other end of the connection. - - - The socket to use for sending and receiving. - - - The local peer this connection is associated with. - - - An array to receive message size values into. - - - The size of the next message to be received. - - - Initializes the connection. - The socket to use for sending and receiving. - The endpoint representing the other end of the connection. - The local peer this connection is associated with. - - - - - - Polls the socket and checks if any data was received. - - - Receives a message, if all of its data is ready to be received. - How many bytes were received. - Whether or not all of the message's data was ready to be received. - - - Closes the connection. - - - - - - - - - - - - - - - Provides base send & receive functionality for and . - - - - - - An array that incoming data is received into. - - - An array that outgoing data is sent out of. - - - The default size used for the socket's send and receive buffers. - - - The size to use for the socket's send and receive buffers. - - - The main socket, either used for listening for connections or for sending and receiving data. - - - The minimum size that may be used for the socket's send and receive buffers. - - - Initializes the transport. - How big the socket's send and receive buffers should be. - - - Handles received data. - The number of bytes that were received. - The connection from which the data was received. - - - Invokes the event. - The closed connection. - The reason for the disconnection. - - - A server which can accept connections from s. - - - - - - - - - - - - The maximum number of pending connections to allow at any given time. - - - Whether or not the server is running. - - - The currently open connections, accessible by their endpoints. - - - Connections that need to be closed. - - - - - - - - - Starts listening for connections on the given port. - The port to listen on. - - - - - - Accepts any pending connections. - - - Stops listening for connections. - - - - - - - - - Invokes the event. - The successfully established connection. - - - - - - A client which can connect to a . - - - - - - - - - - - - The connection to the server. - - - - - - - Expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777. - - - Parses into and , if possible. - The host address to parse. - The retrieved IP. - The retrieved port. - Whether or not was in a valid format. - - - - - - Invokes the event. - - - Invokes the event. - - - - - - Represents a connection to a or . - - - The endpoint representing the other end of the connection. - - - The local peer this connection is associated with. - - - Initializes the connection. - The endpoint representing the other end of the connection. - The local peer this connection is associated with. - - - - - - - - - - - - - - - - - - The kind of socket to create. - - - Dual-mode. Works with both IPv4 and IPv6. - - - IPv4 only mode. - - - IPv6 only mode. - - - Provides base send & receive functionality for and . - - - - - - The default size used for the socket's send and receive buffers. - - - The minimum size that may be used for the socket's send and receive buffers. - - - How long to wait for a packet, in microseconds. - - - Whether to create an IPv4 only, IPv6 only, or dual-mode socket. - - - The size to use for the socket's send and receive buffers. - - - The array that incoming data is received into. - - - The socket to use for sending and receiving. - - - Whether or not the transport is running. - - - A reusable endpoint. - - - Initializes the transport. - Whether to create an IPv4 only, IPv6 only, or dual-mode socket. - How big the socket's send and receive buffers should be. - - - - - - Opens the socket and starts the transport. - The port to bind the socket to. - - - Closes the socket and stops the transport. - - - Polls the socket and checks if any data was received. - - - Sends data to a given endpoint. - The array containing the data. - The number of bytes in the array which should be sent. - The endpoint to send the data to. - - - Handles received data. - A byte array containing the received data. - The number of bytes in used by the received data. - The endpoint from which the data was received. - - - Invokes the event. - The closed connection. - The reason for the disconnection. - - - A server which can accept connections from s. - - - - - - - - - - - - The currently open connections, accessible by their endpoints. - - - - - - - - - Decides what to do with a connection attempt. - The connection to accept or reject. - Whether or not the connection attempt was a new connection. - - - - - - - - - Invokes the event. - The successfully established connection. - - - - - - Provides functionality for queueing methods for later execution from a chosen thread. - - - The name to use when logging messages via . - - - Handles initial setup. - The name to use when logging messages via . - - - Adds an action to the queue. - The action to be added to the queue. - - - Executes all actions in the queue on the calling thread. - This method should only be called from a single thread in the application. - - - Clears all actions in the queue without executing them. - - - Provides functionality for converting bytes to various value types and vice versa. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 2 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts the 2 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 4 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts the 4 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 8 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts the 8 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 4 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 8 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Executes an action when invoked. - - - Executes the action. - - - Resends a when invoked. - - - The message to resend. - - - The time at which the resend event was queued. - - - Initializes the event. - The message to resend. - The time at which the resend event was queued. - - - - - - Executes a heartbeat when invoked. - - - The peer whose heart to beat. - - - Initializes the event. - The peer whose heart to beat. - - - - - - Contains extension methods for various classes. - - - Takes the 's IP address and port number and converts it to a string, accounting for whether the address is an IPv4 or IPv6 address. - A string containing the IP address and port number of the endpoint. - - - Contains miscellaneous helper methods. - - - Determines whether or form should be used based on the . - The amount that and refer to. - The singular form. - The plural form. - if is 1; otherwise . - - - Calculates the signed gap between sequence IDs, accounting for wrapping. - The new sequence ID. - The previous sequence ID. - The signed gap between the two given sequence IDs. A positive gap means is newer than . A negative gap means is older than . - - - Represents a collection of items that have a value and a priority. On dequeue, the item with the lowest priority value is removed. - Specifies the type of elements in the queue. - Specifies the type of priority associated with enqueued elements. - - - Gets the number of elements contained in the . - - - Adds the specified element and associated priority to the . - The element to add. - The priority with which to associate the new element. - - - Removes and returns the lowest priority element. - - - Returns the priority of the lowest priority element. - - - Removes all elements from the . - - - Defines log message types. - - - Logs that are used for investigation during development. - - - Logs that provide general information about application flow. - - - Logs that highlight abnormal or unexpected events in the application flow. - - - Logs that highlight problematic events in the application flow which will cause unexpected behavior if not planned for. - - - Provides functionality for logging messages. - - - Whether or not messages will be logged. - - - Whether or not messages will be logged. - - - Whether or not messages will be logged. - - - Whether or not messages will be logged. - - - Encapsulates a method used to log messages. - The message to log. - - - Log methods, accessible by their - - - Whether or not to include timestamps when logging messages. - - - The format to use for timestamps. - - - Initializes with all log types enabled. - The method to use when logging all types of messages. - Whether or not to include timestamps when logging messages. - The format to use for timestamps. - - - Initializes with the supplied log methods. - The method to use when logging debug messages. Set to to disable debug logs. - The method to use when logging info messages. Set to to disable info logs. - The method to use when logging warning messages. Set to to disable warning logs. - The method to use when logging error messages. Set to to disable error logs. - Whether or not to include timestamps when logging messages. - The format to use for timestamps. - - - Enables logging for messages of the given . - The type of message to enable logging for. - The method to use when logging this type of message. - - - Disables logging for messages of the given . - The type of message to enable logging for. - - - Logs a message. - The type of log message that is being logged. - The message to log. - - - Logs a message. - The type of log message that is being logged. - Who is logging this message. - The message to log. - - - Converts a object to a formatted timestamp string. - The time to format. - The formatted timestamp. - - - diff --git a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.xml.meta b/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.xml.meta deleted file mode 100644 index b73b3424..00000000 --- a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/RiptideNetworking.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 7e53d802df6193448bd9cdb934d1e4fa -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/NetworkManager.cs b/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/NetworkManager.cs similarity index 100% rename from Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/NetworkManager.cs rename to Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/NetworkManager.cs diff --git a/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/NetworkManager.cs.meta b/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/NetworkManager.cs.meta similarity index 100% rename from Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/NetworkManager.cs.meta rename to Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/NetworkManager.cs.meta diff --git a/Demos/Unity/DedicatedServerDemo/Client/Packages/manifest.json b/Demos/Unity/DedicatedServerDemo/Client/Packages/manifest.json index 137e47ea..17afdd7e 100644 --- a/Demos/Unity/DedicatedServerDemo/Client/Packages/manifest.json +++ b/Demos/Unity/DedicatedServerDemo/Client/Packages/manifest.json @@ -9,6 +9,7 @@ "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.4.8", "com.unity.ugui": "1.0.0", + "net.tomweiland.riptide": "https://github.com/RiptideNetworking/Riptide.git?path=/Packages/Core#unity-package", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", diff --git a/Demos/Unity/DedicatedServerDemo/Client/Packages/packages-lock.json b/Demos/Unity/DedicatedServerDemo/Client/Packages/packages-lock.json index 984ab05e..3fc84e4a 100644 --- a/Demos/Unity/DedicatedServerDemo/Client/Packages/packages-lock.json +++ b/Demos/Unity/DedicatedServerDemo/Client/Packages/packages-lock.json @@ -145,6 +145,13 @@ "com.unity.modules.imgui": "1.0.0" } }, + "net.tomweiland.riptide": { + "version": "https://github.com/RiptideNetworking/Riptide.git?path=/Packages/Core#unity-package", + "depth": 0, + "source": "git", + "dependencies": {}, + "hash": "bb252ba2ea4bd1314d3f8f60bea490418635d06e" + }, "com.unity.modules.ai": { "version": "1.0.0", "depth": 0, diff --git a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer.meta b/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer.meta deleted file mode 100644 index ca62ba9d..00000000 --- a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6b9b2b7cc2937f0459021a0acf148a58 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/MessageExtensions.cs b/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/MessageExtensions.cs deleted file mode 100644 index faf569c9..00000000 --- a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/MessageExtensions.cs +++ /dev/null @@ -1,70 +0,0 @@ -using UnityEngine; - -namespace Riptide.Demos.DedicatedServer -{ - public static class MessageExtensions - { - #region Vector2 - /// - /// This method is simply an alternative way of calling . - public static Message Add(this Message message, Vector2 value) => AddVector2(message, value); - - /// Adds a to the message. - /// The to add. - /// The message that the was added to. - public static Message AddVector2(this Message message, Vector2 value) - { - return message.AddFloat(value.x).AddFloat(value.y); - } - - /// Retrieves a from the message. - /// The that was retrieved. - public static Vector2 GetVector2(this Message message) - { - return new Vector2(message.GetFloat(), message.GetFloat()); - } - #endregion - - #region Vector3 - /// - /// This method is simply an alternative way of calling . - public static Message Add(this Message message, Vector3 value) => AddVector3(message, value); - - /// Adds a to the message. - /// The to add. - /// The message that the was added to. - public static Message AddVector3(this Message message, Vector3 value) - { - return message.AddFloat(value.x).AddFloat(value.y).AddFloat(value.z); - } - - /// Retrieves a from the message. - /// The that was retrieved. - public static Vector3 GetVector3(this Message message) - { - return new Vector3(message.GetFloat(), message.GetFloat(), message.GetFloat()); - } - #endregion - - #region Quaternion - /// - /// This method is simply an alternative way of calling . - public static Message Add(this Message message, Quaternion value) => AddQuaternion(message, value); - - /// Adds a to the message. - /// The to add. - /// The message that the was added to. - public static Message AddQuaternion(this Message message, Quaternion value) - { - return message.AddFloat(value.x).AddFloat(value.y).AddFloat(value.z).AddFloat(value.w); - } - - /// Retrieves a from the message. - /// The that was retrieved. - public static Quaternion GetQuaternion(this Message message) - { - return new Quaternion(message.GetFloat(), message.GetFloat(), message.GetFloat(), message.GetFloat()); - } - #endregion - } -} diff --git a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/MessageExtensions.cs.meta b/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/MessageExtensions.cs.meta deleted file mode 100644 index 219f11fb..00000000 --- a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/MessageExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 85d4e36c412dbce4a83e5bd3061451dd -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.dll b/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.dll deleted file mode 100644 index 48e9c081..00000000 Binary files a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.dll and /dev/null differ diff --git a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.dll.meta b/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.dll.meta deleted file mode 100644 index c86b2b9e..00000000 --- a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 4454308f8452d3b40acfead0227c816b -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.xml b/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.xml deleted file mode 100644 index 1cd4d0cf..00000000 --- a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.xml +++ /dev/null @@ -1,2678 +0,0 @@ - - - - RiptideNetworking - - - - A client that can connect to a . - - - Invoked when a connection to the server is established. - - - Invoked when a connection to the server fails to be established. - - - Invoked when a message is received. - - - Invoked when disconnected from the server. - - - Invoked when another non-local client connects. - - - Invoked when another non-local client disconnects. - - - The client's numeric ID. - - - - - - - This value is slower to accurately represent lasting changes in latency than , but it is less susceptible to changing drastically due to significant—but temporary—jumps in latency. - - - Whether or not the client is currently not connected nor trying to connect. - - - Whether or not the client is currently in the process of connecting. - - - Whether or not the client's connection is currently pending (will only be when a server doesn't immediately accept the connection request). - - - Whether or not the client is currently connected. - - - - - - Encapsulates a method that handles a message from a server. - The message that was received. - - - The client's connection to a server. - - - How many connection attempts have been made so far. - - - How many connection attempts to make before giving up. - - - - - - The underlying transport's client that is used for sending and receiving data. - - - Custom data to include when connecting. - - - - - - - - - Disconnects the client if it's connected and swaps out the transport it's using. - The new transport to use for sending and receiving data. - This method does not automatically reconnect to the server. To continue communicating with the server, must be called again. - - - Attempts to connect to a server at the given host address. - The host address to connect to. - How many connection attempts to make before giving up. - The ID of the group of message handler methods to use when building . - Data that should be sent to the server with the connection attempt. Use to get an empty message instance. - Riptide's default transport expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777. If you are using a different transport, check the relevant documentation for what information it requires in the host address. - if a connection attempt will be made. if an issue occurred (such as being in an invalid format) and a connection attempt will not be made. - - - Subscribes appropriate methods to the transport's events. - - - Unsubscribes methods from all of the transport's events. - - - - - - - - - - - - - - - Sends a message to the server. - The message to send. - Whether or not to return the message to the pool after it is sent. - - - - Disconnects from the server. - - - Cleans up the local side of the connection. - The reason why the client has disconnected. - The disconnection or rejection message, potentially containing extra data to be handled externally. - TData that should be sent to the client being disconnected. Use to get an empty message instance. Unused if the connection wasn't rejected. - - - What to do when the transport establishes a connection. - - - What to do when the transport fails to connect. - - - What to do when the transport disconnects. - - - Invokes the event. - - - Invokes the event. - The reason for the connection failure. - Additional data related to the failed connection attempt. - - - Invokes the event and initiates handling of the received message. - The received message. - - - Invokes the event. - The reason for the disconnection. - Additional data related to the disconnection. - - - Invokes the event. - The numeric ID of the client that connected. - - - Invokes the event. - The numeric ID of the client that disconnected. - - - The state of a connection. - - - Not connected. No connection has been established or the connection has been closed. - - - Connecting. Still trying to establish a connection. - - - Connection is pending. The server is still determining whether or not the connection should be allowed. - - - Connected. A connection has been established successfully. - - - Represents a connection to a or . - - - The connection's numeric ID. - - - Whether or not the connection is currently not connected nor trying to connect. - - - Whether or not the connection is currently in the process of connecting. - - - Whether or not the connection is currently pending (will only be when a server doesn't immediately accept the connection request). - - - Whether or not the connection is currently connected. - - - The round trip time (ping) of the connection, in milliseconds. -1 if not calculated yet. - - - The smoothed round trip time (ping) of the connection, in milliseconds. -1 if not calculated yet. - This value is slower to accurately represent lasting changes in latency than , but it is less susceptible to changing drastically due to significant—but temporary—jumps in latency. - - - Whether or not the connection can time out. - - - The local peer this connection is associated with. - - - Whether or not the connection has timed out. - - - Whether or not the connection attempt has timed out. Uses a multiple of and ignores the value of . - - - The currently pending reliably sent messages whose delivery has not been acknowledged yet. Stored by sequence ID. - - - The sequence ID of the latest message that we want to acknowledge. - - - Messages that we have received and want to acknowledge. - - - Messages that we have received whose sequence IDs no longer fall into 's range. Used to improve duplicate message filtering capabilities. - - - The sequence ID of the latest message that we've received an ack for. - - - Messages that we sent which have been acknoweledged. - - - A with the left-most bit set to 1. - - - The next sequence ID to use. - - - The connection's current state. - - - The time at which the last heartbeat was received from the other end. - - - The ID of the last ping that was sent. - - - The ID of the currently pending ping. - - - The stopwatch that tracks the time since the currently pending ping was sent. - - - Initializes the connection. - - - Resets the connection's timeout time. - - - Sends a message. - The message to send. - Whether or not to return the message to the pool after it is sent. - - If you intend to continue using the message instance after calling this method, you must set - to . can be used to manually return the message to the pool at a later time. - - - - Sends data. - The array containing the data. - The number of bytes in the array which should be sent. - - - Updates acks and determines whether the message is a duplicate. - The message's sequence ID. - Whether or not the message should be handled. - - - Cleans up the local side of the connection. - - - Updates the acks bitfield and determines whether or not to handle the message. - The gap between the newly received sequence ID and the previously last received sequence ID. - Whether or not the message should be handled, based on whether or not it's a duplicate. - - - Updates the duplicate filter bitfield and determines whether or not to handle the message. - The gap between the newly received sequence ID and the previously last received sequence ID. - Whether or not the message should be handled, based on whether or not it's a duplicate. - - - Updates which messages we've received acks for. - The latest sequence ID that the other end has received. - A redundant list of sequence IDs that the other end has (or has not) received. - - - Check the ack status of the given sequence ID. - The sequence ID whose ack status to check. - The bit corresponding to the sequence ID's position in the bit field. - - - Immediately marks the of a given sequence ID as delivered. - The sequence ID that was acknowledged. - - - Puts the connection in the pending state. - - - Sends an ack message for the given sequence ID. - The sequence ID to acknowledge. - - - Handles an ack message. - The ack message to handle. - - - Handles an ack message for a sequence ID other than the last received one. - The ack message to handle. - - - Sends a welcome message. - - - Handles a welcome message on the server. - The welcome message to handle. - - - Handles a heartbeat message. - The heartbeat message to handle. - - - Sends a heartbeat message. - - - Handles a welcome message on the client. - The welcome message to handle. - - - Sends a welcome response message. - - - Sends a heartbeat message. - - - Handles a heartbeat message. - The heartbeat message to handle. - - - Contains event data for when a client connects to the server. - - - The newly connected client. - - - Initializes event data. - The newly connected client. - - - Contains event data for when a client disconnects from the server. - - - The client that disconnected. - - - The reason for the disconnection. - - - Initializes event data. - The client that disconnected. - The reason for the disconnection. - - - Contains event data for when a message is received. - - - The connection from which the message was received. - - - The ID of the message. - - - The received message. - - - Initializes event data. - The connection from which the message was received. - The ID of the message. - The received message. - - - Contains event data for when a connection attempt to a server fails. - - - Additional data related to the failed connection attempt (if any). - - - Initializes event data. - Additional data related to the failed connection attempt (if any). - - - Contains event data for when the client disconnects from a server. - - - The reason for the disconnection. - - - Additional data related to the disconnection (if any). - - - Initializes event data. - The reason for the disconnection. - Additional data related to the disconnection (if any). - - - Contains event data for when a non-local client connects to the server. - - - The numeric ID of the client that connected. - - - Initializes event data. - The numeric ID of the client that connected. - - - Contains event data for when a non-local client disconnects from the server. - - - The numeric ID of the client that disconnected. - - - Initializes event data. - The numeric ID of the client that disconnected. - - - The exception that is thrown when a does not contain enough unread bytes to add a certain value. - - - The message with insufficient remaining capacity. - - - The name of the type which could not be added to the message. - - - The number of available bytes the type requires in order to be added successfully. - - - Initializes a new instance. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The message with insufficient remaining capacity. - The name of the type which could not be added to the message. - The number of available bytes required for the type to be added successfully. - - - Initializes a new instance and constructs an error message from the given information. - The message with insufficient remaining capacity. - The length of the array which could not be added to the message. - The name of the array's type. - The number of available bytes required for a single element of the array to be added successfully. - The number of available bytes required for the entire array to be added successfully. If left as -1, this will be set to * . - - - Constructs the error message from the given information. - The error message. - - - Constructs the error message from the given information. - The error message. - - - The exception that is thrown when a method with a is not marked as . - - - The type containing the handler method. - - - The name of the handler method. - - - Initializes a new instance. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The type containing the handler method. - The name of the handler method. - - - Constructs the error message from the given information. - The error message. - - - The exception that is thrown when a method with a does not have an acceptable message handler method signature (either or ). - - - The type containing the handler method. - - - The name of the handler method. - - - Initializes a new instance. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The type containing the handler method. - The name of the handler method. - - - Constructs the error message from the given information. - The error message. - - - The exception that is thrown when multiple methods with s are set to handle messages with the same ID and have the same method signature. - - - The message ID with multiple handler methods. - - - The type containing the first handler method. - - - The name of the first handler method. - - - The type containing the second handler method. - - - The name of the second handler method. - - - Initializes a new instance with a specified error message. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The message ID with multiple handler methods. - The first handler method's info. - The second handler method's info. - - - Constructs the error message from the given information. - The error message. - - - Represents a type that can be added to and retrieved from messages using the and methods. - - - Adds the type to the message. - The message to add the type to. - - - Retrieves the type from the message. - The message to retrieve the type from. - - - The send mode of a . - - - Unreliable send mode. - - - Reliable send mode. - - - Provides functionality for converting data to bytes and vice versa. - - - The maximum number of bytes required for a message's header. - 1 byte for the actual header, 2 bytes for the sequence ID (only for reliable messages), 2 bytes for the message ID. Messages sent unreliably will use 2 bytes less than this value for the header. - - - The maximum number of bytes that a message can contain, including the . - - - The maximum number of bytes of payload data that a message can contain. This value represents how many bytes can be added to a message on top of the . - - - How many messages to add to the pool for each or instance that is started. - Changes will not affect and instances which are already running until they are restarted. - - - A pool of reusable message instances. - - - The message's send mode. - - - The length in bytes of the unread data contained in the message. - - - The length in bytes of the data that has been written to the message. - - - How many more bytes can be written into the packet. - - - The message's data. - - - The position in the byte array that the next bytes will be written to. - - - The position in the byte array that the next bytes will be read from. - - - Initializes a reusable instance. - The maximum amount of bytes the message can contain. - - - Trims the message pool to a more appropriate size for how many and/or instances are currently running. - - - Gets a usable message instance. - A message instance ready to be used. - - - Gets a message instance that can be used for sending. - The mode in which the message should be sent. - The message ID. - A message instance ready to be used for sending. - - - - NOTE: will be cast to a . You should ensure that its value never exceeds that of , otherwise you'll encounter unexpected behaviour when handling messages. - - - Gets a message instance that can be used for sending. - The message's header type. - A message instance ready to be used for sending. - - - Gets a message instance directly from the pool without doing any extra setup. - As this message instance is returned straight from the pool, it will contain all previous data and settings. Using this instance without preparing it properly will likely result in unexpected behaviour. - A message instance. - - - Retrieves a message instance from the pool. If none is available, a new instance is created. - A message instance ready to be used for sending or handling. - - - Returns the message instance to the internal pool so it can be reused. - - - Prepares the message to be used. - The message, ready to be used. - - - Prepares the message to be used for sending. - The header of the message. - The message, ready to be used for sending. - - - Prepares the message to be used for handling. - The header of the message. - The number of bytes that this message contains and which can be retrieved. - The message, ready to be used for handling. - - - Sets the message's header byte to the given and determines the appropriate and read/write positions. - The header to use for this message. - - - Adds a single to the message. - The to add. - The message that the was added to. - - - Adds a single to the message. - The to add. - The message that the was added to. - - - Retrieves a single from the message. - The that was retrieved. - - - Retrieves a single from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds an array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of bytes to retrieve. - The array that was retrieved. - - - Populates a array with bytes retrieved from the message. - The amount of bytes to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves an array from the message. - The array that was retrieved. - - - Retrieves an array from the message. - The amount of sbytes to retrieve. - The array that was retrieved. - - - Populates a array with bytes retrieved from the message. - The amount of sbytes to retrieve. - The array to populate. - The position at which to start populating . - - - Reads a number of bytes from the message and writes them into the given array. - The amount of bytes to read. - The array to write the bytes into. - The position at which to start writing into the array. - - - Reads a number of sbytes from the message and writes them into the given array. - The amount of sbytes to read. - The array to write the sbytes into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of bools to retrieve. - The array that was retrieved. - - - Populates a array with bools retrieved from the message. - The amount of bools to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of bools from the message and writes them into the given array. - The number of bytes the bools are being stored in. - The array to write the bools into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of shorts to retrieve. - The array that was retrieved. - - - Populates a array with shorts retrieved from the message. - The amount of shorts to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of ushorts to retrieve. - The array that was retrieved. - - - Populates a array with ushorts retrieved from the message. - The amount of ushorts to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of shorts from the message and writes them into the given array. - The amount of shorts to read. - The array to write the shorts into. - The position at which to start writing into the array. - - - Reads a number of ushorts from the message and writes them into the given array. - The amount of ushorts to read. - The array to write the ushorts into. - The position at which to start writing into the array. - - - Adds an to the message. - The to add. - The message that the was added to. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves an from the message. - The that was retrieved. - - - Retrieves a from the message. - The that was retrieved. - - - Adds an array message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves an array from the message. - The array that was retrieved. - - - Retrieves an array from the message. - The amount of ints to retrieve. - The array that was retrieved. - - - Populates an array with ints retrieved from the message. - The amount of ints to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of uints to retrieve. - The array that was retrieved. - - - Populates a array with uints retrieved from the message. - The amount of uints to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of ints from the message and writes them into the given array. - The amount of ints to read. - The array to write the ints into. - The position at which to start writing into the array. - - - Reads a number of uints from the message and writes them into the given array. - The amount of uints to read. - The array to write the uints into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of longs to retrieve. - The array that was retrieved. - - - Populates a array with longs retrieved from the message. - The amount of longs to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of ulongs to retrieve. - The array that was retrieved. - - - Populates a array with ulongs retrieved from the message. - The amount of ulongs to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of longs from the message and writes them into the given array. - The amount of longs to read. - The array to write the longs into. - The position at which to start writing into the array. - - - Reads a number of ulongs from the message and writes them into the given array. - The amount of ulongs to read. - The array to write the ulongs into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of floats to retrieve. - The array that was retrieved. - - - Populates a array with floats retrieved from the message. - The amount of floats to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of floats from the message and writes them into the given array. - The amount of floats to read. - The array to write the floats into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of doubles to retrieve. - The array that was retrieved. - - - Populates a array with doubles retrieved from the message. - The amount of doubles to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of doubles from the message and writes them into the given array. - The amount of doubles to read. - The array to write the doubles into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of strings to retrieve. - The array that was retrieved. - - - Populates a array with strings retrieved from the message. - The amount of strings to retrieve. - The array to populate. - The position at which to start populating the array. - - - The maximum number of elements an array can contain where the length still fits into a single byte. - - - The maximum number of elements an array can contain where the length still fits into two byte2. - - - Adds the length of an array to the message, using either 1 or 2 bytes depending on how large the array is. Does not support arrays with more than 32,767 elements. - The length of the array. - - - Retrieves the length of an array from the message, using either 1 or 2 bytes depending on how large the array is. - The length of the array. - - - Adds a serializable to the message. - The serializable to add. - The message that the serializable was added to. - - - Retrieves a serializable from the message. - The serializable that was retrieved. - - - Adds an array of serializables to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves an array of serializables from the message. - The array that was retrieved. - - - Retrieves an array of serializables from the message. - The amount of serializables to retrieve. - The array that was retrieved. - - - Populates an array of serializables retrieved from the message. - The amount of serializables to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of serializables from the message and writes them into the given array. - The amount of serializables to read. - The array to write the serializables into. - The position at which to start writing into . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of an value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of an array length value. - - - Constructs an error message for when a message contains insufficient unread bytes to retrieve a certain value. - The name of the value type for which the retrieval attempt failed. - Text describing the value which will be returned. - The error message. - - - Constructs an error message for when a message contains insufficient unread bytes to retrieve an array of values. - The expected length of the array. - The name of the value type for which the retrieval attempt failed. - The error message. - - - Constructs an error message for when a number of retrieved values do not fit inside the bounds of the provided array. - The number of values being retrieved. - The length of the provided array. - The position in the array at which to begin writing values. - The name of the value type which is being retrieved. - The name of the value type in plural form. If left empty, this will be set to with an s appended to it. - The error message. - - - Specifies a method as the message handler for messages with the given ID. - - - In order for a method to qualify as a message handler, it must match a valid message handler method signature. s - will only use methods marked with this attribute if they match the signature, and s - will only use methods marked with this attribute if they match the signature. - - - Methods marked with this attribute which match neither of the valid message handler signatures will not be used by s - or s and will cause warnings at runtime. - - - If you want a or to only use a subset of all message handler methods, you can do so by setting up - custom message handler groups. Simply set the group ID in the constructor and pass the - same value to the or method. This - will make that or only use message handlers which have the same group ID. - - - - - The ID of the message type which this method is meant to handle. - - - The ID of the group of message handlers which this method belongs to. - - - Initializes a new instance of the class with the and values. - The ID of the message type which this method is meant to handle. - The ID of the group of message handlers which this method belongs to. - - s will only use this method if its signature matches the signature. - s will only use this method if its signature matches the signature. - This method will be ignored if its signature matches neither of the valid message handler signatures. - - - - Provides functionality for enabling/disabling automatic message relaying by message type. - - - The number of bits an int consists of. - - - An array storing all the bits which represent whether messages of a given ID should be relayed or not. - - - Creates a filter of a given size. - How big to make the filter. - - should be set to the value of the largest message ID, plus 1. For example, if a server will - handle messages with IDs 1, 2, 3, 7, and 8, should be set to 9 (8 is the largest possible value, - and 8 + 1 = 9) despite the fact that there are only 5 unique message IDs the server will ever handle. - - - - Creates a filter based on an enum of message IDs. - The enum type. - - - Creates a filter of a given size and enables relaying for the given message IDs. - How big to make the filter. - Message IDs to enable auto relaying for. - - - - Creates a filter based on an enum of message IDs and enables relaying for the given message IDs. - The enum type. - Message IDs to enable relaying for. - - - Enables auto relaying for the given message IDs. - Message IDs to enable relaying for. - - - Calculate the filter size necessary to manage all message IDs in the given enum. - The enum type. - The appropriate filter size. - is not an . - - - Sets the filter size. - How big to make the filter. - - - Enables auto relaying for the given message ID. - The message ID to enable relaying for. - - - - - - Disables auto relaying for the given message ID. - The message ID to enable relaying for. - - - - - - Checks whether or not messages with the given ID should be relayed. - The message ID to check. - Whether or not messages with the given ID should be relayed. - - - The reason the connection attempt was rejected. - - - No response was received from the server (because the client has no internet connection, the server is offline, no server is listening on the target endpoint, etc.). - - - The client is already connected. - - - A connection attempt is already pending. - - - The server is full. - - - The connection attempt was rejected. - - - The connection attempt was rejected and custom data may have been included with the rejection message. - - - The reason for a disconnection. - - - No connection was ever established. - - - The connection attempt was rejected by the server. - - - The active transport detected a problem with the connection. - - - The connection timed out. - - This also acts as the fallback reason—if a client disconnects and the message containing the real reason is lost - in transmission, it can't be resent as the connection will have already been closed. As a result, the other end will time - out the connection after a short period of time and this will be used as the reason. - - - - The client was forcibly disconnected by the server. - - - The server shut down. - - - The disconnection was initiated by the client. - - - Provides base functionality for and . - - - The name to use when logging messages via . - - - The time (in milliseconds) after which to disconnect if no heartbeats are received. - - - The interval (in milliseconds) at which to send and expect heartbeats to be received. - Changes to this value will only take effect after the next heartbeat is executed. - - - The number of currently active and instances. - - - The current time. - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected or rejected due to an unknown reason. - - - The text to log when the connection failed due to . - - - The text to log when the connection failed due to . - - - The text to log when the connection failed due to . - - - The text to log when the connection failed due to . - - - A stopwatch used to track how much time has passed. - - - Received messages which need to be handled. - - - A queue of events to execute, ordered by how soon they need to be executed. - - - Initializes the peer. - The name to use when logging messages via . - - - Retrieves methods marked with . - An array containing message handler methods. - - - Builds a dictionary of message IDs and their corresponding message handler methods. - The ID of the group of message handler methods to include in the dictionary. - - - Starts tracking how much time has passed. - - - Stops tracking how much time has passed. - - - Beats the heart. - - - Handles any received messages and invokes any delayed events which need to be invoked. - - - Sets up a delayed event to be executed after the given time has passed. - How long from now to execute the delayed event, in milliseconds. - The delayed event to execute later. - - - Handles all queued messages. - - - Handles data received by the transport. - - - Handles a message. - The message to handle. - The message's header type. - The connection which the message was received on. - - - Increases . For use when a new or is started. - - - Decreases . For use when a or is stopped. - - - Stores information about a message that needs to be handled. - - - The message that needs to be handled. - - - The message's header type. - - - The connection on which the message was received. - - - Handles initialization. - The message that needs to be handled. - The message's header type. - The connection on which the message was received. - - - Represents a currently pending reliably sent message whose delivery has not been acknowledged yet. - - - The time of the latest send attempt. - - - The multiplier used to determine how long to wait before resending a pending message. - - - How often to try sending the message before giving up. - - - A pool of reusable instances. - - - The to use to send (and resend) the pending message. - - - The sequence ID of the message. - - - The contents of the message. - - - The length in bytes of the data that has been written to the message. - - - How many send attempts have been made so far. - - - Whether the pending message has been cleared or not. - - - Handles initial setup. - - - Retrieves a instance, initializes it and then sends it. - The sequence ID of the message. - The message that is being sent reliably. - The to use to send (and resend) the pending message. - - - Retrieves a instance from the pool. If none is available, a new instance is created. - A instance. - - - Returns the instance to the pool so it can be reused. - - - Resends the message. - - - Attempts to send the message. - - - Clears the message. - Whether or not to remove the message from . - - - A server that can accept connections from s. - - - Invoked when a client connects. - - - Invoked when a message is received. - - - Invoked when a client disconnects. - - - Whether or not the server is currently running. - - - The local port that the server is running on. - - - The maximum number of concurrent connections. - - - The number of currently connected clients. - - - An array of all the currently connected clients. - The position of each instance in the array does not correspond to that client's numeric ID (except by coincidence). - - - Encapsulates a method that handles a message from a client. - The numeric ID of the client from whom the message was received. - The message that was received. - - - Encapsulates a method that determines whether or not to accept a client's connection attempt. - - - An optional method which determines whether or not to accept a client's connection attempt. - The parameter is the pending connection and the parameter is a message containing any additional data the client included with the connection attempt. - - - Stores which message IDs have auto relaying enabled. Relaying is disabled entirely when this is . - - - Currently pending connections which are waiting to be accepted or rejected. - - - Currently connected clients. - - - Clients that have timed out and need to be removed from . - - - Methods used to handle messages, accessible by their corresponding message IDs. - - - The underlying transport's server that is used for sending and receiving data. - - - All currently unused client IDs. - - - Handles initial setup. - The transport to use for sending and receiving data. - The name to use when logging messages via . - - - Handles initial setup using the built-in UDP transport. - The name to use when logging messages via . - - - Stops the server if it's running and swaps out the transport it's using. - The new underlying transport server to use for sending and receiving data. - This method does not automatically restart the server. To continue accepting connections, must be called again. - - - Starts the server. - The local port on which to start the server. - The maximum number of concurrent connections to allow. - The ID of the group of message handler methods to use when building . - - - Subscribes appropriate methods to the transport's events. - - - Unsubscribes methods from all of the transport's events. - - - - - - Handles an incoming connection attempt. - - - Handles a connect message. - The client that sent the connect message. - The connect message. - - - Accepts the given pending connection. - The connection to accept. - - - Rejects the given pending connection. - The connection to reject. - Data that should be sent to the client being rejected. Use to get an empty message instance. - - - Accepts the given pending connection. - The connection to accept. - - - Rejects the given pending connection. - The connection to reject. - The reason why the connection is being rejected. - Data that should be sent to the client being rejected - - - Checks if clients have timed out. - - - - - - - - - Sends a message to a given client. - The message to send. - The numeric ID of the client to send the message to. - Whether or not to return the message to the pool after it is sent. - - - - Sends a message to a given client. - The message to send. - The client to send the message to. - Whether or not to return the message to the pool after it is sent. - - - - Sends a message to all connected clients. - The message to send. - Whether or not to return the message to the pool after it is sent. - - - - Sends a message to all connected clients except the given one. - The message to send. - The numeric ID of the client to not send the message to. - Whether or not to return the message to the pool after it is sent. - - - - Retrieves the client with the given ID, if a client with that ID is currently connected. - The ID of the client to retrieve. - The retrieved client. - if a client with the given ID was connected; otherwise . - - - Disconnects a specific client. - The numeric ID of the client to disconnect. - Data that should be sent to the client being disconnected. Use to get an empty message instance. - - - Disconnects the given client. - The client to disconnect. - Data that should be sent to the client being disconnected. Use to get an empty message instance. - - - Cleans up the local side of the given connection. - The client to disconnect. - The reason why the client is being disconnected. - - - What to do when the transport disconnects a client. - - - Stops the server. - - - Initializes available client IDs. - - - Retrieves an available client ID. - The client ID. 0 if none were available. - - - Sends a disconnect message. - The client to send the disconnect message to. - Why the client is being disconnected. - Optional custom data that should be sent to the client being disconnected. - - - Sends a client connected message. - The newly connected client. - - - Sends a client disconnected message. - The numeric ID of the client that disconnected. - - - Invokes the event. - The newly connected client. - - - Invokes the event and initiates handling of the received message. - The received message. - The client from which the message was received. - - - Invokes the event. - The client that disconnected. - The reason for the disconnection. - - - Contains event data for when a server's transport successfully establishes a connection to a client. - - - The newly established connection. - - - Initializes event data. - The newly established connection. - - - Contains event data for when a server's or client's transport receives data. - - - An array containing the received data. - - - The number of bytes that were received. - - - The connection which the data was received from. - - - Initializes event data. - An array containing the received data. - The number of bytes that were received. - The connection which the data was received from. - - - Contains event data for when a server's or client's transport initiates or detects a disconnection. - - - The closed connection. - - - The reason for the disconnection. - - - Initializes event data. - The closed connection. - The reason for the disconnection. - - - Defines methods, properties, and events which every transport's client must implement. - - - Invoked when a connection is established at the transport level. - - - Invoked when a connection attempt fails at the transport level. - - - Starts the transport and attempts to connect to the given host address. - The host address to connect to. - The pending connection. if an issue occurred. - The error message associated with the issue that occurred, if any. - if a connection attempt will be made. if an issue occurred (such as being in an invalid format) and a connection attempt will not be made. - - - Closes the connection to the server. - - - The header type of a . - - - An unreliable user message. - - - An internal unreliable ack message. - - - An internal unreliable ack message, used when acknowledging a sequence ID other than the last received one. - - - An internal unreliable connect message. - - - An internal unreliable connection rejection message. - - - An internal unreliable heartbeat message. - - - An internal unreliable disconnect message. - - - A reliable user message. - - - An internal reliable welcome message. - - - An internal reliable client connected message. - - - An internal reliable client disconnected message. - - - Defines methods, properties, and events which every transport's server and client must implement. - - - Invoked when data is received by the transport. - - - Invoked when a disconnection is initiated or detected by the transport. - - - Initiates handling of any received messages. - - - Defines methods, properties, and events which every transport's server must implement. - - - Invoked when a connection is established at the transport level. - - - - - - Starts the transport and begins listening for incoming connections. - The local port on which to listen for connections. - - - Closes an active connection. - The connection to close. - - - Closes all existing connections and stops listening for new connections. - - - A client which can connect to a . - - - - - - - - - - - - The connection to the server. - - - - Expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777. - - - Parses into and , if possible. - The host address to parse. - The retrieved IP. - The retrieved port. - Whether or not was in a valid format. - - - - - - - - - Invokes the event. - - - Invokes the event. - - - - - - Represents a connection to a or . - - - The endpoint representing the other end of the connection. - - - The socket to use for sending and receiving. - - - The local peer this connection is associated with. - - - An array to receive message size values into. - - - The size of the next message to be received. - - - Initializes the connection. - The socket to use for sending and receiving. - The endpoint representing the other end of the connection. - The local peer this connection is associated with. - - - - - - Polls the socket and checks if any data was received. - - - Receives a message, if all of its data is ready to be received. - How many bytes were received. - Whether or not all of the message's data was ready to be received. - - - Closes the connection. - - - - - - - - - - - - - - - Provides base send & receive functionality for and . - - - - - - An array that incoming data is received into. - - - An array that outgoing data is sent out of. - - - The default size used for the socket's send and receive buffers. - - - The size to use for the socket's send and receive buffers. - - - The main socket, either used for listening for connections or for sending and receiving data. - - - The minimum size that may be used for the socket's send and receive buffers. - - - Initializes the transport. - How big the socket's send and receive buffers should be. - - - Handles received data. - The number of bytes that were received. - The connection from which the data was received. - - - Invokes the event. - The closed connection. - The reason for the disconnection. - - - A server which can accept connections from s. - - - - - - - - - - - - The maximum number of pending connections to allow at any given time. - - - Whether or not the server is running. - - - The currently open connections, accessible by their endpoints. - - - Connections that need to be closed. - - - - - - - - - Starts listening for connections on the given port. - The port to listen on. - - - - - - Accepts any pending connections. - - - Stops listening for connections. - - - - - - - - - Invokes the event. - The successfully established connection. - - - - - - A client which can connect to a . - - - - - - - - - - - - The connection to the server. - - - - - - - Expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777. - - - Parses into and , if possible. - The host address to parse. - The retrieved IP. - The retrieved port. - Whether or not was in a valid format. - - - - - - Invokes the event. - - - Invokes the event. - - - - - - Represents a connection to a or . - - - The endpoint representing the other end of the connection. - - - The local peer this connection is associated with. - - - Initializes the connection. - The endpoint representing the other end of the connection. - The local peer this connection is associated with. - - - - - - - - - - - - - - - - - - The kind of socket to create. - - - Dual-mode. Works with both IPv4 and IPv6. - - - IPv4 only mode. - - - IPv6 only mode. - - - Provides base send & receive functionality for and . - - - - - - The default size used for the socket's send and receive buffers. - - - The minimum size that may be used for the socket's send and receive buffers. - - - How long to wait for a packet, in microseconds. - - - Whether to create an IPv4 only, IPv6 only, or dual-mode socket. - - - The size to use for the socket's send and receive buffers. - - - The array that incoming data is received into. - - - The socket to use for sending and receiving. - - - Whether or not the transport is running. - - - A reusable endpoint. - - - Initializes the transport. - Whether to create an IPv4 only, IPv6 only, or dual-mode socket. - How big the socket's send and receive buffers should be. - - - - - - Opens the socket and starts the transport. - The port to bind the socket to. - - - Closes the socket and stops the transport. - - - Polls the socket and checks if any data was received. - - - Sends data to a given endpoint. - The array containing the data. - The number of bytes in the array which should be sent. - The endpoint to send the data to. - - - Handles received data. - A byte array containing the received data. - The number of bytes in used by the received data. - The endpoint from which the data was received. - - - Invokes the event. - The closed connection. - The reason for the disconnection. - - - A server which can accept connections from s. - - - - - - - - - - - - The currently open connections, accessible by their endpoints. - - - - - - - - - Decides what to do with a connection attempt. - The connection to accept or reject. - Whether or not the connection attempt was a new connection. - - - - - - - - - Invokes the event. - The successfully established connection. - - - - - - Provides functionality for queueing methods for later execution from a chosen thread. - - - The name to use when logging messages via . - - - Handles initial setup. - The name to use when logging messages via . - - - Adds an action to the queue. - The action to be added to the queue. - - - Executes all actions in the queue on the calling thread. - This method should only be called from a single thread in the application. - - - Clears all actions in the queue without executing them. - - - Provides functionality for converting bytes to various value types and vice versa. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 2 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts the 2 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 4 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts the 4 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 8 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts the 8 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 4 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 8 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Executes an action when invoked. - - - Executes the action. - - - Resends a when invoked. - - - The message to resend. - - - The time at which the resend event was queued. - - - Initializes the event. - The message to resend. - The time at which the resend event was queued. - - - - - - Executes a heartbeat when invoked. - - - The peer whose heart to beat. - - - Initializes the event. - The peer whose heart to beat. - - - - - - Contains extension methods for various classes. - - - Takes the 's IP address and port number and converts it to a string, accounting for whether the address is an IPv4 or IPv6 address. - A string containing the IP address and port number of the endpoint. - - - Contains miscellaneous helper methods. - - - Determines whether or form should be used based on the . - The amount that and refer to. - The singular form. - The plural form. - if is 1; otherwise . - - - Calculates the signed gap between sequence IDs, accounting for wrapping. - The new sequence ID. - The previous sequence ID. - The signed gap between the two given sequence IDs. A positive gap means is newer than . A negative gap means is older than . - - - Represents a collection of items that have a value and a priority. On dequeue, the item with the lowest priority value is removed. - Specifies the type of elements in the queue. - Specifies the type of priority associated with enqueued elements. - - - Gets the number of elements contained in the . - - - Adds the specified element and associated priority to the . - The element to add. - The priority with which to associate the new element. - - - Removes and returns the lowest priority element. - - - Returns the priority of the lowest priority element. - - - Removes all elements from the . - - - Defines log message types. - - - Logs that are used for investigation during development. - - - Logs that provide general information about application flow. - - - Logs that highlight abnormal or unexpected events in the application flow. - - - Logs that highlight problematic events in the application flow which will cause unexpected behavior if not planned for. - - - Provides functionality for logging messages. - - - Whether or not messages will be logged. - - - Whether or not messages will be logged. - - - Whether or not messages will be logged. - - - Whether or not messages will be logged. - - - Encapsulates a method used to log messages. - The message to log. - - - Log methods, accessible by their - - - Whether or not to include timestamps when logging messages. - - - The format to use for timestamps. - - - Initializes with all log types enabled. - The method to use when logging all types of messages. - Whether or not to include timestamps when logging messages. - The format to use for timestamps. - - - Initializes with the supplied log methods. - The method to use when logging debug messages. Set to to disable debug logs. - The method to use when logging info messages. Set to to disable info logs. - The method to use when logging warning messages. Set to to disable warning logs. - The method to use when logging error messages. Set to to disable error logs. - Whether or not to include timestamps when logging messages. - The format to use for timestamps. - - - Enables logging for messages of the given . - The type of message to enable logging for. - The method to use when logging this type of message. - - - Disables logging for messages of the given . - The type of message to enable logging for. - - - Logs a message. - The type of log message that is being logged. - The message to log. - - - Logs a message. - The type of log message that is being logged. - Who is logging this message. - The message to log. - - - Converts a object to a formatted timestamp string. - The time to format. - The formatted timestamp. - - - diff --git a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.xml.meta b/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.xml.meta deleted file mode 100644 index ded4fecb..00000000 --- a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/RiptideNetworking.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: c5a61e845c1fff044b95518a94069a85 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/NetworkManager.cs b/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/NetworkManager.cs similarity index 100% rename from Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/NetworkManager.cs rename to Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/NetworkManager.cs diff --git a/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/NetworkManager.cs.meta b/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/NetworkManager.cs.meta similarity index 100% rename from Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/NetworkManager.cs.meta rename to Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/NetworkManager.cs.meta diff --git a/Demos/Unity/DedicatedServerDemo/Server/Packages/manifest.json b/Demos/Unity/DedicatedServerDemo/Server/Packages/manifest.json index 137e47ea..17afdd7e 100644 --- a/Demos/Unity/DedicatedServerDemo/Server/Packages/manifest.json +++ b/Demos/Unity/DedicatedServerDemo/Server/Packages/manifest.json @@ -9,6 +9,7 @@ "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.4.8", "com.unity.ugui": "1.0.0", + "net.tomweiland.riptide": "https://github.com/RiptideNetworking/Riptide.git?path=/Packages/Core#unity-package", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", diff --git a/Demos/Unity/DedicatedServerDemo/Server/Packages/packages-lock.json b/Demos/Unity/DedicatedServerDemo/Server/Packages/packages-lock.json index 984ab05e..3fc84e4a 100644 --- a/Demos/Unity/DedicatedServerDemo/Server/Packages/packages-lock.json +++ b/Demos/Unity/DedicatedServerDemo/Server/Packages/packages-lock.json @@ -145,6 +145,13 @@ "com.unity.modules.imgui": "1.0.0" } }, + "net.tomweiland.riptide": { + "version": "https://github.com/RiptideNetworking/Riptide.git?path=/Packages/Core#unity-package", + "depth": 0, + "source": "git", + "dependencies": {}, + "hash": "bb252ba2ea4bd1314d3f8f60bea490418635d06e" + }, "com.unity.modules.ai": { "version": "1.0.0", "depth": 0, diff --git a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer.meta b/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer.meta deleted file mode 100644 index 81e5a3c3..00000000 --- a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9b534641b4d8d5e45b96413300921df4 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/MessageExtensions.cs b/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/MessageExtensions.cs deleted file mode 100644 index acafc335..00000000 --- a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/MessageExtensions.cs +++ /dev/null @@ -1,70 +0,0 @@ -using UnityEngine; - -namespace Riptide.Demos.PlayerHosted -{ - public static class MessageExtensions - { - #region Vector2 - /// - /// This method is simply an alternative way of calling . - public static Message Add(this Message message, Vector2 value) => AddVector2(message, value); - - /// Adds a to the message. - /// The to add. - /// The message that the was added to. - public static Message AddVector2(this Message message, Vector2 value) - { - return message.AddFloat(value.x).AddFloat(value.y); - } - - /// Retrieves a from the message. - /// The that was retrieved. - public static Vector2 GetVector2(this Message message) - { - return new Vector2(message.GetFloat(), message.GetFloat()); - } - #endregion - - #region Vector3 - /// - /// This method is simply an alternative way of calling . - public static Message Add(this Message message, Vector3 value) => AddVector3(message, value); - - /// Adds a to the message. - /// The to add. - /// The message that the was added to. - public static Message AddVector3(this Message message, Vector3 value) - { - return message.AddFloat(value.x).AddFloat(value.y).AddFloat(value.z); - } - - /// Retrieves a from the message. - /// The that was retrieved. - public static Vector3 GetVector3(this Message message) - { - return new Vector3(message.GetFloat(), message.GetFloat(), message.GetFloat()); - } - #endregion - - #region Quaternion - /// - /// This method is simply an alternative way of calling . - public static Message Add(this Message message, Quaternion value) => AddQuaternion(message, value); - - /// Adds a to the message. - /// The to add. - /// The message that the was added to. - public static Message AddQuaternion(this Message message, Quaternion value) - { - return message.AddFloat(value.x).AddFloat(value.y).AddFloat(value.z).AddFloat(value.w); - } - - /// Retrieves a from the message. - /// The that was retrieved. - public static Quaternion GetQuaternion(this Message message) - { - return new Quaternion(message.GetFloat(), message.GetFloat(), message.GetFloat(), message.GetFloat()); - } - #endregion - } -} diff --git a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/MessageExtensions.cs.meta b/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/MessageExtensions.cs.meta deleted file mode 100644 index 8ca6499c..00000000 --- a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/MessageExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 902e9c84d084f8646b058c1c9e02625f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.dll b/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.dll deleted file mode 100644 index 48e9c081..00000000 Binary files a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.dll and /dev/null differ diff --git a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.dll.meta b/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.dll.meta deleted file mode 100644 index cb9677fa..00000000 --- a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: dc23106aa097d8a488c815e9bcb76acf -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.xml b/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.xml deleted file mode 100644 index 1cd4d0cf..00000000 --- a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.xml +++ /dev/null @@ -1,2678 +0,0 @@ - - - - RiptideNetworking - - - - A client that can connect to a . - - - Invoked when a connection to the server is established. - - - Invoked when a connection to the server fails to be established. - - - Invoked when a message is received. - - - Invoked when disconnected from the server. - - - Invoked when another non-local client connects. - - - Invoked when another non-local client disconnects. - - - The client's numeric ID. - - - - - - - This value is slower to accurately represent lasting changes in latency than , but it is less susceptible to changing drastically due to significant—but temporary—jumps in latency. - - - Whether or not the client is currently not connected nor trying to connect. - - - Whether or not the client is currently in the process of connecting. - - - Whether or not the client's connection is currently pending (will only be when a server doesn't immediately accept the connection request). - - - Whether or not the client is currently connected. - - - - - - Encapsulates a method that handles a message from a server. - The message that was received. - - - The client's connection to a server. - - - How many connection attempts have been made so far. - - - How many connection attempts to make before giving up. - - - - - - The underlying transport's client that is used for sending and receiving data. - - - Custom data to include when connecting. - - - - - - - - - Disconnects the client if it's connected and swaps out the transport it's using. - The new transport to use for sending and receiving data. - This method does not automatically reconnect to the server. To continue communicating with the server, must be called again. - - - Attempts to connect to a server at the given host address. - The host address to connect to. - How many connection attempts to make before giving up. - The ID of the group of message handler methods to use when building . - Data that should be sent to the server with the connection attempt. Use to get an empty message instance. - Riptide's default transport expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777. If you are using a different transport, check the relevant documentation for what information it requires in the host address. - if a connection attempt will be made. if an issue occurred (such as being in an invalid format) and a connection attempt will not be made. - - - Subscribes appropriate methods to the transport's events. - - - Unsubscribes methods from all of the transport's events. - - - - - - - - - - - - - - - Sends a message to the server. - The message to send. - Whether or not to return the message to the pool after it is sent. - - - - Disconnects from the server. - - - Cleans up the local side of the connection. - The reason why the client has disconnected. - The disconnection or rejection message, potentially containing extra data to be handled externally. - TData that should be sent to the client being disconnected. Use to get an empty message instance. Unused if the connection wasn't rejected. - - - What to do when the transport establishes a connection. - - - What to do when the transport fails to connect. - - - What to do when the transport disconnects. - - - Invokes the event. - - - Invokes the event. - The reason for the connection failure. - Additional data related to the failed connection attempt. - - - Invokes the event and initiates handling of the received message. - The received message. - - - Invokes the event. - The reason for the disconnection. - Additional data related to the disconnection. - - - Invokes the event. - The numeric ID of the client that connected. - - - Invokes the event. - The numeric ID of the client that disconnected. - - - The state of a connection. - - - Not connected. No connection has been established or the connection has been closed. - - - Connecting. Still trying to establish a connection. - - - Connection is pending. The server is still determining whether or not the connection should be allowed. - - - Connected. A connection has been established successfully. - - - Represents a connection to a or . - - - The connection's numeric ID. - - - Whether or not the connection is currently not connected nor trying to connect. - - - Whether or not the connection is currently in the process of connecting. - - - Whether or not the connection is currently pending (will only be when a server doesn't immediately accept the connection request). - - - Whether or not the connection is currently connected. - - - The round trip time (ping) of the connection, in milliseconds. -1 if not calculated yet. - - - The smoothed round trip time (ping) of the connection, in milliseconds. -1 if not calculated yet. - This value is slower to accurately represent lasting changes in latency than , but it is less susceptible to changing drastically due to significant—but temporary—jumps in latency. - - - Whether or not the connection can time out. - - - The local peer this connection is associated with. - - - Whether or not the connection has timed out. - - - Whether or not the connection attempt has timed out. Uses a multiple of and ignores the value of . - - - The currently pending reliably sent messages whose delivery has not been acknowledged yet. Stored by sequence ID. - - - The sequence ID of the latest message that we want to acknowledge. - - - Messages that we have received and want to acknowledge. - - - Messages that we have received whose sequence IDs no longer fall into 's range. Used to improve duplicate message filtering capabilities. - - - The sequence ID of the latest message that we've received an ack for. - - - Messages that we sent which have been acknoweledged. - - - A with the left-most bit set to 1. - - - The next sequence ID to use. - - - The connection's current state. - - - The time at which the last heartbeat was received from the other end. - - - The ID of the last ping that was sent. - - - The ID of the currently pending ping. - - - The stopwatch that tracks the time since the currently pending ping was sent. - - - Initializes the connection. - - - Resets the connection's timeout time. - - - Sends a message. - The message to send. - Whether or not to return the message to the pool after it is sent. - - If you intend to continue using the message instance after calling this method, you must set - to . can be used to manually return the message to the pool at a later time. - - - - Sends data. - The array containing the data. - The number of bytes in the array which should be sent. - - - Updates acks and determines whether the message is a duplicate. - The message's sequence ID. - Whether or not the message should be handled. - - - Cleans up the local side of the connection. - - - Updates the acks bitfield and determines whether or not to handle the message. - The gap between the newly received sequence ID and the previously last received sequence ID. - Whether or not the message should be handled, based on whether or not it's a duplicate. - - - Updates the duplicate filter bitfield and determines whether or not to handle the message. - The gap between the newly received sequence ID and the previously last received sequence ID. - Whether or not the message should be handled, based on whether or not it's a duplicate. - - - Updates which messages we've received acks for. - The latest sequence ID that the other end has received. - A redundant list of sequence IDs that the other end has (or has not) received. - - - Check the ack status of the given sequence ID. - The sequence ID whose ack status to check. - The bit corresponding to the sequence ID's position in the bit field. - - - Immediately marks the of a given sequence ID as delivered. - The sequence ID that was acknowledged. - - - Puts the connection in the pending state. - - - Sends an ack message for the given sequence ID. - The sequence ID to acknowledge. - - - Handles an ack message. - The ack message to handle. - - - Handles an ack message for a sequence ID other than the last received one. - The ack message to handle. - - - Sends a welcome message. - - - Handles a welcome message on the server. - The welcome message to handle. - - - Handles a heartbeat message. - The heartbeat message to handle. - - - Sends a heartbeat message. - - - Handles a welcome message on the client. - The welcome message to handle. - - - Sends a welcome response message. - - - Sends a heartbeat message. - - - Handles a heartbeat message. - The heartbeat message to handle. - - - Contains event data for when a client connects to the server. - - - The newly connected client. - - - Initializes event data. - The newly connected client. - - - Contains event data for when a client disconnects from the server. - - - The client that disconnected. - - - The reason for the disconnection. - - - Initializes event data. - The client that disconnected. - The reason for the disconnection. - - - Contains event data for when a message is received. - - - The connection from which the message was received. - - - The ID of the message. - - - The received message. - - - Initializes event data. - The connection from which the message was received. - The ID of the message. - The received message. - - - Contains event data for when a connection attempt to a server fails. - - - Additional data related to the failed connection attempt (if any). - - - Initializes event data. - Additional data related to the failed connection attempt (if any). - - - Contains event data for when the client disconnects from a server. - - - The reason for the disconnection. - - - Additional data related to the disconnection (if any). - - - Initializes event data. - The reason for the disconnection. - Additional data related to the disconnection (if any). - - - Contains event data for when a non-local client connects to the server. - - - The numeric ID of the client that connected. - - - Initializes event data. - The numeric ID of the client that connected. - - - Contains event data for when a non-local client disconnects from the server. - - - The numeric ID of the client that disconnected. - - - Initializes event data. - The numeric ID of the client that disconnected. - - - The exception that is thrown when a does not contain enough unread bytes to add a certain value. - - - The message with insufficient remaining capacity. - - - The name of the type which could not be added to the message. - - - The number of available bytes the type requires in order to be added successfully. - - - Initializes a new instance. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The message with insufficient remaining capacity. - The name of the type which could not be added to the message. - The number of available bytes required for the type to be added successfully. - - - Initializes a new instance and constructs an error message from the given information. - The message with insufficient remaining capacity. - The length of the array which could not be added to the message. - The name of the array's type. - The number of available bytes required for a single element of the array to be added successfully. - The number of available bytes required for the entire array to be added successfully. If left as -1, this will be set to * . - - - Constructs the error message from the given information. - The error message. - - - Constructs the error message from the given information. - The error message. - - - The exception that is thrown when a method with a is not marked as . - - - The type containing the handler method. - - - The name of the handler method. - - - Initializes a new instance. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The type containing the handler method. - The name of the handler method. - - - Constructs the error message from the given information. - The error message. - - - The exception that is thrown when a method with a does not have an acceptable message handler method signature (either or ). - - - The type containing the handler method. - - - The name of the handler method. - - - Initializes a new instance. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The type containing the handler method. - The name of the handler method. - - - Constructs the error message from the given information. - The error message. - - - The exception that is thrown when multiple methods with s are set to handle messages with the same ID and have the same method signature. - - - The message ID with multiple handler methods. - - - The type containing the first handler method. - - - The name of the first handler method. - - - The type containing the second handler method. - - - The name of the second handler method. - - - Initializes a new instance with a specified error message. - - - Initializes a new instance with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance and constructs an error message from the given information. - The message ID with multiple handler methods. - The first handler method's info. - The second handler method's info. - - - Constructs the error message from the given information. - The error message. - - - Represents a type that can be added to and retrieved from messages using the and methods. - - - Adds the type to the message. - The message to add the type to. - - - Retrieves the type from the message. - The message to retrieve the type from. - - - The send mode of a . - - - Unreliable send mode. - - - Reliable send mode. - - - Provides functionality for converting data to bytes and vice versa. - - - The maximum number of bytes required for a message's header. - 1 byte for the actual header, 2 bytes for the sequence ID (only for reliable messages), 2 bytes for the message ID. Messages sent unreliably will use 2 bytes less than this value for the header. - - - The maximum number of bytes that a message can contain, including the . - - - The maximum number of bytes of payload data that a message can contain. This value represents how many bytes can be added to a message on top of the . - - - How many messages to add to the pool for each or instance that is started. - Changes will not affect and instances which are already running until they are restarted. - - - A pool of reusable message instances. - - - The message's send mode. - - - The length in bytes of the unread data contained in the message. - - - The length in bytes of the data that has been written to the message. - - - How many more bytes can be written into the packet. - - - The message's data. - - - The position in the byte array that the next bytes will be written to. - - - The position in the byte array that the next bytes will be read from. - - - Initializes a reusable instance. - The maximum amount of bytes the message can contain. - - - Trims the message pool to a more appropriate size for how many and/or instances are currently running. - - - Gets a usable message instance. - A message instance ready to be used. - - - Gets a message instance that can be used for sending. - The mode in which the message should be sent. - The message ID. - A message instance ready to be used for sending. - - - - NOTE: will be cast to a . You should ensure that its value never exceeds that of , otherwise you'll encounter unexpected behaviour when handling messages. - - - Gets a message instance that can be used for sending. - The message's header type. - A message instance ready to be used for sending. - - - Gets a message instance directly from the pool without doing any extra setup. - As this message instance is returned straight from the pool, it will contain all previous data and settings. Using this instance without preparing it properly will likely result in unexpected behaviour. - A message instance. - - - Retrieves a message instance from the pool. If none is available, a new instance is created. - A message instance ready to be used for sending or handling. - - - Returns the message instance to the internal pool so it can be reused. - - - Prepares the message to be used. - The message, ready to be used. - - - Prepares the message to be used for sending. - The header of the message. - The message, ready to be used for sending. - - - Prepares the message to be used for handling. - The header of the message. - The number of bytes that this message contains and which can be retrieved. - The message, ready to be used for handling. - - - Sets the message's header byte to the given and determines the appropriate and read/write positions. - The header to use for this message. - - - Adds a single to the message. - The to add. - The message that the was added to. - - - Adds a single to the message. - The to add. - The message that the was added to. - - - Retrieves a single from the message. - The that was retrieved. - - - Retrieves a single from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds an array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of bytes to retrieve. - The array that was retrieved. - - - Populates a array with bytes retrieved from the message. - The amount of bytes to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves an array from the message. - The array that was retrieved. - - - Retrieves an array from the message. - The amount of sbytes to retrieve. - The array that was retrieved. - - - Populates a array with bytes retrieved from the message. - The amount of sbytes to retrieve. - The array to populate. - The position at which to start populating . - - - Reads a number of bytes from the message and writes them into the given array. - The amount of bytes to read. - The array to write the bytes into. - The position at which to start writing into the array. - - - Reads a number of sbytes from the message and writes them into the given array. - The amount of sbytes to read. - The array to write the sbytes into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of bools to retrieve. - The array that was retrieved. - - - Populates a array with bools retrieved from the message. - The amount of bools to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of bools from the message and writes them into the given array. - The number of bytes the bools are being stored in. - The array to write the bools into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of shorts to retrieve. - The array that was retrieved. - - - Populates a array with shorts retrieved from the message. - The amount of shorts to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of ushorts to retrieve. - The array that was retrieved. - - - Populates a array with ushorts retrieved from the message. - The amount of ushorts to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of shorts from the message and writes them into the given array. - The amount of shorts to read. - The array to write the shorts into. - The position at which to start writing into the array. - - - Reads a number of ushorts from the message and writes them into the given array. - The amount of ushorts to read. - The array to write the ushorts into. - The position at which to start writing into the array. - - - Adds an to the message. - The to add. - The message that the was added to. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves an from the message. - The that was retrieved. - - - Retrieves a from the message. - The that was retrieved. - - - Adds an array message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves an array from the message. - The array that was retrieved. - - - Retrieves an array from the message. - The amount of ints to retrieve. - The array that was retrieved. - - - Populates an array with ints retrieved from the message. - The amount of ints to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of uints to retrieve. - The array that was retrieved. - - - Populates a array with uints retrieved from the message. - The amount of uints to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of ints from the message and writes them into the given array. - The amount of ints to read. - The array to write the ints into. - The position at which to start writing into the array. - - - Reads a number of uints from the message and writes them into the given array. - The amount of uints to read. - The array to write the uints into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of longs to retrieve. - The array that was retrieved. - - - Populates a array with longs retrieved from the message. - The amount of longs to retrieve. - The array to populate. - The position at which to start populating the array. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of ulongs to retrieve. - The array that was retrieved. - - - Populates a array with ulongs retrieved from the message. - The amount of ulongs to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of longs from the message and writes them into the given array. - The amount of longs to read. - The array to write the longs into. - The position at which to start writing into the array. - - - Reads a number of ulongs from the message and writes them into the given array. - The amount of ulongs to read. - The array to write the ulongs into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of floats to retrieve. - The array that was retrieved. - - - Populates a array with floats retrieved from the message. - The amount of floats to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of floats from the message and writes them into the given array. - The amount of floats to read. - The array to write the floats into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of doubles to retrieve. - The array that was retrieved. - - - Populates a array with doubles retrieved from the message. - The amount of doubles to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of doubles from the message and writes them into the given array. - The amount of doubles to read. - The array to write the doubles into. - The position at which to start writing into the array. - - - Adds a to the message. - The to add. - The message that the was added to. - - - Retrieves a from the message. - The that was retrieved. - - - Adds a array to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves a array from the message. - The array that was retrieved. - - - Retrieves a array from the message. - The amount of strings to retrieve. - The array that was retrieved. - - - Populates a array with strings retrieved from the message. - The amount of strings to retrieve. - The array to populate. - The position at which to start populating the array. - - - The maximum number of elements an array can contain where the length still fits into a single byte. - - - The maximum number of elements an array can contain where the length still fits into two byte2. - - - Adds the length of an array to the message, using either 1 or 2 bytes depending on how large the array is. Does not support arrays with more than 32,767 elements. - The length of the array. - - - Retrieves the length of an array from the message, using either 1 or 2 bytes depending on how large the array is. - The length of the array. - - - Adds a serializable to the message. - The serializable to add. - The message that the serializable was added to. - - - Retrieves a serializable from the message. - The serializable that was retrieved. - - - Adds an array of serializables to the message. - The array to add. - Whether or not to include the length of the array in the message. - The message that the array was added to. - - - Retrieves an array of serializables from the message. - The array that was retrieved. - - - Retrieves an array of serializables from the message. - The amount of serializables to retrieve. - The array that was retrieved. - - - Populates an array of serializables retrieved from the message. - The amount of serializables to retrieve. - The array to populate. - The position at which to start populating the array. - - - Reads a number of serializables from the message and writes them into the given array. - The amount of serializables to read. - The array to write the serializables into. - The position at which to start writing into . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - - This method is simply an alternative way of calling . - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of an value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of a value. - - - The name of an array length value. - - - Constructs an error message for when a message contains insufficient unread bytes to retrieve a certain value. - The name of the value type for which the retrieval attempt failed. - Text describing the value which will be returned. - The error message. - - - Constructs an error message for when a message contains insufficient unread bytes to retrieve an array of values. - The expected length of the array. - The name of the value type for which the retrieval attempt failed. - The error message. - - - Constructs an error message for when a number of retrieved values do not fit inside the bounds of the provided array. - The number of values being retrieved. - The length of the provided array. - The position in the array at which to begin writing values. - The name of the value type which is being retrieved. - The name of the value type in plural form. If left empty, this will be set to with an s appended to it. - The error message. - - - Specifies a method as the message handler for messages with the given ID. - - - In order for a method to qualify as a message handler, it must match a valid message handler method signature. s - will only use methods marked with this attribute if they match the signature, and s - will only use methods marked with this attribute if they match the signature. - - - Methods marked with this attribute which match neither of the valid message handler signatures will not be used by s - or s and will cause warnings at runtime. - - - If you want a or to only use a subset of all message handler methods, you can do so by setting up - custom message handler groups. Simply set the group ID in the constructor and pass the - same value to the or method. This - will make that or only use message handlers which have the same group ID. - - - - - The ID of the message type which this method is meant to handle. - - - The ID of the group of message handlers which this method belongs to. - - - Initializes a new instance of the class with the and values. - The ID of the message type which this method is meant to handle. - The ID of the group of message handlers which this method belongs to. - - s will only use this method if its signature matches the signature. - s will only use this method if its signature matches the signature. - This method will be ignored if its signature matches neither of the valid message handler signatures. - - - - Provides functionality for enabling/disabling automatic message relaying by message type. - - - The number of bits an int consists of. - - - An array storing all the bits which represent whether messages of a given ID should be relayed or not. - - - Creates a filter of a given size. - How big to make the filter. - - should be set to the value of the largest message ID, plus 1. For example, if a server will - handle messages with IDs 1, 2, 3, 7, and 8, should be set to 9 (8 is the largest possible value, - and 8 + 1 = 9) despite the fact that there are only 5 unique message IDs the server will ever handle. - - - - Creates a filter based on an enum of message IDs. - The enum type. - - - Creates a filter of a given size and enables relaying for the given message IDs. - How big to make the filter. - Message IDs to enable auto relaying for. - - - - Creates a filter based on an enum of message IDs and enables relaying for the given message IDs. - The enum type. - Message IDs to enable relaying for. - - - Enables auto relaying for the given message IDs. - Message IDs to enable relaying for. - - - Calculate the filter size necessary to manage all message IDs in the given enum. - The enum type. - The appropriate filter size. - is not an . - - - Sets the filter size. - How big to make the filter. - - - Enables auto relaying for the given message ID. - The message ID to enable relaying for. - - - - - - Disables auto relaying for the given message ID. - The message ID to enable relaying for. - - - - - - Checks whether or not messages with the given ID should be relayed. - The message ID to check. - Whether or not messages with the given ID should be relayed. - - - The reason the connection attempt was rejected. - - - No response was received from the server (because the client has no internet connection, the server is offline, no server is listening on the target endpoint, etc.). - - - The client is already connected. - - - A connection attempt is already pending. - - - The server is full. - - - The connection attempt was rejected. - - - The connection attempt was rejected and custom data may have been included with the rejection message. - - - The reason for a disconnection. - - - No connection was ever established. - - - The connection attempt was rejected by the server. - - - The active transport detected a problem with the connection. - - - The connection timed out. - - This also acts as the fallback reason—if a client disconnects and the message containing the real reason is lost - in transmission, it can't be resent as the connection will have already been closed. As a result, the other end will time - out the connection after a short period of time and this will be used as the reason. - - - - The client was forcibly disconnected by the server. - - - The server shut down. - - - The disconnection was initiated by the client. - - - Provides base functionality for and . - - - The name to use when logging messages via . - - - The time (in milliseconds) after which to disconnect if no heartbeats are received. - - - The interval (in milliseconds) at which to send and expect heartbeats to be received. - Changes to this value will only take effect after the next heartbeat is executed. - - - The number of currently active and instances. - - - The current time. - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected due to . - - - The text to log when disconnected or rejected due to an unknown reason. - - - The text to log when the connection failed due to . - - - The text to log when the connection failed due to . - - - The text to log when the connection failed due to . - - - The text to log when the connection failed due to . - - - A stopwatch used to track how much time has passed. - - - Received messages which need to be handled. - - - A queue of events to execute, ordered by how soon they need to be executed. - - - Initializes the peer. - The name to use when logging messages via . - - - Retrieves methods marked with . - An array containing message handler methods. - - - Builds a dictionary of message IDs and their corresponding message handler methods. - The ID of the group of message handler methods to include in the dictionary. - - - Starts tracking how much time has passed. - - - Stops tracking how much time has passed. - - - Beats the heart. - - - Handles any received messages and invokes any delayed events which need to be invoked. - - - Sets up a delayed event to be executed after the given time has passed. - How long from now to execute the delayed event, in milliseconds. - The delayed event to execute later. - - - Handles all queued messages. - - - Handles data received by the transport. - - - Handles a message. - The message to handle. - The message's header type. - The connection which the message was received on. - - - Increases . For use when a new or is started. - - - Decreases . For use when a or is stopped. - - - Stores information about a message that needs to be handled. - - - The message that needs to be handled. - - - The message's header type. - - - The connection on which the message was received. - - - Handles initialization. - The message that needs to be handled. - The message's header type. - The connection on which the message was received. - - - Represents a currently pending reliably sent message whose delivery has not been acknowledged yet. - - - The time of the latest send attempt. - - - The multiplier used to determine how long to wait before resending a pending message. - - - How often to try sending the message before giving up. - - - A pool of reusable instances. - - - The to use to send (and resend) the pending message. - - - The sequence ID of the message. - - - The contents of the message. - - - The length in bytes of the data that has been written to the message. - - - How many send attempts have been made so far. - - - Whether the pending message has been cleared or not. - - - Handles initial setup. - - - Retrieves a instance, initializes it and then sends it. - The sequence ID of the message. - The message that is being sent reliably. - The to use to send (and resend) the pending message. - - - Retrieves a instance from the pool. If none is available, a new instance is created. - A instance. - - - Returns the instance to the pool so it can be reused. - - - Resends the message. - - - Attempts to send the message. - - - Clears the message. - Whether or not to remove the message from . - - - A server that can accept connections from s. - - - Invoked when a client connects. - - - Invoked when a message is received. - - - Invoked when a client disconnects. - - - Whether or not the server is currently running. - - - The local port that the server is running on. - - - The maximum number of concurrent connections. - - - The number of currently connected clients. - - - An array of all the currently connected clients. - The position of each instance in the array does not correspond to that client's numeric ID (except by coincidence). - - - Encapsulates a method that handles a message from a client. - The numeric ID of the client from whom the message was received. - The message that was received. - - - Encapsulates a method that determines whether or not to accept a client's connection attempt. - - - An optional method which determines whether or not to accept a client's connection attempt. - The parameter is the pending connection and the parameter is a message containing any additional data the client included with the connection attempt. - - - Stores which message IDs have auto relaying enabled. Relaying is disabled entirely when this is . - - - Currently pending connections which are waiting to be accepted or rejected. - - - Currently connected clients. - - - Clients that have timed out and need to be removed from . - - - Methods used to handle messages, accessible by their corresponding message IDs. - - - The underlying transport's server that is used for sending and receiving data. - - - All currently unused client IDs. - - - Handles initial setup. - The transport to use for sending and receiving data. - The name to use when logging messages via . - - - Handles initial setup using the built-in UDP transport. - The name to use when logging messages via . - - - Stops the server if it's running and swaps out the transport it's using. - The new underlying transport server to use for sending and receiving data. - This method does not automatically restart the server. To continue accepting connections, must be called again. - - - Starts the server. - The local port on which to start the server. - The maximum number of concurrent connections to allow. - The ID of the group of message handler methods to use when building . - - - Subscribes appropriate methods to the transport's events. - - - Unsubscribes methods from all of the transport's events. - - - - - - Handles an incoming connection attempt. - - - Handles a connect message. - The client that sent the connect message. - The connect message. - - - Accepts the given pending connection. - The connection to accept. - - - Rejects the given pending connection. - The connection to reject. - Data that should be sent to the client being rejected. Use to get an empty message instance. - - - Accepts the given pending connection. - The connection to accept. - - - Rejects the given pending connection. - The connection to reject. - The reason why the connection is being rejected. - Data that should be sent to the client being rejected - - - Checks if clients have timed out. - - - - - - - - - Sends a message to a given client. - The message to send. - The numeric ID of the client to send the message to. - Whether or not to return the message to the pool after it is sent. - - - - Sends a message to a given client. - The message to send. - The client to send the message to. - Whether or not to return the message to the pool after it is sent. - - - - Sends a message to all connected clients. - The message to send. - Whether or not to return the message to the pool after it is sent. - - - - Sends a message to all connected clients except the given one. - The message to send. - The numeric ID of the client to not send the message to. - Whether or not to return the message to the pool after it is sent. - - - - Retrieves the client with the given ID, if a client with that ID is currently connected. - The ID of the client to retrieve. - The retrieved client. - if a client with the given ID was connected; otherwise . - - - Disconnects a specific client. - The numeric ID of the client to disconnect. - Data that should be sent to the client being disconnected. Use to get an empty message instance. - - - Disconnects the given client. - The client to disconnect. - Data that should be sent to the client being disconnected. Use to get an empty message instance. - - - Cleans up the local side of the given connection. - The client to disconnect. - The reason why the client is being disconnected. - - - What to do when the transport disconnects a client. - - - Stops the server. - - - Initializes available client IDs. - - - Retrieves an available client ID. - The client ID. 0 if none were available. - - - Sends a disconnect message. - The client to send the disconnect message to. - Why the client is being disconnected. - Optional custom data that should be sent to the client being disconnected. - - - Sends a client connected message. - The newly connected client. - - - Sends a client disconnected message. - The numeric ID of the client that disconnected. - - - Invokes the event. - The newly connected client. - - - Invokes the event and initiates handling of the received message. - The received message. - The client from which the message was received. - - - Invokes the event. - The client that disconnected. - The reason for the disconnection. - - - Contains event data for when a server's transport successfully establishes a connection to a client. - - - The newly established connection. - - - Initializes event data. - The newly established connection. - - - Contains event data for when a server's or client's transport receives data. - - - An array containing the received data. - - - The number of bytes that were received. - - - The connection which the data was received from. - - - Initializes event data. - An array containing the received data. - The number of bytes that were received. - The connection which the data was received from. - - - Contains event data for when a server's or client's transport initiates or detects a disconnection. - - - The closed connection. - - - The reason for the disconnection. - - - Initializes event data. - The closed connection. - The reason for the disconnection. - - - Defines methods, properties, and events which every transport's client must implement. - - - Invoked when a connection is established at the transport level. - - - Invoked when a connection attempt fails at the transport level. - - - Starts the transport and attempts to connect to the given host address. - The host address to connect to. - The pending connection. if an issue occurred. - The error message associated with the issue that occurred, if any. - if a connection attempt will be made. if an issue occurred (such as being in an invalid format) and a connection attempt will not be made. - - - Closes the connection to the server. - - - The header type of a . - - - An unreliable user message. - - - An internal unreliable ack message. - - - An internal unreliable ack message, used when acknowledging a sequence ID other than the last received one. - - - An internal unreliable connect message. - - - An internal unreliable connection rejection message. - - - An internal unreliable heartbeat message. - - - An internal unreliable disconnect message. - - - A reliable user message. - - - An internal reliable welcome message. - - - An internal reliable client connected message. - - - An internal reliable client disconnected message. - - - Defines methods, properties, and events which every transport's server and client must implement. - - - Invoked when data is received by the transport. - - - Invoked when a disconnection is initiated or detected by the transport. - - - Initiates handling of any received messages. - - - Defines methods, properties, and events which every transport's server must implement. - - - Invoked when a connection is established at the transport level. - - - - - - Starts the transport and begins listening for incoming connections. - The local port on which to listen for connections. - - - Closes an active connection. - The connection to close. - - - Closes all existing connections and stops listening for new connections. - - - A client which can connect to a . - - - - - - - - - - - - The connection to the server. - - - - Expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777. - - - Parses into and , if possible. - The host address to parse. - The retrieved IP. - The retrieved port. - Whether or not was in a valid format. - - - - - - - - - Invokes the event. - - - Invokes the event. - - - - - - Represents a connection to a or . - - - The endpoint representing the other end of the connection. - - - The socket to use for sending and receiving. - - - The local peer this connection is associated with. - - - An array to receive message size values into. - - - The size of the next message to be received. - - - Initializes the connection. - The socket to use for sending and receiving. - The endpoint representing the other end of the connection. - The local peer this connection is associated with. - - - - - - Polls the socket and checks if any data was received. - - - Receives a message, if all of its data is ready to be received. - How many bytes were received. - Whether or not all of the message's data was ready to be received. - - - Closes the connection. - - - - - - - - - - - - - - - Provides base send & receive functionality for and . - - - - - - An array that incoming data is received into. - - - An array that outgoing data is sent out of. - - - The default size used for the socket's send and receive buffers. - - - The size to use for the socket's send and receive buffers. - - - The main socket, either used for listening for connections or for sending and receiving data. - - - The minimum size that may be used for the socket's send and receive buffers. - - - Initializes the transport. - How big the socket's send and receive buffers should be. - - - Handles received data. - The number of bytes that were received. - The connection from which the data was received. - - - Invokes the event. - The closed connection. - The reason for the disconnection. - - - A server which can accept connections from s. - - - - - - - - - - - - The maximum number of pending connections to allow at any given time. - - - Whether or not the server is running. - - - The currently open connections, accessible by their endpoints. - - - Connections that need to be closed. - - - - - - - - - Starts listening for connections on the given port. - The port to listen on. - - - - - - Accepts any pending connections. - - - Stops listening for connections. - - - - - - - - - Invokes the event. - The successfully established connection. - - - - - - A client which can connect to a . - - - - - - - - - - - - The connection to the server. - - - - - - - Expects the host address to consist of an IP and port, separated by a colon. For example: 127.0.0.1:7777. - - - Parses into and , if possible. - The host address to parse. - The retrieved IP. - The retrieved port. - Whether or not was in a valid format. - - - - - - Invokes the event. - - - Invokes the event. - - - - - - Represents a connection to a or . - - - The endpoint representing the other end of the connection. - - - The local peer this connection is associated with. - - - Initializes the connection. - The endpoint representing the other end of the connection. - The local peer this connection is associated with. - - - - - - - - - - - - - - - - - - The kind of socket to create. - - - Dual-mode. Works with both IPv4 and IPv6. - - - IPv4 only mode. - - - IPv6 only mode. - - - Provides base send & receive functionality for and . - - - - - - The default size used for the socket's send and receive buffers. - - - The minimum size that may be used for the socket's send and receive buffers. - - - How long to wait for a packet, in microseconds. - - - Whether to create an IPv4 only, IPv6 only, or dual-mode socket. - - - The size to use for the socket's send and receive buffers. - - - The array that incoming data is received into. - - - The socket to use for sending and receiving. - - - Whether or not the transport is running. - - - A reusable endpoint. - - - Initializes the transport. - Whether to create an IPv4 only, IPv6 only, or dual-mode socket. - How big the socket's send and receive buffers should be. - - - - - - Opens the socket and starts the transport. - The port to bind the socket to. - - - Closes the socket and stops the transport. - - - Polls the socket and checks if any data was received. - - - Sends data to a given endpoint. - The array containing the data. - The number of bytes in the array which should be sent. - The endpoint to send the data to. - - - Handles received data. - A byte array containing the received data. - The number of bytes in used by the received data. - The endpoint from which the data was received. - - - Invokes the event. - The closed connection. - The reason for the disconnection. - - - A server which can accept connections from s. - - - - - - - - - - - - The currently open connections, accessible by their endpoints. - - - - - - - - - Decides what to do with a connection attempt. - The connection to accept or reject. - Whether or not the connection attempt was a new connection. - - - - - - - - - Invokes the event. - The successfully established connection. - - - - - - Provides functionality for queueing methods for later execution from a chosen thread. - - - The name to use when logging messages via . - - - Handles initial setup. - The name to use when logging messages via . - - - Adds an action to the queue. - The action to be added to the queue. - - - Executes all actions in the queue on the calling thread. - This method should only be called from a single thread in the application. - - - Clears all actions in the queue without executing them. - - - Provides functionality for converting bytes to various value types and vice versa. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 2 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts the 2 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 4 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts the 4 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 8 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts the 8 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 4 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Converts a given to bytes and writes them into the given array. - The to convert. - The array to write the bytes into. - The position in the array at which to write the bytes. - - - Converts the 8 bytes in the array at to a . - The array to read the bytes from. - The position in the array at which to read the bytes. - The converted . - - - Executes an action when invoked. - - - Executes the action. - - - Resends a when invoked. - - - The message to resend. - - - The time at which the resend event was queued. - - - Initializes the event. - The message to resend. - The time at which the resend event was queued. - - - - - - Executes a heartbeat when invoked. - - - The peer whose heart to beat. - - - Initializes the event. - The peer whose heart to beat. - - - - - - Contains extension methods for various classes. - - - Takes the 's IP address and port number and converts it to a string, accounting for whether the address is an IPv4 or IPv6 address. - A string containing the IP address and port number of the endpoint. - - - Contains miscellaneous helper methods. - - - Determines whether or form should be used based on the . - The amount that and refer to. - The singular form. - The plural form. - if is 1; otherwise . - - - Calculates the signed gap between sequence IDs, accounting for wrapping. - The new sequence ID. - The previous sequence ID. - The signed gap between the two given sequence IDs. A positive gap means is newer than . A negative gap means is older than . - - - Represents a collection of items that have a value and a priority. On dequeue, the item with the lowest priority value is removed. - Specifies the type of elements in the queue. - Specifies the type of priority associated with enqueued elements. - - - Gets the number of elements contained in the . - - - Adds the specified element and associated priority to the . - The element to add. - The priority with which to associate the new element. - - - Removes and returns the lowest priority element. - - - Returns the priority of the lowest priority element. - - - Removes all elements from the . - - - Defines log message types. - - - Logs that are used for investigation during development. - - - Logs that provide general information about application flow. - - - Logs that highlight abnormal or unexpected events in the application flow. - - - Logs that highlight problematic events in the application flow which will cause unexpected behavior if not planned for. - - - Provides functionality for logging messages. - - - Whether or not messages will be logged. - - - Whether or not messages will be logged. - - - Whether or not messages will be logged. - - - Whether or not messages will be logged. - - - Encapsulates a method used to log messages. - The message to log. - - - Log methods, accessible by their - - - Whether or not to include timestamps when logging messages. - - - The format to use for timestamps. - - - Initializes with all log types enabled. - The method to use when logging all types of messages. - Whether or not to include timestamps when logging messages. - The format to use for timestamps. - - - Initializes with the supplied log methods. - The method to use when logging debug messages. Set to to disable debug logs. - The method to use when logging info messages. Set to to disable info logs. - The method to use when logging warning messages. Set to to disable warning logs. - The method to use when logging error messages. Set to to disable error logs. - Whether or not to include timestamps when logging messages. - The format to use for timestamps. - - - Enables logging for messages of the given . - The type of message to enable logging for. - The method to use when logging this type of message. - - - Disables logging for messages of the given . - The type of message to enable logging for. - - - Logs a message. - The type of log message that is being logged. - The message to log. - - - Logs a message. - The type of log message that is being logged. - Who is logging this message. - The message to log. - - - Converts a object to a formatted timestamp string. - The time to format. - The formatted timestamp. - - - diff --git a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.xml.meta b/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.xml.meta deleted file mode 100644 index bdf63c99..00000000 --- a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/RiptideNetworking.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: e19a3f2faa2051941881847be1d0a3e7 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/NetworkManager.cs b/Demos/Unity/PlayerHostedDemo/Assets/Scripts/NetworkManager.cs similarity index 100% rename from Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/NetworkManager.cs rename to Demos/Unity/PlayerHostedDemo/Assets/Scripts/NetworkManager.cs diff --git a/Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/NetworkManager.cs.meta b/Demos/Unity/PlayerHostedDemo/Assets/Scripts/NetworkManager.cs.meta similarity index 100% rename from Demos/Unity/PlayerHostedDemo/Assets/Scripts/Multiplayer/NetworkManager.cs.meta rename to Demos/Unity/PlayerHostedDemo/Assets/Scripts/NetworkManager.cs.meta diff --git a/Demos/Unity/PlayerHostedDemo/Packages/manifest.json b/Demos/Unity/PlayerHostedDemo/Packages/manifest.json index 137e47ea..17afdd7e 100644 --- a/Demos/Unity/PlayerHostedDemo/Packages/manifest.json +++ b/Demos/Unity/PlayerHostedDemo/Packages/manifest.json @@ -9,6 +9,7 @@ "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.4.8", "com.unity.ugui": "1.0.0", + "net.tomweiland.riptide": "https://github.com/RiptideNetworking/Riptide.git?path=/Packages/Core#unity-package", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", diff --git a/Demos/Unity/PlayerHostedDemo/Packages/packages-lock.json b/Demos/Unity/PlayerHostedDemo/Packages/packages-lock.json index 984ab05e..3fc84e4a 100644 --- a/Demos/Unity/PlayerHostedDemo/Packages/packages-lock.json +++ b/Demos/Unity/PlayerHostedDemo/Packages/packages-lock.json @@ -145,6 +145,13 @@ "com.unity.modules.imgui": "1.0.0" } }, + "net.tomweiland.riptide": { + "version": "https://github.com/RiptideNetworking/Riptide.git?path=/Packages/Core#unity-package", + "depth": 0, + "source": "git", + "dependencies": {}, + "hash": "bb252ba2ea4bd1314d3f8f60bea490418635d06e" + }, "com.unity.modules.ai": { "version": "1.0.0", "depth": 0, diff --git a/Docs/manual/overview/getting-started.md b/Docs/manual/overview/getting-started.md index c9f2871c..b56d86e3 100644 --- a/Docs/manual/overview/getting-started.md +++ b/Docs/manual/overview/getting-started.md @@ -16,7 +16,7 @@ RiptideLogger.Initialize(Debug.Log, Debug.Log, Debug.LogWarning, Debug.LogError, Obviously this is using Unity's logging methods, so if you're not using Unity for your project you'll need to replace the four log methods with `Console.WriteLine` or your engine's equivalent. > [!IMPORTANT] -> This article explains the basics and includes various code snippets, but if you'd like to see these snippets in the context of a working demo, take a look at the `NetworkManager` classes in the [dedicated server demo](https://github.com/RiptideNetworking/Riptide/tree/main/Demos/Unity/DedicatedServerDemo)'s [server](https://github.com/RiptideNetworking/Riptide/blob/main/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/Multiplayer/NetworkManager.cs) and [client](https://github.com/RiptideNetworking/Riptide/blob/main/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/Multiplayer/NetworkManager.cs) projects. +> This article explains the basics and includes various code snippets, but if you'd like to see these snippets in the context of a working demo, take a look at the `NetworkManager` classes in the [dedicated server demo](https://github.com/RiptideNetworking/Riptide/tree/main/Demos/Unity/DedicatedServerDemo)'s [server](https://github.com/RiptideNetworking/Riptide/blob/main/Demos/Unity/DedicatedServerDemo/Server/Assets/Scripts/NetworkManager.cs) and [client](https://github.com/RiptideNetworking/Riptide/blob/main/Demos/Unity/DedicatedServerDemo/Client/Assets/Scripts/NetworkManager.cs) projects. ### Starting a Server