anti cheat: don't trust the client, move trip completions to server
All checks were successful
pedestrian-simulator / build (push) Successful in 1m11s

This commit is contained in:
2026-01-14 17:17:58 -07:00
parent f0172afb1e
commit 16c6c9c074
5 changed files with 121 additions and 83 deletions

View File

@@ -134,5 +134,13 @@ func createTables() {
// Migration for KML description
db.Exec("ALTER TABLE kml_metadata ADD COLUMN IF NOT EXISTS description TEXT")
// Migration for trips metadata
db.Exec("ALTER TABLE trips ADD COLUMN IF NOT EXISTS trip_type ENUM('address', 'kml') DEFAULT 'address'")
db.Exec("ALTER TABLE trips ADD COLUMN IF NOT EXISTS route_name TEXT")
db.Exec("ALTER TABLE trips ADD COLUMN IF NOT EXISTS start_address TEXT")
db.Exec("ALTER TABLE trips ADD COLUMN IF NOT EXISTS end_address TEXT")
db.Exec("ALTER TABLE trips ADD COLUMN IF NOT EXISTS kml_id INT")
db.Exec("ALTER TABLE trips ADD COLUMN IF NOT EXISTS total_distance DOUBLE")
log.Println("Database tables initialized")
}