Page 1 of 1

Realtime global variable!?

Posted: 02 Feb 2012, 22:45
by hassanayoub85
Hello,
Can I setup a global variable in the server, which will be available for all connected users in real time?
If yes, how to do this and access it?
Thx

Posted: 02 Feb 2012, 23:04
by rjgtav
Hi.

I suggest you to use a variable stored in a Zone-Level Extension so every user that is logged in that zone can access it. Then, for retrieving that variable, you have 2 options available:

1. You just send an ExtensionRequest from the client to that extension, which sends back the value of that variable

2. Schedule a new task on the Server-Side which runs at a specific rate, and each time it runs, it sends the value of that variable to everyone that is connected.

Of course this all depends on your application and the kind of variable you're dealing with. Please keep in mind that sending data to a lot of people can use significant network resources.

Posted: 02 Feb 2012, 23:55
by hassanayoub85
I am yhniking of using this variable to move the cars while racing.

Posted: 03 Feb 2012, 19:08
by rjgtav
Hmm? So what kind of global variable are you referring to?

Posted: 04 Feb 2012, 01:19
by hassanayoub85
for now all what i want is to create a string with 10 characters. and how to access it from clients and change it too.