Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SessionInfo.c
Go to the documentation of this file.
2 {
3  protected WorldTimestamp m_fLoginTimestamp;
4 
5  // Backend-stored variables
6  protected string m_sRoomID;
7  protected FactionKey m_sFactionKey;
8  protected int m_iLoginYear;
9  protected int m_iLoginMonth;
10  protected int m_iLoginDay;
11  protected int m_iLoginHour;
12  protected int m_iLoginMinute;
13  protected int m_iLoginSecond;
14  protected int m_iLogoutYear;
15  protected int m_iLogoutMonth;
16  protected int m_iLogoutDay;
17  protected int m_iLogoutHour;
18  protected int m_iLogoutMinute;
19  protected int m_iLogoutSecond
20  protected float m_fTimeInSession;
21 
22  //------------------------------------------------------------------------------------------------
23  void SetRoomID(string ID)
24  {
25  m_sRoomID = ID;
26  }
27 
28  //------------------------------------------------------------------------------------------------
29  string GetRoomID()
30  {
31  return m_sRoomID;
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  void SetFactionKey(FactionKey factionKey)
36  {
37  m_sFactionKey = factionKey;
38  }
39 
40  //------------------------------------------------------------------------------------------------
41  FactionKey GetFactionKey()
42  {
43  return m_sFactionKey;
44  }
45 
46  //------------------------------------------------------------------------------------------------
47  void SetLoginTime(int year, int month, int day, int hour, int minute, int second)
48  {
49  m_iLoginYear = year;
50  m_iLoginMonth = month;
51  m_iLoginDay = day;
52  m_iLoginHour = hour;
53  m_iLoginMinute = minute;
54  m_iLoginSecond = second;
55  ChimeraWorld world = GetGame().GetWorld();
56  m_fLoginTimestamp = world.GetServerTimestamp();
57  }
58 
59  //------------------------------------------------------------------------------------------------
60  void GetLoginTime(out notnull array<int> loginData)
61  {
62  loginData = {m_iLoginYear, m_iLoginMonth, m_iLoginDay, m_iLoginHour, m_iLoginMinute, m_iLoginSecond};
63  }
64 
65  //------------------------------------------------------------------------------------------------
66  void SetLogoutTime(int year, int month, int day, int hour, int minute, int second)
67  {
68  m_iLogoutYear = year;
69  m_iLogoutMonth = month;
70  m_iLogoutDay = day;
71  m_iLogoutHour = hour;
72  m_iLogoutMinute = minute;
73  m_iLogoutSecond = second;
74  ChimeraWorld world = GetGame().GetWorld();
75  m_fTimeInSession = world.GetServerTimestamp().DiffMilliseconds(m_fLoginTimestamp);
76  }
77 
78  //------------------------------------------------------------------------------------------------
79  void GetLogoutTime(out notnull array<int> logoutData)
80  {
81  logoutData = {m_iLogoutYear, m_iLogoutMonth, m_iLogoutDay, m_iLogoutHour, m_iLogoutMinute, m_iLogoutSecond};
82  }
83 
84  //------------------------------------------------------------------------------------------------
85  float GetTimeInSession()
86  {
87  return m_fTimeInSession;
88  }
89 
90  //------------------------------------------------------------------------------------------------
91  void SCR_SessionInfo()
92  {
93  RegV("m_sRoomID");
94  RegV("m_sFactionKey");
95 
96  RegV("m_iLoginYear");
97  RegV("m_iLoginMonth");
98  RegV("m_iLoginDay");
99  RegV("m_iLoginHour");
100  RegV("m_iLoginMinute");
101  RegV("m_iLoginSecond");
102 
103  RegV("m_iLogoutYear");
104  RegV("m_iLogoutMonth");
105  RegV("m_iLogoutDay");
106  RegV("m_iLogoutHour");
107  RegV("m_iLogoutMinute");
108  RegV("m_iLogoutSecond");
109 
110  RegV("m_fTimeInSession");
111  }
112 };
ChimeraWorld
Definition: ChimeraWorld.c:12
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
JsonApiStruct
Parameters for joining server.
Definition: FeedbackDialogUI.c:2
m_sFactionKey
protected FactionKey m_sFactionKey
Definition: SCR_ScenarioFrameworkLayerBase.c:25
SCR_SessionInfo
Definition: SCR_SessionInfo.c:1