Show / Hide Table of Contents

Class TrimmerClient

Client API to access Trimmer configuration over the network.

Inheritance
System.Object
TrimmerClient
Namespace: sttz.Trimmer.Options
Assembly: Trimmer.dll
Syntax
public class TrimmerClient
Remarks

A client to connect to TrimmerServer.

If you use this class directly, make sure you call Update() regularily for the server to process commands.

Warning

The communication is unencrypted and doesn't use authentication. The use of this server is only intended for development.

Constructors

| Improve this Doc View Source

TrimmerClient()

Declaration
public TrimmerClient()

Properties

| Improve this Doc View Source

ClientHelloFormat

Hello sent to the server.

Declaration
public string ClientHelloFormat { get; set; }
Property Value
Type Description
System.String
Remarks

The format string can contain following placeholders:

  • {0}: Application.productName
  • {1}: Application.version
  • {2}: Application.unityVersion
| Improve this Doc View Source

IsConnected

Wether the client is currently connected.

Declaration
public bool IsConnected { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ServerAddress

The server address connected to.

Declaration
public IPAddress ServerAddress { get; }
Property Value
Type Description
System.Net.IPAddress
| Improve this Doc View Source

ServerHello

Expected string to receive back from server for discoveries and connections.

Declaration
public string ServerHello { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

ServerPort

The port the server is listening on.

Declaration
public int ServerPort { get; set; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

Connect(IPAddress, TrimmerClient.CommandResult)

Connect to a server.

Declaration
public void Connect(IPAddress address, TrimmerClient.CommandResult onConnect)
Parameters
Type Name Description
System.Net.IPAddress address
TrimmerClient.CommandResult onConnect
| Improve this Doc View Source

Disconnect()

Disconnect from the server.

Declaration
public void Disconnect()
| Improve this Doc View Source

FindServers()

Find discoverable servers on the local network.

Declaration
public void FindServers()
| Improve this Doc View Source

GetOptionValue(String, TrimmerClient.CommandResult)

Get an Option value.

Declaration
public void GetOptionValue(string optionPath, TrimmerClient.CommandResult onResult)
Parameters
Type Name Description
System.String optionPath

Path of the Option

TrimmerClient.CommandResult onResult
| Improve this Doc View Source

Ping(TrimmerClient.CommandResult)

Send a Ping command.

Declaration
public void Ping(TrimmerClient.CommandResult onPong)
Parameters
Type Name Description
TrimmerClient.CommandResult onPong
| Improve this Doc View Source

RawCommand(String, String, TrimmerClient.CommandResult)

Send a raw command to the server.

Declaration
public void RawCommand(string name, string arguments, TrimmerClient.CommandResult onResult)
Parameters
Type Name Description
System.String name

Name of the command

System.String arguments

Arguments of the command (if any)

TrimmerClient.CommandResult onResult

Result callback

| Improve this Doc View Source

SetOptionValue(String, TrimmerClient.CommandResult)

Set an Option value.

Declaration
public void SetOptionValue(string optionPath, TrimmerClient.CommandResult onResult)
Parameters
Type Name Description
System.String optionPath

Path of the Option

TrimmerClient.CommandResult onResult
| Improve this Doc View Source

Update()

Call this method in a regular interval to process server messages.

Declaration
public void Update()

Events

| Improve this Doc View Source

OnServerFound

Event triggered when a server has been found.

Declaration
public event Action<IPAddress, string> OnServerFound
Event Type
Type Description
System.Action<System.Net.IPAddress, System.String>
  • Improve this Doc
  • View Source
Back to top © 2017 Adrian Stutz