Skip to content

Commit

Permalink
v1.0.0-beta.7
Browse files Browse the repository at this point in the history
  • Loading branch information
TechStudent10 committed Nov 24, 2024
1 parent d920a63 commit ff83199
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ geode build
### Credits

- [Jay/Dasshu](https://dasshu.dev) for their amazing work creating the logo and all assets for this mod. Wouldn't have been possible without you
- [Prevter](https://github.com/Prevter) for hosting the main server instance for Creation Rotation. Again, I'm not sure if I would've been able to release this without your help
- [Prevter](https://github.com/Prevter) for originally hosting the main server instance for Creation Rotation. Again, I'm not sure if I would've been able to release this without your help
2 changes: 1 addition & 1 deletion about.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Once the swap starts, after the amount of time inputted has passed, your level w
### Credits

- [Jay/Dasshu](https://dasshu.dev) for their amazing work creating the logo and all assets for this mod. Wouldn't have been possible without you
- [Prevter](https://github.com/Prevter) for hosting the main server instance for Creation Rotation. Again, I'm not sure if I would've been able to release this without your help
- [Prevter](https://github.com/Prevter) for originally hosting the main server instance for Creation Rotation. Again, I'm not sure if I would've been able to release this without your help

#### Testers

Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.0.0-beta.7
**New Features**
- Added code that automatically changes the server URL to the brand new one

**Bugfixes**
- Fixed the "login data not received" and "invalid token received" errors with new confirmation dialogs
- Other misc. bugfixes

# 1.0.0-beta.6
**New Features**
- NEW Authentication System, similar to the likes of Globed.
Expand Down
6 changes: 3 additions & 3 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "4.0.0",
"geode": "4.0.1",
"gd": {
"win": "2.2074",
"android": "2.2074",
Expand All @@ -8,7 +8,7 @@
},
"id": "techstudent10.creation_rotation",
"name": "Creation Rotation",
"version": "v1.0.0-beta.6",
"version": "v1.0.0-beta.7",
"developer": "TechStudent10",
"description": "Wulzy's Creation Rotation as a mod",
"resources": {
Expand Down Expand Up @@ -40,7 +40,7 @@
"server-url": {
"name": "Server URL",
"type": "string",
"default": "wss://creationrotation.prevter.me",
"default": "wss://creationrotation.underscored.me",
"description": "The Creation Rotation server URL",
"filter": "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM.:/"
},
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cr-server",
"version": "1.0.0-beta.6",
"version": "1.0.0-beta.7",
"main": "index.js",
"author": "TechStudent10",
"license": "MIT",
Expand Down
9 changes: 7 additions & 2 deletions server/src/db/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,15 @@ export class DBState {

const db = await this.openDB()

const { token: acc_token } = await db.get(
const response = await db.get(
`
SELECT token FROM users WHERE account_id = ?
`,
accountID
)
if (!response) return false

log.info(acc_token + " " + token)
const { token: acc_token } = response

return token == acc_token
}
Expand All @@ -170,6 +171,10 @@ export class DBState {
const { passw: hashedPassw } = await db.get("SELECT passw FROM moderators WHERE account_id = ?", data.account?.accountID)
data.is_authorized = hashPsw(password) === hashedPassw

if (data.is_authorized) {
log.log("ADMIN", `user ${data.account?.name} has logged in to the admin panel`)
}

return data.is_authorized
}

Expand Down
2 changes: 1 addition & 1 deletion server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ handlerFiles.forEach(async (handlerName) => {
}
})

const unauthorizedPacketRange = new Array<number>(1000).map((val) => val + 5000)
const unauthorizedPacketRange = [...Array(1000).keys()].map((val) => val + 5000)

wss.on("connection", (socket) => {
let data: SocketData = {
Expand Down
10 changes: 5 additions & 5 deletions src/layers/Lobby.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ LobbyLayer::~LobbyLayer() {
void LobbyLayer::refresh(LobbyInfo info, bool isFirstRefresh) {
isOwner = GameManager::get()->m_playerUserID == info.settings.owner.userID;

loadingCircle = LoadingCircle::create();
loadingCircle->setParentLayer(this);
loadingCircle->setFade(true);
loadingCircle->show();
// loadingCircle = LoadingCircle::create();
// loadingCircle->setParentLayer(this);
// loadingCircle->setFade(true);
// loadingCircle->show();

auto size = CCDirector::sharedDirector()->getWinSize();
auto listWidth = size.width / 1.5f;
Expand Down Expand Up @@ -357,7 +357,7 @@ void LobbyLayer::refresh(LobbyInfo info, bool isFirstRefresh) {
settingsBtn->setVisible(isOwner);
startBtn->setVisible(isOwner);

loadingCircle->fadeAndRemove();
// loadingCircle->fadeAndRemove();
}

void LobbyLayer::onStart(CCObject* sender) {
Expand Down
14 changes: 14 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ class $modify(CRBrowserLayer, LevelBrowserLayer) {
}

void onMyButton(CCObject*) {
if (Mod::get()->getSettingValue<std::string>("server-url").find("prevter.me") != std::string::npos) {
if (!Mod::get()->setSavedValue("seen-prevter-notice", true)) {
Mod::get()->setSettingValue<std::string>("server-url", "wss://creationrotation.underscored.me");

FLAlertLayer::create(
"Creation Rotation",
"We recently moved servers from <cy>prevter.me</c> to <cy>underscored.me</c>. The old server will not work, and as such the setting value has changed accordingly.",
"OK"
)->show();

return;
}
}

if (cr::utils::createAccountType().accountID == 0) {
FLAlertLayer::create(
"Creation Rotation",
Expand Down

0 comments on commit ff83199

Please sign in to comment.