C# Класс SharpQuake.Net

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
ActiveConnections int
HostCacheCount int
HostPort int
LanDriverLevel int
Message MsgWriter
Reader MsgReader
SlistLocal bool
SlistSilent bool

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

Метод Описание
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

Приватные методы

Метод Описание
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

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

CanSendMessage() публичный статический Метод

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
Результат bool

CheckNewConnections() публичный статический Метод

NET_CheckNewConnections
public static CheckNewConnections ( ) : qsocket_t
Результат qsocket_t

Close() публичный статический Метод

NET_Close
public static Close ( qsocket_t sock ) : void
sock qsocket_t
Результат void

Connect() публичный статический Метод

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
Результат qsocket_t

FreeSocket() публичный статический Метод

NET_FreeQSocket
public static FreeSocket ( qsocket_t sock ) : void
sock qsocket_t
Результат void

GetMessage() публичный статический Метод

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
Результат int

Init() публичный статический Метод

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

NewSocket() публичный статический Метод

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
Результат qsocket_t

Poll() публичный статический Метод

NET_Poll
public static Poll ( ) : void
Результат void

SendMessage() публичный статический Метод

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
Результат int

SendToAll() публичный статический Метод

NET_SendToAll This is a reliable *blocking* send to all attached clients.
public static SendToAll ( MsgWriter data, int blocktime ) : int
data MsgWriter
blocktime int
Результат int

SendUnreliableMessage() публичный статический Метод

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
Результат int

SetNetTime() публичный статический Метод

public static SetNetTime ( ) : double
Результат double

Shutdown() публичный статический Метод

NET_Shutdown
public static Shutdown ( ) : void
Результат void

Slist_f() публичный статический Метод

NET_Slist_f
public static Slist_f ( ) : void
Результат void

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

ActiveConnections публичное статическое свойство

public static int ActiveConnections
Результат int

HostCacheCount публичное статическое свойство

public static int HostCacheCount
Результат int

HostPort публичное статическое свойство

public static int HostPort
Результат int

LanDriverLevel публичное статическое свойство

public static int LanDriverLevel
Результат int

Message публичное статическое свойство

public static MsgWriter Message
Результат MsgWriter

Reader публичное статическое свойство

public static MsgReader Reader
Результат MsgReader

SlistLocal публичное статическое свойство

public static bool SlistLocal
Результат bool

SlistSilent публичное статическое свойство

public static bool SlistSilent
Результат bool