You are viewing a potentially older version of this package. View all versions.
AndrewLin-Reconnect-0.0.1 icon

Reconnect

Reconnect: Auto-reconnect to lobby after unexpected disconnection.

Date uploaded 3 months ago
Version 0.0.1
Download link AndrewLin-Reconnect-0.0.1.zip
Downloads 18
Dependency string AndrewLin-Reconnect-0.0.1

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2305
AndrewLin-Alpha-0.1.1 icon
AndrewLin-Alpha

Alpha: A mod for On-Together to provide common utilities and features.

Preferred version: 0.1.1

README

Reconnect

NOTE: !EXPERIMENTAL! Only get this if you have severe reconnection issue. Also when hosting you should disable this mod. Either via r2modman or via /reconnecttoggle.

Auto-reconnect to lobby after unexpected disconnection. Will not attempt reconnect on deliberate leaves (quit button, etc.).

Features

  • Detects unexpected disconnection vs intentional leave
  • Attempts up to 3 reconnects with configurable interval and max attempt
  • Cooldown prevents infinite reconnect loops
  • Falls back to normal menu return if all attempts fail
  • Hosts are excluded (only clients reconnect)

Disconnect behavior

Intentional disconnect

An intentional disconnect is any action where the player explicitly chose to leave:

  • Clicking the Quit button in the pause menu

Sequence: The game's normal flow runs unmodified. The client disconnects and returns to the main menu immediately. No reconnect is attempted.

Unintentional disconnect

An unintentional disconnect is anything that triggers ConnectionLost without a prior intentional-leave marker:

  • Host closes the game or crashes
  • Network drop or timeout
  • Host kicks the client

Sequence:

  1. ConnectionLost fires on the client.
  2. The patch suppresses the normal return-to-menu flow.
  3. A notification is shown: "Connection lost - attempting to reconnect..."
  4. The reconnect sequence starts. Up to MaxAttempts attempts are made, each waiting up to AttemptIntervalSec seconds for the connection to resolve.
  5. On success: the client is connected again. The intentional-leave flag is cleared and the sequence ends silently.
  6. On failure (all attempts exhausted, or StartClient throws every time): the normal menu-return flow is restored and the game returns to the main menu as if ConnectionLost had run normally.

A cooldown (CooldownSec) prevents a new reconnect sequence from starting too soon after the last one, avoiding rapid-fire loops if the host is unstable.

Commands

Command Short Description
/reconnecttoggle /rct Get or set auto-reconnect on/off. No arg toggles; on/off sets directly
/reconnectmaxattempts /rcma Get or set max reconnect attempts (1-10)
/reconnectinterval /rciv Get or set seconds between attempts (2-30)
/reconnectcooldown /rccd Get or set cooldown between sequences in seconds (10-120)
/reconnecttest /rctest Simulate an unintentional disconnect to test the reconnect sequence
/reconnecthelp /rch List all reconnect commands

Configuration

Setting Default Description
Enabled true Enable auto-reconnect
MaxAttempts 3 Max reconnect attempts (1-10)
AttemptIntervalSec 5 Seconds between attempts
CooldownSec 30 Minimum seconds between reconnect sequences

Installation

Install via Thunderstore or r2modman.

Requires: Alpha

CHANGELOG

Changelog

0.0.5

Added

  • Focus area repair: re-requests FocusAreaManager state after spawn if Init RPC was missed
  • Auto-restore focus activity after reconnect (sets up state via reflection and calls SetFocus)
  • New command: /reconnectfocus (/rcfo) - manually trigger focus area repair
  • Config: Fix.FocusArea (default on) - toggle automatic focus area repair
  • Config: Fix.RestoreFocus (default on) - toggle automatic focus activity restoration

0.0.4

Added

  • Restore player position and rotation after successful reconnect
  • Capture focus state at disconnect time and notify player to re-enter manually

0.0.3

Fixed

  • /reconnecttest - renamed to /reconnectsimulate (/rcs) to avoid shortname collision with /reconnecttoggle (/rct).

0.0.2

  • Better default values
  • Update configs in-game

0.0.1

  • Initial release
  • Auto-reconnect on unexpected disconnection (client-only)
  • Configurable max attempts, interval, and cooldown
  • Intentional leave detection via QuitSession/ButtonQuit patches