Don't remember working on this but sure
This commit is contained in:
1 file changed
+12
-12
+12
-12
@@ -338,20 +338,20 @@ app.ws('/ws', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const currentUserData = await db1
|
const currentUserData = await db1
|
||||||
.select({
|
.select({
|
||||||
saveData: berryDashUserData.saveData
|
saveData: berryDashUserData.saveData
|
||||||
})
|
})
|
||||||
.from(berryDashUserData)
|
.from(berryDashUserData)
|
||||||
.where(eq(berryDashUserData.id, userId))
|
.where(eq(berryDashUserData.id, userId))
|
||||||
.execute()
|
.execute()
|
||||||
|
|
||||||
const currentSavedata = currentUserData[0]?.saveData
|
const currentSavedata = currentUserData[0]?.saveData
|
||||||
? JSON.parse(currentUserData[0].saveData)
|
? JSON.parse(currentUserData[0].saveData)
|
||||||
: null
|
: null
|
||||||
|
|
||||||
if (!currentSavedata) {
|
if (!currentSavedata) {
|
||||||
connection0.end()
|
connection0.end()
|
||||||
connection1.end()
|
connection1.end()
|
||||||
ws.send({
|
ws.send({
|
||||||
type: 'multiplayer_join_response',
|
type: 'multiplayer_join_response',
|
||||||
accepted: false,
|
accepted: false,
|
||||||
@@ -359,8 +359,8 @@ app.ws('/ws', {
|
|||||||
id: null,
|
id: null,
|
||||||
players: null
|
players: null
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentCustomIcon =
|
const currentCustomIcon =
|
||||||
currentSavedata.bird?.customIcon?.selected ?? null
|
currentSavedata.bird?.customIcon?.selected ?? null
|
||||||
@@ -371,10 +371,10 @@ app.ws('/ws', {
|
|||||||
? 1
|
? 1
|
||||||
: currentSavedata.bird?.overlay ?? 0
|
: currentSavedata.bird?.overlay ?? 0
|
||||||
const currentIconColor = currentCustomIcon
|
const currentIconColor = currentCustomIcon
|
||||||
? [255, 255, 255]
|
? [255, 255, 255]
|
||||||
: currentSavedata?.settings?.colors?.icon ?? [255, 255, 255]
|
: currentSavedata?.settings?.colors?.icon ?? [255, 255, 255]
|
||||||
const currentOverlayColor = currentCustomIcon
|
const currentOverlayColor = currentCustomIcon
|
||||||
? [255, 255, 255]
|
? [255, 255, 255]
|
||||||
: currentSavedata?.settings?.colors?.overlay ?? [255, 255, 255]
|
: currentSavedata?.settings?.colors?.overlay ?? [255, 255, 255]
|
||||||
|
|
||||||
const players: any = []
|
const players: any = []
|
||||||
|
|||||||
Reference in new issue
Block a user