From 482ae91fafbb78c3ad988e6175f13798009b7ae9 Mon Sep 17 00:00:00 2001
From: Li
Date: Thu, 10 Nov 2022 06:10:48 +1300
Subject: [PATCH] Fix Signups
---
DreamTown/cgi-bin/character/save | 4 ++--
DreamTown/cgi-bin/dreamtown_config.py | 2 +-
DreamTown/cgi-bin/harvestable/save | 15 +++++++++++----
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/DreamTown/cgi-bin/character/save b/DreamTown/cgi-bin/character/save
index 4e740d3..81b6a8b 100644
--- a/DreamTown/cgi-bin/character/save
+++ b/DreamTown/cgi-bin/character/save
@@ -22,7 +22,7 @@ result = {"status":SUCCESS}
def TrySave():
CharacterIds = jsonData['characterIds']
- ActualCharacterId = jsonData['ActualCharacterId']
+ ActualCharacterId = jsonData['actualCharacterId']
authToken = jsonData['authToken']
@@ -43,7 +43,7 @@ def TrySave():
for CharacterId in CharacterIds:
c.execute('DELETE from characterList where Name=? AND CharacterId=?',(username,CharacterId))
c.execute('INSERT INTO characterList VAlUES (?,?,NULL)',(username,CharacterId))
- c.execute('DELETE from characterList WHERE Name=? and ActualCharacterId IS NOT NULL',(username,))
+ c.execute('DELETE from characterList WHERE Name=? and actualCharacterId IS NOT NULL',(username,))
c.execute('INSERT INTO characterList VAlUES (?,NULL,?)',(username,ActualCharacterId))
diff --git a/DreamTown/cgi-bin/dreamtown_config.py b/DreamTown/cgi-bin/dreamtown_config.py
index 1bf2dfd..2de14e5 100644
--- a/DreamTown/cgi-bin/dreamtown_config.py
+++ b/DreamTown/cgi-bin/dreamtown_config.py
@@ -111,7 +111,7 @@ try:
c.execute("""
CREATE TABLE areaList(
Name TEXT(12),
- LastVisit int,
+ LastVisit bigint,
AreaId int,
NextRubishSpawnTime bigint,
ActualAreaId int
diff --git a/DreamTown/cgi-bin/harvestable/save b/DreamTown/cgi-bin/harvestable/save
index 72dd788..9d2062c 100644
--- a/DreamTown/cgi-bin/harvestable/save
+++ b/DreamTown/cgi-bin/harvestable/save
@@ -44,10 +44,17 @@ def TrySave():
harvestables = Container['harvestables']
areaId = Container['areaId']
- harvestablesEncoded = json.dumps(harvestables)
-
- c.execute('DELETE from containerList where Name=? and AreaId=? and containerName=?',(username,areaId,containerName))
- c.execute('INSERT INTO containerList VAlUES (?,?,?,?,?,?)',(username,harvestableTemplateId,lastHarvest,containerName,harvestablesEncoded,areaId))
+ for harvestable in harvestables:
+ itemTemplateId = harvestable['itemTemplateId']
+ updateTime = harvestable['updateTime']
+ index = harvestable['index']
+ harvestableName = harvestable['harvestableName']
+
+ c.execute('DELETE from harvestablesList where Name=? and HarvestableName=? and AreaId=? and ParentContainerName=?',(username,harvestableName,areaId,containerName))
+ c.execute('INSERT INTO harvestablesList VAlUES (?,?,?,?,?,?,?)',(username,itemTemplateId,updateTime,Index,harvestableName,areaId,containerName))
+
+ c.execute('DELETE from containerList where Name=? and AreaId=? and ContainerName=?',(username,areaId,containerName))
+ c.execute('INSERT INTO containerList VAlUES (?,?,?,?,?)',(username,harvestableTemplateId,lastHarvest,containerName,areaId))
try: