I guess the first time the user connect, but when you refresh the page,
i guess the APE Server will awnser you an error like NICK_USED.
[email protected] a écrit :
Uniquestring is the string, not a variable. So I was trying
this: client.core.start({"name":"jefe"})
Is that incorrect format? I'm not doing anything
with that info, just trying to connect.
On Jan 5, 5:46 pm, Nicolas Trani <[email protected]> wrote:
Hi,
I suggest you to use to firebug to find what is the response of the APE
server.
- When you do client.core.start(); the server response is BAD_PARAMS
because name argument is mandatory. If you don't want to use name, edit
main.ape.js on the server side and remove nickname.js.
- And when you do ({"name":"uniquestring") what is the content of
uniquestring, do it contain some special character?
Cheers.
[email protected] a crit :
This works fine: client.core.start({"name":prompt('your name')});
After I enter a string from the prompt, it connects to my server and
the page can send/recieve. However I don't want to prompt people, I
just wanted my page to auto join. When I do this, client.core.start
(), the page just hangs. Even this client.core.start
({"name":"uniquestring"), will not work. It seems like it needs the
prompt command??
I must be doing something wrong. Any ideas would be great. Below is
my code:
//Instantiate APE Client
var client = new APE.Client();
//Load APE Core
client.load();
//Intercept 'load' event. This event is fired when the
Core is loaded and ready to connect to APE Server
client.addEvent('load', function() {
//Call core start function to connect to APE Server
client.core.start({"name":prompt('testing')});
//client.core.start();
$('#message').html('started');
});
//4) Listen to the ready event to know when your client is
connected
client.addEvent('init', function() {
//console.log('Your client is now connected');
$('#message').html('connected');
//1) join 'testChannel'
client.core.join('testChannel');
//2) Intercept multiPipeCreate event
client.addEvent('multiPipeCreate', function(pipe,
options) {
//3) Send the message on the pipe
pipe.send('Jefeyo');
//console.log('Sending Hello world');
$('#message').html('sending jefeyo');
});
//4) Intercept the reception of new message.
client.onRaw('data', function(raw, pipe) {
//console.log('Receiving : ' + unescape
(raw.data.msg));
$('#message').html(unescape(raw.data.msg));
});
});
--
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/