diff --git a/@AntistasiServerUtility/Addons/AntistasiServerUtility.pbo b/@AntistasiServerUtility/Addons/AntistasiServerUtility.pbo deleted file mode 100644 index ddecba6..0000000 Binary files a/@AntistasiServerUtility/Addons/AntistasiServerUtility.pbo and /dev/null differ diff --git a/AntistasiServerUtility/config.cpp b/AntistasiServerUtility/config.cpp index f6f9688..d4e70a7 100644 --- a/AntistasiServerUtility/config.cpp +++ b/AntistasiServerUtility/config.cpp @@ -4,11 +4,11 @@ class CfgPatches { // Meta information for editor name = "Antistasi Server Utility"; - author = "Sparker"; + author = "Initial author Sparker - modified by the official antistasi community"; url = ""; // Minimum compatible version. When the game's version is lower, pop-up warning will appear when launching the game. - requiredVersion = 1.60; + requiredVersion = 1.60; // Required addons, used for setting load order. // When any of the addons is missing, pop-up warning will appear when launching the game. requiredAddons[] = {}; @@ -30,11 +30,11 @@ class CfgFunctions file = "AntistasiServerUtility\fn_init.sqf"; preInit = 1; }; - + class onPlayerConnected { file = "AntistasiServerUtility\fn_onPlayerConnected.sqf"; }; }; }; -}; \ No newline at end of file +}; diff --git a/AntistasiServerUtility/fn_init.sqf b/AntistasiServerUtility/fn_init.sqf index 8f211b8..39d951b 100644 --- a/AntistasiServerUtility/fn_init.sqf +++ b/AntistasiServerUtility/fn_init.sqf @@ -1,31 +1,40 @@ diag_log "[ASU] Info: AntistasiServerUtility addon: init"; -ASU_serverMode = "NONE"; -ASU_TSChannelName = ""; // Name of the TFAR channel for this server +ASU_serverMode = "NONE"; // this sets the initial value for the servermode to NONE +ASU_TSChannelName = ""; // Name of the TFAR channel for this server - sets initial value to nill +ASU_TSChannelPassword = ""; // Password of the TFAR channel for this server - sets initial value to nill - added by Bob Murphy 31.03.2020 switch (serverName) do { // Tell me your name! // Hardcore server // Where is my RPG! - case "A3-Antistasi Official US 1 - hardcore": { - diag_log "[ASU] Info: hardcore server detected"; - ASU_serverMode = "HARDCORE"; - ASU_TSChannelName = "Task Force Radio US1"; + case "A3-Antistasi Official US 1 - hardcore": { //here has to be the exact name of the game-server + diag_log "[ASU] Info: hardcore server detected"; // this is a custom log line which you can adapt for your needs + ASU_serverMode = "HARDCORE"; // if set to "HARDCORE" this enables the settings in ASU_fnc_onPlayerConnected which can disable ingame channels + ASU_TSChannelName = "Task Force Radio US1"; //here has to be the exact name of the TS channel you intent to use as your radiochannel + ASU_TSChannelPassword = "123"; // added by Bob Murphy 31.03.2020 }; - + // Casual server // Don't shoot me or I will cry! - case "A3-Antistasi Official EU 2 - casual": { - ASU_serverMode = "CASUAL"; - ASU_TSChannelName = "Task Force Radio EU2"; - diag_log "[ASU] Info: casual server detected"; + case "A3-Antistasi Official EU 2 - casual": { //here has to be the exact name of the game-server + diag_log "[ASU] Info: casual server detected"; // this is a custom log line which you can adapt for your needs + ASU_serverMode = "CASUAL"; // if set to "HARDCORE" this enables the settings in ASU_fnc_onPlayerConnected which can disable ingame channels + ASU_TSChannelName = "Task Force Radio EU2"; //here has to be the exact name of the TS channel you intent to use as your radiochannel + ASU_TSChannelPassword = "123"; // added by Bob Murphy 31.03.2020 + }; + + default {diag_log format ["[ASU] Error: detected neither hardcore nor casual server! Server name: %1", serverName]; }; - - default {diag_log format ["[ASU] Error: detected neither hardcore nor casual server! Server name: %1", serverName]; }; }; if (ASU_TSChannelName != "") then { - tf_radio_channel_name = ASU_TSChannelName; + tf_radio_channel_name = ASU_TSChannelName; //for TFAR 0.9.12 + tf_radio_channel_password = ASU_TSChannelPassword; //for TFAR 0.9.12 + TFAR_Teamspeak_Channel_Name = ASU_TSChannelName; //for TFAR BETA + TFAR_Teamspeak_Channel_Password = ASU_TSChannelPassword; //for TFAR BETA + + }; -addMissionEventHandler ["PlayerConnected", ASU_fnc_onPlayerConnected]; \ No newline at end of file +addMissionEventHandler ["PlayerConnected", ASU_fnc_onPlayerConnected]; diff --git a/AntistasiServerUtility/fn_onPlayerConnected.sqf b/AntistasiServerUtility/fn_onPlayerConnected.sqf index 02dafd2..ff60430 100644 --- a/AntistasiServerUtility/fn_onPlayerConnected.sqf +++ b/AntistasiServerUtility/fn_onPlayerConnected.sqf @@ -10,7 +10,14 @@ params ["_id", "_uid", "_name", "_jip", "_owner", "_hasInterface"]; // Set TS3 channel name for auto move if (ASU_TSChannelName != "") then { - [missionNamespace, ["tf_radio_channel_name", ASU_TSChannelName]] remoteExecCall ["setVariable", _owner]; + [missionNamespace, ["tf_radio_channel_name", ASU_TSChannelName]] remoteExecCall ["setVariable", _owner]; //for TFAR 0.9.12 + [missionNamespace, ["TFAR_Teamspeak_Channel_Name", ASU_TSChannelName]] remoteExecCall ["setVariable", _owner]; //for TFAR BETA +}; + +//Set TS3 channel password for auto move - added by Bob Murphy 31.03.2020 +if (ASU_TSChannelName !="") then { + [missionNamespace, ["tf_radio_channel_password", ASU_TSChannelPassword]] remoteExecCall ["setVariable", _owner]; //for TFAR 0.9.12 + [missionNamespace, ["TFAR_Teamspeak_Channel_Password", ASU_TSChannelPassword]] remoteExecCall ["setVariable", _owner]; //for TFAR BETA }; //diag_log "Player connected!"; @@ -29,4 +36,4 @@ if (ASU_serverMode == "HARDCORE") then { 6-15 = Custom Radio (Is not supported by enableChannel) */ [0, false] remoteExecCall ["enableChannel", _owner]; -}; \ No newline at end of file +}; diff --git a/README.md b/README.md index a55cf44..8407954 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Antistasi Server Utility This is a server side addon we use to customize our servers a bit: set up proper teamspeak channels, disable global chat at the hardcore server, perform performance logging, etc. -This addon is probably of no ineterest for anyone else. +This addon is probably of no interest for anyone else. +The code is now compatible with TFAR 0.9.12 as well as TFAR BETA (updated and tested with version 1.-1.0.325) +