Added support for reset at certain points to golf

This commit is contained in:
2022-05-29 21:31:52 -04:00
parent cc461ec382
commit ec3afbfb92
4 changed files with 24 additions and 9 deletions

View File

@@ -167,7 +167,7 @@ def repair(): # Repairs all tables or updates them if needed
"space3likes" : [["id", 1], ["account", 0]],
"golfGamePlayers" : [["gameID", 1], ["multiplier", 1], ["user", 0], ["points", 1], ["orderID", 1], ["lastMode", 0], ["upToDate", 6], ["turnsSkipped", 1]],
"golfGameCards" : [["gameID", 1], ["user", 0], ["card", 1], ["cardPlacement", 1], ["faceUp", 6]],
"golfGame" : [["ID", 5], ["deck", 4], ["discard", 4], ["cardNumber", 1], ["flipNumber", 1], ["multiplierForFlip", 1], ["pointsToEnd", 1], ["name", 0], ["password", 0], ["players", 1], ["playersToStart", 1], ["currentPlayer", 1], ["turnStartTime", 1], ["locked", 6], ["decks", 1], ["skipTime", 1], ["timeLeft", 1], ["skipTurns", 1]],
"golfGame" : [["ID", 5], ["deck", 4], ["discard", 4], ["cardNumber", 1], ["flipNumber", 1], ["multiplierForFlip", 1], ["pointsToEnd", 1], ["name", 0], ["password", 0], ["players", 1], ["playersToStart", 1], ["currentPlayer", 1], ["turnStartTime", 1], ["locked", 6], ["decks", 1], ["skipTime", 1], ["timeLeft", 1], ["skipTurns", 1], ["resetPoints", 1]],
"docker" : [["link", 0], ["action", 0], ["image", 0], ["password", 0], ["owner", 0], ["port", 1], ["ID", 0]],
"dockerImages" : [["realName", 0], ["shortName", 0]]
}
@@ -226,7 +226,7 @@ def repair(): # Repairs all tables or updates them if needed
changedTables.append(name)
elif name == "information": # Used to check the information table to see if the database can be updated in a better way.
version = trueSearch("SELECT data FROM information WHERE pointer='version'")
latest_version = "v2.3"
latest_version = "v2.4"
if version: # Checks if the version tag still exists.
try: # In here you can update the version to a new version
version = version[0][0]
@@ -265,6 +265,9 @@ def repair(): # Repairs all tables or updates them if needed
command("UPDATE golfGamePlayers SET turnsSkipped='0'")
version = "v2.3"
updatedVersions.append("v2.3")
if version == "v2.3": # Adds support for reset points when hitting a certain multiplier
command("ALTER table golfGame ADD resetPoints int")
command("UPDATE golfGame SET resetPoints='0'")
# Fixes the version if it is invalid to the latest version
if version != latest_version:
version = latest_version