C# Класс Ballz.Network.Connection

Provides an abstraction of the protocol layer. Use it to establish a network connection with another game instance.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ClientPlayerId int
Id int

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
Connection ( TcpClient connection, int id ) : System

Initializes a new instance of the Connection class and uses the already established connection.

Connection ( string host, int port, int id ) : System

Initializes a new instance of the Connection class and connects to the specified port on the specified host.

ReadUpdates ( ) : void
Send ( object obj ) : bool

Serializes on object and send it to another game instance.

Описание методов

Connection() публичный метод

Initializes a new instance of the Connection class and uses the already established connection.
public Connection ( TcpClient connection, int id ) : System
connection System.Net.Sockets.TcpClient An already established connection.
id int Id for this connection
Результат System

Connection() публичный метод

Initializes a new instance of the Connection class and connects to the specified port on the specified host.
public Connection ( string host, int port, int id ) : System
host string The DNS name of the remote host to which you intend to connect.
port int The port number of the remote host to which you intend to connect.
id int Id for this connection
Результат System

ReadUpdates() публичный метод

public ReadUpdates ( ) : void
Результат void

Send() публичный метод

Serializes on object and send it to another game instance.
public Send ( object obj ) : bool
obj object The object to send
Результат bool

Описание свойств

ClientPlayerId публичное свойство

public int ClientPlayerId
Результат int

Id публичное свойство

public int Id
Результат int