Files
ashlar/scripts/world/sql.lua
T
David Cernat 14bd073102 [General] Implement ban system and associated commands
Create banlist.json file.

Add playerName argument to Player initialization to allow the reading of player files for players who are offline.

Fix confusing syntax for some command descriptions.

Rename pname into playerName in all instances for consistency in variable naming.

Remove unnecessary spaces at the ends of certain rows.

Remove unnecessary lib/.gitkeep
2017-07-27 20:51:09 +03:00

35 lines
637 B
Lua

Database = require("database")
local BaseWorld = require("world.base")
local World = class("World", BaseWorld)
function World:__init()
BaseWorld.__init(self)
if self.hasEntry == nil then
local test = Database:GetSingleValue("world_general", "currentMpNum", "")
if test ~= nil then
self.hasEntry = true
else
self.hasEntry = false
end
end
end
function World:CreateEntry()
self:Save()
self.hasEntry = true
end
function World:Save()
Database:SaveWorld(self.data)
end
function World:Load()
self.data = Database:LoadWorld(self.data)
end
return World