Files
Commonwealth-Online-Public/plugin/include/F4TSessionLaunch.h
T
andrew e61922678b Add server validation, profile store, session launch
Introduce server validation and a session launch flow with persistent server profiles.

- Add ConnectAndValidateServer to Networking to validate handshake/timeouts and return human-friendly errors; avoid auto-connecting in transform send path and remove unconditional local connect on startup.
- Add ServerProfileStore (header + implementation) to persist server->saveFile bindings under Documents/My Games/.../CommonwealthOnline/server-profiles.json with thread-safe load/save, lookup, touch and bind operations.
- Add SessionLaunch (header + implementation) to handle launching validated sessions, first-time join flow (auto coc to SanctuaryExt, character creation menus, save binding), F4SE message handling and periodic Update processing.
- Update ServerBrowserBridge to parse/validate ports, use ConnectAndValidateServer, display joinLoading UI events, schedule validated session launch on the game task thread, and centralize join success/failure handling.
- Wire SessionLaunch into main.cpp (update loop and F4SE message hook).
- Improve direct-connect UI in app.js with client-side validation, port parsing, and handling of joinLoading events.

These changes provide better connection validation, user feedback during joins, and automatic handling for first-time server joins with persistence of associated saves.
2026-06-09 16:26:33 +12:00

17 lines
342 B
C++

#pragma once
#include "F4TServerBrowserData.h"
namespace F4SE
{
class MessagingInterface;
}
namespace F4T::SessionLaunch
{
bool LaunchValidatedSession(const ServerBrowser::ServerEntry& a_entry, std::string& a_error);
void OnF4SEMessage(F4SE::MessagingInterface::Message* a_msg);
void Update();
void TryCompletePendingProfileBind();
}