diff --git a/BakkesWebApi/ApiTeam.h b/BakkesWebApi/ApiTeam.h index 2f8353a..d09b604 100644 --- a/BakkesWebApi/ApiTeam.h +++ b/BakkesWebApi/ApiTeam.h @@ -3,6 +3,8 @@ class ApiTeam { public: + int TeamNum; + int TeamIndex; bool Dirty = true; std::string Name; int Goals; diff --git a/BakkesWebApi/BakkesWebApi.cpp b/BakkesWebApi/BakkesWebApi.cpp index 8641391..ddd0dd5 100644 --- a/BakkesWebApi/BakkesWebApi.cpp +++ b/BakkesWebApi/BakkesWebApi.cpp @@ -2,7 +2,7 @@ using websocketpp::connection_hdl; using namespace std; using placeholders::_1; -BAKKESMOD_PLUGIN(BakkesWebApi, "BakkesWebApi", "0.2.0", PLUGINTYPE_THREADED) +BAKKESMOD_PLUGIN(BakkesWebApi, "BakkesWebApi", "0.2.1", PLUGINTYPE_THREADED) void BakkesWebApi::onLoad() { this->gameWrapper->HookEventPost("Function TAGame.PRI_TA.PostBeginPlay", std::bind(&BakkesWebApi::HookGameStarted, this, _1)); @@ -125,10 +125,12 @@ void BakkesWebApi::UpdateTeamsState() { for (int a = 0; a < teams.Count(); a++) { TeamsState[a].Dirty = false; TeamsState[a].Goals = teams.Get(a).GetScore(); + TeamsState[a].TeamIndex = teams.Get(a).GetTeamIndex(); + TeamsState[a].TeamNum = teams.Get(a).GetTeamNum(); if (!teams.Get(a).GetSanitizedTeamName().IsNull()) { TeamsState[a].Name = teams.Get(a).GetSanitizedTeamName().ToString(); } - else if (teams.Get(a).GetTeamIndex() == 1) { + else if (TeamsState[a].TeamIndex == 1) { TeamsState[a].Name = "Orange"; } else { diff --git a/README.md b/README.md index 0eb9264..9bcb3ce 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ The goal is to have a Rocket League stats/event web API to be used : - Bots - Desktop/Mobile applications - HTML/CSS/JS widgets to be used in OBS (or any streaming solution supporting transparent HTML). + - see https://www.twitch.tv/videos/481056339 for a demo. ## Websocket events diff --git a/ball.png b/ball.png new file mode 100644 index 0000000..355a50c Binary files /dev/null and b/ball.png differ diff --git a/game-mode.html b/game-mode.html new file mode 100644 index 0000000..148ee1f --- /dev/null +++ b/game-mode.html @@ -0,0 +1,216 @@ + + +Notifier + + + + + +
+

Widget loaded

+
+ +