diff options
Diffstat (limited to 'Server/PVFunctions')
| -rw-r--r-- | Server/PVFunctions/RequestChangeScore.sqf | 12 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestCommanderVote.sqf | 20 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestDefense.sqf | 11 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestJoin.sqf | 28 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestMHQRepair.sqf | 1 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestSpecial.sqf | 1 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestStructure.sqf | 12 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestTeamUpdate.sqf | 26 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestUpgrade.sqf | 1 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestVehicleLock.sqf | 10 | ||||
| -rw-r--r-- | Server/PVFunctions/RequestWorker.sqf | 19 |
11 files changed, 141 insertions, 0 deletions
diff --git a/Server/PVFunctions/RequestChangeScore.sqf b/Server/PVFunctions/RequestChangeScore.sqf new file mode 100644 index 0000000..2d7bec8 --- /dev/null +++ b/Server/PVFunctions/RequestChangeScore.sqf @@ -0,0 +1,12 @@ +Private["_oldScore","_newScore","_playerChanged"];
+
+_playerChanged = _this select 0;
+_newScore = _this select 1;
+
+_oldScore = score _playerChanged;
+_playerChanged addScore -_oldScore;
+_playerChanged addScore _newScore;
+
+WFBE_ChangeScore = [nil,'CLTFNCCHANGESCORE',[_playerChanged,_newScore]];
+publicVariable 'WFBE_ChangeScore';
+if (isHostedServer) then {[nil,'CLTFNCCHANGESCORE',[_playerChanged,_newScore]] Spawn HandlePVF};
diff --git a/Server/PVFunctions/RequestCommanderVote.sqf b/Server/PVFunctions/RequestCommanderVote.sqf new file mode 100644 index 0000000..cff13d4 --- /dev/null +++ b/Server/PVFunctions/RequestCommanderVote.sqf @@ -0,0 +1,20 @@ +Private["_commanderTeam","_side","_team"];
+
+_side = _this;
+
+if ((WF_Logic getVariable Format["%1CommanderVoteTime",str _side]) <= 0) then {
+ _team = -1;
+ _commanderTeam = (_side) Call GetCommanderTeam;
+
+ if (!IsNull _commanderTeam) then {
+ _team = (Format["WFBE_%1TEAMS",str _side] Call GetNamespace) find _commanderTeam;
+ };
+
+ [_side,_team] Call SetCommanderVotes;
+ [_side] Spawn SVoteForCommander;
+ ["VotingForNewCommander","",_side,""] Spawn SideMessage;
+
+ WFBE_VoteForCommander = [_side,'CLTFNCVOTEFORCOMMANDER'];
+ publicVariable 'WFBE_VoteForCommander';
+ if (isHostedServer) then {[_side,'CLTFNCVOTEFORCOMMANDER'] Spawn HandlePVF};
+};
diff --git a/Server/PVFunctions/RequestDefense.sqf b/Server/PVFunctions/RequestDefense.sqf new file mode 100644 index 0000000..70d6a5d --- /dev/null +++ b/Server/PVFunctions/RequestDefense.sqf @@ -0,0 +1,11 @@ +private ["_defenseType","_dir","_index","_manned","_pos","_side"];
+_side = _this select 0;
+_defenseType = _this select 1;
+_pos = _this select 2;
+_dir = _this select 3;
+_manned = _this select 4;
+
+_index = (Format["WFBE_%1DEFENSENAMES",str _side] Call GetNamespace) find _defenseType;
+if (_index != -1) then {
+ [_defenseType,_side,_pos,_dir,_manned,false] Call ConstructDefense;
+};
\ No newline at end of file diff --git a/Server/PVFunctions/RequestJoin.sqf b/Server/PVFunctions/RequestJoin.sqf new file mode 100644 index 0000000..010dff6 --- /dev/null +++ b/Server/PVFunctions/RequestJoin.sqf @@ -0,0 +1,28 @@ +Private["_canJoin","_get","_name","_side","_sideOrigin","_uid","_varname"];
+
+_uid = _this select 0;
+_side = _this select 1;
+_name = _this select 2;
+_varname = _this select 3;
+
+_canJoin = true;
+
+_get = Format["WFBE_JIP_USER%1",_uid] Call GetNamespace;
+
+if !(isNil '_get') then {
+ _sideOrigin = _get select 3;
+
+ if (_sideOrigin != _side) then {
+ if !(paramShowUID) then {_uid = "xxxxxxx"};
+
+ WFBE_LocalizeMessage = [nil,'CLTFNCLOCALIZEMESSAGE',['Teamswap',_name,_uid,_sideOrigin,_side]];
+ publicVariable 'WFBE_LocalizeMessage';
+
+ _canJoin = false;
+
+ diag_log Format["[WFBE (INFORMATION)][frameno:%4 | ticktime:%5] RequestJoin: Player %1 <%2> (%3) has been sent back to the lobby for teamswapping.",_name,_varname,_get select 0,diag_frameno,diag_tickTime];
+ };
+};
+
+WFBE_CanJoin = [_varname,'CLTFNCCANJOIN',[_varname,_canJoin]];
+publicVariable 'WFBE_CanJoin';
\ No newline at end of file diff --git a/Server/PVFunctions/RequestMHQRepair.sqf b/Server/PVFunctions/RequestMHQRepair.sqf new file mode 100644 index 0000000..087a7a1 --- /dev/null +++ b/Server/PVFunctions/RequestMHQRepair.sqf @@ -0,0 +1 @@ +[_this] Spawn MHQRepair;
\ No newline at end of file diff --git a/Server/PVFunctions/RequestSpecial.sqf b/Server/PVFunctions/RequestSpecial.sqf new file mode 100644 index 0000000..3455c98 --- /dev/null +++ b/Server/PVFunctions/RequestSpecial.sqf @@ -0,0 +1 @@ +_this Spawn HandleSpecial;
\ No newline at end of file diff --git a/Server/PVFunctions/RequestStructure.sqf b/Server/PVFunctions/RequestStructure.sqf new file mode 100644 index 0000000..ad6b610 --- /dev/null +++ b/Server/PVFunctions/RequestStructure.sqf @@ -0,0 +1,12 @@ +Private ['_dir','_index','_pos','_script','_side','_structure','_structureType'];
+
+_side = _this select 0;
+_structureType = _this select 1;
+_pos = _this select 2;
+_dir = _this select 3;
+
+_index = (Format ["WFBE_%1STRUCTURENAMES",str _side] Call GetNamespace) find _structureType;
+if (_index != -1) then {
+ _script = (Format ["WFBE_%1STRUCTURESCRIPTS",str _side] Call GetNamespace) select _index;
+ [_structureType,_side,_pos,_dir,_index] ExecVM (Format["Server\Construction\Construction_%1.sqf",_script]);
+};
\ No newline at end of file diff --git a/Server/PVFunctions/RequestTeamUpdate.sqf b/Server/PVFunctions/RequestTeamUpdate.sqf new file mode 100644 index 0000000..892c182 --- /dev/null +++ b/Server/PVFunctions/RequestTeamUpdate.sqf @@ -0,0 +1,26 @@ +private ["_args","_team"];
+
+_args = _this;
+_team = _args select 0;
+
+//--- One team.
+if (typeName _team == "ARRAY") then {
+ {
+ _x setBehaviour (_args select 1);
+ _x setCombatMode (_args select 2);
+ _x setFormation (_args select 3);
+ _x setSpeedMode (_args select 4);
+ diag_log Format["[WFBE (INFORMATION)][frameno:%6 | ticktime:%7] RequestTeamUpdate: The %1 Team properties has been updated (Behavior: %2 | Combat Mode: %3 | Formation: %4 | Speed Mode: %5)",_x,(_args select 1),(_args select 2),(_args select 3),(_args select 4),diag_frameno,diag_tickTime];
+ } forEach _team;
+};
+
+//--- The whole team.
+if (typeName _team == "SIDE") then {
+ {
+ _x setBehaviour (_args select 1);
+ _x setCombatMode (_args select 2);
+ _x setFormation (_args select 3);
+ _x setSpeedMode (_args select 4);
+ } forEach (Format["WFBE_%1TEAMS",str _team] Call GetNamespace);
+ diag_log Format["[WFBE (INFORMATION)][frameno:%6 | ticktime:%7] RequestTeamUpdate: The %1 Teams properties have been updated (Behavior: %2 | Combat Mode: %3 | Formation: %4 | Speed Mode: %5)",_team,(_args select 1),(_args select 2),(_args select 3),(_args select 4),diag_frameno,diag_tickTime];
+};
\ No newline at end of file diff --git a/Server/PVFunctions/RequestUpgrade.sqf b/Server/PVFunctions/RequestUpgrade.sqf new file mode 100644 index 0000000..f811ca5 --- /dev/null +++ b/Server/PVFunctions/RequestUpgrade.sqf @@ -0,0 +1 @@ +_this Spawn AIUpgrade;
\ No newline at end of file diff --git a/Server/PVFunctions/RequestVehicleLock.sqf b/Server/PVFunctions/RequestVehicleLock.sqf new file mode 100644 index 0000000..299ca0e --- /dev/null +++ b/Server/PVFunctions/RequestVehicleLock.sqf @@ -0,0 +1,10 @@ +private ["_locked","_vehicle"];
+
+_vehicle = _this select 0;
+_locked = _this select 1;
+
+_vehicle lock _locked;
+
+WFBE_SetVehicleLock = [nil,'CLTFNCSETVEHICLELOCK',[_vehicle,_locked]];
+publicVariable 'WFBE_SetVehicleLock';
+if (isHostedServer) then {[nil,'CLTFNCSETVEHICLELOCK',[_vehicle,_locked]] Spawn HandlePVF};
diff --git a/Server/PVFunctions/RequestWorker.sqf b/Server/PVFunctions/RequestWorker.sqf new file mode 100644 index 0000000..3c891dc --- /dev/null +++ b/Server/PVFunctions/RequestWorker.sqf @@ -0,0 +1,19 @@ +Private["_group","_index","_model","_models","_position","_side","_unit"];
+
+_side = _this select 0;
+_position = _this select 1;
+_index = _this select 2;
+
+_models = Format ["WFBE_WORKERS_MODELS_%1",str _side] Call GetNamespace;
+_model = _models select (round(random((count _models)-1)));
+_group = createGroup _side;
+_position = [getPos _position, 30] Call GetSafePlace;
+_unit = [_model,_group,_position,_side] Call CreateMan;
+
+_group setSpeedMode "LIMITED";
+
+_workers = Call Compile Format ["WF_%1Workers",str _side];
+_workers set [_index, _unit];
+Call Compile Format ["WF_%1Workers = _workers; publicVariable 'WF_%1Workers';",str _side];
+
+[_unit,_side,_index] ExecFSM "Server\FSM\workers.fsm";
\ No newline at end of file |
