Bug #12526

1.0.0.24 - addPublicVariableEventHandler adds a new scope like EH, but not yet implemented

Added by kju over 4 years ago. Updated over 4 years ago.

Status:Closed Start date:07/31/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:1.0.0.36
Affected Version:

0004.jpg (258.1 kB) kju, 08/03/2010 10:12

History

Updated by sbsmac over 4 years ago

  • Status changed from New to Resolved
  • Target version set to 1.0.0.35

SHould now be fixed

Updated by kju over 4 years ago

  • Status changed from Resolved to Feedback

Still not (fully) working here. Some vars are not noted.

ColumnHeader: Text: Error

  1 //-- CODEWINDOW
  2 // Called by        :    ArmA thread launcher at start of game 
  3 // Function area    :    server initialization 
  4 
  5 // Description 
  6 // Initialization of server only code. 
  7 
  8 #include "globalDefines.hpp" 
  9 
 10 private["_hour","_minute"];//"_logicCenter","_logicGroup","_logic" 
 11 
 12 // ---------------------------------------------------------------------------- 
 13 //                            GLOBALS 
 14 // ---------------------------------------------------------------------------- 
 15 
 16 //----------------- prepare critical data required by other sources ----------- 
 17 
 18 // create public/global logic to store public setVariable data on it 
 19 //private["_logicCenter","_logicGroup","_logic"]; 
 20 //_logicCenter = createCenter sideLogic; 
 21 //_logicGroup = createGroup _logicCenter; 
 22 //public AAS_ClassLimitArrayLogic = _logicGroup createUnit ["LOGIC",[10,10,10],[],0,""]; 
 23 
 24 //publicVariable "AAS_ClassLimitArrayLogic"; 
 25 //sleep 0.01; 
 26 //AAS_ClassLimitArrayLogic setVariable ["AAS_ClassChangeLocked",false,true]; 
 27 
 28 //publish list of initial players with class set to default (0) 
 29 #include "sSetDefaultPlayerClass.sqf" 
 30 publicVariable "AAS_PlayerClassesWest"; 
 31 publicVariable "AAS_PlayerClassesEast"; 
 32 
 33 //------------------------------- normal data --------------------------------- 
 34 
 35 // multiplier to change base capture speed 
 36 int AAS_CaptureSpeedFactor = AAS_Params_ZoneCaptureSpeedFactor; 
 37 if (AAS_EditorModeSP) then {AAS_CaptureSpeedFactor = 20;}; 
 38 
 39 // dummy position for disconnected cleanup 
 40 if (isDedicated) then 
 41 { 
 42     pos AAS_MyRespawnZone = [10,10,1000]; 
 43 }; 
 44 
 45 // Set up the hour of day to AAS_Params_HourOfDay or something random 
 46 _hour = AAS_DEFAULT_TIME_HOUR; 
 47 if (AAS_Params_HourOfDay > 0) then {_hour = AAS_Params_HourOfDay;}; 
 48 if (AAS_Params_HourOfDay < 0) then {_hour = floor(random 24);}; 
 49 
 50 // Set up the minute of day to AAS_Params_MinuteOfDay or something random 
 51 _minute = AAS_DEFAULT_TIME_MINUTE; 
 52 if (AAS_Params_MinuteOfDay > 0) then {_minute = AAS_Params_MinuteOfDay;}; 
 53 if (AAS_Params_MinuteOfDay < 0) then {_minute = floor(random 24);}; 
 54 
 55 // apply time setting 
 56 if (isNil "_hour") then {_hour = 12;}; 
 57 if (isNil "_minute") then {_minute = 0;}; 
 58 setDate [(date select 0),(date select 1),(date select 2),_hour,_minute]; 
 59 
 60 // Set up the weather to AAS_Params_Weather or something random 
 61 AAS_GlobalOvercast = switch (AAS_Params_Weather) do 
 62 { 
 63     case -1:    {random floor (101)}; 
 64     case 1:        {0}; 
 65     case 2:        {0.25}; 
 66     case 3:        {0.55}; 
 67     case 4:        {0.85}; 
 68     case 5:        {1}; 
 69     default        {-1}; 
 70 }; 
 71 if (AAS_GlobalOvercast == 1) then {AAS_GlobalRain = 1;}; 
 72 
 73 // Set up the fog to AAS_Params_Fog or something random 
 74 AAS_GlobalFog = switch (AAS_Params_Fog) do 
 75 { 
 76     case -1:    {random floor (101)}; 
 77     case 1:        {0}; 
 78     case 2:        {0.25}; 
 79     case 3:        {0.5}; 
 80     case 4:        {0.75}; 
 81     case 5:        {1}; 
 82     default        {-1}; 
 83 }; 
 84 
 85 // ----------- broadcast weather ----------- 
 86 
 87 if (AAS_GlobalOvercast != -1) then {publicVariable "AAS_GlobalOvercast";}; 
 88 if (AAS_GlobalRain != -1) then {publicVariable "AAS_GlobalRain";}; 
 89 if (AAS_GlobalFog != -1) then {publicVariable "AAS_GlobalFog";}; 
 90 
 91 0 setOvercast AAS_GlobalOvercast; 
 92 0 setRain AAS_GlobalRain; 
 93 0 setFog AAS_GlobalFog; 
 94 
 95 //--------------------------- misc -------------------------------------------- 
 96 
 97 // set JIP handlers and handle history 
 98 PlayerConnected = false; 
 99 onPlayerConnected {[_name,_id,_uid] execVM 'sPlayerConnected.sqf';}; 
100 onPlayerDisconnected {[_name,_id,_uid] execVM 'sPlayerDisconnected.sqf';}; 
101 
102 // calc player history 
103 [] execVM "sPlayerHistory.sqf"; 
104 
105 //------------------ mission side features ------------------------------------ 
106 
107 // bon_artillery 
108 [] execVM "features\bon_artillery\bon_arti_initServer.sqf"; 
109 
110 // UPSMON 
111 if (AAS_Params_AISupportMode != SUPPORT_OFF) then 
112 { 
113     [] execVM "features\UPSMON\Init_UPSMON.sqf"; 
114 }; 
115 
116 //--------------------------- setup class limit system ------------------------ 
117 
118 "AAS_PublicPlayerClassesSync" addPublicVariableEventHandler 
119 { 
120     _playerQID = (_this select 1) select 0; 
121     _class = (_this select 1) select 1; 
122     _side = (_this select 1) select 2; 
123     switch (_side) do 
124     { 
125         //0 is default class at mission start 
126         case west:    {AAS_PlayerClassesWest set [_playerQID,_class];}; 
127         case east:    {AAS_PlayerClassesEast set [_playerQID,_class];}; 
128     }; 
129 }; 
130 "AAS_PlayerTransmitCmd" addPublicVariableEventHandler 
131 { 
132     _playerQId = (_this select 1) select 0; 
133     _type = (_this select 1) select 1; 
134     _data = (_this select 1) select 2; 
135     _side = (_this select 1) select 3; 
136     [_playerQId,_type,_data,_side] spawn AAS_fnc_sHandleSpawnInstructions; 
137 }; 
138 "AAS_PlayerRequestsZoneUpdate" addPublicVariableEventHandler 
139 { 
140     [true] spawn AAS_fnc_sPackStateSAAS; 
141 }; 
142 
143 //----------------------------------------------------------------------------- 
144 
145 AAS_PostBriefing = true; 
146 
147 [] execVM "sMainThread.sqf";

//-- ERRORWINDOW
Change/Insert 'private' array here?
'_class' assigned to without being declared private (may corrupt outer variable)
'_side' assigned to without being declared private (may corrupt outer variable)
'_type' assigned to without being declared private (may corrupt outer variable)
'_data' assigned to without being declared private (may corrupt outer variable)

//-- CURRENTERROR

    _class
'_class' assigned to without being declared private (may corrupt outer variable)
VARNAME _class

Updated by kju over 4 years ago

Updated by sbsmac over 4 years ago

Hmm - looks like I have introduced another bug which is causing this and the other issues you are seeing. Could you send me a copy of globaldefines.hpp ? Alternatively if you switch the view to preproprocessed mode before submitting the bug report all included files are expanded in the bug-report.

Updated by sbsmac over 4 years ago

  • Status changed from Feedback to Resolved
  • Target version changed from 1.0.0.35 to 1.0.0.36

Should now be fixed - just forgot to add addpublicvariableeventhandler to the list of eventhandlers

Updated by kju over 4 years ago

  • Status changed from Resolved to Closed

works. ty

Also available in: Atom PDF