Files
ashlar/scripts/player/sql.lua
T
David Cernat b6f5fcce64 Change IsLoggedOn & LoggedOn into IsLoggedIn & FinishLogin
"Logging on" usually has a different meaning than "logging in." In the context of players putting in their names and passwords, we should use the latter.

For more information, read http://stackoverflow.com/a/406034
2017-02-19 01:46:43 +02:00

37 lines
872 B
Lua

local BasePlayer = require "player.base"
local Player = class ("Player", BasePlayer)
--[[function Player:__init(pid)
BasePlayer:__init(pid)
self.accountFile = self.accountName .. ".txt"
if self.hasAccount == nil then
local home = os.getenv("MOD_DIR").."/players/"
local file = io.open(home .. self.accountFile, "r")
if file ~= nil then
io.close()
self.hasAccount = true
else
self.hasAccount = false
end
end
end
function Player:CreateAccount()
LIP.save("players/" .. self.accountFile, self.data)
self.hasAccount = true
end
function Player:Save()
if self.hasAccount and self.loggedIn then
LIP.save("players/" .. self.accountFile, self.data)
end
end
function Player:Load()
self.data = LIP.load("players/" .. self.accountFile)
end]]--
return Player