// Invoke the disconnect event and the extra events which are assigned before the LeaveGame function
 public void WaitForDisconnect(PacketStatus status)
 {
     InvokeDisconnect(status != null ? status.packet.peerId : LocalId);
     afterDisconnectEvent?.Invoke();
     afterDisconnectEvent.RemoveAllListeners();
     peerManager = null;
 }
Example #2
0
 // Remove a packet from the reliable list
 public void RemoveWaitingPacket(PacketStatus status)
 {
     waitingForConfirmation.Remove(status);
 }
 // Callback when a peer joins
 private static void PeerJoinedSuccessFully(PacketStatus status)
 {
     UpdateLobbyMenu();
 }
 // Callback when a peer does not respond
 private static void DisconnectNonResponsivePeer(PacketStatus status)
 {
     RemovePeer(peerManager.GetPeerWithIp(status.packet.ip, status.packet.port));
 }