From d48ad24c08b74ba850873778ed4e1b65d879161e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sun, 17 Mar 2024 21:20:39 -0500 Subject: [PATCH] adding map db --- app.lua | 4 +++- config.lua | 3 ++- database.sqlite3 | Bin 20480 -> 20480 bytes lua_scripts/map.lua | 30 ++++++++++++++++++++++++++++++ setup_db | 2 +- 5 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 lua_scripts/map.lua diff --git a/app.lua b/app.lua index 49da45a..4ebef33 100644 --- a/app.lua +++ b/app.lua @@ -1,18 +1,20 @@ local lapis = require("lapis") local app = lapis.Application() local say = require('lua_scripts/main') +local mapFunc = require('lua_scripts/map') local player = require('player') local db = require("lapis.db") local Model = require("lapis.db.model").Model -local db = Model:extend('database') +local map = Model:extend('map') app:enable("etlua") app.layout = require "views.layout" app:post("/clickme", function(self) self.plane = "P-38L" + mapFunc.populate(self, map) return {self.plane, layout = false} end) diff --git a/config.lua b/config.lua index fd412a1..2c6dc80 100644 --- a/config.lua +++ b/config.lua @@ -4,8 +4,9 @@ config("development", { server = "nginx", code_cache = "off", num_workers = "1", + port = "1010" sqlite = { - database = "my_database.sqlite", + database = "database.sqlite3", -- open_flags = ... } }) diff --git a/database.sqlite3 b/database.sqlite3 index d5c7d8885092a70b7dfb65935ced5151f85890cb..6c4792d4070b6970beef5abe9c73f4b481be155d 100644 GIT binary patch delta 69 zcmZozz}T>Wae_1>%S0JxMwX2UOZeFs`M)vnf7>i5@P=Q6gOQDapP!f4(2$pbfq{|# Y2Lt~Ppv*gd4mL(+Vb0vdf<*!f0A}?NbN~PV delta 30 kcmZozz}T>Wae_1>^F$eEM&^wPOZYdl82pi6