Search Results for

    Show / Hide Table of Contents

    Client Class

    Namespace: Riptide
    Assembly: RiptideNetworking.dll

    A client that can connect to a Server.

    public class Client : Peer
    Inheritance
    object
    Peer
    Client
    Inherited Members
    Peer.LogName
    Peer.HeartbeatInterval
    Peer.useMessageHandlers
    Peer.defaultTimeout
    Peer.FindMessageHandlers()
    Peer.StartTime()
    Peer.StopTime()
    Peer.HandleMessages()
    Peer.HandleData(object, DataReceivedEventArgs)
    Peer.IncreaseActiveCount()
    Peer.DecreaseActiveCount()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()

    Constructors

    Client(IClient, string)

    Handles initial setup.

    Client(string)

    Handles initial setup using the built-in UDP transport.

    Properties

    Connection

    The client's connection to a server.

    Id

    The client's numeric ID.

    IsConnected

    Whether or not the client is currently connected.

    IsConnecting

    Whether or not the client is currently in the process of connecting.

    IsNotConnected

    Whether or not the client is currently not trying to connect, pending, nor actively connected.

    IsPending

    Whether or not the client's connection is currently pending (waiting to be accepted/rejected by the server).

    RTT

    The round trip time (ping) of the connection, in milliseconds. -1 if not calculated yet.

    SmoothRTT

    The smoothed round trip time (ping) of the connection, in milliseconds. -1 if not calculated yet.

    TimeoutTime

    Sets the client's TimeoutTime.

    Methods

    ChangeTransport(IClient)

    Disconnects the client if it's connected and swaps out the transport it's using.

    Connect(string, int, byte, Message, bool)

    Attempts to connect to a server at the given host address.

    CreateMessageHandlersDictionary(byte)

    Builds a dictionary of message IDs and their corresponding message handler methods.

    Disconnect()

    Disconnects from the server.

    Handle(Message, MessageHeader, Connection)

    Handles a message.

    OnClientConnected(ushort)

    Invokes the ClientConnected event.

    OnClientDisconnected(ushort)

    Invokes the ClientDisconnected event.

    OnConnected()

    Invokes the Connected event.

    OnConnectionFailed(RejectReason, Message)

    Invokes the ConnectionFailed event.

    OnDisconnected(DisconnectReason, Message)

    Invokes the Disconnected event.

    OnMessageReceived(Message)

    Invokes the MessageReceived event and initiates handling of the received message.

    Send(Message, bool)

    Sends a message to the server.

    Update()

    Handles any received messages and invokes any delayed events which need to be invoked.

    Events

    ClientConnected

    Invoked when another non-local client connects.

    ClientDisconnected

    Invoked when another non-local client disconnects.

    Connected

    Invoked when a connection to the server is established.

    ConnectionFailed

    Invoked when a connection to the server fails to be established.

    Disconnected

    Invoked when disconnected from the server.

    MessageReceived

    Invoked when a message is received.

    • Improve this Doc
    • View Source
    • Support Riptide
    In This Article
    Back to top Copyright © Tom Weiland 2022
    Made with DocFX