CNetChan
CNetChan
| Metatable function | Description |
|---|---|
__tostring |
Returns a formated string of the CNetChan -> CNetChan [channel name] |
__index |
Used to find the functions on the metatable and access saved variables |
__newindex |
Used to allow one to save variables on the object |
Methods
Returns whether the channel is currently allowed to send a packet, based on its rate limit.
string CNetChan:GetAddress( )
Returns the Address as ip:port
number CNetChan:GetBufferSize( )
number CNetChan:GetChallengeNr( )
Returns the challenge number.
number CNetChan:GetChokedPackets( )
boolean CNetChan:GetClearedDuringProcessing( )
number CNetChan:GetClearTime( )
function CNetChan:GetConnectionClosingCallback( )
Returns the current connection closing callback function.
Can be set using CNetChan:SetConnectionClosingCallback
Can be set using CNetChan:SetConnectionClosingCallback
function CNetChan:GetConnectionCrashedCallback( )
Returns the current connection crashed callback function.
Can be set using CNetChan:SetConnectionCrashedCallback
Can be set using CNetChan:SetConnectionCrashedCallback
function CNetChan:GetConnectionStartCallback( )
Returns the current connection start callback function.
Can be set using CNetChan:SetConnectionStartCallback
Can be set using CNetChan:SetConnectionStartCallback
number CNetChan:GetConnectTime( )
number CNetChan:GetDataRate( )
number CNetChan:GetDropNumber( )
function CNetChan:GetFileDeniedCallback( )
Returns the current file denied callback function.
Can be set using CNetChan:SetFileDeniedCallback
Can be set using CNetChan:SetFileDeniedCallback
function CNetChan:GetFileReceivedCallback( )
Returns the current file received callback function.
Can be set using CNetChan:SetFileReceivedCallback
Can be set using CNetChan:SetFileReceivedCallback
function CNetChan:GetFileRequestedCallback( )
Returns the current file requested callback function.
Can be set using CNetChan:SetFileRequestedCallback
Can be set using CNetChan:SetFileRequestedCallback
function CNetChan:GetFileSentCallback( )
Returns the current file sent callback function.
Can be set using CNetChan:SetFileSentCallback
Can be set using CNetChan:SetFileSentCallback
number CNetChan:GetInReliableState( )
number CNetChan:GetInSequenceNr( )
number CNetChan:GetLastReceived( )
number CNetChan:GetMaxReliablePayloadSize( )
number CNetChan:GetMaxRoutablePayloadSize( )
Returns the maximum routable payload size of the channel.
function CNetChan:GetMessageCallback( )
Returns the current message callback function.
Can be set using CNetChan:SetMessageCallback
Can be set using CNetChan:SetMessageCallback
number CNetChan:GetOutReliableState( )
number CNetChan:GetOutSequenceNr( )
number CNetChan:GetOutSequenceNrAck( )
function CNetChan:GetPacketEndCallback( )
Returns the current packet end callback function.
Can be set using CNetChan:SetPacketEndCallback
Can be set using CNetChan:SetPacketEndCallback
function CNetChan:GetPacketStartCallback( )
Returns the current packet start callback function.
Can be set using CNetChan:SetPacketStartCallback
Can be set using CNetChan:SetPacketStartCallback
boolean CNetChan:GetProcessingMessages( )
Returns true if the channel is currently processing messages.
number CNetChan:GetProtocolVersion( )
Returns the data rate of the channel in bytes/sec.
Alias of CNetChan:GetDataRate.
Alias of CNetChan:GetDataRate.
Returns the framerate the other side of the channel reports it is running at.
function CNetChan:GetShouldAcceptFileCallback( )
Returns the current should-accept-file callback function.
Can be set using CNetChan:SetShouldAcceptFileCallback
Can be set using CNetChan:SetShouldAcceptFileCallback
bf_write CNetChan:GetStreamReliable( )
Returns the reliable stream used by net messages.
number CNetChan:GetStreamSocket( )
bf_write CNetChan:GetStreamUnreliable( )
Returns the unreliable stream used by net messages.
bf_write CNetChan:GetStreamVoice( )
Returns the voice stream used by the voice chat.
This function errors if the client doesn't have a valid CNetChannel
number CNetChan:GetTimeConnected( )
number CNetChan:GetTimeout( )
number CNetChan:GetTimeoutSeconds( )
number CNetChan:GetTimeSinceLastReceived( )
boolean CNetChan:ProcessStream( )
Processes all pending incoming net messages.
Returns true on success.
Returns true on success.
Requests the given file from the other side of the channel.
The result is reported through CNetChan:SetFileReceivedCallback (or CNetChan:SetFileDeniedCallback if the other side denies it), using the returned transfer ID.
The result is reported through CNetChan:SetFileReceivedCallback (or CNetChan:SetFileDeniedCallback if the other side denies it), using the returned transfer ID.
Sends the given file to the other side of the channel.
Sends out the given buffer as a message.
Returns true on success.
Returns true on success.
CNetChan:SetChoked()
CNetChan:SetCompressionMode( boolean compression = false )
CNetChan:SetConnectionClosingCallback( function callback )
Sets the callback function for when a connection is closed.
Can be returned using CNetChan:GetConnectionClosingCallback
Can be returned using CNetChan:GetConnectionClosingCallback
CNetChan:SetConnectionCrashedCallback( function callback )
Sets the callback function for when a connection has crashed.
Can be returned using CNetChan:GetConnectionCrashedCallback
Can be returned using CNetChan:GetConnectionCrashedCallback
CNetChan:SetConnectionStartCallback( function callback )
Sets the callback function for when the connection was established.
Can be returned using CNetChan:GetConnectionStartCallback
Can be returned using CNetChan:GetConnectionStartCallback
CNetChan:SetDataRate( number rate )
CNetChan:SetFileDeniedCallback( function callback )
Sets the callback function for when a file request was denied by the other side of the channel.
Can be returned using CNetChan:GetFileDeniedCallback
Can be returned using CNetChan:GetFileDeniedCallback
CNetChan:SetFileReceivedCallback( function callback )
Sets the callback function for when a requested file has been fully received.
Can be returned using CNetChan:GetFileReceivedCallback
Can be returned using CNetChan:GetFileReceivedCallback
CNetChan:SetFileRequestedCallback( function callback )
Sets the callback function for when the other side of the channel requests a file for download.
Can be returned using CNetChan:GetFileRequestedCallback
Can be returned using CNetChan:GetFileRequestedCallback
CNetChan:SetFileSentCallback( function callback )
Sets the callback function for when a file has been fully sent to the other side of the channel.
Can be returned using CNetChan:GetFileSentCallback
Can be returned using CNetChan:GetFileSentCallback
CNetChan:SetFileTransmissionMode( boolean backgroundTransmission = false )
Resizes the specified buffer to the given size in bytes.
All data inside that stream is discarded, make sure everything was sent out.
CNetChan:SetMessageCallback( function callback )
Sets the callback function for any incomming messages.
Can be returned using CNetChan:GetMessageCallback
Can be returned using CNetChan:GetMessageCallback
CNetChan:SetPacketEndCallback( function callback )
Sets the callback function that is called once all messages of an incoming packet have been parsed.
Can be returned using CNetChan:GetPacketEndCallback
Can be returned using CNetChan:GetPacketEndCallback
CNetChan:SetPacketStartCallback( function callback )
Sets the callback function that is called each time a new packet has started arriving on the channel.
Can be returned using CNetChan:GetPacketStartCallback
Can be returned using CNetChan:GetPacketStartCallback
Sets the data rate of the channel in bytes/sec.
Alias of CNetChan:SetDataRate.
Alias of CNetChan:SetDataRate.
CNetChan:SetShouldAcceptFileCallback( function callback )
Sets the callback function that decides whether an incoming file transfer request should be accepted.
If no callback is set, or the callback errors, the file is denied.
Can be returned using CNetChan:GetShouldAcceptFileCallback
If no callback is set, or the callback errors, the file is denied.
Can be returned using CNetChan:GetShouldAcceptFileCallback
CNetChan:SetTimeout( number seconds )
Sets the time in seconds before the channel is marked as timing out.