C# Class SharpQuake.Net

Show file Open project: Memorix101/SharpQuake Class Usage Examples

Public Properties

Property Type Description
ActiveConnections int
HostCacheCount int
HostPort int
LanDriverLevel int
Message MsgWriter
Reader MsgReader
SlistLocal bool
SlistSilent bool

Public Methods

Method Description
CanSendMessage ( qsocket_t sock ) : bool

NET_CanSendMessage Returns true or false if the given qsocket can currently accept a message to be transmitted.

CheckNewConnections ( ) : qsocket_t

NET_CheckNewConnections

Close ( qsocket_t sock ) : void

NET_Close

Connect ( string host ) : qsocket_t

NET_Connect called by client to connect to a host. Returns -1 if not able to connect

FreeSocket ( qsocket_t sock ) : void

NET_FreeQSocket

GetMessage ( qsocket_t sock ) : int

NET_GetMessage returns data in net_message sizebuf returns 0 if no data is waiting returns 1 if a message was received returns 2 if an unreliable message was received returns -1 if the connection died

Init ( ) : void
NewSocket ( ) : qsocket_t

NET_NewQSocket Called by drivers when a new communications endpoint is required The sequence and buffer fields will be filled in properly

Poll ( ) : void

NET_Poll

SendMessage ( qsocket_t sock, MsgWriter data ) : int

NET_SendMessage Try to send a complete length+message unit over the reliable stream. returns 0 if the message cannot be delivered reliably, but the connection is still considered valid returns 1 if the message was sent properly returns -1 if the connection died

SendToAll ( MsgWriter data, int blocktime ) : int

NET_SendToAll This is a reliable *blocking* send to all attached clients.

SendUnreliableMessage ( qsocket_t sock, MsgWriter data ) : int

NET_SendUnreliableMessage returns 0 if the message connot be delivered reliably, but the connection is still considered valid returns 1 if the message was sent properly returns -1 if the connection died

SetNetTime ( ) : double
Shutdown ( ) : void

NET_Shutdown

Slist_f ( ) : void

NET_Slist_f

Private Methods

Method Description
Listen_f ( ) : void
MaxPlayers_f ( ) : void
Port_f ( ) : void
PrintSlist ( ) : void
PrintSlistHeader ( ) : void
PrintSlistTrailer ( ) : void
SchedulePollProcedure ( PollProcedure proc, double timeOffset ) : void

SchedulePollProcedure

SlistPoll ( object arg ) : void

Slist_Poll

SlistSend ( object arg ) : void

Slist_Send

Method Details

CanSendMessage() public static method

NET_CanSendMessage Returns true or false if the given qsocket can currently accept a message to be transmitted.
public static CanSendMessage ( qsocket_t sock ) : bool
sock qsocket_t
return bool

CheckNewConnections() public static method

NET_CheckNewConnections
public static CheckNewConnections ( ) : qsocket_t
return qsocket_t

Close() public static method

NET_Close
public static Close ( qsocket_t sock ) : void
sock qsocket_t
return void

Connect() public static method

NET_Connect called by client to connect to a host. Returns -1 if not able to connect
public static Connect ( string host ) : qsocket_t
host string
return qsocket_t

FreeSocket() public static method

NET_FreeQSocket
public static FreeSocket ( qsocket_t sock ) : void
sock qsocket_t
return void

GetMessage() public static method

NET_GetMessage returns data in net_message sizebuf returns 0 if no data is waiting returns 1 if a message was received returns 2 if an unreliable message was received returns -1 if the connection died
public static GetMessage ( qsocket_t sock ) : int
sock qsocket_t
return int

Init() public static method

public static Init ( ) : void
return void

NewSocket() public static method

NET_NewQSocket Called by drivers when a new communications endpoint is required The sequence and buffer fields will be filled in properly
public static NewSocket ( ) : qsocket_t
return qsocket_t

Poll() public static method

NET_Poll
public static Poll ( ) : void
return void

SendMessage() public static method

NET_SendMessage Try to send a complete length+message unit over the reliable stream. returns 0 if the message cannot be delivered reliably, but the connection is still considered valid returns 1 if the message was sent properly returns -1 if the connection died
public static SendMessage ( qsocket_t sock, MsgWriter data ) : int
sock qsocket_t
data MsgWriter
return int

SendToAll() public static method

NET_SendToAll This is a reliable *blocking* send to all attached clients.
public static SendToAll ( MsgWriter data, int blocktime ) : int
data MsgWriter
blocktime int
return int

SendUnreliableMessage() public static method

NET_SendUnreliableMessage returns 0 if the message connot be delivered reliably, but the connection is still considered valid returns 1 if the message was sent properly returns -1 if the connection died
public static SendUnreliableMessage ( qsocket_t sock, MsgWriter data ) : int
sock qsocket_t
data MsgWriter
return int

SetNetTime() public static method

public static SetNetTime ( ) : double
return double

Shutdown() public static method

NET_Shutdown
public static Shutdown ( ) : void
return void

Slist_f() public static method

NET_Slist_f
public static Slist_f ( ) : void
return void

Property Details

ActiveConnections public static property

public static int ActiveConnections
return int

HostCacheCount public static property

public static int HostCacheCount
return int

HostPort public static property

public static int HostPort
return int

LanDriverLevel public static property

public static int LanDriverLevel
return int

Message public static property

public static MsgWriter Message
return MsgWriter

Reader public static property

public static MsgReader Reader
return MsgReader

SlistLocal public static property

public static bool SlistLocal
return bool

SlistSilent public static property

public static bool SlistSilent
return bool