Skip to content

Commit

Permalink
Fixed missing teamindex
Browse files Browse the repository at this point in the history
Added game mode indiccator
  • Loading branch information
Gbo committed Sep 13, 2019
1 parent ea1e564 commit fae6b19
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 2 deletions.
2 changes: 2 additions & 0 deletions BakkesWebApi/ApiTeam.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

class ApiTeam {
public:
int TeamNum;
int TeamIndex;
bool Dirty = true;
std::string Name;
int Goals;
Expand Down
6 changes: 4 additions & 2 deletions BakkesWebApi/BakkesWebApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file added ball.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
216 changes: 216 additions & 0 deletions game-mode.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
<HTML>
<HEAD>
<TITLE>Notifier</TITLE>
<script type="text/javascript">
webSocket = new WebSocket("ws://localhost:8323");
webSocket.onmessage = function (event) {
rocket_event = JSON.parse(event.data);
switch (rocket_event.event) {
case "game_changed":
if (rocket_event.game.PlaylistId == 5) {
document.getElementById('notif_box').classList.add("slide-out-blurred-left");
} else {
document.getElementById('notif_box').classList.remove("slide-out-blurred-left");
document.getElementById("notif_text").innerHTML = "Playing " + rocket_event.game.PlaylistName;
}
break;
default:

}
}
</script>
<style>
.bounce-in-top {
-webkit-animation: bounce-in-top 1.1s both;r
animation: bounce-in-top 1.1s both;
}
.slide-out-blurred-left {
-webkit-animation: slide-out-blurred-left 0.45s cubic-bezier(0.755, 0.050, 0.855, 0.060) both;
animation: slide-out-blurred-left 0.45s cubic-bezier(0.755, 0.050, 0.855, 0.060) both;
}
@-webkit-keyframes slide-out-blurred-left {
0% {
-webkit-transform: translateX(0) scaleY(1) scaleX(1);
transform: translateX(0) scaleY(1) scaleX(1);
-webkit-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webkit-filter: blur(0);
filter: blur(0);
opacity: 1;
}

100% {
-webkit-transform: translateX(-1000px) scaleX(2) scaleY(0.2);
transform: translateX(-1000px) scaleX(2) scaleY(0.2);
-webkit-transform-origin: 100% 50%;
transform-origin: 100% 50%;
-webkit-filter: blur(40px);
filter: blur(40px);
opacity: 0;
}
}

@keyframes slide-out-blurred-left {
0% {
-webkit-transform: translateX(0) scaleY(1) scaleX(1);
transform: translateX(0) scaleY(1) scaleX(1);
-webkit-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webkit-filter: blur(0);
filter: blur(0);
opacity: 1;
}

100% {
-webkit-transform: translateX(-1000px) scaleX(2) scaleY(0.2);
transform: translateX(-1000px) scaleX(2) scaleY(0.2);
-webkit-transform-origin: 100% 50%;
transform-origin: 100% 50%;
-webkit-filter: blur(40px);
filter: blur(40px);
opacity: 0;
}
}

@-webkit-keyframes bounce-in-top {
0% {
-webkit-transform: translateY(-500px);
transform: translateY(-500px);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
opacity: 0;
}

38% {
-webkit-transform: translateY(0);
transform: translateY(0);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
opacity: 1;
}

55% {
-webkit-transform: translateY(-65px);
transform: translateY(-65px);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}

72% {
-webkit-transform: translateY(0);
transform: translateY(0);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}

81% {
-webkit-transform: translateY(-28px);
transform: translateY(-28px);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}

90% {
-webkit-transform: translateY(0);
transform: translateY(0);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}

95% {
-webkit-transform: translateY(-8px);
transform: translateY(-8px);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}

100% {
-webkit-transform: translateY(0);
transform: translateY(0);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
}

@keyframes bounce-in-top {
0% {
-webkit-transform: translateY(-500px);
transform: translateY(-500px);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
opacity: 0;
}

38% {
-webkit-transform: translateY(0);
transform: translateY(0);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
opacity: 1;
}

55% {
-webkit-transform: translateY(-65px);
transform: translateY(-65px);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}

72% {
-webkit-transform: translateY(0);
transform: translateY(0);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}

81% {
-webkit-transform: translateY(-28px);
transform: translateY(-28px);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}

90% {
-webkit-transform: translateY(0);
transform: translateY(0);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}

95% {
-webkit-transform: translateY(-8px);
transform: translateY(-8px);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}

100% {
-webkit-transform: translateY(0);
transform: translateY(0);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
}

</style>
<style>

.blackbox {
font-size: 2em;
font-family: sans-serif;;
color: #e28400;
width: 600px;
background-color: rgba(40,40,40, 0.7);
box-shadow: 1px 2px 4px rgba(0, 0, 0, .5);
}
.blackbox p {
padding: 5px;
}
</style>
</HEAD>
<BODY>
<div id="notif_box" class="bounce-in-top slide-out-blurred-left blackbox">
<p id="notif_text">Widget loaded</p>
</div>
</BODY>
</HTML>

0 comments on commit fae6b19

Please sign in to comment.