mirror of https://github.com/minetest/minetest.git
FIxed some problems
This commit is contained in:
parent
61871358c2
commit
4556de1087
|
@ -122,6 +122,7 @@ core.builtin_auth_handler = {
|
|||
core.auth_table[name] = {
|
||||
password = password,
|
||||
privileges = core.string_to_privs(core.setting_get("default_privs")),
|
||||
lastlogin = 0,
|
||||
}
|
||||
save_auth_file()
|
||||
end,
|
||||
|
|
|
@ -126,7 +126,7 @@ bool ScriptApiServer::setPassword(const std::string &playername,
|
|||
}
|
||||
|
||||
bool ScriptApiServer::set_login_time(const std::string &playername,
|
||||
const std::int &logintime)
|
||||
int logintime)
|
||||
{
|
||||
SCRIPTAPI_PRECHECKHEADER
|
||||
|
||||
|
@ -136,7 +136,7 @@ bool ScriptApiServer::set_login_time(const std::string &playername,
|
|||
if(lua_type(L, -1) != LUA_TFUNCTION)
|
||||
throw LuaError("Authentication handler missing set_login_time");
|
||||
lua_pushstring(L, playername.c_str());
|
||||
lua_pushNumber(L, logintime);
|
||||
lua_pushnumber(L, logintime);
|
||||
if(lua_pcall(L, 2, 1, m_errorhandler))
|
||||
scriptError();
|
||||
return lua_toboolean(L, -1);
|
||||
|
|
|
@ -42,6 +42,8 @@ public:
|
|||
const std::string &password);
|
||||
bool setPassword(const std::string &playername,
|
||||
const std::string &password);
|
||||
bool set_login_time(const std::string &playername,
|
||||
int logintime)
|
||||
private:
|
||||
void getAuthHandler();
|
||||
void readPrivileges(int index, std::set<std::string> &result);
|
||||
|
|
|
@ -1601,11 +1601,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
|||
L"a minute.");
|
||||
}
|
||||
|
||||
time_t time;
|
||||
time = time(NULL);
|
||||
time_t logtim;
|
||||
logtim = time(NULL);
|
||||
|
||||
|
||||
m_script->set_login_time(playername, (int) time);
|
||||
m_script->set_login_time(playername, (int) logtim);
|
||||
|
||||
m_clients.setPlayerName(peer_id,playername);
|
||||
|
||||
|
|
Loading…
Reference in New Issue