Skip to content

Commit 9357627

Browse files
committed
debug
1 parent 572dad8 commit 9357627

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Official Avalanche levels and profiles.
99
>
1010
> [<img alt="Downloads" src="https://img.shields.io/github/downloads/CubicCommunity/AvalancheIndex/total?style=for-the-badge&logo=geode&logoColor=ffffff&label=Downloads">](https://www.geode-sdk.org/mods/cubicstudios.avalancheindex)
1111
12-
Easily spot legitimate Avalanche profiles and projects at a glance. No more need to double-check.
13-
1412
> [!TIP]
1513
> *This mod has settings you can utilize to customize your experience.*
1614

about.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# ![Avalanche Index](frame:cubicstudios.avalancheindex/wordmark.png)
22
**Official Avalanche levels and profiles.**
33

4-
---
5-
6-
Easily spot legitimate Avalanche profiles and projects at a glance. No more need to double-check.
7-
84
> ![icon](frame:collaborationIcon_001.png) <cg>*This mod has settings you can utilize to customize your experience.*</c>
95
106
---

incl/src/Avalanche.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ namespace avalanche {
236236
auto c_name = cacheStd["name"].asString().unwrapOr(und);
237237
auto c_badge = Handler::Badges::fromBadgeID(cacheStd["badge"].asString().unwrapOr(und));
238238

239-
log::info("Finishing up for level {}", id);
239+
log::info("Finishing up for player {}", id);
240+
log::debug("{}", c_name);
240241

241242
Profile res(c_name, c_badge);
242243
return res;
@@ -298,6 +299,7 @@ namespace avalanche {
298299
};
299300

300301
log::info("Finishing up for level {}", id);
302+
log::debug("{}, {}, {}, {}, {}", c_name, c_host, c_showcase, c_thumbnail, c_fame);
301303

302304
Project res(c_name, c_host, c_showcase, c_thumbnail, c_type, c_fame, ltm);
303305
return res;

src/main.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using namespace avalanche;
3838
*/
3939

4040
// avalanche data handler
41-
auto getHandler = Handler::get();
41+
auto myHandler = Handler::get();
4242

4343
// if the server wasn't already checked for the new avalanche project :O
4444
bool noProjectPing = true;
@@ -51,16 +51,16 @@ class $modify(ProfilePage) {
5151

5252
if (AVAL_GEODE_MOD->getSettingValue<bool>("badge-profile")) {
5353
// gets all badge data
54-
getHandler->scanAll();
54+
myHandler->scanAll();
5555

5656
// get the username menu and cast it
5757
CCMenu* cell_menu = static_cast<CCMenu*>(m_mainLayer->getChildByIDRecursive("username-menu"));
5858

5959
TextArea* fakeText = nullptr;
6060
CCLabelBMFont* fakeFont = nullptr;
6161

62-
Profile plr = getHandler->GetProfile(user->m_accountID);
63-
getHandler->createBadge(this, plr, cell_menu, fakeText, fakeFont, 0.875f);
62+
Profile plr = myHandler->GetProfile(user->m_accountID);
63+
myHandler->createBadge(this, plr, cell_menu, fakeText, fakeFont, 0.875f);
6464

6565
AVAL_LOG_DEBUG("Viewing profile of ID {}", (int)user->m_accountID);
6666
} else {
@@ -77,7 +77,7 @@ class $modify(CommentCell) {
7777

7878
if (AVAL_GEODE_MOD->getSettingValue<bool>("badge-comments")) {
7979
// checks if the user is a member of avalanche
80-
getHandler->scanAll();
80+
myHandler->scanAll();
8181

8282
// get the username menu and cast it
8383
CCMenu* cell_menu = static_cast<CCMenu*>(m_mainLayer->getChildByIDRecursive("username-menu"));
@@ -107,8 +107,8 @@ class $modify(CommentCell) {
107107
commentText = nullptr;
108108
};
109109

110-
Profile plr = getHandler->GetProfile(comment->m_accountID);
111-
getHandler->createBadge(this, plr, cell_menu, commentText, commentFont, 0.55f);
110+
Profile plr = myHandler->GetProfile(comment->m_accountID);
111+
myHandler->createBadge(this, plr, cell_menu, commentText, commentFont, 0.55f);
112112

113113
AVAL_LOG_DEBUG("Viewing comment profile of ID {}", (int)comment->m_accountID);
114114
} else {
@@ -119,11 +119,11 @@ class $modify(CommentCell) {
119119

120120
// attempts to fetch data on level or badge locally to verify ownership of the level
121121
Project::Type scanForLevelCreator(GJGameLevel* level) {
122-
auto project = getHandler->GetProject(level->m_levelID.value());
122+
auto project = myHandler->GetProject(level->m_levelID.value());
123123

124124
if (project.type == Project::Type::NONE) {
125125
// get the member's badge data
126-
auto profile = getHandler->GetProfile(level->m_accountID.value());
126+
auto profile = myHandler->GetProfile(level->m_accountID.value());
127127

128128
if (profile.badge == Profile::Badge::NONE) {
129129
AVAL_LOG_ERROR("Level creator not associated with Avalanche");
@@ -145,7 +145,7 @@ Project::Type scanForLevelCreator(GJGameLevel* level) {
145145
return Project::Type::TEAM;
146146
} else {
147147
// checks if level is published by a team member
148-
if (getHandler->isTeamMember(profile.badge)) {
148+
if (myHandler->isTeamMember(profile.badge)) {
149149
// checks if level is rated
150150
if (level->m_stars.value() >= 1) {
151151
AVAL_LOG_DEBUG("Level {} is Avalanche team member solo", (int)level->m_levelID.value());
@@ -193,7 +193,7 @@ class $modify(LevelInfo, LevelInfoLayer) {
193193

194194
CCMenu* leftMenu = typeinfo_cast<CCMenu*>(getChildByID("left-side-menu"));
195195

196-
Project thisProj = getHandler->GetProject(level->m_levelID.value());
196+
Project thisProj = myHandler->GetProject(level->m_levelID.value());
197197

198198
// if the project is not avalanche, then we don't need to do anything
199199
if (thisProj.type == Project::Type::NONE) {
@@ -430,7 +430,7 @@ class $modify(Level, LevelCell) {
430430

431431
if ((color) && (levelName)) {
432432
// checks if the level is an avalanche project
433-
auto lvl = getHandler->GetProject(level->m_levelID.value());
433+
auto lvl = myHandler->GetProject(level->m_levelID.value());
434434
auto levelType = scanForLevelCreator(level);
435435

436436
// check the project type and set decoration accordingly
@@ -619,7 +619,7 @@ class $modify(Pause, PauseLayer) {
619619

620620
if (auto rightMenu = getChildByID("right-button-menu")) {
621621
if (m_fields->m_level) {
622-
Project thisProj = getHandler->GetProject(m_fields->m_level->m_levelID.value());
622+
Project thisProj = myHandler->GetProject(m_fields->m_level->m_levelID.value());
623623

624624
if (thisProj.type == Project::Type::NONE) {
625625
AVAL_LOG_ERROR("Level {} is not an Avalanche project", (int)m_fields->m_level->m_levelID.value());
@@ -837,7 +837,7 @@ class $modify(Menu, MenuLayer) {
837837
};
838838

839839
// gets all badge data
840-
getHandler->scanAll();
840+
myHandler->scanAll();
841841

842842
return true;
843843
} else {

0 commit comments

Comments
 (0)