Pig Latin?
ElectroServer's web admin interface makes it easy to set language filters, but what if we want all the public chat in a given room to be translated in some fashion?
Override a single method of BasePlugin:
Finally, in the Flash client that allows the user to join a room where you want the translation plug-in to be used, add the new plug-in to the list of plug-ins for the room. Any PublicMessageRequest the user sends will be processed by userSendPublicMessage. Easy!
For more information, see the PluginPigLatin example, and the plug-in tutorial on our new wiki.
- Replace all words on a given list with a random string made of characters from "!@#$%^&*"
- Expand each of the acronyms on a given list, so that "btw" becomes "by the way", etc.
- Have a game where all chat is encrypted using a simple cipher, and an encrypted quotation is presented. First player to submit the correct decrypted quotation wins, with incorrect guesses appearing in encrypted form.
- Have a silly room where everything anybody says is translated into Pig Latin. Eryvay illysay!
Override a single method of BasePlugin:
public ChainAction userSendPublicMessage(UserPublicMessageContext context) {
String message = context.getMessage();
String returnMessage = translate(message.trim());
context.setMessage(returnMessage);
return ChainAction.OkAndContinue;
}Next edit (or create) the Extension.xml file to include your plugin. Copy the compiled class and new version of Extension.xml to the proper folders for ElectroServer, then reboot the server.Finally, in the Flash client that allows the user to join a room where you want the translation plug-in to be used, add the new plug-in to the list of plug-ins for the room. Any PublicMessageRequest the user sends will be processed by userSendPublicMessage. Easy!
For more information, see the PluginPigLatin example, and the plug-in tutorial on our new wiki.
Labels: plug-in, plugin, translate, translation, transmogrification

Great post! ElectroServer seems to be really flexible!
Awesome, I didn't know this was possible. So in my MMOG where the avatars are Rap Stars and Gangsters, the chat could get translated so everyone says, "Foh-shizzle my nizzle!" Lol, this has so much potential.
Post a Comment
<< Home