This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-05-14 11:28:44

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

I am very happy today!!!

I am crazily happy today basically because i jst experiment and found a method with Old Comet System that can now actually make realtime games possible just with PHP and JavaScript (for those who know PHP and JAVASCRIPT BOTH ::
Just make a dynamic stack of xmlHTTPRequests (XHR here on) to server for getting a variable information i mean at a time manage more then 1 XHR's and code the server side script to give reply to only request at a time (i leave it to you how to do that ) , using the architecture and using a function like

Code:

function XHR()
{ make multibrowser XMLHTTPRequest;
}

var RequestRate;

function SetReqRate(){
var Last = new Date().getTime();

tester = new XHR();
params = "Hi=Hello";
tester.open('POST','yourUrl.php','false');
tester.send();
var Now = new Date().getTime();

delta = Now - Last;

RequestRate = math.ceil(1000/delta);
}

Now POP() all the requests that have responded and PUSH() n requests per second you could also handle your function dynamically to have epic fast rate of data transfers

I know streaming is a solution but streaming can bug sometimes in my model it can never bug i mean if streaming crashes the whole application is crashed but if 1 request crashes in this model it wont just update the variables once -> the nxt request will cover it up

  big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile  ..

and also my chat project nearly being finished!!! (Though much done is left)

Last edited by fanofcena (2011-05-14 11:30:28)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

Board footer