Skip to content

UI - Add password fill compatiblity for "connectToServer" (2.19+) #1726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions addons/ui/fnc_initDisplayPassword.sqf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "script_component.hpp"
// since 2.19 "server:port" is stored on the display in "guid" variable, makes password filling compatible with "connectToServer" command
#define GET_SERVER (_display getVariable ["guid", _ctrlServerList lbData lbCurSel _ctrlServerList])

if (profileNamespace getVariable [QGVAR(StorePasswords), 1] < 1) exitWith {};

Expand All @@ -13,7 +15,7 @@ _ctrlConfirm ctrlAddEventHandler ["ButtonClick", {
private _ctrlPassword = _display displayCtrl IDC_PASSWORD;
private _ctrlServerList = (uiNamespace getVariable "RscDisplayMultiplayer") displayCtrl IDC_MULTI_SESSIONS;

private _server = _ctrlServerList lbData lbCurSel _ctrlServerList;
private _server = GET_SERVER;
private _password = ctrlText _ctrlPassword;
//diag_log ["write", _server, _password];

Expand All @@ -28,7 +30,7 @@ _ctrlConfirm ctrlAddEventHandler ["ButtonClick", {
saveProfileNamespace;
}];

private _server = _ctrlServerList lbData lbCurSel _ctrlServerList;
private _server = GET_SERVER;

// read password from cache
private _passwordCache = profileNamespace getVariable [QGVAR(ServerPasswords), [[], []]];
Expand Down