Can the server read varibles, without the client sending it?

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

poppop
Posts: 57
Joined: 07 Jul 2007, 10:24

Can the server read varibles, without the client sending it?

Postby poppop » 11 Aug 2007, 13:50

Hello,

Is it possible for the server to request the value of a varible or position of a movieclip, without the client sending it?

Only the server requesting it.

So instead of...
================================
CLIENT SITE:

_root.var1 = 123
_root.var2 = 456

function SendToServer(var1, var2){

}
=================================

I could maybe have:

=================================
CLIENT SIDE:

_root.var1 = 123
_root.var2 = 456

function SendToServer(){

}

SERVER SIDE:

function Check Player1's var1 and var 2 value

=============================


Hope this makes sense.


Thanks. :wink:
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 16 Aug 2007, 09:30

Is it possible for the server to request the value of a varible or position of a movieclip, without the client sending it?

You're reversing the problem... it's not the server that sends requests to the client, it's the opposite.
At least in terms of logic.

If the client needs to update certain data (mc positions or whatever else) just send a message to the server.
Lapo
--
gotoAndPlay()
...addicted to flash games
poppop
Posts: 57
Joined: 07 Jul 2007, 10:24

Postby poppop » 17 Aug 2007, 15:19

Lapo wrote:
Is it possible for the server to request the value of a varible or position of a movieclip, without the client sending it?

You're reversing the problem... it's not the server that sends requests to the client, it's the opposite.
At least in terms of logic.

If the client needs to update certain data (mc positions or whatever else) just send a message to the server.



Can the server do it then?

Can it request info from the client, without the client sending it?

if a varible in the client side is _root.var = "xxx"

Could the server just request that without the client sending it to the server first?


Thanks.
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 17 Aug 2007, 15:25

of course. The server can send a message with a certain "command" name.
Let's it is called "tellMeTheVariable"

When this message gets to the client, the client responds with the value.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 46 guests