20 lines
559 B
Lua
20 lines
559 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
|
|
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 |