0
我無法調用未定義AS3的方法put
。以下是造成問題(我用Smartfoxserver來運行該服務器)代碼:無法調用未定義AS3的方法「put」
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)
}