add initial files
This commit is contained in:
BIN
addons/17th_Connection/17th_ranger.paa
Normal file
BIN
addons/17th_Connection/17th_ranger.paa
Normal file
Binary file not shown.
5
addons/17th_Connection/BIS_AddonInfo.hpp
Normal file
5
addons/17th_Connection/BIS_AddonInfo.hpp
Normal file
@@ -0,0 +1,5 @@
|
||||
class BIS_AddonInfo
|
||||
{
|
||||
author="Gary Sinise";
|
||||
timepacked="1639750575";
|
||||
};
|
||||
48
addons/17th_Connection/config.cpp
Normal file
48
addons/17th_Connection/config.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include "BIS_AddonInfo.hpp"
|
||||
/*
|
||||
class CfgMainMenuSpotlight {
|
||||
class seventeenth_training_server {
|
||||
text = "seventeenth Ranger Battalion Training Range";
|
||||
textIsQuote = 0;
|
||||
picture = "\seventeenth_Fixes\seventeenth_ranger.paa";
|
||||
action = "connectToServer ['74.91.113.129', 2402, '']";
|
||||
actionText = "Connect";
|
||||
condition = true;
|
||||
};
|
||||
|
||||
class seventeenth_operations_server {
|
||||
text = "seventeenth Ranger Battalion Private Operations";
|
||||
textIsQuote = 0;
|
||||
picture = "seventeenth_Fixes\seventeenth_ranger.paa";
|
||||
action = "connectToServer ['74.91.113.129', 2302, '']";
|
||||
actionText = "Connect";
|
||||
condition = true;
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
class CfgPatches
|
||||
{
|
||||
class 17th_Connection
|
||||
{
|
||||
name = "17th Connection";
|
||||
author = "Gary";
|
||||
requiredVersion = ;
|
||||
requiredAddons[] = {};
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
};
|
||||
};
|
||||
class CfgFunctions {
|
||||
class 17th_es_core {
|
||||
class common {
|
||||
file = "\17th_Connection\functions\common";
|
||||
class connectToServer {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Config features/fixes
|
||||
#include "configs\CfgDirectConnect.hpp"
|
||||
|
||||
38
addons/17th_Connection/configs/CfgDirectConnect.hpp
Normal file
38
addons/17th_Connection/configs/CfgDirectConnect.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
Config: Direct Connect
|
||||
|
||||
Description:
|
||||
Registers direct connection tiles to the main menu spotlight.
|
||||
|
||||
Author:
|
||||
Gary
|
||||
Arend
|
||||
---------------------------------------------------------------------------- */
|
||||
class CfgMainMenuSpotlight {
|
||||
class seventeenth_es_miniOps_server {
|
||||
text = "17th Ranger Battalion Training Range";
|
||||
textIsQuote = 0;
|
||||
picture = "17th_Connection\17th_ranger.paa";
|
||||
action = "[""216.52.148.142"", 2402] call compile preprocessFileLineNumbers '\17th_Connection\functions\common\fn_connectToServer.sqf'";
|
||||
actionText = "Connect";
|
||||
condition = true;
|
||||
};
|
||||
|
||||
class seventeenth_es_public_server {
|
||||
text = "17th Ranger Battalion Private Operations";
|
||||
textIsQuote = 0;
|
||||
picture = "17th_Connection\17th_ranger.paa";
|
||||
action = "[""216.52.148.142"", 2302] call compile preprocessFileLineNumbers '\17th_Connection\functions\common\fn_connectToServer.sqf'";
|
||||
actionText = "Connect";
|
||||
condition = true;
|
||||
};
|
||||
|
||||
class seventeenth_es_persistence_server {
|
||||
text = "17th Ranger Battalion Persistence Server";
|
||||
textIsQuote = 0;
|
||||
picture = "17th_Connection\17th_ranger.paa";
|
||||
action = "[""216.52.148.142"", 2502] call compile preprocessFileLineNumbers '\17th_Connection\functions\common\fn_connectToServer.sqf'";
|
||||
actionText = "Connect";
|
||||
condition = true;
|
||||
};
|
||||
};
|
||||
100
addons/17th_Connection/functions/common/fn_connectToServer.sqf
Normal file
100
addons/17th_Connection/functions/common/fn_connectToServer.sqf
Normal file
@@ -0,0 +1,100 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: seventeenth_es_core_fnc_connectToServer
|
||||
|
||||
Description:
|
||||
Direct Connect to a server using connection details defined in
|
||||
`\x\seventeenth_es\core\config.cpp`
|
||||
|
||||
Parameters:
|
||||
0: _address - Server address to connect to <STRING>
|
||||
1: _port - Server port to connect to <NUMBER>
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Examples:
|
||||
["2seventeenth.eu", 2302] call seventeenth_es_core_fnc_connectToServer;
|
||||
|
||||
Author:
|
||||
Gary
|
||||
Arend
|
||||
McDiod
|
||||
DerZade
|
||||
Salbei
|
||||
---------------------------------------------------------------------------- */
|
||||
params [["_address", "arma.gruppe-adler.de", [""]], ["_port", 2302, [0]]];
|
||||
|
||||
#include "\A3\Ui_f\hpp\defineResincl.inc";
|
||||
#define UI_DIRECTCONNECTTIMEOUT 5
|
||||
|
||||
diag_log (format ["Attempting direct connect to %1:%2", _address, _port]);
|
||||
seventeenth_es_directConnectAddress = _address;
|
||||
seventeenth_es_directConnectPort = _port;
|
||||
|
||||
onEachFrame {
|
||||
seventeenth_es_directConnectStartTime = diag_tickTime;
|
||||
|
||||
_displayMain = findDisplay IDD_MAIN;
|
||||
_ctrlServerBrowser = _displayMain displayCtrl IDC_MAIN_MULTIPLAYER;
|
||||
ctrlActivate _ctrlServerBrowser;
|
||||
|
||||
onEachFrame {
|
||||
ctrlActivate (findDisplay IDD_MULTIPLAYER displayCtrl IDC_MULTI_TAB_DIRECT_CONNECT);
|
||||
|
||||
onEachFrame {
|
||||
_ctrlServerAddress = findDisplay IDD_IP_ADDRESS displayCtrl 2300;
|
||||
_ctrlServerAddress controlsGroupCtrl IDC_IP_ADDRESS ctrlSetText seventeenth_es_directConnectAddress;
|
||||
|
||||
_ctrlServerAddress controlsGroupCtrl IDC_IP_PORT ctrlSetText str seventeenth_es_directConnectPort;
|
||||
|
||||
ctrlActivate (_ctrlServerAddress controlsGroupCtrl IDC_OK);
|
||||
|
||||
onEachFrame {
|
||||
_ctrlServerList = findDisplay IDD_MULTIPLAYER displayCtrl IDC_MULTI_SESSIONS;
|
||||
|
||||
for "_i" from 0 to ((lbSize _ctrlServerList) - 1) do {
|
||||
([_ctrlServerList lbText _i,_ctrlServerList lbData _i]) call {
|
||||
params [["_serverName", ""], ["_serverData", ""]];
|
||||
|
||||
if (diag_tickTime > (seventeenth_es_directConnectStartTime + UI_DIRECTCONNECTTIMEOUT)) exitWith {
|
||||
diag_log (format ["Direct connect on %1:%2 timed out", seventeenth_es_directConnectAddress, seventeenth_es_directConnectPort]);
|
||||
onEachFrame {};
|
||||
};
|
||||
|
||||
if (_serverData isEqualTo format ["%1:%2", seventeenth_es_directConnectAddress, seventeenth_es_directConnectPort]) exitWith {
|
||||
findDisplay IDD_MULTIPLAYER displayCtrl IDC_MULTI_SESSIONS lbSetCurSel _i;
|
||||
|
||||
onEachFrame {
|
||||
ctrlActivate (findDisplay IDD_MULTIPLAYER displayCtrl IDC_MULTI_JOIN);
|
||||
|
||||
onEachFrame {
|
||||
if (diag_tickTime > seventeenth_es_directConnectStartTime + UI_DIRECTCONNECTTIMEOUT) then {
|
||||
diag_log (format ["Direct connect on %1:%2 timed out", seventeenth_es_directConnectAddress, seventeenth_es_directConnectPort]);
|
||||
onEachFrame {};
|
||||
};
|
||||
|
||||
if (!isNull findDisplay IDD_PASSWORD) then {
|
||||
private _display = findDisplay IDD_PASSWORD;
|
||||
private _passwordEditBoxCtrl = _display displayCtrl IDC_PASSWORD;
|
||||
|
||||
// No password saved by CBA --> abort here so user can enter password
|
||||
if (!isNull _passwordEditBoxCtrl && {ctrlText _passwordEditBoxCtrl == ""}) exitWith {
|
||||
onEachFrame {};
|
||||
};
|
||||
|
||||
ctrlActivate (_display displayCtrl IDC_OK);
|
||||
};
|
||||
|
||||
if (getClientStateNumber >= 3) then {
|
||||
diag_log (format ["Direct connect on %1:%2 successful", seventeenth_es_directConnectAddress, seventeenth_es_directConnectPort]);
|
||||
onEachFrame {};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user