Mute users

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

User avatar
Xelius
Posts: 70
Joined: 06 Apr 2006, 15:16
Location: Sweden
Contact:

Mute users

Postby Xelius » 06 Apr 2006, 15:30

Hi!
I'm making my own moderator functions, I want to be able to mute a user from the chat. I have user variables on the server which stores the mute status (1 or 0), everything works fine. But now I'm wondering how I'm actually going to stop the message from being sent?

I tried writing a custom public message, which worked, except for the flood filter, which I still want.

One solution would be to store the mute status in the flash using the onUserVariablesUpdate function, and only display the message if the user who sent it isn't muted. But that would be a lot of extra programming and waste of bandwidth.

Any other ideas on how I could approach this?
User avatar
Xelius
Posts: 70
Joined: 06 Apr 2006, 15:16
Location: Sweden
Contact:

Postby Xelius » 06 Apr 2006, 16:03

I tried the onUserVariablesUpdate solution. It wasn't to bad, but there's one problem, It dosn't send a update to the user whos variables are being updated. But I guess I can go around it by sending a server response to that user, or is there a better way?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 07 Apr 2006, 05:59

I would suggest a couple of simple solution:

1) Simply set a flag in the client. When the moderator sends a "muted" command to the client he won't be able to send public messages, by disabling the "Send" button or so. Plain and simple :)

2) Set a flag on all clients. A UserVariable, like you suggested. I don't see wy it should be a waste of bandwidth. Unless you plan to continuosly mute and un-mute hundreds of clients, I don't see the bandwidth problem.

You would use the same method as before, only this extra flag guarantees that hacked clients won't work too.

I tried the onUserVariablesUpdate solution. It wasn't to bad, but there's one problem, It dosn't send a update to the user whos variables are being updated. But I guess I can go around it by sending a server response to that user, or is there a better way?


That's correct but you already muted him, so from that moment his "Send" function will be inhibited

hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
goodguy20k
Posts: 71
Joined: 10 Jan 2006, 23:58
Location: Texas, USA
Contact:

Postby goodguy20k » 07 Apr 2006, 20:14

Lapo wrote:2) Set a flag on all clients. A UserVariable, like you suggested. I don't see wy it should be a waste of bandwidth. Unless you plan to continuosly mute and un-mute hundreds of clients, I don't see the bandwidth problem.


You corrected his problem with bandwidth in part 1, but I'd just like to mention something. We're all worried about hackers breaking into our code and messing everything up. Here is one of those times where a user could dump the Flash code, find out how the mute flag is set and either try blocking it, or, if you don't use the domain policy trick, he/she could compile their own version of your Flash app with the mute flag code removed and you're helpless. That's where I agree with Lapo on doing both steps to mute someone.

By the way, Lapo, the bandwidth problem I think he was talking about is when you set a UserVariable to mute, yet the user can still send messages. That's extra load that goes nowhere. Just thought I'd help point this out.
User avatar
Xelius
Posts: 70
Joined: 06 Apr 2006, 15:16
Location: Sweden
Contact:

Postby Xelius » 09 Apr 2006, 21:39

Lapo I went with solution two, setting a variable on all clients, and it works perfectly. Security is very important for me, so number one wasn't really an option.

goodguy20k wrote:By the way, Lapo, the bandwidth problem I think he was talking about is when you set a UserVariable to mute, yet the user can still send messages. That's extra load that goes nowhere. Just thought I'd help point this out.


Yep. That's what I meant, but when I think about it, it shouldn't be a problem, the anti flood filter will still kick in.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 20 guests