Fix Signups

This commit is contained in:
Li 2022-11-10 06:10:48 +13:00
parent a5116641a3
commit 482ae91faf
3 changed files with 14 additions and 7 deletions

View File

@ -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))

View File

@ -111,7 +111,7 @@ try:
c.execute("""
CREATE TABLE areaList(
Name TEXT(12),
LastVisit int,
LastVisit bigint,
AreaId int,
NextRubishSpawnTime bigint,
ActualAreaId int

View File

@ -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: