Skip to content

Commit ff83199

Browse files
author
TechStudent10
committed
v1.0.0-beta.7
1 parent d920a63 commit ff83199

File tree

9 files changed

+41
-14
lines changed

9 files changed

+41
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ geode build
1818
### Credits
1919

2020
- [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
21-
- [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
21+
- [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

about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Once the swap starts, after the amount of time inputted has passed, your level w
2424
### Credits
2525

2626
- [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
27-
- [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
27+
- [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
2828

2929
#### Testers
3030

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 1.0.0-beta.7
2+
**New Features**
3+
- Added code that automatically changes the server URL to the brand new one
4+
5+
**Bugfixes**
6+
- Fixed the "login data not received" and "invalid token received" errors with new confirmation dialogs
7+
- Other misc. bugfixes
8+
19
# 1.0.0-beta.6
210
**New Features**
311
- NEW Authentication System, similar to the likes of Globed.

mod.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.0.0",
2+
"geode": "4.0.1",
33
"gd": {
44
"win": "2.2074",
55
"android": "2.2074",
@@ -8,7 +8,7 @@
88
},
99
"id": "techstudent10.creation_rotation",
1010
"name": "Creation Rotation",
11-
"version": "v1.0.0-beta.6",
11+
"version": "v1.0.0-beta.7",
1212
"developer": "TechStudent10",
1313
"description": "Wulzy's Creation Rotation as a mod",
1414
"resources": {
@@ -40,7 +40,7 @@
4040
"server-url": {
4141
"name": "Server URL",
4242
"type": "string",
43-
"default": "wss://creationrotation.prevter.me",
43+
"default": "wss://creationrotation.underscored.me",
4444
"description": "The Creation Rotation server URL",
4545
"filter": "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM.:/"
4646
},

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cr-server",
3-
"version": "1.0.0-beta.6",
3+
"version": "1.0.0-beta.7",
44
"main": "index.js",
55
"author": "TechStudent10",
66
"license": "MIT",

server/src/db/db.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,15 @@ export class DBState {
149149

150150
const db = await this.openDB()
151151

152-
const { token: acc_token } = await db.get(
152+
const response = await db.get(
153153
`
154154
SELECT token FROM users WHERE account_id = ?
155155
`,
156156
accountID
157157
)
158+
if (!response) return false
158159

159-
log.info(acc_token + " " + token)
160+
const { token: acc_token } = response
160161

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

174+
if (data.is_authorized) {
175+
log.log("ADMIN", `user ${data.account?.name} has logged in to the admin panel`)
176+
}
177+
173178
return data.is_authorized
174179
}
175180

server/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ handlerFiles.forEach(async (handlerName) => {
5252
}
5353
})
5454

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

5757
wss.on("connection", (socket) => {
5858
let data: SocketData = {

src/layers/Lobby.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@ LobbyLayer::~LobbyLayer() {
274274
void LobbyLayer::refresh(LobbyInfo info, bool isFirstRefresh) {
275275
isOwner = GameManager::get()->m_playerUserID == info.settings.owner.userID;
276276

277-
loadingCircle = LoadingCircle::create();
278-
loadingCircle->setParentLayer(this);
279-
loadingCircle->setFade(true);
280-
loadingCircle->show();
277+
// loadingCircle = LoadingCircle::create();
278+
// loadingCircle->setParentLayer(this);
279+
// loadingCircle->setFade(true);
280+
// loadingCircle->show();
281281

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

360-
loadingCircle->fadeAndRemove();
360+
// loadingCircle->fadeAndRemove();
361361
}
362362

363363
void LobbyLayer::onStart(CCObject* sender) {

src/main.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ class $modify(CRBrowserLayer, LevelBrowserLayer) {
7878
}
7979

8080
void onMyButton(CCObject*) {
81+
if (Mod::get()->getSettingValue<std::string>("server-url").find("prevter.me") != std::string::npos) {
82+
if (!Mod::get()->setSavedValue("seen-prevter-notice", true)) {
83+
Mod::get()->setSettingValue<std::string>("server-url", "wss://creationrotation.underscored.me");
84+
85+
FLAlertLayer::create(
86+
"Creation Rotation",
87+
"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.",
88+
"OK"
89+
)->show();
90+
91+
return;
92+
}
93+
}
94+
8195
if (cr::utils::createAccountType().accountID == 0) {
8296
FLAlertLayer::create(
8397
"Creation Rotation",

0 commit comments

Comments
 (0)