TNet 3  3.0.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
TNet.Channel Class Reference

A channel contains one or more players. All information broadcast by players is visible by others in the same channel. More...

Inheritance diagram for TNet.Channel:
TNet.DataNodeContainer

Classes

class  CreatedObject
 Created objects are saved by the channels. More...
 
class  Info
 Channel information class created as a result of retrieving a list of channels. More...
 
class  RFC
 Remote function call entry stored within the channel. More...
 

Public Member Functions

uint GetUniqueID ()
 Helper function that returns a new unique ID that's not currently used by any object. More...
 
void AddCreatedObject (CreatedObject obj)
 Add a new created object to the list. This object's ID must always be above 32767. More...
 
Player GetPlayer (int pid)
 Return a player with the specified ID. More...
 
bool RemovePlayer (int pid)
 Remove the player with the specified ID. More...
 
void Reset ()
 Reset the channel to its initial state. More...
 
void RemovePlayer (TcpPlayer p, List< uint > destroyedObjects)
 Remove the specified player from the channel. More...
 
bool DestroyObject (uint objID)
 Remove an object with the specified unique identifier. More...
 
void DestroyObjectRFCs (uint objectID)
 Delete the specified remote function call. More...
 
CreatedObject TransferObject (uint objectID, Channel other)
 Transfer the specified object to another channel, changing its Object ID in the process. More...
 
void AddRFC (uint uid, string funcName, Buffer buffer)
 Add a new saved remote function call. More...
 
void DeleteRFC (uint inID, string funcName)
 Delete the specified remote function call. More...
 
void SaveTo (BinaryWriter writer)
 Save the channel's data into the specified file. More...
 
bool LoadFrom (BinaryReader reader)
 Load the channel's data from the specified file. More...
 
- Public Member Functions inherited from TNet.DataNodeContainer
DataNode Set (string path, object val)
 Set the specified value. Note that on the client side only the player's owner should be setting the values. More...
 
DataNode Get (string path)
 Get the specified child within the DataNode. More...
 
Get< T > (string path)
 Get the specified value from the DataNode. More...
 
Get< T > (string path, T defaultVal)
 Get the specified value from the DataNode. More...
 

Public Attributes

int id
 
string password = ""
 
string level = ""
 
bool persistent = false
 
bool closed = false
 
bool isLocked = false
 
ushort playerLimit = 65535
 
List< Playerplayers = new List<Player>()
 
List< RFCrfcs = new List<RFC>()
 
List< CreatedObjectcreated = new List<CreatedObject>()
 
List< uint > destroyed = new List<uint>()
 
uint objectCounter = 0xFFFFFF
 
Player host
 
- Public Attributes inherited from TNet.DataNodeContainer
DataNode dataNode
 Custom data easily accessible via Get and Set functions. More...
 

Properties

bool hasData [get]
 Whether the channel has data that can be saved. More...
 
bool isOpen [get]
 Whether the channel can be joined. More...
 

Detailed Description

A channel contains one or more players. All information broadcast by players is visible by others in the same channel.

Member Function Documentation

void TNet.Channel.AddCreatedObject ( CreatedObject  obj)

Add a new created object to the list. This object's ID must always be above 32767.

void TNet.Channel.AddRFC ( uint  uid,
string  funcName,
Buffer  buffer 
)

Add a new saved remote function call.

void TNet.Channel.DeleteRFC ( uint  inID,
string  funcName 
)

Delete the specified remote function call.

bool TNet.Channel.DestroyObject ( uint  objID)

Remove an object with the specified unique identifier.

void TNet.Channel.DestroyObjectRFCs ( uint  objectID)

Delete the specified remote function call.

Player TNet.Channel.GetPlayer ( int  pid)

Return a player with the specified ID.

uint TNet.Channel.GetUniqueID ( )

Helper function that returns a new unique ID that's not currently used by any object.

bool TNet.Channel.LoadFrom ( BinaryReader  reader)

Load the channel's data from the specified file.

bool TNet.Channel.RemovePlayer ( int  pid)

Remove the player with the specified ID.

void TNet.Channel.RemovePlayer ( TcpPlayer  p,
List< uint >  destroyedObjects 
)

Remove the specified player from the channel.

void TNet.Channel.Reset ( )

Reset the channel to its initial state.

void TNet.Channel.SaveTo ( BinaryWriter  writer)

Save the channel's data into the specified file.

CreatedObject TNet.Channel.TransferObject ( uint  objectID,
Channel  other 
)

Transfer the specified object to another channel, changing its Object ID in the process.

Member Data Documentation

bool TNet.Channel.closed = false
List<CreatedObject> TNet.Channel.created = new List<CreatedObject>()
List<uint> TNet.Channel.destroyed = new List<uint>()
Player TNet.Channel.host
int TNet.Channel.id
bool TNet.Channel.isLocked = false
string TNet.Channel.level = ""
uint TNet.Channel.objectCounter = 0xFFFFFF
string TNet.Channel.password = ""
bool TNet.Channel.persistent = false
ushort TNet.Channel.playerLimit = 65535
List<Player> TNet.Channel.players = new List<Player>()
List<RFC> TNet.Channel.rfcs = new List<RFC>()

Property Documentation

bool TNet.Channel.hasData
get

Whether the channel has data that can be saved.

bool TNet.Channel.isOpen
get

Whether the channel can be joined.


The documentation for this class was generated from the following file: