Sintaxis
RakNetSignalConnection.Disconnect(connection: RakNetSignalConnection)Argumentos
| Nombre | Tipo | Descripción |
|---|---|---|
connection | RakNetSignalConnection | Connection object returned by a RakNet packet signal Connect call. |
Descripción
Disconnects a connection returned by RakNet.OnPacketSend.Connect or RakNet.OnPacketReceive.Connect. The method returns no values.
Llamalo con 1 parametro(s): connection. La tabla de argumentos explica que valores son obligatorios y cuales refinan el comportamiento.
No devuelve datos. Trata la llamada como una accion y maneja errores cerca del punto de llamada.
Ejemplo
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.