Skip to content

Commit

Permalink
this might not compile
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMario211 committed Feb 13, 2024
1 parent 6bdc630 commit 0b29f85
Show file tree
Hide file tree
Showing 23 changed files with 221 additions and 76 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ build-linux-deb/
svgs/
compile_commands.json
resources/fontvers/

notas.h
resources/gatos/
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
A mod menu made in Geode for Geometry Dash

# TODOs (Based on whats next)
- Fix bug with info text being off screen
- Add a keyback function for those that use keyback on android
- Fix bug with the menu buttons not working
STEPS:

- Fix bug with input button not working for button position on android
- Add credits screen for cocos2d ui
- Allow for dragging the button
- Add "Render Hitbox" (Basically enables hitbox even if not in practice mode)
- Add menu scale for the cocos ui
- Add "Transparent Lists" (look in https://discord.com/channels/911701438269386882/911702353546215524/1205501190025117779)
- Add "No Shaders"
- Add "uncomplete level" hack
- Add "Custom Object Bypass" (basically allows you to store more than 1000 objects in custom object)
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.4.2
- Fixed bug with No Mirror Transition & Instant Mirror Portal if "No Effect" is applied.
- Fixed speedhack not syncing with gameplay correctly
- Fixed Platformer Mode buttons not showing if you use Force Platformer Mode on Android
- Fixed bug with camera effects affecting Cheat Indicator and Noclip Accuracy
- (Hopefully) Fixed issue with info text being off screen
- Removed Text Length and Character Filter functionality
# v1.4.1
- Fixed Mac OS issue with not being able to open menu.
# v1.4.0
Expand Down
Binary file removed resources/gato.jpg
Binary file not shown.
Binary file removed resources/gato2.png
Binary file not shown.
2 changes: 1 addition & 1 deletion resources/hacks/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"opcodes": [],
"type": "dropdown",
"default": 0,
"values": ["English [100%]", "Français [90%]", "Português (Brasil) [100%]", "Deutsch [90%]", "Русский [90%]", "Čeština [90%]", "Indonesia [90%]", "Español [90%]", "Polskie [90%]", "Melayu [90%]"]
"values": ["English [100%]", "Français [88%]", "Português (Brasil) [100%]", "Deutsch [88%]", "Русский [100%]", "Čeština [88%]", "Indonesia [88%]", "Español [88%]", "Polskie [88%]", "Melayu [88%]"]
},
{
"name": "Theme",
Expand Down
7 changes: 7 additions & 0 deletions server/src/components/Macro.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface MacroData {
timestamp: string;
userID: number;
name: string;
levelID: string;
data: string;
};
8 changes: 8 additions & 0 deletions server/src/components/Theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface ThemeData {
timestamp: string;
userID: number;
name: string;
desc: string;
screenshots?: Array<string>;
data: string;
};
6 changes: 6 additions & 0 deletions server/src/components/User.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default interface UserData {
userID: number;
userName: string;
token: string; // based on a hashed ip addr
timestamp: string;
};
31 changes: 31 additions & 0 deletions server/src/controllers/auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import redis from 'redis'
import crypto from 'crypto';
import User from '../components/User';

const client = redis.createClient(); // switch to cache

export function hashIP(ip: string): string {
const hash = crypto.createHash('sha256');
hash.update(ip);
return hash.digest('hex');
}

export async function getUser(hashIP: string): Promise<User | null> {
try {
const userData = (await client.hGetAll(`users:${hashIP}`) as unknown) as User;
if (userData) return userData;
return null;
} catch (e) {
console.error(e);
return null;
}
}

export async function createUser(name: string, hashIP: string): Promise<User | null> {
return new Promise((resolve, reject) => {
return getUser(hashIP).then(user => {
if (user != null) return reject("Already created an account.");
resolve();
}).catch(reject);
})
}
12 changes: 12 additions & 0 deletions server/src/controllers/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Router, Request, Response } from 'express'
import crypto from 'crypto'
import multer from 'multer'

const router = Router();

router.post('/api/themes', (req: Request, res: Response) => {
const { token, data } = req.body;

})

export default router;
Empty file added server/src/controllers/user.ts
Empty file.
30 changes: 30 additions & 0 deletions server/src/redis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// taken from my discord bot

// https://stackoverflow.com/a/74535407
import type { RedisClientType } from 'redis'
import { createClient } from 'redis'

let redisClient: RedisClientType
let isReady: boolean
async function getCache(): Promise<RedisClientType> {
if (!isReady) {
redisClient = createClient({
url: 'redis://127.0.0.1:6379',
})
redisClient.on('error', err => console.error(`[Redis] Error: ${err}`))
redisClient.on('connect', () => console.log('[Redis] Connected!'))
redisClient.on('reconnecting', () => console.log('[Redis] Reconnecting...'))
redisClient.on('ready', () => {
isReady = true
console.log('[Redis] Ready!')
})
await redisClient.connect();
}
return redisClient
}
getCache().then(connection => {
redisClient = connection
}).catch(err => {
console.error('Failed to connect to Redis', err)
})
export { getCache }
23 changes: 0 additions & 23 deletions server/src/typings/Theme.ts

This file was deleted.

18 changes: 18 additions & 0 deletions src/GatoSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@

// TODO: add a popup asking for name, and what sprite

/*
std::string name;
std::string desc;
int price;
int tier;
int amount;
*/

std::vector<PetItem> items = {
{
"",
"",
2,
2,
2
}
};

// definitely not copied off a mod that i was working on with someone *cough cough*
bool GatoSim::init() {
auto size = cocos2d::CCDirector::sharedDirector()->getWinSize();
Expand Down
12 changes: 7 additions & 5 deletions src/GatoSim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
// this is all a spoiler!
#include <Geode/Geode.hpp>

struct ShopItem {

struct PetItem {
std::string name;
std::string desc;
int price;
int tier = 1;
int amount;
};



using namespace geode::prelude;
class GatoSim : public CCLayer, public FLAlertLayerProtocol {
// TODO: add some json file
// maybe turn this into some sort of "cookie clicker" because why not
std::string name;
int fod = 0;
int drank = 0;
int pet = 0;
std::vector<std::string> toi;
bool hasDoneDaily = false;
int bal = 250;
int satis = 0;

protected:
CCMenu* m_buttonMenu;
Expand Down
3 changes: 2 additions & 1 deletion src/Hacks/Bypass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ class $modify(GameManager) {
};

// Text Length, Character Filter
#if 0
class $modify(CCTextInputNode) {
void updateLabel(gd::string p0) {
if (Hacks::isHackEnabled("Character Filter") && !Hacks::isHackEnabled("Enable Patching")) this->setAllowedChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-!?:;)(/\\\"\'`*= +-_%[]<>|@&^#{}%$~");
if (Hacks::isHackEnabled("Text Length") && !Hacks::isHackEnabled("Enable Patching")) this->m_maxLabelLength = -1;
CCTextInputNode::updateLabel(p0);
}
};

#endif
/*
class $modify(GameStatsManager) {
// Almost all bypass
Expand Down
53 changes: 30 additions & 23 deletions src/Hacks/Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
using namespace geode::prelude;

#include <Geode/modify/GameStatsManager.hpp>
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/GameObject.hpp>
#include <Geode/modify/GJGameLevel.hpp>
#include <Geode/modify/CCTransitionFade.hpp>
#include <Geode/modify/FMODAudioEngine.hpp>
#include <Geode/modify/CCScheduler.hpp>
#include <Geode/modify/CCSprite.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>

// Practice Music
class $modify(GameStatsManager) {
Expand All @@ -34,19 +36,26 @@ class $modify(CCScheduler) {
};

#ifndef GEODE_IS_MACOS
class $modify(PlayLayer) {
// No Glow, Show Hidden Objects
void addObject(GameObject* obj) {
// "Optimization"
if (Hacks::isHackEnabled("Show Hidden Objects")) {
obj->m_activeMainColorID = -1;
obj->m_isHide = false;
if (obj->m_objectID == 1007) return;
}
if (Hacks::isHackEnabled("No Glow")) {
obj->m_hasNoGlow = true;
}
PlayLayer::addObject(obj);
}
};


// Layout Mode
class $modify(GameObject) {
// Layout Mode, No Glow
void setVisible(bool v) {
if (Hacks::isHackEnabled("No Glow")) { // easier than having to check for glow sprite lol
this->m_hasNoGlow = true;
}
if (Hacks::isHackEnabled("Show Hidden Objects")) {
m_activeMainColorID = -1;
if (m_isHide) v = true;
m_isHide = false;
// ok but why doesnt this work
}
if (!Hacks::isHackEnabled("Layout Mode")) return GameObject::setVisible(v);
//m_hasGroupParent == 0
std::vector<int> outerPortal = {};
Expand All @@ -57,19 +66,6 @@ class $modify(GameObject) {
GameObject::setVisible(v);
}
}
/*
void makeInvisible() { // 0x13bf20
std::cout << "make it invisible" << std::endl;
if (!Hacks::isHackEnabled("Show Hidden Objects")) return GameObject::makeInvisible();
}
*/
static GameObject* createWithKey(int p0) {
auto gameObject = GameObject::createWithKey(p0);
if (Hacks::isHackEnabled("Show Hidden Objects")) {
if (p0 == 1007 && PlayLayer::get() != nullptr) return nullptr;
}
return gameObject;
}
};
#endif

Expand Down Expand Up @@ -111,3 +107,14 @@ class $modify(CCSprite) {
}
}
};

// Physics Bypass (TPS)
// dVar3 = 0.004166666883975267;
// which (dVar3 * 240 = 1) lol, so 1.F / TPS?
/*
class $modify(GJBaseGameLayer) {
float getModifiedDelta(float p0) {
std::cout << "yAEY" << std::endl;
return GJBaseGameLayer::getModifiedDelta(p0);
}
};*/
47 changes: 41 additions & 6 deletions src/Hacks/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ class $modify(PlayerObject) {
if (!m_fields->was_platformer) {
m_fields->was_platformer = this->m_isPlatformer;
}
if (Hacks::isHackEnabled("Force Platformer Mode")) {
togglePlatformerMode(true);
} else {
togglePlatformerMode(m_fields->was_platformer);
#ifndef GEODE_IS_DESKTOP
if (PlayLayer::get() != nullptr) {
auto playLayer = PlayLayer::get(); //shut!
playLayer->m_uiLayer->togglePlatformerMode(Hacks::isHackEnabled("Force Platformer Mode") ? true : m_fields->was_platformer);
// for some reason i was trying to look for togglePlatformerMode when I realized that i couldve just literally used the func as its android, im so mad
}
#endif
togglePlatformerMode(Hacks::isHackEnabled("Force Platformer Mode") ? true : m_fields->was_platformer);
auto gravityHack = Hacks::getHack("Gravity Value");
if (Hacks::isHackEnabled("Change Gravity")) { // assume its enabled
m_gravityMod = gravityHack->value.floatValue;
Expand Down Expand Up @@ -75,10 +78,42 @@ class $modify(GJBaseGameLayer) {
#ifndef GEODE_IS_MACOS
// No Mirror Transition, Instant Mirror Portal
void toggleFlipped(bool p0, bool p1) { // i spent a lot of time figuring out why CCActionTween wont hook, only to realize that p1 instantly transitions it
if (Hacks::isHackEnabled("Enable Patching")) return GJBaseGameLayer::toggleFlipped(p0, p1);
if (!Hacks::isHackEnabled("No Mirror Transition")) GJBaseGameLayer::toggleFlipped(p0, Hacks::isHackEnabled("Instant Mirror Portal"));
//std::cout << this->m_gameState.m_unk188 << std::endl;
if (!Hacks::isHackEnabled("No Mirror Transition")) return GJBaseGameLayer::toggleFlipped(p0, (p1) ? p1 : Hacks::isHackEnabled("Instant Mirror Portal"));
}
#endif
void update(float dt) {
/*
fVar30 = (float)((double)dt + *(double *)&this[4].GJBaseGameLayer_data.m_gameState.field_0xf0);
fVar25 = *(float *)&(this->GJBaseGameLayer_data).m_gameState.field_0x188;
if (1.0 < fVar25) {
fVar25 = 1.0;
}
fVar24 = (float10)roundf(fVar30 / (fVar25 * 0.004166667));
fStack_64 = (float)fVar24;
dVar28 = (double)(int)fVar24 * (double)(fVar25 * 0.004166667);
dVar26 = (double)fVar30 - dVar28;
dt = (float)dVar28;
*/
// we love ghidra
/*float fVar30 = (float)((double)dt + 0.0);
float fVar25 = m_gameState.m_unk188;
if (1.0 < fVar25) {
fVar25 = 1.0;
}
float physicsTPS = (1.F / 360.F);
float fVar24 = (float)roundf(fVar30 / (fVar25 * physicsTPS));
double dVar28 = (int)fVar24 * (double)(fVar25 * physicsTPS);
double dVar26 = (double)fVar30 - dVar28;
auto beforeDt = dt;
dt = (float)dVar28;
std::cout << dt << "," << beforeDt << std::endl;*/
//this->m_gameState.m_unk188 = 0.7F;
//std::cout << (float)((double)dt + (double)m_gameState.m_unkf0) << "," << dt << std::endl;
//std::cout << m_gameState.m_unkf0 << std::endl;
//m_gameState.m_unkf0 = 0.00001;
GJBaseGameLayer::update(dt);
}
};

#ifndef GEODE_IS_MACOS
Expand Down
Loading

0 comments on commit 0b29f85

Please sign in to comment.