12 protected BunkerBroadcastConfigInstance
m_Config;
84 int year, month, day, hour, minute;
85 GetGame().GetWorld().GetDate(year, month, day, hour, minute);
88 int now = hour * 60 + minute;
90 foreach (BunkerBroadcastPeriod period :
m_Config.schedulerSettings.periods)
92 int start = period.GetStartHour() * 60 + period.GetStartMinute();
93 int end = period.GetEndHour() * 60 + period.GetEndMinute();
100 active = (now >= start) && (now <= end);
102 else if (start > end)
105 active = (now >= start) || (now <= end);
141 int timeTrackerDeltaMinutes;
159 #ifdef ENABLE_LOGGING
160 Log(
"Enforcing batch selection - inactivity");
206 TIntArray xCoords = mapCoords.Slice(0, 2);
207 TIntArray yCoords = mapCoords.Slice(3, 5);
210 foreach(
int ix : xCoords)
211 xCoordsString.Insert(ix.ToString());
213 foreach(
int iy : yCoords)
214 yCoordsString.Insert(iy.ToString());
216 string mapCoordsConverted;
217 mapCoordsConverted =
string.
Join(
"", xCoordsString);
218 mapCoordsConverted +=
string.
Join(
"", yCoordsString);
219 results.
Insert(mapCoordsConverted);
220 results.Insert(active.GetLockCode());
230 if (data.Count() == 0)
242 m_Config.playbackSettings.dotDuration,
243 m_Config.playbackSettings.dashDuration,
244 m_Config.playbackSettings.symbolGapDuration,
245 m_Config.playbackSettings.wordGapDuration,
253 #ifdef ENABLE_LOGGING
254 Log(
"Reporting active bunkers:");
256 for (i = 0; i < data.Count(); i += 2)
258 Log(
string.Format(
"position:%1 code:%2", data[i], data[i+1]),
true);
278 int year, month, day, hour, minute;
279 g_Game.GetWorld().GetDate(year, month, day, hour, minute);
288 activeBunkerTempMap.Insert(bunker.GetId(), bunker.GetLockCode());
313 int year, month, day, hour, minute;
314 GetGame().GetWorld().GetDate(year, month, day, hour, minute);
317 int currTotalMinutes = hour * 60 + minute;
319 int minuteDiff = currTotalMinutes - prevTotalMinutes;
322 if (minuteDiff < -720)
324 else if (minuteDiff > 720)
330 #ifdef ENABLE_LOGGING
331 private static void Log(
string message,
bool indented =
false)
333 #ifdef DIAG_DEVELOPER
339 string indentation =
"";
341 indentation =
" \\__";
array< ref BunkerBroadcastComponentBase > BunkerComponentsArray
class LogTemplates Log(string message, LogTemplateID template_id=0)
Creates debug log (optional) from LogTemplate which are registred.
void MapNavigationBehaviour(PlayerBase pPlayer, EMapNavigationType pNavigationType=EMapNavigationType.BASIC)
proto native void SetBroadcastBunkerRepeatCount(int count)
proto native void SetPauseBetweenBunkers(float pause)
proto native void SetMessageSpeed(float dotDuration, float dashDuration, float symbolGap, float wordGap)
proto native void SetBroadcastTotalRepeatCount(int count)
proto native void BroadcastTextAsMorse(notnull array< string > inputs, notnull array< string > outputs)
static BunkerBroadcastPersistenceStorage GetInstance()
BunkerBroadcastHandler m_Handler
ref WorldTimeTracker m_WorldTimeTracker
ref ScriptInvoker m_OnAskForNewBunkers
void ~BunkerBroadcastScheduler()
void LoadLastReportTimeFromStorage()
void OnUpdate(float timeslice)
BunkerBroadcastConfigInstance m_Config
ref TStringArray m_MorseOutputData
int GetDifferenceFromLastReport()
bool SendReport(TStringArray data, TStringArray morseData)
int m_LastReportDifferenceMinutes
void BunkerBroadcastScheduler(notnull BunkerBroadcastHandler handler)
ref BunkerComponentsArray m_ActiveBunkers
BunkerBroadcastPersistenceStorage m_PersitenceStorage
ScriptInvoker GetOnAskForNewBunkers()
static ref BunkerBroadcastScheduler m_Instance
void UpdatePersistentData()
TStringArray PrepareReport()
int m_BatchSelectionTimer
static BunkerBroadcastScheduler GetInstance(notnull BunkerBroadcastHandler handler)
ref TStringArray m_ReportData
static BunkerBroadcastConfigInstance GetData()
static void RadioGameplayLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static bool IsRadioGameplayLogEnabled()
ScriptInvoker Class provide list of callbacks usage:
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
map< int, string > TIntStringMap
class array< Class T > TStringArray
proto void Insert(int index, string input)
Inserts a string into the n-th index, increasing the string length by the size of the input.
static string Join(string separator, notnull TStringArray tokens)