Posts Tagged ‘filter’

Smartfox Server–Chapter 06-Server side Config-part-3

October 3rd, 2010 by aabhaanjan


Server side Config-part-3 Bad words filtering


Lets continue with Bad words filtering  🙂

server side config -part-3

SmartFoxServer provides a built-in customizable bad words filter which allow automatic moderation of chat applications and games. We can make a list of bad words that we want to be filtered and server will automatically handle that by replacing them with asterisks or completely remove the phrase.

Also you can turn automatic administrator messages and specify the amount of warnings before the user is kicked and the amounts of kicks before the user is completely banned from the server.

Active : It is a Boolean value which specify if we want to use this feature.

FilterMode : There are two mode :

a). FILTER : It will replace the bad words with asterisks

b). REMOVE : it will remove every phrase containing bad words

StripCharacters : By default the following characters are , . ; : _ ! $ % & / # * – +.By using this feature we can specify which characters should be stripped from the original message

Warnings: It is a Boolean value. By turning them on the server will send a custom warning message to the user each time a bad word is detected or removed.

FilterRoomNames : It is a Boolean value. By turning them on it will filter bad words in room names.

FilterUserNames: It is a Boolean value. By turning them on it will filter bad words in user nicknames.

WarningsBeforeKick: Here we can specify how many warnings are sent before the user is automatically kicked.

WarningMessage : Here we can specify the custom warning message.

KickMessage : Here we can specify the custom kick message.

BanMessage: Here we can specify the custom ban message.

BanAfter: Here we can specify how many kicks are tolerated before the user is automatically banned from the server.

BadWordsList : Here we can list the custom list of bad words to be filtered.

Previous Chapter

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Unload vs UnloadAndstop

May 7th, 2010 by aabhaanjan

I had a SWfLoadersClass for a large application which loads a bunch of external swfs, and when requested distributes copies of those swfs to the part of application. The application was developed in

Flash CS3. When I was using Loader.unload() method of Flash Player 9 I found it was very difficult to remove a loaded SWF from memory after it is unloaded . Most fired Events were still running and within

15 minutes my application hanged.

How I knew the Events were still running after unload ?

package {

import flash.display.*;


public class loadSWF  extends MovieClip {

private  var ldr:Loader = new Loader();

private function loadSWF(){

     var url:String = "";
     var urlReq:URLRequest = new URLRequest(url);


btnUnload.addEventListener(MouseEvent.CLICK, unloadButtonClicked);


private function traceEnterFrameLisnerIsWorking (e:Event):void {

trace(“ENTER_FRAME is running.”);


private function unloadButtonClicked(e:MouseEvent):void {





I found ‘trace’ calls that the listeners were still  active even after the loader.unload() was called.

After some Googling J I found The Loader.unload() method doesn’t do much. In that case Garbage

Collector is not working properly.

I found some other facts too :

A SWF file that has a music track is loaded into an application. Later, the SWF is unloaded using Loader.unload(). Though the SWF will be removed from the screen, the music will still be heard.

Solution :

In Flash Player 10, there is a new method, Loader.unloadAndStop(). The latter method stops execution of the left-over listeners and prompts the garbage collector to remove the external swf file from memory.

Loader.unloadAndStop() method is supposed to trigger garbage collector to remove an unloaded swf file from memory.

The unloadAndStop() method tries to solve this by stopping all actions running in a loaded element and clearing the element out of RAM. The unloadAndStop() methos belongs to the Loader class. The idea is to call this method on your Loader instance to clean what you have loaded.

What unlaodAndStop() does ? :

  • Stops all MovieClips
  • Stops all sounds playing/streaming
  • Stop/removes all Timer objects
  • Removes all global listeners for enterFrame, exitFrame, frameconstructed, activate, deactivate
  • Removes all stage listeners that have been created by the child.
  • Closes all NetConnection/NetStream and Video.attachNetStream/attachCamera(0) and Microphone.setLoopback(0)
  • Removes AS3 fonts from the global font table
  • Stops sockets, xmlsockets, filereference downloads, other downloading objects (grandchildren SWF), etc.
  • Frees bitmap related to cacheAsBitmap/filter, etc.

After converting my files into Flash CS4 and calling unlaodAndStop() my application worked fine 🙂 .

Thank you various sources..

Keep reading coming soon with some thing amazing about the CPU Memory usage in a multiplayer virtual world 🙂

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,