Best approach for waiting for approval

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

mixart
Posts: 95
Joined: 08 Aug 2007, 20:32

Best approach for waiting for approval

Postby mixart » 20 Apr 2012, 10:04

Just curious from you all the best approach to this:

Have a room full of users, a user can ask for the rest of the room users to approve a request and more than half the room needs to approve or deny the request.

Which of these makes more sense?
- user asking request sends an object to each user. Each user gets a dialog asking to approve or deny. Responses are sent back to the requester and client-side the if the requester receives enough approval responses, they are granted their request
- user asking request sends and extension message to the server. The extension counts users in the room, creates a room variable to count all the responses. On roomvars update, the requester would tally results and be given approval.

or any other approaches?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Best approach for waiting for approval

Postby rjgtav » 20 Apr 2012, 23:04

Hi.
Well, the best way is really to do it server-side. You could also try using the Invitation system from the Game API.
If you decide to use the RoomVariable option, for example, the requester sends an ExtensionRequest asking for a request, and the extension sends to all the users in that room a message asking if they accept that request or not. Every time an user replies, he sends also an ExtensionRequest, which then updates a room variable. After some time or when the last user answers, you provide the result to the rest of the users.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 26 guests