Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup network component #481

Merged
merged 2 commits into from
Aug 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions addons/network/CfgEventHandlers.hpp

This file was deleted.

52 changes: 12 additions & 40 deletions addons/network/CfgFunctions.hpp
Original file line number Diff line number Diff line change
@@ -1,44 +1,16 @@
// -----------------------------------------------------------------------------
// Automatically generated by 'functions_config.rb'
// DO NOT MANUALLY EDIT THIS FILE!
// -----------------------------------------------------------------------------

class CfgFunctions
{
class CBA
{
class Network
{
// CBA_fnc_globalExecute
class globalExecute
{
description = "Executes code on given destinations";
file = "\x\cba\addons\network\fnc_globalExecute.sqf";
};
// CBA_fnc_globalSay
class globalSay
{
description = "Says sound on all client computer";
file = "\x\cba\addons\network\fnc_globalSay.sqf";
};
// CBA_fnc_globalSay3d
class globalSay3d
{
description = "Says sound on all client computer in 3d";
file = "\x\cba\addons\network\fnc_globalSay3d.sqf";
};
// CBA_fnc_publicVariable
class publicVariable
{
description = "CBA_fnc_publicVariable does only broadcast the new value if it doesn't exist in missionNamespace or the new value is different to the one in missionNamespace. Checks also for different types. Nil as value gets always broadcasted.";
file = "\x\cba\addons\network\fnc_publicVariable.sqf";
};
// CBA_fnc_setVarNet
class setVarNet
{
description = "Same as setVariable [""name"",var, true] but only broadcasts when the value of var is different to the one which is already saved in the variable space. Checks also for different types. Nil as value gets always broadcasted.";
file = "\x\cba\addons\network\fnc_setVarNet.sqf";
};
#define F_FILEPATH(func) class func {\
file = QUOTE(PATHTOF(DOUBLES(fnc,func).sqf));\
}

class CfgFunctions {
class CBA {
class Network {
F_FILEPATH(globalExecute);
F_FILEPATH(globalSay);
F_FILEPATH(globalSay3d);
F_FILEPATH(publicVariable);
F_FILEPATH(setVarNet);
};
};
};
8 changes: 8 additions & 0 deletions addons/network/CfgSettings.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

class CfgSettings {
class CBA {
class COMPONENT {
disableGlobalExecute = 0;
};
};
};
66 changes: 0 additions & 66 deletions addons/network/XEH_preInit.sqf

This file was deleted.

14 changes: 4 additions & 10 deletions addons/network/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@ class CfgPatches {
name = CSTRING(component);
url = "$STR_CBA_URL";
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "CBA_common", "CBA_events" };
requiredAddons[] = {"CBA_common", "CBA_events"};
version = VERSION;
authors[] = {"Sickboy"};
};
};

class CfgSettings {
class CBA {
class COMPONENT {
disableGlobalExecute = 0;
};
};
};

#include "CfgEventHandlers.hpp"
#include "CfgFunctions.hpp"

#include "CfgSettings.hpp"
25 changes: 9 additions & 16 deletions addons/network/fnc_globalExecute.sqf
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/*
/* ----------------------------------------------------------------------------
Function: CBA_fnc_globalExecute

DEPRECATED. Use <remoteExec at https://community.bistudio.com/wiki/remoteExec> instead.

Description
Description:
Executes code on given destinations.

DEPRECATED. Use <remoteExec at https://community.bistudio.com/wiki/remoteExec> instead.

Parameters:
_channel - All: -2, ClientsOnly: -1, ServerOnly: 0 [Integer]
_code - Code to execute [Code]
_parameters - OPTIONAL. Parameter to pass to the code in the _this variables [Any]
_channel - All: -2, ClientsOnly: -1, ServerOnly: 0 <NUMBER>
_code - Code to execute <CODE>
_parameters - Parameter to pass in the _this variable. (optional) <ANY>

Returns:
Magazine of the units binocular <STRING>

Example:
(begin example)
Expand All @@ -20,17 +21,9 @@ Example:

Author:
Sickboy, commy2
*/
---------------------------------------------------------------------------- */
#include "script_component.hpp"

#define CBA_SEND_TO_ALL -2
#define CBA_SEND_TO_CLIENTS_ONLY -1
#define CBA_SEND_TO_SERVER_ONLY 0

#define BI_SEND_TO_ALL 0
#define BI_SEND_TO_CLIENTS_ONLY -2
#define BI_SEND_TO_SERVER_ONLY 2

params [["_channel", CBA_SEND_TO_ALL, [CBA_SEND_TO_ALL]], ["_code", {}, [{}]], ["_parameters", []]];

// translate CBA channel to BI channel
Expand Down
15 changes: 8 additions & 7 deletions addons/network/fnc_globalSay.sqf
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/*
/* ----------------------------------------------------------------------------
Function: CBA_fnc_globalSay

DEPRECATED. Use <remoteExec at https://community.bistudio.com/wiki/remoteExec> ["say"] instead.

Description:
Says sound on all client computer.
Says sound on all clients.

DEPRECATED. Use <remoteExec at https://community.bistudio.com/wiki/remoteExec> ["say"] instead.

Parameters:
[_objects] - Array of Objects that perform Say [Object]
_say - [sound, maxTitlesDistance,speed] or "sound" [Array or String]
_objects - Object or array of objects that perform Say <OBJECT, ARRAY>
_params - [sound, maxTitlesDistance,speed] or "sound" <ARRAY, STRING>

Returns:
Nothing

Example:
(begin example)
Expand All @@ -19,7 +20,7 @@ Example:

Author:
Sickboy, commy2
*/
---------------------------------------------------------------------------- */
#include "script_component.hpp"

params [["_objects", [], [[], objNull]], ["_params", "", ["", []]]];
Expand Down
17 changes: 9 additions & 8 deletions addons/network/fnc_globalSay3d.sqf
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/*
/* ----------------------------------------------------------------------------
Function: CBA_fnc_globalSay3d

DEPRECATED. Use <remoteExec at https://community.bistudio.com/wiki/remoteExec> ["say3D"] instead.

Description:
Says sound on all client computer in 3D.
Says sound on all clients in 3D.

DEPRECATED. Use <remoteExec at https://community.bistudio.com/wiki/remoteExec> ["say3D"] instead.

Parameters:
_object - Object that performs Say [Object] can also be _array - [object, targetObject]
_speechName - Speechname
_range - (Optional parameter) maximum distance from camera to execute command [Number]
_objects - Object or array of objects that perform Say <OBJECT, ARRAY>
_params - [sound, maxTitlesDistance,speed] or "sound" <STRING, ARRAY>
_range - Maximum distance from camera to execute command (optional) <NUMBER>

Returns:
Nothing

Example:
(begin example)
Expand All @@ -20,7 +21,7 @@ Example:

Author:
Sickboy, commy2
*/
---------------------------------------------------------------------------- */
#include "script_component.hpp"

params [["_objects", [], [[], objNull]], ["_params", "", ["", []]], ["_distance", nil, [0]]];
Expand Down
8 changes: 8 additions & 0 deletions addons/network/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@
#endif

#include "\x\cba\addons\main\script_macros.hpp"

#define CBA_SEND_TO_ALL -2
#define CBA_SEND_TO_CLIENTS_ONLY -1
#define CBA_SEND_TO_SERVER_ONLY 0

#define BI_SEND_TO_ALL 0
#define BI_SEND_TO_CLIENTS_ONLY -2
#define BI_SEND_TO_SERVER_ONLY 2