From 56283e0c0871ca5c545484630ca1eb694fad8344 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Wed, 30 Aug 2017 02:43:37 -0500 Subject: [PATCH 1/7] Temp Group System Credit goes to AWOL for the original Epoch Group System. Temp Groups do not allow outsiders access to bases, vehicles or safes. Easily switch to Temp Group for Co-Op mission, then back to Perm Group. Full access to Kick, Set Mod, Leave Group/Delete Group. When leaving or deleting group, you will be put back into the actual group of your teammates if online. Fixed Leave/Delete Button to show Delete Group onLoad of Temp Group UI Added refresh to Group UI's so all players are in sync after changes --- Sources/epoch_code/System/player_login.fsm | 11 +- .../groupTemp/EPOCH_cTempGroup_BtnCreate.sqf | 47 ++++++ .../groupTemp/EPOCH_cTempGroup_onLoad.sqf | 21 +++ .../EPOCH_iTempGroup_acceptInvite.sqf | 18 +++ .../groupTemp/EPOCH_iTempGroup_onLoad.sqf | 22 +++ .../groupTemp/EPOCH_iTempGroup_refresh.sqf | 25 ++++ .../groupTemp/EPOCH_tempGroup_BtnInvite.sqf | 50 +++++++ .../groupTemp/EPOCH_tempGroup_BtnKick.sqf | 48 ++++++ .../groupTemp/EPOCH_tempGroup_BtnLeave.sqf | 42 ++++++ .../groupTemp/EPOCH_tempGroup_BtnMod.sqf | 46 ++++++ .../groupTemp/EPOCH_tempGroup_Combo.sqf | 43 ++++++ .../groupTemp/EPOCH_tempGroup_List.sqf | 39 +++++ .../EPOCH_tempGroup_invitePlayer.sqf | 18 +++ .../groupTemp/EPOCH_tempGroup_onLoad.sqf | 94 ++++++++++++ .../groupTemp/EPOCH_tempGroup_update.sqf | 19 +++ .../inventory/EPOCH_Inventory_itempGroup.sqf | 20 +++ .../inventory/EPOCH_Inventory_tempGroup.sqf | 17 +++ Sources/epoch_code/init/client_init.sqf | 5 + .../CfgActionMenu/CfgActionMenu_self.hpp | 27 +++- .../Configs/CfgClientFunctions.hpp | 20 +++ .../epoch_config/Configs/CfgRemoteExec.hpp | 25 ++++ .../EPOCH_server_createTempGroup.sqf | 56 +++++++ .../EPOCH_server_deleteTempGroup.sqf | 50 +++++++ .../EPOCH_server_invitePlayerTemp.sqf | 20 +++ .../EPOCH_server_updatePlayerTempGroup.sqf | 140 ++++++++++++++++++ .../EPOCH_server_upgradeTempGroup.sqf | 52 +++++++ Sources/epoch_server/config.cpp | 7 + .../configs/security/security_checks.h | 5 +- 28 files changed, 978 insertions(+), 9 deletions(-) create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_cTempGroup_BtnCreate.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_cTempGroup_onLoad.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_acceptInvite.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_onLoad.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_refresh.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnKick.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnLeave.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnMod.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_Combo.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_List.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_invitePlayer.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_onLoad.sqf create mode 100644 Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_update.sqf create mode 100644 Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_itempGroup.sqf create mode 100644 Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_tempGroup.sqf create mode 100644 Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_createTempGroup.sqf create mode 100644 Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf create mode 100644 Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTemp.sqf create mode 100644 Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf create mode 100644 Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf diff --git a/Sources/epoch_code/System/player_login.fsm b/Sources/epoch_code/System/player_login.fsm index f75a4fc6..57cee406 100644 --- a/Sources/epoch_code/System/player_login.fsm +++ b/Sources/epoch_code/System/player_login.fsm @@ -1,8 +1,8 @@ -/*%FSM*/ +/*%FSM*/ /*%FSM*/ /* item0[] = {"INIT",0,250,-25.000000,-375.000000,75.000000,-325.000000,0.000000,"INIT"}; -item1[] = {"FINISH",1,4346,-149.463196,1518.792480,-49.463196,1568.792480,0.000000,"FINISH"}; +item1[] = {"FINISH",1,250,-149.463196,1518.792480,-49.463196,1568.792480,0.000000,"FINISH"}; item2[] = {"true",8,218,-150.000000,-125.000000,-50.000000,-75.000000,0.000000,"true"}; item3[] = {"Version_Check",2,250,-25.000000,-75.000000,75.000000,-25.000000,0.000000,"Version Check"}; item4[] = {"Player_Object_Re",4,218,-150.000000,75.000000,-50.000000,125.000000,0.000000,"Player" \n "Object Ready"}; @@ -17,7 +17,7 @@ item12[] = {"Empty_PlayerUID",4,218,125.000000,125.000000,225.000000,175.000000, item13[] = {"ERROR_PlayerUID",2,250,275.000000,125.000000,375.000000,175.000000,0.000000,"ERROR" \n "PlayerUID Empty"}; item14[] = {"",7,210,471.000061,145.999908,478.999939,154.000092,0.000000,""}; item15[] = {"Timeout_No_Respo",4,218,125.000000,875.000000,225.000000,925.000000,0.000000,"Timeout" \n "No Response"}; -item16[] = {"Response",4,218,-150.000000,825.000000,-50.000000,875.000000,0.000000,"Response"}; +item16[] = {"Response",4,4314,-150.000000,825.000000,-50.000000,875.000000,0.000000,"Response"}; item17[] = {"Setup_Player_Var",2,250,-25.000000,1075.000000,75.000000,1125.000000,0.000000,"Setup Player" \n "Variables"}; item18[] = {"Request_Hive",2,250,-25.000000,575.000000,75.000000,625.000000,0.000000,"Request Hive"}; item19[] = {"Timeout_No_Respo",4,218,125.000000,575.000000,225.000000,625.000000,0.000000,"Timeout" \n "No Response"}; @@ -183,8 +183,8 @@ link93[] = {82,76}; link94[] = {83,16}; link95[] = {83,22}; link96[] = {84,31}; -globals[] = {0.000000,0,0,0,0,640,480,1,247,6316128,1,-346.821808,275.273865,1776.441162,823.351685,577,884,1}; -window[] = {2,-1,-1,-1,-1,923,156,1140,156,3,595}; +globals[] = {0.000000,0,0,0,0,640,480,1,247,6316128,1,-618.033569,546.485168,2139.147705,423.870514,573,844,1}; +window[] = {2,-1,-1,-1,-1,959,-1728,-744,192,3,595}; *//*%FSM*/ class FSM { @@ -1391,6 +1391,7 @@ class FSM "_mass = _C_SET deleteAt 0;" \n "" \n "Epoch_my_GroupUID = _C_SET deleteAt 0;" \n + "Epoch_my_tempGroupUID = """";" \n "Epoch_canBeRevived = _C_SET deleteAt 0;" \n "Epoch_personalToken = _C_SET deleteAt 0;" \n "Epoch_my_Group = _C_SET deleteAt 0;" \n diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_cTempGroup_BtnCreate.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_cTempGroup_BtnCreate.sqf new file mode 100644 index 00000000..244871e9 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_cTempGroup_BtnCreate.sqf @@ -0,0 +1,47 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_cTempGroup_BtnCreate.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_array","_groupName","_ret","_timeout","_txt","_txtCtrl","_upgradePrice"]; +//[[[end]]] +disableSerialization; +_txtCtrl = (findDisplay -1200) displayCtrl 21; +_array = toArray(ctrlText _txtCtrl); + +if (count _array > 24) then { + _array resize 24; +}; + +if (count (_array-[32]) == 0) then { //32 = SPACE + ["Your group need a name!","Epoch Temp Group Menu",true,false] spawn BIS_fnc_GUImessage; +} else { + _groupName = toString(_array); + _txtCtrl ctrlSetText _groupName; + + _groupName spawn { + _txt = format["Do you want to create your temp group called %1? You can disband/leave this group to create a new one!",_this]; + _ret = [_txt,"Epoch Temp Group Menu",true,true] call BIS_fnc_GUImessage; + if (_ret) then { + [player,_this,Epoch_personalToken] remoteExec ["EPOCH_server_createTempGroup",2]; + _timeout = diag_tickTime+10; + waitUntil { + ((Epoch_my_tempGroupUID != "") && !(Epoch_my_tempGroup isEqualTo [])) || ((_timeout - diag_tickTime) <= 0) + }; + (findDisplay -1200) closeDisplay 0; + if ((Epoch_my_tempGroupUID != "") && !(Epoch_my_tempGroup isEqualTo [])) then { + createDialog "Epoch_myTempGroup"; + }; + }; + }; +}; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_cTempGroup_onLoad.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_cTempGroup_onLoad.sqf new file mode 100644 index 00000000..7c938060 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_cTempGroup_onLoad.sqf @@ -0,0 +1,21 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_cTempGroup_onLoad.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_textCtrl"]; +//[[[end]]] +if!(Epoch_my_tempGroup isEqualTo [])exitWith {(findDisplay -1200) closeDisplay 0}; +disableSerialization; +_textCtrl = (findDisplay -1200) displayCtrl 22; +_textCtrl CtrlSetText format ["%1, Temp Groups are free forever",name player]; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_acceptInvite.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_acceptInvite.sqf new file mode 100644 index 00000000..3b83e46e --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_acceptInvite.sqf @@ -0,0 +1,18 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_itempGroup_acceptInvite.sqf +*/ +if (Epoch_invited_tempGroupUID != "") then { + [Epoch_invited_tempGroupUID,getPlayerUID player,true,false,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerTempGroup",2]; +}; +(findDisplay -1500) closeDisplay 0; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_onLoad.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_onLoad.sqf new file mode 100644 index 00000000..91160404 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_onLoad.sqf @@ -0,0 +1,22 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_iTempGroup_onLoad.sqf +*/ +disableSerialization; +//[[[cog import generate_private_arrays ]]] +private ["_display","_text"]; +//[[[end]]] +_display = findDisplay -1400; +if (Epoch_invited_tempGroupUID == "" || Epoch_invited_tempGroupName == "") exitWith { _display closeDisplay 0}; +_text = _display displayCtrl 21; +_text ctrlSetText format ["Join the temp group called %1?",Epoch_invited_tempGroupName]; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_refresh.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_refresh.sqf new file mode 100644 index 00000000..743016f0 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_iTempGroup_refresh.sqf @@ -0,0 +1,25 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_iTempGroup_refresh.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_index"]; +//[[[end]]] +if !(Epoch_invited_tempGroupUIDs isEqualTo []) then { + Epoch_invited_tempGroupUIDsPrev = Epoch_invited_tempGroupUIDs; + lbClear 1500; + { + _index = lbAdd[1500, _x select 1]; + lbSetData[1500, _index, _x select 0]; + } forEach Epoch_invited_tempGroupUIDs; +}; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf new file mode 100644 index 00000000..071f6427 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf @@ -0,0 +1,50 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_tempGroup_BtnInvite.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_BtnInvite","_InvitePlayerCombo","_groupSize","_currentMember","_found","_playerName","_playerUID","_ret","_txt","_upgradePrice","_upgradeSlots"]; +//[[[end]]] +disableSerialization; +_BtnInvite = (findDisplay -1300) displayCtrl 30; +_playerUID = getPlayerUID player; + +Epoch_my_tempGroup params [ + ["_groupName",""], + ["_leaderName",""], + ["_groupSize",0], + ["_modArray",[]], + ["_memberArray",[]] +]; + +if (_playerUID == Epoch_my_tempGroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then { + _currentMember = count(_modArray) + count(_memberArray) + 1; + if (_currentMember < _groupSize) then { + _InvitePlayerCombo = (findDisplay -1300) displayCtrl 41; + _playerUID = _InvitePlayerCombo lbData (lbCurSel _InvitePlayerCombo); + _playerName = _InvitePlayerCombo lbText (lbCurSel _InvitePlayerCombo); + if (_playerUID != "" && _playerName != "" && ({_playerUID in _x} count (_modArray) == 0) && ({_playerUID in _x} count (_memberArray) == 0) && !(_playerUID == Epoch_my_tempGroupUID)) then { + _txt = format["Do you want to add %1 to your Temp Group?",_playerName]; + [_playerUID,_txt,_groupName] spawn { + params ["_playerUID","_txt","_groupName"]; + _ret = [_txt,"Epoch Temp Group Menu",true,true] call BIS_fnc_GUImessage; + if (_ret) then { + [_playerUID,Epoch_my_tempGroupUID,_groupName,player,Epoch_personalToken] remoteExec ["EPOCH_server_invitePlayerTemp",2]; + }; + }; + }; + }; + true +} else { + false +}; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnKick.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnKick.sqf new file mode 100644 index 00000000..d951af2f --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnKick.sqf @@ -0,0 +1,48 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_tempGroup_BtnKick.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_BtnKick","_group","_playerName","_playerUID","_ret","_selected","_txt"]; +//[[[end]]] +disableSerialization; +_BtnKick = (findDisplay -1300) displayCtrl 33; + +_playerUID = getPlayerUID player; + +Epoch_my_tempGroup params [ + ["_groupName",""], + ["_leaderName",""], + ["_groupSize",0], + ["_modArray",[]], + ["_memberArray",[]] +]; + +if (_playerUID == Epoch_my_tempGroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then { + _group = (findDisplay -1300) displayCtrl 40; + _selected = lbCurSel _group; + if (_selected >= 0) then { + _playerUID = _group lbData _selected; + _playerName = _group lbText _selected; + if (_playerUID != "" && _playerName != "") then { + _txt = format["Do you want to kick %1 from your Temp Group?",_playerName]; + [_playerUID,_txt] spawn { + params ["_playerUID","_txt"]; + _ret = [_txt,"Epoch Temp Group Menu",true,true] call BIS_fnc_GUImessage; + if (_ret) then { + [Epoch_my_tempGroupUID,_playerUID,false,false,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerTempGroup",2]; + }; + }; + }; + }; +}; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnLeave.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnLeave.sqf new file mode 100644 index 00000000..16ecedd5 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnLeave.sqf @@ -0,0 +1,42 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_tempGroup_BtnLeave.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_BtnLeave","_ret","_txt"]; +//[[[end]]] +disableSerialization; +Epoch_my_tempGroup params [ + ["_groupName",""], + ["_leaderName",""], + ["_groupSize",0], + ["_modArray",[]], + ["_memberArray",[]] +]; +if (getPlayerUID player == Epoch_my_tempGroupUID) then { + _txt = format["Do you want to delete your Temp Group called %1?",_groupName]; + _txt spawn { + _ret = [_this,"Epoch Temp Group Menu",true,true] call BIS_fnc_GUImessage; + if (_ret) then { + [player,Epoch_personalToken] remoteExec ["EPOCH_server_deleteTempGroup",2]; + }; + }; +} else { + _txt = format["Do you want to leave the %1 Temp Group?",_groupName]; + _txt spawn { + _ret = [_this,"Epoch Temp Group Menu",true,true] call BIS_fnc_GUImessage; + if (_ret) then { + [Epoch_my_tempGroupUID,getPlayerUID player,false,false,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerTempGroup",2]; + }; + }; +}; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnMod.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnMod.sqf new file mode 100644 index 00000000..d60cbb51 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnMod.sqf @@ -0,0 +1,46 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/group/EPOCH_Group_BtnMod.sqf +*/ +disableSerialization; +//[[[cog import generate_private_arrays ]]] +private ["_group","_isMember","_playerUID","_ret","_selected","_txt"]; +//[[[end]]] +if (getPlayerUID player == Epoch_my_tempGroupUID) then { + _group = (findDisplay -1300) displayCtrl 40; + _selected = lbCurSel _group; + if (_selected >= 0) then { + _playerUID = _group lbData _selected; + if (_playerUID != "") then { + _isMember = (_group lbPicture _selected) == (EPOCH_group_level_img select 2); + _txt = if (_isMember) then { + format["Do you want to give %1 moderator permissions?",_group lbText _selected]; + } else { + format["Do you want to remove %1 moderator permissions?",_group lbText _selected]; + }; + + [_playerUID,_isMember,_txt] spawn { + params ["_playerUID","_isMember","_txt"]; + _ret = [_txt,"Epoch Temp Group Menu",true,true] call BIS_fnc_GUImessage; + if (_ret) then { + [Epoch_my_tempGroupUID,_playerUID,true,_isMember,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerTempGroup",2]; + }; + }; + }; + } else { + ["You need to select a player!", 5] call Epoch_message; + }; + true +} else { + false +}; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_Combo.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_Combo.sqf new file mode 100644 index 00000000..057443da --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_Combo.sqf @@ -0,0 +1,43 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/group/EPOCH_Group_Combo.sqf +*/ +disableSerialization; +//[[[cog import generate_private_arrays ]]] +private ["_BtnInvite","_ctrl","_currentMember","_playerUID","_selected"]; +//[[[end]]] + +Epoch_my_tempGroup params [ + ["_groupName",""], + ["_leaderName",""], + ["_groupSize",0], + ["_modArray",[]], + ["_memberArray",[]] +]; + +_ctrl = _this select 0; +_selected = _this select 1; +_playerUID = getPlayerUID player; +if (_playerUID == Epoch_my_tempGroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then { + _BtnInvite = (findDisplay -1300) displayCtrl 30; + _currentMember = count(_modArray) + count(_memberArray) + 1; + if (_currentMember < _groupSize) then { + _BtnInvite ctrlSetText format ["Invite %1",_ctrl lbtext _selected]; + }; + true +} else { + if (_selected != -1) then { + _ctrl lbSetCurSel -1; + }; + false +}; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_List.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_List.sqf new file mode 100644 index 00000000..2c51b38b --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_List.sqf @@ -0,0 +1,39 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_tempGroup_List.sqf +*/ +disableSerialization; +//[[[cog import generate_private_arrays ]]] +private ["_BtnKick","_BtnSetMod","_img"]; +//[[[end]]] +params ["_ctrl","_selected"]; + +if (getPlayerUID player == Epoch_my_tempGroupUID) then { + _img = _ctrl lbPicture _selected; + + _BtnSetMod = (findDisplay -1300) displayCtrl 32; + _BtnKick = (findDisplay -1300) displayCtrl 33; + + switch _img do { + case {getPlayerUID player == _ctrl lbData _selected}:{_BtnSetMod ctrlEnable false;_BtnKick ctrlEnable false}; + case(EPOCH_group_level_img select 0) : {_BtnSetMod ctrlEnable false; _BtnKick ctrlEnable false}; + case(EPOCH_group_level_img select 1) : {_BtnSetMod ctrlEnable true; _BtnKick ctrlEnable true; _BtnSetMod ctrlSetText "Remove Mod"}; + case(EPOCH_group_level_img select 2) : {_BtnSetMod ctrlEnable true; _BtnKick ctrlEnable true; _BtnSetMod ctrlSetText "Set Mod"}; + }; + true +} else { + if (_selected != -1) then { + _ctrl lbSetCurSel -1; + }; + false +}; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_invitePlayer.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_invitePlayer.sqf new file mode 100644 index 00000000..7370452f --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_invitePlayer.sqf @@ -0,0 +1,18 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/group/EPOCH_Group_invitePlayer.sqf +*/ +if !(_this in Epoch_invited_tempGroupUIDs) then { + Epoch_invited_tempGroupUIDs pushBack _this; + ["Temp Group request received", 5] call Epoch_message; +}; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_onLoad.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_onLoad.sqf new file mode 100644 index 00000000..72a3ec1f --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_onLoad.sqf @@ -0,0 +1,94 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_tempGroup_onLoad.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_BtnInvite","_GroupMemberList","_InvitePlayerCombo","_currentMaxMember","_display","_found","_index","_myPlayerUID","_onlinePUID","_picture","_playerIsLeader","_playerIsMod","_playerUID","_players"]; +//[[[end]]] +disableSerialization; +_display = findDisplay -1300; +_BtnInvite = _display displayCtrl 30; + +_GroupMemberList = _display displayCtrl 40; +_InvitePlayerCombo = _display displayCtrl 41; + +Epoch_my_tempGroup params [ + ["_groupName",""], + ["_leaderName",""], + ["_groupSize",0], + ["_modArray",[]], + ["_memberArray",[]] +]; + +_currentMaxMember = count(_modArray) + count(_memberArray) + 1; + +(_display displayCtrl 21) ctrlSetText format["Temp Name: %1 (%2/%3 Slots)",_groupName,_currentMaxMember,_groupSize]; + +_myPlayerUID = getPlayerUID player; +_playerIsLeader = _myPlayerUID == Epoch_my_tempGroupUID; +_playerIsMod = {_x select 0 == _myPlayerUID}count (_modArray) > 0; +(_display displayCtrl 32) ctrlEnable false; +(_display displayCtrl 33) ctrlEnable false; + +_onlinePUID = []; +{ + _onlinePUID pushBack (getPlayerUID _x); +}forEach (units group player); + +if (_currentMaxMember < _groupSize) then { + _players = player nearEntities [["Epoch_Male_F","Epoch_Female_F","LandVehicle","Ship","Air","Tank"], 10]; + + if (_playerIsLeader || _playerIsMod) then { + { + if (!isNull _x) then { + if (isPlayer _x && alive _x) then { + _index = _InvitePlayerCombo lbAdd format["%1",name _x]; + _InvitePlayerCombo lbSetData [_index,getPlayerUID _x]; + }; + }; + }forEach (_players-(units group player)); + }; + + if ((lbSize _InvitePlayerCombo) == 0) then { + _InvitePlayerCombo ctrlEnable false; + _BtnInvite ctrlEnable false; + _BtnInvite ctrlSetText (if (_playerIsLeader || _playerIsMod) then {"No one nearby to invite."} else {"Must be an Owner or a Mod to invite!"}); + } else { + _InvitePlayerCombo lbSetCurSel 0; + lbsort _InvitePlayerCombo; + }; +}; + +if (getPlayerUID player == Epoch_my_tempGroupUID) then { + (findDisplay -1300) displayCtrl 31 ctrlSetText "Delete TempGrp"; +}; + +{ + _picture = EPOCH_group_level_img select _forEachIndex; //0 = lead / 1 = mod / 2 = member + { + _playerUID = _x select 0; + + _index = _GroupMemberList lbAdd format["%1",_x select 1]; + _GroupMemberList lbSetColor [_index,if (_playerUID in _onlinePUID) then {[1,1,1,1]}else{[1,1,1,0.45]}]; + _GroupMemberList lbSetPicture [_index, _picture]; + + if (_playerIsLeader || _playerIsMod) then { + _GroupMemberList lbSetData [_index,_playerUID]; + }; + }forEach _x; +}forEach +[ + [[Epoch_my_tempGroupUID,_leaderName]], + _modArray, + _memberArray +]; diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_update.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_update.sqf new file mode 100644 index 00000000..da19de8e --- /dev/null +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_update.sqf @@ -0,0 +1,19 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/groupTemp/EPOCH_tempGroup_update.sqf +*/ +if (!isNull (findDisplay -1300)) then { + (findDisplay -1300) closeDisplay 0; + uisleep 0.2; + createDialog "Epoch_myTempGroup"; +}; diff --git a/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_itempGroup.sqf b/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_itempGroup.sqf new file mode 100644 index 00000000..d873f74e --- /dev/null +++ b/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_itempGroup.sqf @@ -0,0 +1,20 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/inventory/EPOCH_Inventory_itempGroup.sqf +*/ +disableSerialization; +(findDisplay 602) closeDisplay 0; +if !(Epoch_invited_tempGroupUIDs isEqualTo[]) exitWith { + createDialog "tempGroupRequests"; +}; +["No pending requests", 5] call Epoch_message; diff --git a/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_tempGroup.sqf b/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_tempGroup.sqf new file mode 100644 index 00000000..3199aacc --- /dev/null +++ b/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_tempGroup.sqf @@ -0,0 +1,17 @@ +/* + Author: Niklas Wagner - EpochMod.com + + Contributors: Aaron Clark + + Description: + TODO: DESC-TBA + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/inventory/EPOCH_Inventory_tempGroup.sqf +*/ +disableSerialization; +(findDisplay 602) closeDisplay 0; +createDialog (if ((Epoch_my_tempGroupUID == "") && (Epoch_my_tempGroup isEqualTo [])) then {"EPOCH_createTempGrp"} else {"Epoch_myTempGroup"}); diff --git a/Sources/epoch_code/init/client_init.sqf b/Sources/epoch_code/init/client_init.sqf index 8f7fd5c0..93e79177 100644 --- a/Sources/epoch_code/init/client_init.sqf +++ b/Sources/epoch_code/init/client_init.sqf @@ -42,6 +42,11 @@ Epoch_invited_GroupName = ""; Epoch_invited_GroupUIDs = []; Epoch_invited_GroupUIDsPrev = []; Epoch_my_Group = []; +Epoch_invited_tempGroupUID = ""; +Epoch_invited_tempGroupName = ""; +Epoch_invited_tempGroupUIDs = []; +Epoch_invited_tempGroupUIDsPrev = []; +Epoch_my_tempGroup = []; EPOCH_lastPlayerPos = [0,0,0]; EPOCH_prevOffer = []; EPOCH_drawIcon3d = false; diff --git a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp index 7f1a9a0d..d6b01299 100644 --- a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp +++ b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp @@ -34,12 +34,26 @@ class player_inspect icon = "x\addons\a3_epoch_code\Data\UI\buttons\player_inspect.paa"; tooltip = "Examine"; }; -class player_group_menu +class Groups { condition = "true"; - action = "call EPOCH_Inventory_Group;"; + action = ""; icon = "x\addons\a3_epoch_code\Data\UI\buttons\group_menu_ca.paa"; - tooltip = "Group Menu"; + tooltip = "Groups Menu"; + class Group + { + condition = "true"; + action = "call EPOCH_Inventory_Group;"; + icon = "perm_group_menu_ca.paa";//"x\addons\a3_epoch_code\Data\UI\buttons\perm_group_menu_ca.paa"; + tooltip = "Perm Group Menu"; + }; + class TempGroup + { + condition = "true"; + action = "call EPOCH_Inventory_TempGroup;"; + icon = "temp_group_menu_ca.paa";//"x\addons\a3_epoch_code\Data\UI\buttons\temp_group_menu_ca.paa"; + tooltip = "Temp Group Menu"; + }; }; class player_group_requests { @@ -48,6 +62,13 @@ class player_group_requests icon = "x\addons\a3_epoch_code\Data\UI\buttons\group_requests_ca.paa"; tooltip = "Group Requests"; }; +class player_tempGroup_requests +{ + condition = "!(Epoch_invited_tempGroupUIDs isEqualTo[])"; + action = "call EPOCH_Inventory_itempGroup;"; + icon = "x\addons\a3_epoch_code\Data\UI\buttons\group_requests_ca.paa"; + tooltip = "Temp Group Requests"; +}; class base_mode_enable { diff --git a/Sources/epoch_config/Configs/CfgClientFunctions.hpp b/Sources/epoch_config/Configs/CfgClientFunctions.hpp index d65b93db..5edf9f9e 100644 --- a/Sources/epoch_config/Configs/CfgClientFunctions.hpp +++ b/Sources/epoch_config/Configs/CfgClientFunctions.hpp @@ -295,11 +295,31 @@ class CfgClientFunctions class iGroup_refresh {}; class Group_update {}; }; + class groupTemp + { + file = "epoch_code\gui\scripts\groupTemp"; + class tempGroup_invitePlayer {}; + class tempGroup_BtnMod {}; + class tempGroup_BtnInvite {}; + class tempGroup_onLoad {}; + class tempGroup_List {}; + class tempGroup_Combo {}; + class tempGroup_BtnLeave {}; + class tempGroup_BtnKick {}; + class cTempGroup_onLoad {}; + class cTempGroup_BtnCreate {}; + class iTempGroup_acceptInvite {}; + class iTempGroup_onLoad {}; + class iTempGroup_refresh {}; + class tempGroup_update {}; + }; class gui_inventory { file = "epoch_code\gui\scripts\inventory"; class Inventory_Group {}; class Inventory_iGroup {}; + class Inventory_tempGroup {}; + class Inventory_itempGroup {}; }; class gui_missions { diff --git a/Sources/epoch_config/Configs/CfgRemoteExec.hpp b/Sources/epoch_config/Configs/CfgRemoteExec.hpp index 8a5c5dec..143592fa 100644 --- a/Sources/epoch_config/Configs/CfgRemoteExec.hpp +++ b/Sources/epoch_config/Configs/CfgRemoteExec.hpp @@ -315,6 +315,31 @@ class CfgRemoteExec { allowedTargets = 1; jip = 0; + }; + class EPOCH_server_createTempGroup + { + allowedTargets = 2; + jip = 0; + }; + class EPOCH_server_invitePlayerTemp + { + allowedTargets = 2; + jip = 0; + }; + class EPOCH_server_updatePlayerTempGroup + { + allowedTargets = 2; + jip = 0; + }; + class EPOCH_server_deleteTempGroup + { + allowedTargets = 2; + jip = 0; + }; + class EPOCH_server_upgradeTempGroup + { + allowedTargets = 2; + jip = 0; }; }; class Commands diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_createTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_createTempGroup.sqf new file mode 100644 index 00000000..2ff2f93c --- /dev/null +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_createTempGroup.sqf @@ -0,0 +1,56 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: + + Description: + Add HiveFunction: Create Group / Set Data + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_createTempGroup.sqf + + Return: + + true = group has been created and / or successfully saved! + false = group exist already and hasn't been saved! +*/ +//[[[cog import generate_private_arrays ]]] +private ["_cIndex","_contentArray","_current_crypto","_groupID","_groupName","_leaderName","_playerCryptoLimit","_return","_textArr","_upgradePrice","_vars"]; +//[[[end]]] +params ["_leader", "_groupName", ["_token","",[""]] ]; +if !([_leader, _token] call EPOCH_server_getPToken) exitWith{}; + +_return = false; +_textArr = toArray(_groupName); + +if (count _textArr > 24) exitWith{}; +// remove any disallowed chars in group name "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 -_" +{ + if !(_x in [97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,49,50,51,52,53,54,55,56,57,48,32,45,95]) then { + _textArr = _textArr - [_x]; + }; +} forEach _textArr; +_groupName = toString _textArr; + +if (_groupName != "") then { + + _groupID = getPlayerUID _leader; + + _leaderName = if (alive _leader) then {name _leader} else {"Dead Player"}; + + _contentArray = [_groupName, _leaderName, EPOCH_group_upgrade_lvl_SEPXVar select 0, [], []]; + + [["tempGroupUpdate", _contentArray], _leader] call EPOCH_sendRemoteExecClient; + [["tempGroupUidUpdate", _groupID], _leader] call EPOCH_sendRemoteExecClient; + + _leader setVariable ["TEMPGROUP", _groupID]; + _leader setVariable ["TEMPGROUPARRAY",_contentArray]; + + // Save Group Data + //["TempGroup", _groupID, _contentArray] call EPOCH_fnc_server_hiveSET; + _return = true; +}; +_return diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf new file mode 100644 index 00000000..ced8febb --- /dev/null +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf @@ -0,0 +1,50 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: + + Description: + Delete Group + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_groupID","_return"]; +//[[[end]]] +params ["_player",["_token","",[""]] ]; + +if !([_player, _token] call EPOCH_server_getPToken) exitWith{}; + +_return = false; +_groupID = getPlayerUID _player; +if (_groupID != "") then { + + { + _group = grpNull; + _permGroup = _x getVariable["GROUP",""]; + if !(_permGroup isEqualTo "")then + { + { + if ((_x getVariable["GROUP",""]) == _groupID) exitWith { + _group = group _x; + }; + } forEach _allPlayers; + }; + + _x setVariable ["TEMPGROUP", nil]; + [["resetTempGroup", true], _x] call EPOCH_sendRemoteExecClient; + [["tempGroupUpdate", []], _x] call EPOCH_sendRemoteExecClient; + if (isNull _group) then { + _group = createGroup [west, true]; + }; + [_x] joinSilent _group; + } forEach (allPlayers select {(_x getVariable["TEMPGROUP", ""]) == _groupID}); + + //_return = ["TempGroup", _groupID] call EPOCH_fnc_server_hiveDEL; + _return = true; +}; +_return diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTemp.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTemp.sqf new file mode 100644 index 00000000..2639e02e --- /dev/null +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTemp.sqf @@ -0,0 +1,20 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: + + Description: + Invite Player + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_inviteTempPlayer.sqf +*/ +params ["_playerUID","_var1","_var2","_player",["_token","",[""]]]; +if !([_player, _token] call EPOCH_server_getPToken) exitWith{}; + +{ + [_var1, _var2] remoteExec ['EPOCH_tempGroup_invitePlayer',_x]; +} forEach (allPlayers select {getPlayerUID _x == _playerUID}); diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf new file mode 100644 index 00000000..e8f772b9 --- /dev/null +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf @@ -0,0 +1,140 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: + + Description: + Add or remove members from a group + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_allPlayers","_contentArray","_found","_group","_memberrange","_modOrMember","_modOrMemberArray","_modOrMemberRevert","_removePlayerArray","_response","_selectedPlayerName","_playerObj"]; +//[[[end]]] +params [["_groupID",""],["_selectedPlayerUID",""],["_addOrRemove",false],["_modOrMemberVar",true],["_player",objnull],["_token",""]]; + +if !([_player, _token] call EPOCH_server_getPToken) exitWith {}; + +if (_groupID == "") exitWith{ diag_log format["Epoch: GROUP: No Temp Group Selected %1", _this]; }; + +diag_log format["Epoch: Temp GROUP: Update %1", _this]; + +_modOrMember = if (_modOrMemberVar) then [{3},{4}]; +_modOrMemberRevert = if (_modOrMemberVar) then [{4},{3}]; +_contentArray = []; +{ + _contentArray = _x getVariable ["TEMPGROUPARRAY",[]]; +} forEach (allPlayers select {getPlayerUID _x == _groupID}); +diag_log format["eXpochDEBUG:1 _contentArray:%1",_contentArray]; + +//_response = ["TempGroup", _groupID] call EPOCH_fnc_server_hiveGETRANGE; +if !(_contentArray isEqualTo []) then { + + _contentArray params ["_groupName","_leaderName","_groupSize","_modArray","_memberArray"]; + _allPlayers = allPlayers select {alive _x}; + + if (_addOrRemove) then { //Add + _selectedPlayerName = "Dead Player"; + + { + _selectedPlayerName = if (alive _x) then {name _x}; + if ((_x getVariable ["TEMPGROUP",""]) != _groupID) then { + _group = grpNull; + { + if ((_x getVariable["TEMPGROUP",""]) == _groupID) exitWith { + _group = group _x; + }; + } forEach _allPlayers; + + if (isNull _group) then { + _group = createGroup [west, true]; + }; + _x setVariable ["TEMPGROUP", _groupID]; + [["tempGroupUidUpdate", _groupID], _x] call EPOCH_sendRemoteExecClient; + [_x] joinSilent _group; + }; + } forEach (_allPlayers select {getPlayerUID _x == _selectedPlayerUID}); + + // find player name from DB + if (_selectedPlayerName == "Dead Player") then { + _memberrange = ["PlayerData", _selectedPlayerUID] call EPOCH_fnc_server_hiveGETRANGE; + if (count (_memberrange select 1) > 0) then { + if (typename (_memberrange select 1 select 0) == "STRING") then { + _selectedPlayerName = _memberrange select 1 select 0; + }; + }; + }; + + _removePlayerArray = _contentArray select _modOrMemberRevert; + + { + if (_x select 0 == _selectedPlayerUID) exitWith { + _removePlayerArray deleteAt _forEachIndex; + _contentArray set [_modOrMemberRevert, _removePlayerArray]; + }; + } forEach _removePlayerArray; + + _modOrMemberArray = _contentArray select _modOrMember; + _modOrMemberArray pushBack [_selectedPlayerUID, _selectedPlayerName]; + + _contentArray set [_modOrMember, _modOrMemberArray]; + + } else { + + //Remove + _found = false; + _group = grpNull; + { + _permGroup = _x getVariable["GROUP",""]; + _playerObj = _x; + } forEach (_allPlayers select {getPlayerUID _x == _selectedPlayerUID}); + if !(_permGroup isEqualTo "")then + { + { + if ((_x getVariable["GROUP",""]) == _groupID) exitWith { + _group = group _x; + }; + } forEach _allPlayers; + }; + _playerObj setVariable ["TEMPGROUP", nil]; + if (isNull _group) then { + _group = createGroup [west, true]; + }; + [_playerObj] joinSilent _group; + [["resetTempGroup", true], _playerObj] call EPOCH_sendRemoteExecClient; + [["tempGroupUpdate", []], _playerObj] call EPOCH_sendRemoteExecClient; + { + if (_x select 0 == _selectedPlayerUID) exitWith { + _memberArray deleteAt _forEachIndex; + _found = true; + }; + } forEach _memberArray; + + if (_found) then { + _contentArray set [4, _memberArray]; + } else { + { + if (_x select 0 == _selectedPlayerUID) exitWith { + _modArray deleteAt _forEachIndex; + _found = true; + }; + } forEach _modArray; + _contentArray set [3, _modArray]; + }; + + if (!_found) then { + diag_log format ["Epoch: %1 cannot remove Player! (%1)", __FILE__, _this] + }; + }; + + { + [["tempGroupUpdate", _contentArray], _x] call EPOCH_sendRemoteExecClient; + } forEach (_allPlayers select {(_x getVariable["TEMPGROUP", ""]) == _groupID}); + + // Save Group Data + //["TempGroup", _groupID, _contentArray] call EPOCH_fnc_server_hiveSET; +}; diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf new file mode 100644 index 00000000..208463d5 --- /dev/null +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf @@ -0,0 +1,52 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: + + Description: + Upgrade group size + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf +*/ +//[[[cog import generate_private_arrays ]]] +private ["_cIndex","_contentArray","_current_crypto","_found","_groupMemberPUID","_newGroupSize","_playerCryptoLimit","_response","_return","_upgradePrice","_vars"]; +//[[[end]]] +params ["_groupID","_player",["_token","",[""]] ]; +if !([_player, _token] call EPOCH_server_getPToken) exitWith{}; + +_return = false; + +// [_groupName, _leaderName, _groupSize, _modArray, _memberArray] +//_response = ["TempGroup", _groupID] call EPOCH_fnc_server_hiveGETRANGE; +if ((_response select 0) == 1 && (_response select 1) isEqualType []) then { + _contentArray = (_response select 1); + _found = EPOCH_group_upgrade_lvl_SEPXVar find (_contentArray select 2); + + if ((_found != -1) && count EPOCH_group_upgrade_lvl_SEPXVar >= (_found + 3)) then { + _newGroupSize = EPOCH_group_upgrade_lvl_SEPXVar select (_found + 2); + + _upgradePrice = parseNumber (EPOCH_group_upgrade_lvl_SEPXVar select (_found+3)); + + _contentArray set [2, _newGroupSize]; + + _groupMemberPUID = [_groupID]; + { + { + _groupMemberPUID pushback(_x select 0); + } forEach _x; + } forEach [_contentArray select 3, _contentArray select 4]; + + { + [["tempGroupUpdate", _contentArray], _x] call EPOCH_sendRemoteExecClient; + } forEach (allPlayers select {getPlayerUID _x in _groupMemberPUID}); + + // Save Group Data + //_return = ["TempGroup", _groupID, _contentArray] call EPOCH_fnc_server_hiveSET; + _return = true; + }; +}; +_return diff --git a/Sources/epoch_server/config.cpp b/Sources/epoch_server/config.cpp index 872391ba..4aefbf34 100644 --- a/Sources/epoch_server/config.cpp +++ b/Sources/epoch_server/config.cpp @@ -27,6 +27,13 @@ class CfgServerFunctions class server_deleteGroup {}; class server_invitePlayer {}; }; + class epoch_grouptemp { + class server_upgradeTempGroup {}; + class server_updatePlayerTempGroup {}; + class server_createTempGroup {}; + class server_deleteTempGroup {}; + class server_invitePlayerTemp {}; + }; class epoch_bases { class swapBuilding {}; class saveBuilding {}; diff --git a/Sources/epoch_server_settings/configs/security/security_checks.h b/Sources/epoch_server_settings/configs/security/security_checks.h index 26caadc2..de8285fd 100644 --- a/Sources/epoch_server_settings/configs/security/security_checks.h +++ b/Sources/epoch_server_settings/configs/security/security_checks.h @@ -21,12 +21,15 @@ class CfgSecConf }; class remoteExecClient{ - functions[] = {"bankBalance", "resetGroup", "groupUpdate", "groupUidUpdate", "healPlayer","tradeComplete"}; + functions[] = {"bankBalance", "resetGroup", "groupUpdate", "groupUidUpdate", "healPlayer","tradeComplete","resetTempGroup","tempGroupUpdate","tempGroupUidUpdate"}; // code bankBalance = "EPOCH_bankBalance = _this;"; resetGroup = "Epoch_my_Group = []; Epoch_my_GroupUID = '';"; groupUpdate = "Epoch_my_Group = _this; call EPOCH_Group_update;"; groupUidUpdate = "Epoch_my_GroupUID = _this;"; + resetTempGroup = "Epoch_my_tempGroup = []; Epoch_my_tempGroupUID = '';"; + tempGroupUpdate = "Epoch_my_tempGroup = _this; call EPOCH_tempGroup_update;"; + tempGroupUidUpdate = "Epoch_my_tempGroupUID = _this;"; healPlayer = "{missionNamespace setVariable[format['EPOCH_player%1', _x], EPOCH_defaultVars select(EPOCH_customVars find _x)]} forEach['Temp','Hunger','Thirst','Toxicity','Stamina','HitPoints','BloodP','Alcohol','Radiation'];"; tradeComplete = "EPOCH_TRADE_COMPLETE = _this;"; }; From d90eb4774f791f153b356b2660326f25ac4ec94c Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Wed, 30 Aug 2017 03:14:13 -0500 Subject: [PATCH 2/7] epoch groups system move "Delete Group" button check to onLoad from button click. Remove owner from EPOCH_sendRemoteExecClient calls. Add UI update push to leader on Delete Group. Add UI update push to client on remove in case they clicked leave group. --- Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnLeave.sqf | 2 -- Sources/epoch_code/gui/scripts/group/EPOCH_Group_onLoad.sqf | 4 ++++ .../compile/epoch_group/EPOCH_server_createGroup.sqf | 4 ++-- .../compile/epoch_group/EPOCH_server_deleteGroup.sqf | 1 + .../compile/epoch_group/EPOCH_server_updatePlayerGroup.sqf | 1 + .../compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnLeave.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnLeave.sqf index b9f3724f..83c4f768 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnLeave.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnLeave.sqf @@ -16,7 +16,6 @@ private ["_BtnLeave","_ret","_txt"]; //[[[end]]] disableSerialization; -_BtnLeave = (findDisplay -1300) displayCtrl 31; Epoch_my_Group params [ ["_groupName",""], ["_leaderName",""], @@ -25,7 +24,6 @@ Epoch_my_Group params [ ["_memberArray",[]] ]; if (getPlayerUID player == Epoch_my_GroupUID) then { - _BtnLeave ctrlSetText "Delete Group"; _txt = format["Do you want to delete your Group called %1?",_groupName]; _txt spawn { _ret = [_this,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage; diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_onLoad.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_onLoad.sqf index 8334b4c7..da3906ab 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_onLoad.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_onLoad.sqf @@ -82,6 +82,10 @@ if (_currentMaxMember < _groupSize) then { }; }; +if (_playerIsLeader) then { + (findDisplay -1300) displayCtrl 31 ctrlSetText "Delete Group"; +}; + { _picture = EPOCH_group_level_img select _forEachIndex; //0 = lead / 1 = mod / 2 = member diff --git a/Sources/epoch_server/compile/epoch_group/EPOCH_server_createGroup.sqf b/Sources/epoch_server/compile/epoch_group/EPOCH_server_createGroup.sqf index f43dd931..eb19d397 100644 --- a/Sources/epoch_server/compile/epoch_group/EPOCH_server_createGroup.sqf +++ b/Sources/epoch_server/compile/epoch_group/EPOCH_server_createGroup.sqf @@ -60,8 +60,8 @@ if (_current_crypto >= _upgradePrice) then { _contentArray = [_groupName, _leaderName, EPOCH_group_upgrade_lvl_SEPXVar select 0, [], []]; - [["groupUpdate", _contentArray], (owner _leader)] call EPOCH_sendRemoteExecClient; - [["groupUidUpdate", _groupID], (owner _leader)] call EPOCH_sendRemoteExecClient; + [["groupUpdate", _contentArray], _leader] call EPOCH_sendRemoteExecClient; + [["groupUidUpdate", _groupID], _leader] call EPOCH_sendRemoteExecClient; _leader setVariable ["GROUP", _groupID]; diff --git a/Sources/epoch_server/compile/epoch_group/EPOCH_server_deleteGroup.sqf b/Sources/epoch_server/compile/epoch_group/EPOCH_server_deleteGroup.sqf index 9ffe4666..ba1406c1 100644 --- a/Sources/epoch_server/compile/epoch_group/EPOCH_server_deleteGroup.sqf +++ b/Sources/epoch_server/compile/epoch_group/EPOCH_server_deleteGroup.sqf @@ -30,5 +30,6 @@ if (_groupID != "") then { } forEach (allPlayers select {(_x getVariable["GROUP", ""]) == _groupID}); _return = ["Group", _groupID] call EPOCH_fnc_server_hiveDEL; + [["groupUpdate", []], _player] call EPOCH_sendRemoteExecClient; }; _return diff --git a/Sources/epoch_server/compile/epoch_group/EPOCH_server_updatePlayerGroup.sqf b/Sources/epoch_server/compile/epoch_group/EPOCH_server_updatePlayerGroup.sqf index 78fa5322..04d434b6 100644 --- a/Sources/epoch_server/compile/epoch_group/EPOCH_server_updatePlayerGroup.sqf +++ b/Sources/epoch_server/compile/epoch_group/EPOCH_server_updatePlayerGroup.sqf @@ -87,6 +87,7 @@ if ((_response select 0) == 1 && (_response select 1) isEqualType []) then { _x setVariable ["GROUP", nil]; [_x] joinSilent (createGroup [west, true]); [["resetGroup", true], _x] call EPOCH_sendRemoteExecClient; + [["groupUpdate", []], _x] call EPOCH_sendRemoteExecClient; } forEach (_allPlayers select {getPlayerUID _x == _selectedPlayerUID}); { if (_x select 0 == _selectedPlayerUID) exitWith { diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf index ced8febb..94421636 100644 --- a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf @@ -37,7 +37,6 @@ if (_groupID != "") then { _x setVariable ["TEMPGROUP", nil]; [["resetTempGroup", true], _x] call EPOCH_sendRemoteExecClient; - [["tempGroupUpdate", []], _x] call EPOCH_sendRemoteExecClient; if (isNull _group) then { _group = createGroup [west, true]; }; @@ -45,6 +44,7 @@ if (_groupID != "") then { } forEach (allPlayers select {(_x getVariable["TEMPGROUP", ""]) == _groupID}); //_return = ["TempGroup", _groupID] call EPOCH_fnc_server_hiveDEL; + [["tempGroupUpdate", []], _player] call EPOCH_sendRemoteExecClient; _return = true; }; _return From 3b82e8b0b0145102ac10fcaf008931569ab32eee Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Wed, 30 Aug 2017 03:36:37 -0500 Subject: [PATCH 3/7] clean up server side temp groups --- .../epoch_grouptemp/EPOCH_server_createTempGroup.sqf | 2 -- .../epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf | 1 - .../epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf | 6 +----- .../epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf | 3 --- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_createTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_createTempGroup.sqf index 2ff2f93c..5384a847 100644 --- a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_createTempGroup.sqf +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_createTempGroup.sqf @@ -49,8 +49,6 @@ if (_groupName != "") then { _leader setVariable ["TEMPGROUP", _groupID]; _leader setVariable ["TEMPGROUPARRAY",_contentArray]; - // Save Group Data - //["TempGroup", _groupID, _contentArray] call EPOCH_fnc_server_hiveSET; _return = true; }; _return diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf index 94421636..d99cc1ce 100644 --- a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf @@ -43,7 +43,6 @@ if (_groupID != "") then { [_x] joinSilent _group; } forEach (allPlayers select {(_x getVariable["TEMPGROUP", ""]) == _groupID}); - //_return = ["TempGroup", _groupID] call EPOCH_fnc_server_hiveDEL; [["tempGroupUpdate", []], _player] call EPOCH_sendRemoteExecClient; _return = true; }; diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf index e8f772b9..a34ae866 100644 --- a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf @@ -29,9 +29,7 @@ _contentArray = []; { _contentArray = _x getVariable ["TEMPGROUPARRAY",[]]; } forEach (allPlayers select {getPlayerUID _x == _groupID}); -diag_log format["eXpochDEBUG:1 _contentArray:%1",_contentArray]; - -//_response = ["TempGroup", _groupID] call EPOCH_fnc_server_hiveGETRANGE; + if !(_contentArray isEqualTo []) then { _contentArray params ["_groupName","_leaderName","_groupSize","_modArray","_memberArray"]; @@ -135,6 +133,4 @@ if !(_contentArray isEqualTo []) then { [["tempGroupUpdate", _contentArray], _x] call EPOCH_sendRemoteExecClient; } forEach (_allPlayers select {(_x getVariable["TEMPGROUP", ""]) == _groupID}); - // Save Group Data - //["TempGroup", _groupID, _contentArray] call EPOCH_fnc_server_hiveSET; }; diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf index 208463d5..34f57830 100644 --- a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_upgradeTempGroup.sqf @@ -21,7 +21,6 @@ if !([_player, _token] call EPOCH_server_getPToken) exitWith{}; _return = false; // [_groupName, _leaderName, _groupSize, _modArray, _memberArray] -//_response = ["TempGroup", _groupID] call EPOCH_fnc_server_hiveGETRANGE; if ((_response select 0) == 1 && (_response select 1) isEqualType []) then { _contentArray = (_response select 1); _found = EPOCH_group_upgrade_lvl_SEPXVar find (_contentArray select 2); @@ -44,8 +43,6 @@ if ((_response select 0) == 1 && (_response select 1) isEqualType []) then { [["tempGroupUpdate", _contentArray], _x] call EPOCH_sendRemoteExecClient; } forEach (allPlayers select {getPlayerUID _x in _groupMemberPUID}); - // Save Group Data - //_return = ["TempGroup", _groupID, _contentArray] call EPOCH_fnc_server_hiveSET; _return = true; }; }; From 963ab3058173fcb04a3f7c5791677f7d7fcedd0a Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Wed, 30 Aug 2017 04:02:25 -0500 Subject: [PATCH 4/7] No temp group invite if in main group --- .../scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf index 071f6427..2a3cf0b0 100644 --- a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf @@ -27,13 +27,21 @@ Epoch_my_tempGroup params [ ["_memberArray",[]] ]; +Epoch_my_Group params [ + ["_groupName2",""], + ["_leaderName2",""], + ["_groupSize2",0], + ["_modArray2",[]], + ["_memberArray2",[]] +]; + if (_playerUID == Epoch_my_tempGroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then { _currentMember = count(_modArray) + count(_memberArray) + 1; if (_currentMember < _groupSize) then { _InvitePlayerCombo = (findDisplay -1300) displayCtrl 41; _playerUID = _InvitePlayerCombo lbData (lbCurSel _InvitePlayerCombo); _playerName = _InvitePlayerCombo lbText (lbCurSel _InvitePlayerCombo); - if (_playerUID != "" && _playerName != "" && ({_playerUID in _x} count (_modArray) == 0) && ({_playerUID in _x} count (_memberArray) == 0) && !(_playerUID == Epoch_my_tempGroupUID)) then { + if (_playerUID != "" && _playerName != "" && ({_playerUID in _x} count (_modArray) == 0) && ({_playerUID in _x} count (_memberArray) == 0) && ({_playerUID in _x} count (_modArray2) == 0) && ({_playerUID in _x} count (_memberArray2) == 0) && !(_playerUID == Epoch_my_tempGroupUID)) then { _txt = format["Do you want to add %1 to your Temp Group?",_playerName]; [_playerUID,_txt,_groupName] spawn { params ["_playerUID","_txt","_groupName"]; From cf38ae62a7c649856a862ef9b8dd0949006f327e Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Wed, 30 Aug 2017 11:13:26 -0500 Subject: [PATCH 5/7] BE Filter for AWOL login fsm updates https://github.com/EpochModTeam/Epoch/commit/8e7419ec31924ca1dd1194fc19f7f0621b2b50c6 --- Server_Install_Pack/sc/battleye/remoteexec.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server_Install_Pack/sc/battleye/remoteexec.txt b/Server_Install_Pack/sc/battleye/remoteexec.txt index 71e833ee..739497a5 100644 --- a/Server_Install_Pack/sc/battleye/remoteexec.txt +++ b/Server_Install_Pack/sc/battleye/remoteexec.txt @@ -1 +1 @@ -5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_checkplayer \[[A-Z]{1} [A-Za-z]{4,10} [0-9]{1,3}-[0-9]{1,3}:[0-9]{1,3}( \(.+\)|) REMOTE\]" !="epoch_server_(save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player|(upgrade|updateplayer|create|delete)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]" +5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_checkplayer \[[A-Z]{1} [A-Za-z]{4,10} [0-9]{1,3}-[0-9]{1,3}:[0-9]{1,3}( \(.+\)|) REMOTE\,[0-9]{1,3}]" !="epoch_server_(save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player|(upgrade|updateplayer|create|delete)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]" From 21997a63f89e5e1a8d38042fb13944d0a2a8b08a Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Wed, 30 Aug 2017 12:19:16 -0500 Subject: [PATCH 6/7] add be filters for temp group system --- Server_Install_Pack/sc/battleye/remoteexec.txt | 2 +- Server_Install_Pack/sc/battleye/scripts.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Server_Install_Pack/sc/battleye/remoteexec.txt b/Server_Install_Pack/sc/battleye/remoteexec.txt index 739497a5..c44a7974 100644 --- a/Server_Install_Pack/sc/battleye/remoteexec.txt +++ b/Server_Install_Pack/sc/battleye/remoteexec.txt @@ -1 +1 @@ -5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_checkplayer \[[A-Z]{1} [A-Za-z]{4,10} [0-9]{1,3}-[0-9]{1,3}:[0-9]{1,3}( \(.+\)|) REMOTE\,[0-9]{1,3}]" !="epoch_server_(save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player|(upgrade|updateplayer|create|delete)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]" +5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_checkplayer \[[A-Z]{1} [A-Za-z]{4,10} [0-9]{1,3}-[0-9]{1,3}:[0-9]{1,3}( \(.+\)|) REMOTE\,[0-9]{1,3}]" !="epoch_server_(save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player(Temp)|(upgrade|updateplayer|create|delete)(Temp|)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]" diff --git a/Server_Install_Pack/sc/battleye/scripts.txt b/Server_Install_Pack/sc/battleye/scripts.txt index 20a9811f..0800f8d7 100644 --- a/Server_Install_Pack/sc/battleye/scripts.txt +++ b/Server_Install_Pack/sc/battleye/scripts.txt @@ -32,7 +32,7 @@ 7 createUnit !="_driver = _grp createUnit[\"I_UAV_AI\", position _unit, [], 0, \"CAN_COLLIDE\"];" !="axeGeneral = grpVIPGeneral createUnit [\"I_officer_F\", axeGeneralPos, [], 1, \"CAN_COLLIDE\"];" !="bis_functions_mainscope = _grpLogic createunit [\"Logic\",[9,9,9],[],0,\"none\"];" !="_unit = _grp createUnit[selectRandom _arrUnits, _pos, [], 0, \"FORM\"];" !="_driver = (group player) createUnit[\"I_UAV_AI\", position axeUAV, [], 0, \"CAN_COLLIDE\"];" 7 createAgent !="bis_revive_ratioLethal = createAgent [\"Logic\", [10,10,0], [], 0, \"CAN_COLLIDE\"];" !="_unit = createAgent[_unitClass, _targetPos, [], 256, \"FORM\"];" !="_unit = createAgent [_unitClass, _targetPos, [], 120, \"FORM\"];" !="_animal = createAgent[_randomAIClass, _animalPos, [], 5, \"NONE\"];" !="_unit = createAgent [\"Epoch_Cloak_F\", _pos, [], 0, \"CAN_COLLIDE\"];" !="_unit = createAgent [\"Epoch_Sapper_F\", _targetPos, [], 180, \"FORM\"];" !="_sapper = createAgent [\"Epoch_Sapper_F\", getPos _cage2, [], 0, \"FORM\"];" !="_unit = createAgent[_unitClass, position player, [], _zRange, \"FORM\"];" !="_animal = createAgent[_randomAIClass, _animalPos, [], 0, \"CAN_COLLIDE\"];" !="_axeSapper = createAgent [\"Epoch_Sapper_F\", _pos, [], 12, \"FORM\"];" !="_nestMate = createAgent [\"Epoch_Sapper_F\", _garrPos, [], 0, \"FORM\"];" 7 createTeam -7 createDialog !="createDialog \"rmx_dynamenu\";" !="createDialog \"rmx_craftingUI\";" !="createDialog \"QuickUpgrade\";" !="createDialog \"QuickTake\";" !="createDialog \"InteractBank\";" !="createdialog \"SelectGender\";" !="_handled = createdialog _dialog;" !="if !(createdialog \"InteractItem\") exitWith {};" !="createDialog _tapDiag;" !="if !(createdialog \"Trade\") exitWith {};" !="_ok = createdialog \"Interact\";" !="_ok = createdialog \"TradeNPCMenu\";" !="createDialog \"Epoch_myGroup\";" !="createDialog (if ((Epoch_my_GroupUID == \"\") && (Epoch_my_Group isEqualTo [])) then {\"EPOCH_createGrp\"} else {\"Epoch_myGroup\"});" !="createDialog \"GroupRequests\";" !="_ok = createdialog \"MissionSelect\";" !="createDialog 'Skaronator_AdminMenu';" +7 createDialog !="createDialog \"rmx_dynamenu\";" !="createDialog \"rmx_craftingUI\";" !="createDialog \"QuickUpgrade\";" !="createDialog \"QuickTake\";" !="createDialog \"InteractBank\";" !="createdialog \"SelectGender\";" !="_handled = createdialog _dialog;" !="if !(createdialog \"InteractItem\") exitWith {};" !="createDialog _tapDiag;" !="if !(createdialog \"Trade\") exitWith {};" !="_ok = createdialog \"Interact\";" !="_ok = createdialog \"TradeNPCMenu\";" !="createDialog \"Epoch_myGroup\";" !="createDialog (if ((Epoch_my_GroupUID == \"\") && (Epoch_my_Group isEqualTo [])) then {\"EPOCH_createGrp\"} else {\"Epoch_myGroup\"});" !="createDialog \"GroupRequests\";" !="_ok = createdialog \"MissionSelect\";" !="createDialog 'Skaronator_AdminMenu';" !="createDialog \"Epoch_myTempGroup\";" !="createDialog (if ((Epoch_my_tempGroupUID == \"\") && (Epoch_my_tempGroup isEqualTo [])) then {\"EPOCH_createTempGrp\"} else {\"Epoch_myTempGroup\"});" !="createDialog \"tempGroupRequests\";" 7 createDisplay !="createDisplay \"rmx_dynamenu\";" !="createDisplay \"rmx_moveDynamicHUD\";" !="_parent createdisplay _displayClass;" !="finddisplay 151 createdisplay 'RscDisplayOptionsLayout'" 7 deleteMarker !="deleteMarkerLocal _mName;" 7 setMarker !="CBA_fnc_setMarkerPersistent\"" !="\\fnc_setMarkerPersistent" !="\"setMarkerPersistent" !="_mName setMarkerShapeLocal _mShape;" !="_mName setMarkerTypeLocal _mType;" From f30582cc9f58556037497fc98c14337277feb8df Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Wed, 30 Aug 2017 14:30:27 -0500 Subject: [PATCH 7/7] Function name change and fix be filter --- Server_Install_Pack/sc/battleye/remoteexec.txt | 2 +- .../gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf | 2 +- Sources/epoch_config/Configs/CfgRemoteExec.hpp | 2 +- ...itePlayerTemp.sqf => EPOCH_server_invitePlayerTempGroup.sqf} | 2 +- Sources/epoch_server/config.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename Sources/epoch_server/compile/epoch_grouptemp/{EPOCH_server_invitePlayerTemp.sqf => EPOCH_server_invitePlayerTempGroup.sqf} (88%) diff --git a/Server_Install_Pack/sc/battleye/remoteexec.txt b/Server_Install_Pack/sc/battleye/remoteexec.txt index c44a7974..528a35aa 100644 --- a/Server_Install_Pack/sc/battleye/remoteexec.txt +++ b/Server_Install_Pack/sc/battleye/remoteexec.txt @@ -1 +1 @@ -5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_checkplayer \[[A-Z]{1} [A-Za-z]{4,10} [0-9]{1,3}-[0-9]{1,3}:[0-9]{1,3}( \(.+\)|) REMOTE\,[0-9]{1,3}]" !="epoch_server_(save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player(Temp)|(upgrade|updateplayer|create|delete)(Temp|)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]" +5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_checkplayer \[[A-Z]{1} [A-Za-z]{4,10} [0-9]{1,3}-[0-9]{1,3}:[0-9]{1,3}( \(.+\)|) REMOTE\,[0-9]{1,3}]" !="epoch_server_(save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player) \[.+\]" !="epoch_server_((upgrade|updateplayer|inviteplayer|create|delete)(Temp|)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]" diff --git a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf index 2a3cf0b0..9ac7c09e 100644 --- a/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf +++ b/Sources/epoch_code/gui/scripts/groupTemp/EPOCH_tempGroup_BtnInvite.sqf @@ -47,7 +47,7 @@ if (_playerUID == Epoch_my_tempGroupUID || {_x select 0 == _playerUID}count (_mo params ["_playerUID","_txt","_groupName"]; _ret = [_txt,"Epoch Temp Group Menu",true,true] call BIS_fnc_GUImessage; if (_ret) then { - [_playerUID,Epoch_my_tempGroupUID,_groupName,player,Epoch_personalToken] remoteExec ["EPOCH_server_invitePlayerTemp",2]; + [_playerUID,Epoch_my_tempGroupUID,_groupName,player,Epoch_personalToken] remoteExec ["EPOCH_server_invitePlayerTempGroup",2]; }; }; }; diff --git a/Sources/epoch_config/Configs/CfgRemoteExec.hpp b/Sources/epoch_config/Configs/CfgRemoteExec.hpp index 143592fa..f3b66253 100644 --- a/Sources/epoch_config/Configs/CfgRemoteExec.hpp +++ b/Sources/epoch_config/Configs/CfgRemoteExec.hpp @@ -321,7 +321,7 @@ class CfgRemoteExec allowedTargets = 2; jip = 0; }; - class EPOCH_server_invitePlayerTemp + class EPOCH_server_invitePlayerTempGroup { allowedTargets = 2; jip = 0; diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTemp.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTempGroup.sqf similarity index 88% rename from Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTemp.sqf rename to Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTempGroup.sqf index 2639e02e..624d1526 100644 --- a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTemp.sqf +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTempGroup.sqf @@ -10,7 +10,7 @@ Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike Github: - https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_inviteTempPlayer.sqf + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_invitePlayerTempGroup.sqf */ params ["_playerUID","_var1","_var2","_player",["_token","",[""]]]; if !([_player, _token] call EPOCH_server_getPToken) exitWith{}; diff --git a/Sources/epoch_server/config.cpp b/Sources/epoch_server/config.cpp index 4aefbf34..27ec0c30 100644 --- a/Sources/epoch_server/config.cpp +++ b/Sources/epoch_server/config.cpp @@ -32,7 +32,7 @@ class CfgServerFunctions class server_updatePlayerTempGroup {}; class server_createTempGroup {}; class server_deleteTempGroup {}; - class server_invitePlayerTemp {}; + class server_invitePlayerTempGroup {}; }; class epoch_bases { class swapBuilding {};