有人用APE服务器吗?
我正在尝试弄清楚如何使用 Ape,但是聊天演示代码中有一些我不理解的内容,并且在文档中找不到任何相关内容。 这是代码:
var userlist = new $H;
Ape.registerHookCmd("connect", function(params, cmd) {
if (!$defined(params.name)) return 0;
if (userlist.has(params.name.toLowerCase())) return ["005", "NICK_USED"];
if (params.name.length > 16 || params.name.test('[^a-zA-Z0-9]', 'i')) return ["006", "BAD_NICK"];
cmd.user.setProperty('name', params.name);
return 1;
});
Ape.addEvent('adduser', function(user) {
userlist.set(user.getProperty('name').toLowerCase(), true);
});
Ape.addEvent('deluser', function(user) {
userlist.erase(user.getProperty('name').toLowerCase());
});
在定义 userlist 时的第一行,$H 是什么?我在文档和第四行 userlist.has 中找不到任何有关它的信息,我在哪里可以阅读有关此 .has 的信息,我明白它的含义,但我想也许还有更多类似的命令。 如果有人曾与 ape 合作过并且可以帮助我解决这个问题,那将对我很有帮助。
谢谢
i am trying to figure out how to work with Ape, but there are some things in the chat demo code that i dont understand and cant find nothing about it in the documentation.
here is the code:
var userlist = new $H;
Ape.registerHookCmd("connect", function(params, cmd) {
if (!$defined(params.name)) return 0;
if (userlist.has(params.name.toLowerCase())) return ["005", "NICK_USED"];
if (params.name.length > 16 || params.name.test('[^a-zA-Z0-9]', 'i')) return ["006", "BAD_NICK"];
cmd.user.setProperty('name', params.name);
return 1;
});
Ape.addEvent('adduser', function(user) {
userlist.set(user.getProperty('name').toLowerCase(), true);
});
Ape.addEvent('deluser', function(user) {
userlist.erase(user.getProperty('name').toLowerCase());
});
on the first line when userlist is define what is that $H? i cant find anything about it in the documentation and on the forth line userlist.has, where can i read about this .has, i understand what it means but im thinking maybe there are more commands like that.
if anyone has worked with ape and can help me with this, it would help me very much.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这是一个 MooTools 哈希: http://mootools.net/docs/core125/core/原生/哈希
I think that's a MooTools Hash: http://mootools.net/docs/core125/core/Native/Hash