Fix bugs
This commit is contained in:
parent
c72d2196d5
commit
f481b62cf4
|
@ -40,10 +40,16 @@ def TryUpdate():
|
|||
cur = c.execute('SELECT Name from users WHERE LastSession=?',(authToken,))
|
||||
rows = cur.fetchone()
|
||||
username = rows[0]
|
||||
if nextRubishSpawnTime == None:
|
||||
nextRubishSpawnTime = math.floor(time.time()) + 600
|
||||
c.execute('UPDATE areaList SET NextRubishSpawnTime=? WHERE Name=? and AreaId=?',(nextRubishSpawnTime,username,areaId))
|
||||
c.execute('UPDATE areaList SET ActualAreaId=? WHERE Name=? and ActualAreaId IS NOT NULL',(areaId,username))
|
||||
|
||||
cur = c.execute('SELECT COUNT(1) from areaList WHERE Name=? and AreaId=?',(username,areaId))
|
||||
rows = cur.fetchone()
|
||||
count = rows[0]
|
||||
if count == 0:
|
||||
c.execute('INSERT INTO areaList VALUES(?,NULL,?,?,NULL)',(username,areaId,nextRubishSpawnTime))
|
||||
c.execute('UPDATE areaList SET ActualAreaId=? WHERE Name=? and ActualAreaId IS NOT NULL',(areaId,username))
|
||||
else:
|
||||
c.execute('UPDATE areaList SET NextRubishSpawnTime=? WHERE Name=? and AreaId=?',(nextRubishSpawnTime,username,areaId))
|
||||
c.execute('UPDATE areaList SET ActualAreaId=? WHERE Name=? and ActualAreaId IS NOT NULL',(areaId,username))
|
||||
|
||||
|
||||
try:
|
||||
|
|
|
@ -41,7 +41,7 @@ def TryAdd():
|
|||
|
||||
|
||||
c.execute('DELETE from harvestList where Name=? and AreaId=? and containerName=?',(username,AreaId,ContainerName))
|
||||
c.execute('INSERT INTO harvestList VAlUES (?,?,NULL,?,NULL,?)',(username,harvestableTemplateId,containerName,AreaId))
|
||||
c.execute('INSERT INTO harvestList VAlUES (?,?,NULL,?,NULL,?)',(username,HarvestableTemplateId,ContainerName,AreaId))
|
||||
|
||||
|
||||
try:
|
||||
|
|
|
@ -42,7 +42,14 @@ def TryUpdate():
|
|||
username = rows[0]
|
||||
|
||||
|
||||
c.execute('UPDATE npcList SET RequestLevel=?,Pool=?, NextTimestamp=? WHERE Name=? AND CharacterId=?',(RequestLevel,Pool,NextTimestamp,username,CharacterId))
|
||||
|
||||
cur = c.execute('SELECT COUNT(1) from npcList WHERE Name=? AND CharacterId=?',(username,CharacterId))
|
||||
rows = cur.fetchone()
|
||||
count = rows[0]
|
||||
if count == 0:
|
||||
c.execute('INSERT INTO npcList VALUES(?,?,?,?,?)',(username,CharacterId,NextTimestamp,Pool,RequestLevel))
|
||||
else:
|
||||
c.execute('UPDATE npcList SET RequestLevel=?,Pool=?, NextTimestamp=? WHERE Name=? AND CharacterId=?',(RequestLevel,Pool,NextTimestamp,username,CharacterId))
|
||||
|
||||
|
||||
try:
|
||||
|
|
|
@ -40,8 +40,13 @@ def TryUpdate():
|
|||
rows = cur.fetchone()
|
||||
username = rows[0]
|
||||
|
||||
|
||||
c.execute('UPDATE relationsList SET Level=?,Progress=? WHERE Name=? AND CharacterId=?',(Level,Progress,username,CharacterId))
|
||||
cur = c.execute('SELECT COUNT(1) from relationsList WHERE Name=? AND CharacterId=?',(username,CharacterId))
|
||||
rows = cur.fetchone()
|
||||
count = rows[0]
|
||||
if count == 0:
|
||||
c.execute('INSERT INTO relationsList VALUES(?,?,?,?)',(username,CharacterId,Level,Progress))
|
||||
else:
|
||||
c.execute('UPDATE relationsList SET Level=?,Progress=? WHERE Name=? AND CharacterId=?',(Level,Progress,username,CharacterId))
|
||||
|
||||
|
||||
try:
|
||||
|
|
|
@ -38,7 +38,7 @@ def TryRemove():
|
|||
username = rows[0]
|
||||
|
||||
|
||||
c.execute('DELETE from rubishList WHERE Name=? and Id=?',(username,rubishId))
|
||||
c.execute('DELETE from rubishList WHERE Name=? and Id=?',(username,Id))
|
||||
return 0
|
||||
|
||||
|
||||
|
|
|
@ -39,8 +39,14 @@ def TryUpdate():
|
|||
cur = c.execute('SELECT Name from users WHERE LastSession=?',(authToken,))
|
||||
rows = cur.fetchone()
|
||||
username = rows[0]
|
||||
|
||||
c.execute('UPDATE scenario SET CustomData=?,StepId=? WHERE Name=? AND ScenarioId=?',(CustomData,StepId,username,ScenarioId))
|
||||
|
||||
cur = c.execute('SELECT COUNT(1) from scenario WHERE Name=? AND ScenarioId=?',(username,ScenarioId))
|
||||
rows = cur.fetchone()
|
||||
count = rows[0]
|
||||
if count == 0:
|
||||
c.execute('INSERT INTO scenario VALUES(?,?,?,?,0)',(username,ScenarioId,CustomData,StepId))
|
||||
else:
|
||||
c.execute('UPDATE scenario SET CustomData=?,StepId=? WHERE Name=? AND ScenarioId=?',(CustomData,StepId,username,ScenarioId))
|
||||
|
||||
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue