mirror of
https://github.com/AllenSeitz/dance-maniax-update.git
synced 2026-09-14 13:06:25 -05:00
Adding Basic Analytics
Adding analytics for: game start (freeplay/non), songid chosen, and error (id/string).
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
// source file created by Allen Seitz 7/11/2012
|
||||
|
||||
#include "common.h"
|
||||
#include "analyticsManager.h"
|
||||
#include "GameStateManager.h"
|
||||
#include "inputManager.h"
|
||||
#include "lightsManager.h"
|
||||
#include "scoreManager.h"
|
||||
#include "songwheelMode.h"
|
||||
#include "versionManager.h"
|
||||
#include "videoManager.h"
|
||||
|
||||
extern GameStateManager gs;
|
||||
@@ -16,6 +18,8 @@ extern LightsManager lm;
|
||||
extern ScoreManager sm;
|
||||
extern VideoManager vm;
|
||||
extern EffectsManager em;
|
||||
extern VersionManager version;
|
||||
extern AnalyticsManager am;
|
||||
|
||||
extern unsigned long int frameCounter;
|
||||
extern unsigned long int totalGameTime;
|
||||
@@ -39,8 +43,6 @@ int hitlist[20];
|
||||
int numplays[20];
|
||||
int newlist[10];
|
||||
|
||||
char versionString[128] = "";
|
||||
|
||||
BITMAP* m_title = NULL;
|
||||
BITMAP* m_tile = NULL;
|
||||
BITMAP* m_logo = NULL;
|
||||
@@ -168,8 +170,6 @@ void firstAttractLoop()
|
||||
m_logo = loadImage("DATA/attract/logo.png");
|
||||
m_mask = loadImage("DATA/attract/mask.png");
|
||||
m_hitchart = loadImage("DATA/attract/hitchart.tga");
|
||||
|
||||
strcpy_s(versionString, 128, __DATE__);
|
||||
}
|
||||
|
||||
calculateTop20();
|
||||
@@ -216,6 +216,9 @@ void mainAttractLoop(UTIME dt)
|
||||
gs.g_gameModeTransition = 1;
|
||||
em.playSample(SFX_CREDIT_BEGIN);
|
||||
em.announcerQuip(GUY_GAME_BEGIN);
|
||||
|
||||
// analytics
|
||||
am.logEvent(TRACK_CAT_ACTIVITY, TRACK_EV_GAMESTART, gs.isFreeplay ? "FREEPLAY" : "CREDIT", gs.isFreeplay ? 1 : 0);
|
||||
}
|
||||
|
||||
// blink the start buttons
|
||||
@@ -257,7 +260,7 @@ void mainAttractLoop(UTIME dt)
|
||||
break;
|
||||
case 1: // title
|
||||
blit(m_title, rm.m_backbuf, 0, 0, 0, 0, 640, 480);
|
||||
renderWhiteString(versionString, 10, 10);
|
||||
renderWhiteString(version.versionString, 10, 10);
|
||||
if ( submodeTimer > 5000 )
|
||||
{
|
||||
advanceToNextMode();
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
#include <string.h>
|
||||
#include "gameStateManager.h" // for error mode, is all
|
||||
#include "loadpng.h" // for the RenderingManager initialization
|
||||
#include "analyticsManager.h"
|
||||
|
||||
extern RenderingManager rm;
|
||||
extern GameStateManager gs;
|
||||
extern AnalyticsManager am;
|
||||
|
||||
extern int NUM_SONGS;
|
||||
extern int* songIDs;
|
||||
@@ -95,6 +97,8 @@ void globalError(long errorCode, const char* errorInfo)
|
||||
gs.g_gameModeTransition = 1;
|
||||
gs.g_errorCode = errorCode;
|
||||
strcpy_s(gs.g_errorInfo, 256, errorInfo);
|
||||
|
||||
am.logEvent(TRACK_CAT_ERROR, TRACK_EV_ERROR, gs.g_errorInfo, gs.g_errorCode);
|
||||
}
|
||||
|
||||
void songIndexError(int id)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "lightsManager.h"
|
||||
#include "ScoreManager.h"
|
||||
#include "songwheelMode.h"
|
||||
#include "analyticsManager.h"
|
||||
|
||||
#include "gameplayRendering.h" // for renderGrade()
|
||||
|
||||
@@ -16,6 +17,7 @@ extern InputManager im;
|
||||
extern LightsManager lm;
|
||||
extern ScoreManager sm;
|
||||
extern EffectsManager em;
|
||||
extern AnalyticsManager am;
|
||||
|
||||
extern SongEntry* songs;
|
||||
SongEntry* songlist = NULL;
|
||||
@@ -627,6 +629,7 @@ void mainSongwheelLoop(UTIME dt)
|
||||
gs.currentStage++;
|
||||
int realIndex = songID_to_listID(songlist[songwheelIndex].songID);
|
||||
songs[realIndex].numPlays++;
|
||||
am.logEvent(TRACK_CAT_ACTIVITY, TRACK_EV_PICKSONG, songTitles[realIndex].c_str(), songs[realIndex].songID);
|
||||
|
||||
// fix maniax select for versus play
|
||||
separateSubmenu[0] = separateSubmenu[0] == 3 ? 1 : separateSubmenu[0];
|
||||
|
||||
Reference in New Issue
Block a user