Ok I have edited my script which seems to load up a user id and
name...  The [[+smf.username]] is just a placeholder that will pass
the username.  Now I guess I need to figure out how to send messages
to the mainLobby channel then take it further to one to one messages.
Does this appear to be correct so far?


        APE.Config.scripts = [APE.Config.baseUrl + '/Build/
uncompressed/apeCoreSession.js'];
        var client = new APE.Client();

        client.load({'identifier': 'shoutit', 'channel':'mainLobby',
'userid':'1'});
        client.addEvent('load', function() {
         //core.options.restore is true if a session is active
                if (client.core.options.restore) {
                    client.core.start();
                } else {
                    client.core.start({'name':'[[+smf.username]]',
'userid':'[[+smf.id]]'});
                }
        });

        client.addEvent('ready', function() {
            if (client.core.options.restore) {
                client.core.getSession('name', function(name) {
                    console.log('Receiving sessions data. username
value is : ', name.data.sessions.name);
                });
                client.core.getSession('id', function(id) {
                    console.log('Receiving sessions data. id value
is : ', id.data.sessions.id);
                });
            } else {

                console.log('saving custom session data, username on
the server');
                client.core.setSession({'name':'[[+smf.username]]',
'id':'[[+smf.id]]'});
            }
        });

        client.addEvent('multiPipeCreate', function(pipe) {
                console.log('New pipe ' + pipe.name);
        });

-- 
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/

Reply via email to