samp.directory
← Scripts e bibliotecas

loki-code/gta-relaunch-exe-

A lightweight GTA San Andreas launcher for SA-MP and open.mp, with quick game restart, configurable hotkeys, and server connection settings.

Ferramenta★ 2atualizado há 37 diasSem licença
Abrir no GitHub

Este repositório não tem arquivo de licença. Ele é público para leitura, mas isso sozinho não dá permissão para reutilizar.

README.md

Loki Launcher

A small WPF (.NET 10, Windows) utility that restarts GTA San Andreas and reconnects you to your SA-MP or open.mp server with one hotkey.

What changed from the previous version

The earlier build defaulted to the samp:// protocol link to launch and connect. That mechanism depends on Windows having a registry entry pointing samp:// at your installed client - which many open.mp installs (especially portable/zip extractions, or reinstalls) never set up correctly. When that registration is missing, Process.Start("samp://...") doesn't throw an error, it just silently does nothing, which is almost certainly why it looked "not working."

This version:

  • Defaults to direct launch (-h ip -p port -n name, run against your configured launcher exe) instead of the protocol link. This doesn't depend on any registry state - it's just running an exe with arguments, so it either works or gives you a real error.
  • Adds -g <gta folder> automatically for open.mp launches, since open.mp's launcher needs to know where GTA is installed if it isn't bundled in the same folder.
  • Shows you what happened. Every restart now reports success/failure text in the main window, and a full log is written to %AppData%\LokiLauncher\launcher.log (open it from the "View log file" link at the bottom of the window). If a restart silently "does nothing" again, that log will say exactly why.
  • Fixed the CS8618 warning by initializing the status timer inline.
  • Renamed to Loki Launcher, with a redesigned, tighter UI.

If restart still doesn't work

  1. Click View log file at the bottom of the window right after pressing Restart - it logs every step (closing GTA, launching, any exception).
  2. Open ⚙ Settings and confirm the two paths are exactly right, and that "Connect method" is set to Direct launch (recommended).
  3. If your open.mp launcher exe is not in the same folder as gta_sa.exe, make sure Client type in Settings is set to open.mp so the -g flag gets added - without it, some open.mp builds can't find the game.
  4. Try running your launcher manually once with those same -h/-p/-n arguments from a terminal to confirm it connects outside of this app too (rules out a client-side config issue entirely separate from this tool).

What it does

  • First launch asks for the path to gta_sa.exe and your SA-MP/open.mp launcher executable, plus your player name, and saves them.
  • Lets you enter and change the server IP + port from the main window.
  • Global ALT + ENTER hotkey (works even while GTA is focused/fullscreen):
    1. Closes the running gta_sa.exe process.
    2. Waits for it to fully exit (graceful close, then force-kill fallback).
    3. Relaunches through your configured SA-MP/open.mp launcher.
    4. Connects to the IP/port currently set in the app.
  • A Restart and Reconnect button does the same thing without the hotkey.
  • Shows live GTA running/not-running status in the main window.
  • Settings persist to %AppData%\LokiLauncher\settings.json.
  • Activity/errors are logged to %AppData%\LokiLauncher\launcher.log.

How the launch/connect step works (verified, not guessed)

Two mechanisms are supported, selectable in Settings:

  1. Direct launch (default). Runs your configured launcher exe with -h <ip> -p <port> -n "<name>" (and -g "<gta folder>" for open.mp) - the documented command-line syntax for both samp.exe and open.mp's omp-launcher.exe, confirmed against open.mp's own client documentation and SA-MP's documented client parameters.

  2. samp://ip:port protocol link. Both the classic SA-MP client and the open.mp launcher can register themselves as the handler for this URI scheme on install. It's the same mechanism "Connect" buttons on server browser websites use, but it's only reliable if that registration actually happened on your machine - which is why it's no longer the default.

gta_sa.exe itself is never launched directly by this app - it's always started by the SA-MP/open.mp launcher, exactly like a normal manual launch, so anti-cheat/injection behavior is unaffected.

Notes / design choices

  • No admin elevation. GTA/SA-MP/open.mp normally run unelevated; keeping this app unelevated too avoids UAC friction and keeps the global hotkey behaving normally against the game window.
  • Process close is graceful-then-forced. gta_sa.exe often ignores a polite WM_CLOSE while fullscreen, so the controller tries CloseMainWindow() first, waits, and falls back to Kill() if needed.
  • No database, accounts, telemetry, or network services. Settings are a single local JSON file and a plain text log. That's the entire persistence layer.

gtasamp

Esta página é montada com o que o GitHub publica sobre o repositório. O samp.directory não hospeda o código. Avisar de um problema com esta página