From 4f091efa8259d42bf3c4994b80a6ac5db6f7fb8e Mon Sep 17 00:00:00 2001 From: Li Date: Thu, 10 Nov 2022 04:44:49 +1300 Subject: [PATCH] Fix datatype size --- DreamTown/cgi-bin/area/add | 2 +- DreamTown/cgi-bin/area/get | 2 +- DreamTown/cgi-bin/area/save | 2 +- DreamTown/cgi-bin/area/update | 2 +- DreamTown/cgi-bin/character/add | 2 +- DreamTown/cgi-bin/character/get | 2 +- DreamTown/cgi-bin/character/save | 2 +- DreamTown/cgi-bin/character/switch | 2 +- DreamTown/cgi-bin/code/getLogoutCode | 2 +- DreamTown/cgi-bin/code/getPlayerData | 2 +- DreamTown/cgi-bin/currency/add | 2 +- DreamTown/cgi-bin/currency/get | 2 +- DreamTown/cgi-bin/currency/remove | 2 +- DreamTown/cgi-bin/currency/save | 2 +- DreamTown/cgi-bin/dreamtown_config.py | 8 ++++++-- DreamTown/cgi-bin/harvestable/addContainer | 2 +- DreamTown/cgi-bin/harvestable/addHarvestable | 2 +- DreamTown/cgi-bin/harvestable/get | 2 +- DreamTown/cgi-bin/harvestable/remove | 2 +- DreamTown/cgi-bin/harvestable/save | 2 +- DreamTown/cgi-bin/inventory/add | 2 +- DreamTown/cgi-bin/inventory/get | 2 +- DreamTown/cgi-bin/inventory/remove | 2 +- DreamTown/cgi-bin/inventory/save | 2 +- DreamTown/cgi-bin/npc/get | 2 +- DreamTown/cgi-bin/npc/save | 2 +- DreamTown/cgi-bin/npc/update | 2 +- DreamTown/cgi-bin/relation/get | 2 +- DreamTown/cgi-bin/relation/save | 2 +- DreamTown/cgi-bin/relation/update | 2 +- DreamTown/cgi-bin/rubish/add | 2 +- DreamTown/cgi-bin/rubish/get | 2 +- DreamTown/cgi-bin/rubish/remove | 2 +- DreamTown/cgi-bin/rubish/save | 2 +- DreamTown/cgi-bin/scenario/add | 2 +- DreamTown/cgi-bin/scenario/complete | 2 +- DreamTown/cgi-bin/scenario/get | 2 +- DreamTown/cgi-bin/scenario/update | 2 +- DreamTown/cgi-bin/time/get | 2 +- DreamTown/cgi-bin/tutorial/add | 2 +- DreamTown/cgi-bin/tutorial/get | 2 +- 41 files changed, 46 insertions(+), 42 deletions(-) diff --git a/DreamTown/cgi-bin/area/add b/DreamTown/cgi-bin/area/add index 3d530f4..0be458e 100644 --- a/DreamTown/cgi-bin/area/add +++ b/DreamTown/cgi-bin/area/add @@ -47,7 +47,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/area/get b/DreamTown/cgi-bin/area/get index a0ad870..5dbe879 100644 --- a/DreamTown/cgi-bin/area/get +++ b/DreamTown/cgi-bin/area/get @@ -65,7 +65,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/area/save b/DreamTown/cgi-bin/area/save index 0bce8db..116f461 100644 --- a/DreamTown/cgi-bin/area/save +++ b/DreamTown/cgi-bin/area/save @@ -65,7 +65,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/area/update b/DreamTown/cgi-bin/area/update index 613b7a1..8e8c8b8 100644 --- a/DreamTown/cgi-bin/area/update +++ b/DreamTown/cgi-bin/area/update @@ -58,7 +58,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/character/add b/DreamTown/cgi-bin/character/add index 9794220..7d38d23 100644 --- a/DreamTown/cgi-bin/character/add +++ b/DreamTown/cgi-bin/character/add @@ -47,7 +47,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/character/get b/DreamTown/cgi-bin/character/get index d6bcdbe..6014870 100644 --- a/DreamTown/cgi-bin/character/get +++ b/DreamTown/cgi-bin/character/get @@ -59,7 +59,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/character/save b/DreamTown/cgi-bin/character/save index b610251..4e740d3 100644 --- a/DreamTown/cgi-bin/character/save +++ b/DreamTown/cgi-bin/character/save @@ -54,7 +54,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/character/switch b/DreamTown/cgi-bin/character/switch index 9a2a4c3..ebb8f5a 100644 --- a/DreamTown/cgi-bin/character/switch +++ b/DreamTown/cgi-bin/character/switch @@ -46,7 +46,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) #print(json.dumps(result)) diff --git a/DreamTown/cgi-bin/code/getLogoutCode b/DreamTown/cgi-bin/code/getLogoutCode index a59fec5..8e738b7 100644 --- a/DreamTown/cgi-bin/code/getLogoutCode +++ b/DreamTown/cgi-bin/code/getLogoutCode @@ -231,7 +231,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/code/getPlayerData b/DreamTown/cgi-bin/code/getPlayerData index b5c0182..42bee07 100644 --- a/DreamTown/cgi-bin/code/getPlayerData +++ b/DreamTown/cgi-bin/code/getPlayerData @@ -173,7 +173,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/currency/add b/DreamTown/cgi-bin/currency/add index be85694..54c03c0 100644 --- a/DreamTown/cgi-bin/currency/add +++ b/DreamTown/cgi-bin/currency/add @@ -56,7 +56,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/currency/get b/DreamTown/cgi-bin/currency/get index 61d541f..5cec587 100644 --- a/DreamTown/cgi-bin/currency/get +++ b/DreamTown/cgi-bin/currency/get @@ -53,7 +53,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/currency/remove b/DreamTown/cgi-bin/currency/remove index ebbf031..dc8d24a 100644 --- a/DreamTown/cgi-bin/currency/remove +++ b/DreamTown/cgi-bin/currency/remove @@ -49,7 +49,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/currency/save b/DreamTown/cgi-bin/currency/save index 3195f26..54862fd 100644 --- a/DreamTown/cgi-bin/currency/save +++ b/DreamTown/cgi-bin/currency/save @@ -50,7 +50,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/dreamtown_config.py b/DreamTown/cgi-bin/dreamtown_config.py index 116383e..a558886 100644 --- a/DreamTown/cgi-bin/dreamtown_config.py +++ b/DreamTown/cgi-bin/dreamtown_config.py @@ -4,6 +4,7 @@ import mariadb import binascii import hashlib + #MAKE SURE THE DB IS *OUTSIDE* THE PUBLIC_HTML!!! #SQLLITE_DB_PATH = "/home/web/DreamTown.db" @@ -25,6 +26,9 @@ def DbConnect(): db = DbConnect() +def raise e: + print("".join(traceback.TracebackException.from_exception(e).format()) + def xor(data, key): l = len(key) return bytearray(( @@ -55,7 +59,7 @@ try: PassHash TEXT(128), Salt TEXT(128), LastSession TEXT(128), - CreationDate int + CreationDate bigint ); """) except: @@ -140,7 +144,7 @@ try: CREATE TABLE containerList( Name TEXT(12), HarvestableTemplateId int, - LastHarvest int, + LastHarvest bigint, ContainerName TEXT(128), AreaId int ); diff --git a/DreamTown/cgi-bin/harvestable/addContainer b/DreamTown/cgi-bin/harvestable/addContainer index 98c1f0a..e2d88b9 100644 --- a/DreamTown/cgi-bin/harvestable/addContainer +++ b/DreamTown/cgi-bin/harvestable/addContainer @@ -54,7 +54,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/harvestable/addHarvestable b/DreamTown/cgi-bin/harvestable/addHarvestable index 6ccce83..577c30b 100644 --- a/DreamTown/cgi-bin/harvestable/addHarvestable +++ b/DreamTown/cgi-bin/harvestable/addHarvestable @@ -52,7 +52,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/harvestable/get b/DreamTown/cgi-bin/harvestable/get index db32c25..2a51e83 100644 --- a/DreamTown/cgi-bin/harvestable/get +++ b/DreamTown/cgi-bin/harvestable/get @@ -70,7 +70,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/harvestable/remove b/DreamTown/cgi-bin/harvestable/remove index 8af9ce5..eb2bf84 100644 --- a/DreamTown/cgi-bin/harvestable/remove +++ b/DreamTown/cgi-bin/harvestable/remove @@ -51,7 +51,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/harvestable/save b/DreamTown/cgi-bin/harvestable/save index e0301b8..72dd788 100644 --- a/DreamTown/cgi-bin/harvestable/save +++ b/DreamTown/cgi-bin/harvestable/save @@ -56,7 +56,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/inventory/add b/DreamTown/cgi-bin/inventory/add index a3946d4..749cad1 100644 --- a/DreamTown/cgi-bin/inventory/add +++ b/DreamTown/cgi-bin/inventory/add @@ -55,7 +55,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/inventory/get b/DreamTown/cgi-bin/inventory/get index e24cd12..e4c8443 100644 --- a/DreamTown/cgi-bin/inventory/get +++ b/DreamTown/cgi-bin/inventory/get @@ -53,7 +53,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/inventory/remove b/DreamTown/cgi-bin/inventory/remove index a32c219..b01d912 100644 --- a/DreamTown/cgi-bin/inventory/remove +++ b/DreamTown/cgi-bin/inventory/remove @@ -55,7 +55,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/inventory/save b/DreamTown/cgi-bin/inventory/save index 39a122a..1b8f944 100644 --- a/DreamTown/cgi-bin/inventory/save +++ b/DreamTown/cgi-bin/inventory/save @@ -50,7 +50,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/npc/get b/DreamTown/cgi-bin/npc/get index 74c265d..8ee7dd3 100644 --- a/DreamTown/cgi-bin/npc/get +++ b/DreamTown/cgi-bin/npc/get @@ -53,7 +53,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/npc/save b/DreamTown/cgi-bin/npc/save index 338ba7f..db4ba07 100644 --- a/DreamTown/cgi-bin/npc/save +++ b/DreamTown/cgi-bin/npc/save @@ -53,7 +53,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/npc/update b/DreamTown/cgi-bin/npc/update index d8cb4d8..2b39975 100644 --- a/DreamTown/cgi-bin/npc/update +++ b/DreamTown/cgi-bin/npc/update @@ -58,7 +58,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/relation/get b/DreamTown/cgi-bin/relation/get index 7f6a2e2..4bb3a52 100644 --- a/DreamTown/cgi-bin/relation/get +++ b/DreamTown/cgi-bin/relation/get @@ -51,7 +51,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/relation/save b/DreamTown/cgi-bin/relation/save index 704878c..f40b7a7 100644 --- a/DreamTown/cgi-bin/relation/save +++ b/DreamTown/cgi-bin/relation/save @@ -51,7 +51,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/relation/update b/DreamTown/cgi-bin/relation/update index 0211ef6..523efad 100644 --- a/DreamTown/cgi-bin/relation/update +++ b/DreamTown/cgi-bin/relation/update @@ -55,7 +55,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/rubish/add b/DreamTown/cgi-bin/rubish/add index 8a4165b..388f60f 100644 --- a/DreamTown/cgi-bin/rubish/add +++ b/DreamTown/cgi-bin/rubish/add @@ -51,7 +51,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/rubish/get b/DreamTown/cgi-bin/rubish/get index cf1fb73..599de2f 100644 --- a/DreamTown/cgi-bin/rubish/get +++ b/DreamTown/cgi-bin/rubish/get @@ -54,7 +54,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/rubish/remove b/DreamTown/cgi-bin/rubish/remove index 4cc772d..2b9ee44 100644 --- a/DreamTown/cgi-bin/rubish/remove +++ b/DreamTown/cgi-bin/rubish/remove @@ -48,7 +48,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/rubish/save b/DreamTown/cgi-bin/rubish/save index 8c94b66..4b10f00 100644 --- a/DreamTown/cgi-bin/rubish/save +++ b/DreamTown/cgi-bin/rubish/save @@ -54,7 +54,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/scenario/add b/DreamTown/cgi-bin/scenario/add index 296ae6b..2022d16 100644 --- a/DreamTown/cgi-bin/scenario/add +++ b/DreamTown/cgi-bin/scenario/add @@ -47,7 +47,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/scenario/complete b/DreamTown/cgi-bin/scenario/complete index 9f3260c..fbf1221 100644 --- a/DreamTown/cgi-bin/scenario/complete +++ b/DreamTown/cgi-bin/scenario/complete @@ -47,7 +47,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/scenario/get b/DreamTown/cgi-bin/scenario/get index b6adc0e..f1b6e01 100644 --- a/DreamTown/cgi-bin/scenario/get +++ b/DreamTown/cgi-bin/scenario/get @@ -55,7 +55,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/scenario/update b/DreamTown/cgi-bin/scenario/update index 1af4f73..98327be 100644 --- a/DreamTown/cgi-bin/scenario/update +++ b/DreamTown/cgi-bin/scenario/update @@ -55,7 +55,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/time/get b/DreamTown/cgi-bin/time/get index d44d704..82af35c 100644 --- a/DreamTown/cgi-bin/time/get +++ b/DreamTown/cgi-bin/time/get @@ -53,7 +53,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/tutorial/add b/DreamTown/cgi-bin/tutorial/add index c021de3..be903c2 100644 --- a/DreamTown/cgi-bin/tutorial/add +++ b/DreamTown/cgi-bin/tutorial/add @@ -47,7 +47,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file diff --git a/DreamTown/cgi-bin/tutorial/get b/DreamTown/cgi-bin/tutorial/get index 9e3c2b1..a890c9e 100644 --- a/DreamTown/cgi-bin/tutorial/get +++ b/DreamTown/cgi-bin/tutorial/get @@ -53,7 +53,7 @@ try: db.commit() db.close() except Exception as e: - print(e) + raise e os._exit(1) print(json.dumps(result)) \ No newline at end of file