[server side] what information can be gathered about users, pipes, channels, ... ?

11 views
Skip to first unread message

nouknouk

unread,
Feb 23, 2010, 2:13:37 PM2/23/10
to APE Project
Hi,

I did a little function to retrive all informations available when
receiving a command from a client.

I basically found:

infos[host]=18.ape.mydomain.net:6969
infos[client]=[object apesocket]
infos[chl]=2
infos[ip]=1.2.3.4
infos[user]=[object user]
infos[subuser]=[object subuser]

... plus the pipe object in the user instance(s).

I would like to know if it is possible to retrieve other data, more
especially the session ID of the user (chen using sessions, of
course).

Another information may be usefull too (at least for me), like knowing
the exact status of the user's connexion to the APE server: is a
'CHECK' request currently open (the user is definitively still
connected), or not (there is a chance he left the website). If not,
when was the last connexion, ...

Also, I noticed there are several properties stored in several
objects, which can be retrieved with the getProperty() function. Is
there somewhere an extensive list of all properties filled by default
for each object type (pipe, user, channel, ...) ?

Many thanks in advance.

Anthony Catel

unread,
Feb 23, 2010, 2:39:59 PM2/23/10
to ape-p...@googlegroups.com
Hi, nouknouk,

Indeed, you can look at "APE_JS_NATIVE(apeuser_sm_get_property)" in
libape-spidermonkey.c

When a registerCmd is called, you can be sure that the user is still
connected at this time.
Btw, don't forget that you can store informations in "user" object an
resolve them in cmd.user.

i.e.


Ape.addEvent("adduser", function(user) {
user.foo = "bar";
});

Ape.registerCmd("bla", true, function(params, cmd) {
Ape.log(cmd.user.foo);
});

All users, channel objects are persistants.

Hope this help ;)

Anthony

nouknouk a �crit :

Nouk NOUK

unread,
Feb 23, 2010, 4:46:52 PM2/23/10
to ape-p...@googlegroups.com


2010/2/23 Anthony Catel <a.c...@weelya.com>

Hi, nouknouk,

Indeed, you can look at "APE_JS_NATIVE(apeuser_sm_get_property)" in libape-spidermonkey.c


Thanks for that.

 
When a registerCmd is called, you can be sure that the user is still connected at this time.

My idea was more to check if *another* user (or subuser) was connected.

Indeed, it would be usefull to discriminate two cases: when one (sub)user connects a second time. It can either be because he just refreshed his browser (hit F5), or because he opened a second tab of the same webpage in the same browser. Knowing if the 'other' subuser is actually 'connected' or not would give me informations about those two different cases.


Nouk NOUK

unread,
Feb 23, 2010, 4:56:49 PM2/23/10
to ape-p...@googlegroups.com

Note: according to APE_JS_NATIVE(apeuser_sm_get_property) function, there are 3 properties that can be readen: 'sessid', 'ip' and 'pubid' for users objects.

I suppose it could be written somewhere in the doc (for example in the 'sessions' tutorial, for the 'sessid' property).


Best regards,

Nouk²


2010/2/23 Nouk NOUK <nouk...@gmail.com>
Reply all
Reply to author
Forward
0 new messages