-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ddce139
commit c57e952
Showing
41 changed files
with
177 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": [ | ||
"matthewthorning.align-vertically", | ||
"me-dutour-mathieu.vscode-github-actions", | ||
"github.vscode-pull-request-github", | ||
"eamodio.gitlens", | ||
"billw2011.sqf-debugger", | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": [ | ||
"matthewthorning.align-vertically", | ||
"me-dutour-mathieu.vscode-github-actions", | ||
"github.vscode-pull-request-github", | ||
"eamodio.gitlens", | ||
"billw2011.sqf-debugger", | ||
"smith.sqf-formatter", | ||
"armitxes.sqf", | ||
"armitxes.sqf", | ||
"eelislynne.sqf-wiki", | ||
"senfo.sqflint", | ||
"redhat.vscode-yaml" | ||
] | ||
"senfo.sqflint", | ||
"redhat.vscode-yaml" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
RandFramework/Global/loadbalancer/fn_loadbalancer_aggregate.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// private _fnc_scriptName = "TRGM_GLOBAL_fnc_loadbalancer_aggregate"; | ||
private _allHeadlessClients = entities "HeadlessClient_F"; | ||
private _allPlayers = allPlayers - _allHeadlessClients; | ||
|
||
private _allHeadlessClientsWeighted = flatten (_allHeadlessClients apply {[owner _x, linearConversion [25, 60, _x getVariable ["TRGM_VAR_ClientFps", 0], 0, 1, true]]}); | ||
private _allPlayersWeighted = flatten (_allPlayers apply {[owner _x, linearConversion [25, 60, _x getVariable ["TRGM_VAR_ClientFps", 0], 0, 1, true]]}); | ||
|
||
// update arrays | ||
missionNamespace setVariable ["TRGM_VAR_HC_FpsWeighted", _allHeadlessClientsWeighted]; | ||
missionNamespace setVariable ["TRGM_VAR_Players_FpsWeighted", _allPlayersWeighted]; |
7 changes: 7 additions & 0 deletions
7
RandFramework/Global/loadbalancer/fn_loadbalancer_fpsLoop.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// private _fnc_scriptName = "TRGM_GLOBAL_fnc_loadbalancer_fpsLoop"; | ||
[] spawn { | ||
if (player != player) exitWith {}; | ||
while {sleep 10; true} do { | ||
[player, diag_fps] call TRGM_GLOBAL_fnc_loadbalancer_setFps; | ||
}; | ||
}; |
8 changes: 8 additions & 0 deletions
8
RandFramework/Global/loadbalancer/fn_loadbalancer_getHost.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// private _fnc_scriptName = "TRGM_GLOBAL_fnc_loadbalancer_getHost"; | ||
private _target = selectRandomWeighted (missionNamespace getVariable ["TRGM_VAR_HC_FpsWeighted", []]); | ||
if (!isNil "_target") exitWith { _target }; | ||
|
||
_target = selectRandomWeighted (missionNamespace getVariable ["TRGM_VAR_Players_FpsWeighted", []]); | ||
if (!isNil "_target") exitWith { _target }; | ||
|
||
2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// private _fnc_scriptName = "TRGM_GLOBAL_fnc_loadbalancer_init"; | ||
[] spawn { | ||
while {sleep 10; true} do { | ||
call TRGM_GLOBAL_fnc_loadbalancer_aggregate; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// private _fnc_scriptName = "TRGM_GLOBAL_fnc_loadbalancer_setFps"; | ||
params [["_player", objNull, [objNull]], ["_fps",0,[0]]]; | ||
if (isNull _player) exitWith {}; | ||
_player setVariable ["TRGM_VAR_ClientFps", _fps]; |
15 changes: 15 additions & 0 deletions
15
RandFramework/Global/loadbalancer/fn_loadbalancer_setGroupOwner.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// private _fnc_scriptName = "TRGM_GLOBAL_fnc_loadbalancer_setGroupOwner"; | ||
params [["_group", grpNull, [grpNull]]]; | ||
if (isNull _group) exitWith {}; | ||
if (({isPlayer _x} count units _group) > 0) exitWith {}; | ||
private _selectedClient = call TRGM_GLOBAL_fnc_loadbalancer_getHost; | ||
_group setGroupOwner _selectedClient; | ||
_group setVariable ["TRGM_VAR_groupClientOwner", _selectedClient]; | ||
{ | ||
_x addEventHandler ["Local", { | ||
params ["_unit", "_isLocal"]; | ||
if (_isLocal) then { | ||
group _unit setVariable ["TRGM_VAR_groupClientOwner", clientOwner, true]; | ||
}; | ||
}]; | ||
} forEach units _group; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.