Sintaxe
RakNetSignalConnection.Disconnect(connection: RakNetSignalConnection)Argumentos
| Nome | Tipo | Descrição |
|---|---|---|
connection | RakNetSignalConnection | Connection object returned by a RakNet packet signal Connect call. |
Descrição
Disconnects a connection returned by RakNet.OnPacketSend.Connect or RakNet.OnPacketReceive.Connect. The method returns no values.
Chame com 1 parametro(s): connection. A tabela de argumentos explica quais valores sao obrigatorios e quais refinam o comportamento.
Nao retorna dados. Trate a chamada como uma acao e lide com erros no ponto de chamada.
Exemplo
Disconnect a RakNet packet signal connection.
if RakNet.is_enabled then
local connection = RakNet.OnPacketSend:Connect(function(packet)
print(packet.Size)
end)
connection:Disconnect()
print(connection.Connected)
endTipos
RakNetSignalConnection
Connection object returned by RakNet.OnPacketSend.Connect and RakNet.OnPacketReceive.Connect.
Disconnect () -> () Removes the connection from the packet signal.Connected boolean true while the connection still exists for the current RakNet hook generation.