Skip to content

Commit 791c24f

Browse files
authored
Merge pull request #122 from GNCLORD-MDB/Optimierungen_Servermod
* Doppelte Logeinträge in der Statistik * GPS auf Statische Marker Erstellung ändern mit +10 Puffer am Markern. * GPS auf Modus 2 Fix setzen. * initxxxx Funktionen auf Doppellauf Server/Client kontrollieren. * Cargo Sani LKW nachtragen * Fix Erfassung Fall und Stoßschaden Revive * Fix richtige Gegner Meldung bei unbekannt Quelle
2 parents 0cd9525 + f5248e1 commit 791c24f

19 files changed

+86
-125
lines changed

addons/OPT/CARGO/fn_Init.sqf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,4 @@
2828
*/
2929
#include "macros.hpp"
3030

31-
/* INITIALIZE GLOBAL VARS*/
32-
GVAR(canTransportCargo) = []; // holds cargo definitions for all objects with cargo space
33-
GVAR(canBeTransported) = []; // holds all objects that can be transported
34-
GVAR(canBeDragged) = []; // holds all objects that can be dragged
35-
GVAR(canBeCarried) = []; // holds all objects that can be carried
3631

37-
[] call FUNC(setupCargoSpaceAndSize);
38-
39-
[] call FUNC(cbaclassevents);

addons/OPT/CARGO/fn_clientInit.sqf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,14 @@
3737
missionNamespace setVariable ["ACE_maxWeightCarry", OPT_CARGO_ACE_maxWeightCarry];
3838
missionNamespace setVariable ["ACE_maxWeightDrag", OPT_CARGO_ACE_maxWeightDrag];
3939

40+
/* INITIALIZE GLOBAL VARS*/
41+
GVAR(canTransportCargo) = []; // holds cargo definitions for all objects with cargo space
42+
GVAR(canBeTransported) = []; // holds all objects that can be transported
43+
GVAR(canBeDragged) = []; // holds all objects that can be dragged
44+
GVAR(canBeCarried) = []; // holds all objects that can be carried
45+
46+
[] call FUNC(setupCargoSpaceAndSize);
47+
48+
[] call FUNC(cbaclassevents);
49+
4050
}] call CFUNC(addEventhandler);

addons/OPT/CARGO/fn_setupcargospaceandsize.sqf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ GVAR(canTransportCargo) =
167167
["OPT_O_T_Truck_02_box_F", 2], // Zamack Repair
168168
["OPT_O_T_Truck_02_ammo_F", 2], // Zamack Ammo
169169
["OPT_O_T_Truck_02_fuel_F", 2], // Zamack Fuel
170+
["OPT_O_T_Truck_02_Medical_F", 2], // Zamack Medical
170171

171172
// CSAT Armored
172173
["OPT4_O_MRAP_02_gmg_F", 4], // Ifrit GMG
@@ -240,6 +241,7 @@ GVAR(canTransportCargo) =
240241
["OPT_I_Truck_02_transport_F", 10], // Zamak
241242
["OPT_I_Truck_02_ammo_F", 2], // Zamak Ammo
242243
["OPT_I_Truck_02_fuel_F", 2], // Zamak Fuel
244+
["OPT_I_Truck_02_medical_F", 2], // Zamak Medical
243245
// AAF Choppers
244246
["OPT_I_Heli_light_03_F", 4], // WY-55 Hellcat
245247
["OPT_I_Heli_light_03_v2_F", 4], // WY-55 Hellcat Cas Light

addons/OPT/CfgCLibLocalisation.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ class CfgCLibLocalisation {
121121
English = "self-caused";
122122
German = "Selbstverschulden";
123123
};
124+
class KILL_UNKNOWN {
125+
English = "unknown";
126+
German = "Unbekannt";
127+
};
124128
class FIRST_AID {
125129
English = "First Aid";
126130
German = "Erste Hilfe";

addons/OPT/FIELDREPAIR/fn_clientcbaclassevents.sqf renamed to addons/OPT/FIELDREPAIR/fn_clientInitcbaclassevents.sqf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
["LandVehicle", "init",
1818
{
1919
params ["_vec"];
20-
20+
2121
_vec addAction [
2222
format["<t color=""#ff0000"">%1</t>", MLOC(FIELD_REPAIR)],
2323
{[_this select 0] call FUNC(repairVehicle)},
@@ -26,19 +26,19 @@
2626
false,
2727
true,
2828
'',
29-
QUOTE([_target] call FUNC(needRepair)),
29+
format["[_target] call %1", QFUNC(needRepair)],
3030
10
3131
];
3232

3333
_vec addAction [
34-
format["<t color=""#ff0000"">%1</t>", MLOC(FIELD_REPAIR)],
34+
format["<t color=""#ff0000"">%1</t>", MLOC(FIELD_REFUEL)],
3535
{[_this select 0] call FUNC(refuelVehicle)},
3636
[],
3737
-1,
3838
false,
3939
true,
4040
'',
41-
QUOTE([_target] call FUNC(vehicleNoFuel)),
41+
format["[_target] call %1", QFUNC(vehicleNoFuel)],
4242
10
4343
];
4444

@@ -83,7 +83,7 @@
8383
false,
8484
true,
8585
'',
86-
QUOTE([_target] call FUNC(needRepair)),
86+
format["[_target] call %1", QFUNC(needRepair)],
8787
10
8888
];
8989

@@ -95,7 +95,7 @@
9595
false,
9696
true,
9797
'',
98-
QUOTE([_target] call FUNC(vehicleNoFuel)),
98+
format["[_target] call %1", QFUNC(vehicleNoFuel)],
9999
10
100100
];
101101

@@ -110,4 +110,5 @@
110110
format["_truck = vehicle _this; ([_target] call %1 || damage _target > 0.01) and _truck getVariable ['%2', -1] > 0 and {alive _target} and {speed _truck < 3} and (_truck distance _target) < 20", QFUNC(vehicleDamagedLight), QGVAR(repair_cargo)
111111
]
112112
];
113-
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
113+
114+
}, nil, nil, true] call CBA_fnc_addClassEventHandler;

addons/OPT/GPS/fn_gps.sqf

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -24,63 +24,34 @@
2424

2525
#include "macros.hpp";
2626

27-
GVAR(officer) = [
28-
"OPT_NATO_Offizier_T",
29-
"OPT_CSAT_Offizier_T",
30-
"OPT_NATO_Offizier",
31-
"OPT_CSAT_Offizier",
32-
"I_officer_F"
33-
];
34-
35-
// default GPS mode: all squad units are visible
36-
// Auf Wunsch der Comm solle alle alle sehen können, Normal Modus ist GVAR(mode) = 1;
37-
GVAR(mode) = 2;
38-
39-
// GPS mode: all units are visible in mode 2
40-
if (typeOf player in GVAR(officer)) then
41-
{
42-
GVAR(mode) = 2;
27+
//Erfassung der Einheiten beim Start
4328

44-
};
29+
GVAR(unitnumber) = (count units Side player)+10;
4530

46-
//Erfassung der Einheiten beim Start
4731
GVAR(unitsToMark) = [];
48-
GVAR(unitsToMark) = [] call FUNC(selectUnits);
4932

5033
//Marker erstellen für die Spieler
5134
GVAR(markerPool) = [];
5235

53-
for "_i" from 1 to (count GVAR(unitsToMark)) do
54-
{
55-
GVAR(markerPool) pushBack ([PLAYERSIDE, _i] call FUNC(createUnitMarker));
56-
};
36+
for "_i" from 1 to GVAR(unitnumber) do
37+
{
38+
GVAR(markerPool) pushBack ([PLAYERSIDE, _i] call FUNC(createUnitMarker));
39+
};
5740

5841
// create special local player marker
59-
GVAR(markerplayer) = [];
6042
GVAR(markerplayer) = [] call FUNC(createPlayerMarker);
6143

6244
//
6345
[{
64-
private _markerplayer = [];
6546
private _unitsToMark = [];
47+
48+
{
49+
if (side _x == playerSide) then
50+
{
51+
_unitsToMark pushBack _x;
6652

67-
//Erneuerung der Spielererfassung
68-
_unitsToMark = [] call FUNC(selectUnits);
69-
70-
//Vergleich ob mehr Spieler da sind als Marker vonhanden
71-
//bei mehr Spieler als Marker vorhanden sind, neue Marker erstellen
72-
if ((count _unitsToMark) > (count GVAR(unitsToMark))) then
73-
{
74-
private _neuemarker = 0;
75-
_neuemarker = (count _unitsToMark) - (count GVAR(unitsToMark));
76-
77-
for "_i" from 1 to (_neuemarker) do
78-
{
79-
GVAR(markerPool) pushBack ([PLAYERSIDE, ((count GVAR(unitsToMark))+_i)] call FUNC(createUnitMarker));
80-
};
81-
82-
GVAR(unitsToMark) = _unitsToMark;
83-
};
53+
};
54+
} foreach allUnits;
8455

8556
GVAR(markerPool) apply
8657
{

addons/OPT/GPS/fn_gps_Unconscious.sqf

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@
2424

2525
#include "macros.hpp";
2626

27-
GVAR(unitsToMarkisUnconsciousold) = [];
2827
GVAR(markerPoolisUnconscious) = [];
2928

29+
GVAR(unitnumberUnconscious) = (count units Side player)+10;
30+
31+
for "_i" from 1 to (GVAR(unitnumberUnconscious)) do
32+
{
33+
GVAR(markerPoolisUnconscious) pushBack ([PLAYERSIDE, _i] call FUNC(createunitmarker_Unconscious));
34+
};
35+
3036
//Seitenabfrage des Spieler per config
3137
//Bei ACE Medic wird Spieler zu CIV seite bei Side Abfrage
3238
//_sidesoldat =getnumber (configFile >> "CfgVehicles" >> (typeof player) >> "side");
@@ -48,21 +54,6 @@ GVAR(markerPoolisUnconscious) = [];
4854
};
4955
} foreach playableUnits;
5056

51-
//Vergleich ob mehr Spieler da sind als Marker vonhanden
52-
//bei mehr Spieler als Marker vorhanden sind, neue Marker erstellen
53-
if ((count _unitsToMarkisUnconscious) > (count GVAR(unitsToMarkisUnconsciousold))) then
54-
{
55-
private _neuemarker = 0;
56-
_neuemarker = (count _unitsToMarkisUnconscious) - (count GVAR(unitsToMarkisUnconsciousold));
57-
58-
for "_i" from 1 to (_neuemarker) do
59-
{
60-
GVAR(markerPoolisUnconscious) pushBack ([PLAYERSIDE, ((count _unitsToMarkisUnconscious)+_i)] call FUNC(createunitmarker_Unconscious));
61-
};
62-
63-
GVAR(unitsToMarkisUnconsciousold) = _unitsToMarkisUnconscious;
64-
};
65-
6657
GVAR(markerPoolisUnconscious) apply
6758
{
6859
_x setMarkerTextLocal "";

addons/OPT/REVIVE/fn_clientInitEH.sqf

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ DFUNC(playercheckINCAPACITATED) =
101101
if (GVAR(playerHandleDamage_unit) == GVAR(playerHandleDamage_source)) then
102102
{
103103
[MLOC(KILL_MSG), MLOC(KILL_SELF)] spawn BIS_fnc_infoText;
104-
}
105-
else
106-
{
104+
};
105+
if (isNull GVAR(playerHandleDamage_source) or isNil QGVAR(playerHandleDamage_source)) then
106+
{
107+
[MLOC(KILL_MSG), MLOC(KILL_UNKNOWN)] spawn BIS_fnc_infoText;
108+
};
109+
if ((GVAR(playerHandleDamage_unit) != GVAR(playerHandleDamage_source)) and not(isNull GVAR(playerHandleDamage_source) or isNil QGVAR(playerHandleDamage_source))) then
110+
{
107111
[MLOC(KILL_MSG), format["%1",name GVAR(playerHandleDamage_instigator)]] spawn BIS_fnc_infoText;
108-
109112
};
110113

111114
//Funktion starten wenn Spieler bewustlos ist.
@@ -128,11 +131,11 @@ DFUNC(playerHandleDamage) =
128131

129132
private _resultingDamage = _damage;
130133

131-
if (getDammage _unit >= 0.65) then
134+
if ((getDammage _unit >= 0.65) or (_damage >= GVAR(MAX_DAMAGE))) then
132135
{
133136
[FUNC(playercheckINCAPACITATED), 1,""] call CLib_fnc_wait;
134-
};
135-
137+
};
138+
136139
if (_damage >= GVAR(MAX_DAMAGE)) then
137140
{
138141
// Player will be "down" from this point on.
File renamed without changes.

addons/OPT/SHOP/fn_Init.sqf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Description:
3+
* Initializes Vars für Client und Server
4+
*
5+
* Author:
6+
* [GNC]Lord-MDB
7+
*
8+
* Arguments:
9+
*
10+
* Return Value:
11+
*
12+
* Server Only:
13+
* no
14+
*
15+
* Global:
16+
* yes
17+
*
18+
* API:
19+
* No
20+
*
21+
* Example:
22+
*/
23+
24+
25+
#include "macros.hpp"
26+
27+
//Dateneinlesen
28+
[] call FUNC(config);

0 commit comments

Comments
 (0)