我不能调用put
未定义的 AS3 的方法。以下是导致问题的代码(我正在使用 Smartfoxserver 运行此服务器):
var error = ""
var nick = evt["nick"].split("~")[1]
var pass = evt["pass"]
var chan = evt["chan"]
var userList = zone.getUserList()
var sql = "SELECT * FROM meh_users WHERE Username='" + String(nick) + "' AND Password='" + String(pass) + "' LIMIT 1"
debug(">>Channel: " + chan);
var queryRes = dbase.executeQuery(sql)
if (queryRes != null)
{
for(var i = 0; i < queryRes.size(); i++)
{
user = _server.getUserByChannel(chan)
uData.put("intLevel", queryRes.get(0).getItem("Level"))
uData.put("CharID", queryRes.get(0).getItem("id"))
var access = parseInt(queryRes.get(0).getItem("Access"))
if(access > 40) {
user.setAsModerator()
}
if(access > 60) {
user.setAsAdmin()
}
uData = []
initUserProperties(user)
}
}
if (userList[nick] != pass)
{
error = "Authentication failed"
}
else
{
var obj = _server.loginUser(nick, pass, chan)
if (obj.success == false)
error = obj.error
}
// Send response to client
var response = new Object()
if (error == "")
{
response._cmd = "logOK"
}
else
{
response._cmd = "logKO"
response.err = error
}
_server.sendResponse(response, -1, null, chan)
}