Skip to content

Commit 33a9b85

Browse files
committed
v0.1.0: Renamed Mode to Playlist and moved Type into its own node
1 parent 1f8bda3 commit 33a9b85

5 files changed

Lines changed: 28 additions & 26 deletions

File tree

AuroraGSI-RL/AuroraGSI.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "AuroraGSI.h"
33

44
//using std::placeholders::_1;
5-
BAKKESMOD_PLUGIN(AuroraGSI, "AuroraGSI", "0.0.2", PLUGINTYPE_THREADED)
5+
BAKKESMOD_PLUGIN(AuroraGSI, "AuroraGSI", "0.1.0", PLUGINTYPE_THREADED)
66

77
#pragma region Plugin Methods
88
void AuroraGSI::onLoad()
@@ -116,16 +116,18 @@ void AuroraGSI::UpdateState(ServerWrapper wrapper)
116116
}
117117

118118
GameSettingPlaylistWrapper playlistWrapper = wrapper.GetPlaylist();
119-
if (playlistWrapper.memory_address != NULL) {
120-
GameState.Match.Mode = playlistWrapper.GetPlaylistId();
121-
}
119+
if (playlistWrapper.memory_address != NULL)
120+
GameState.Match.Playlist = playlistWrapper.GetPlaylistId();
121+
else
122+
GameState.Match.Playlist = -1;
122123
}
123124

124125

125126
void AuroraGSI::ResetStates()
126127
{
127-
GameState.Match.Mode = -1;
128-
GameState.Match.Type = MatchType::Menu;
128+
GameState.Status = GameStatus::Menu;
129+
130+
GameState.Match.Playlist = -1;
129131
GameState.Match.Time = -1;
130132
GameState.Match.Teams[0].Index = -1;
131133
GameState.Match.Teams[0].Goals = -1;
@@ -151,27 +153,27 @@ void AuroraGSI::ResetStates()
151153

152154
ServerWrapper AuroraGSI::GetCurrentGameType() {
153155
if (this->gameWrapper->IsInReplay()) {
154-
GameState.Match.Type = MatchType::Replay;
156+
GameState.Status = GameStatus::Replay;
155157
return this->gameWrapper->GetGameEventAsReplay();
156158
}
157159
else if (this->gameWrapper->IsInOnlineGame()) {
158-
GameState.Match.Type = MatchType::OnlineGame;
160+
GameState.Status = GameStatus::OnlineGame;
159161
return this->gameWrapper->GetOnlineGame();
160162
}
161163
else if (this->gameWrapper->IsInFreeplay()) {
162-
GameState.Match.Type = MatchType::Freeplay;
164+
GameState.Status = GameStatus::Freeplay;
163165
return this->gameWrapper->GetGameEventAsServer();
164166
}
165167
else if (this->gameWrapper->IsInCustomTraining()) {
166-
GameState.Match.Type = MatchType::Training;
168+
GameState.Status = GameStatus::Training;
167169
return this->gameWrapper->GetGameEventAsServer();
168170
}
169171
else if (this->gameWrapper->IsSpectatingInOnlineGame()) {
170-
GameState.Match.Type = MatchType::Spectate;
172+
GameState.Status = GameStatus::Spectate;
171173
return this->gameWrapper->GetOnlineGame();
172174
}
173175
else {
174-
GameState.Match.Type = MatchType::Menu;
176+
GameState.Status = GameStatus::Menu;
175177
return NULL;
176178
}
177179
}

AuroraGSI-RL/GameStateNode.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ nlohmann::json GameStateNode::GetJson()
55
nlohmann::json data;
66
data["provider"]["name"] = "rocketleague";
77
data["provider"]["appid"] = 13377331;
8+
data["game"]["status"] = Status;
89
data["player"] = Player.GetJson();
910
data["match"] = Match.GetJson();
11+
1012
return data;
1113
}

AuroraGSI-RL/GameStateNode.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@
44
#include "MatchNode.h"
55
#include "PlayerNode.h"
66

7+
enum class GameStatus
8+
{
9+
Menu = -1,
10+
Replay,
11+
OnlineGame,
12+
Freeplay,
13+
Training,
14+
Spectate
15+
};
716

817
class GameStateNode {
918
public:
1019
MatchNode Match;
1120
PlayerNode Player;
21+
GameStatus Status;
1222

1323
nlohmann::json GetJson();
1424
};

AuroraGSI-RL/MatchNode.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ nlohmann::json MatchNode::GetJson()
55
nlohmann::json json_match;
66
json_match["team_0"] = Teams[0].GetJson();
77
json_match["team_1"] = Teams[1].GetJson();
8-
json_match["mode"] = Mode;
9-
json_match["type"] = Type;
8+
json_match["playlist"] = Playlist;
109
json_match["time"] = Time;
1110
return json_match;
1211
};

AuroraGSI-RL/MatchNode.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,11 @@
33
#include "TeamNode.h"
44
#include "PlayerNode.h"
55

6-
enum class MatchType
7-
{
8-
Menu = -1,
9-
Replay,
10-
OnlineGame,
11-
Freeplay,
12-
Training,
13-
Spectate
14-
};
15-
166
class MatchNode {
177
public:
18-
MatchType Type;
198
TeamNode Teams[2];
209
int Time;
21-
int Mode;
10+
int Playlist;
2211

2312
nlohmann::json GetJson();
2413
};

0 commit comments

Comments
 (0)