On Mar 4, 5:36 pm, Anthony Catel <[email protected]> wrote:
> Hi,
>
> What version do you run?
> Do you have some custom modules? server-side JS modules?
>
> Thanks
>
> Anthony
Running version 1.0. Yes server-side JS modules:
stats.js:
Ape.registerCmd('getUsers', true, function(params,info) {
var responseArr = [];
var channel = Ape.getChannelByName('*testChannel');
if(channel != null)
{
channel.userslist.each(function(user) {
if(user.getProperty("ClientName") !=
'undefined')
{
responseArr.push({"ClientName":user.getProperty("ClientName"),
"ClientIP":user.getProperty("ClientIP"),
"ClientUserAgent":user.getProperty("ClientUserAgent"),
"ClientConnectTime":
user.getProperty("ClientConnectTime")});
}
});
var outChannel =
Ape.getChannelByName('*statsChannel');
if(outChannel == null)
outChannel = Ape.mkChan('*statsChannel');
outChannel.pipe.sendRaw("USERS_LIST", responseArr);
}
return 1;
});
Ape.registerHookCmd('join', function(params, info) {
var channel = Ape.getChannelByName('*statsChannel');
if(channel == null)
channel = Ape.mkChan('*statsChannel');
channel.pipe.sendRaw("USER_CONNECT",
{"ClientName":info.user.getProperty("ClientName"),
"ClientConnectTime": info.user.getProperty("ClientConnectTi
me"),
"ClientIP": info.ip, "ClientUserAgent":
info.user.getProperty("ClientUserAgent")});
});
Ape.registerHookCmd('left', function(params, info) {
var channel = Ape.getChannelByName('*statsChannel');
if(channel == null)
channel = Ape.mkChan('*statsChannel');
channel.pipe.sendRaw("USER_DISCONNECT",
{"ClientName":info.user.getProperty("ClientName") });
});
Ape.registerHookCmd('deluser', function(user) {
var channel = Ape.getChannelByName('*statsChannel');
if(channel == null)
channel = Ape.mkChan('*statsChannel');
channel.pipe.sendRaw("USER_DISCONNECT",
{"ClientName":user.getProperty("ClientName") });
});
Ape.registerHookCmd('connect', function(params, info) {
info.user.setProperty('ClientName', params.name);
info.user.setProperty('ClientIP', info.ip);
info.user.setProperty('ClientUserAgent',
params.clientUserAgent);
info.user.setProperty('ClientConnectTime', new
Date().toTimeString());
});
-------------------------------------------------------------------------------------------------------------------------
bid.js:
Ape.registerCmd('bid', true, function(params, info) {
Ape.log('bid placed from ' + info.ip);
Ape.getPipe(params.pubid).sendRaw("OUTGOING_BID", {"Bid":params.msg,
"Bidder":params.clientName, "ClientIP": params.clientIP,
"ClientUserAgent": params.clientUserAgent});
});
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/