C# Class Ballz.Network.Connection

Provides an abstraction of the protocol layer. Use it to establish a network connection with another game instance.
Datei anzeigen Open project: SpagAachen/Ballz Class Usage Examples

Public Properties

Property Type Description
ClientPlayerId int
Id int

Private Properties

Property Type Description

Public Methods

Method Description
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.

Method Details

Connection() public method

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
return System

Connection() public method

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
return System

ReadUpdates() public method

public ReadUpdates ( ) : void
return void

Send() public method

Serializes on object and send it to another game instance.
public Send ( object obj ) : bool
obj object The object to send
return bool

Property Details

ClientPlayerId public_oe property

public int ClientPlayerId
return int

Id public_oe property

public int Id
return int