21 lines
602 B
Lua
21 lines
602 B
Lua
local ServerPlayerData = class("ServerPlayerData", ServerBaseData)
|
|
|
|
function ServerPlayerData:init(data)
|
|
self.data.loginDay = data and data.loginDay or 0
|
|
self.data.lastLoginTime = data and data.lastLoginTime or 0
|
|
Logger.logHighlight(Time:getServerTime())
|
|
if self.data.lastLoginTime < Time:getBeginningOfServerToday() then
|
|
self.data.lastLoginTime = Time:getBeginningOfServerToday()
|
|
self.data.loginDay = self.data.loginDay + 1
|
|
end
|
|
end
|
|
|
|
function ServerPlayerData:setVit(vit)
|
|
self.vit = tonumber(vit) or 0
|
|
end
|
|
|
|
function ServerPlayerData:getVit()
|
|
return self.vit or 0
|
|
end
|
|
|
|
return ServerPlayerData |