Syntax
RakNetSignalConnection.Disconnect(connection: RakNetSignalConnection)Argumente
| Name | Typ | Beschreibung |
|---|---|---|
connection | RakNetSignalConnection | Connection object returned by a RakNet packet signal Connect call. |
Beschreibung
Disconnects a connection returned by RakNet.OnPacketSend.Connect or RakNet.OnPacketReceive.Connect. The method returns no values.
Rufe es mit 1 Parameter(n) auf: connection. Die Argumenttabelle erklärt, welche Werte erforderlich sind und welche nur das Verhalten verfeinern.
Es gibt keine Daten zurück. Behandle den Aufruf als Aktion und fange Fehler an der Aufrufstelle ab.
Beispiel
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)
endTypen
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.