************************ChatMessageBuilder Version 1.0 ********************* The purpose of this DLL is to facilitate the creation of appropriate message strings that meet the Agent == Smith message specification. ****** Installation ****** The .zip file for download contains three files: ChatMessageBuilder.dll ChatMessageBuilder.lib ChatMessageBuilder.h - Place the .dll and .lib files in your default build directory, for most this is your ../modules/debug/ folder. - To keep things simple place the .h file inside the project directory that you will be using the ChatMessageBuilder with. - Inside your VisualStudio project, you will want to include the .h file inside the .h file from which you will be instantiating the ChatMessageBuilder. #include "ChatMessageBuilder.h" - Right click on the properties of the project you are using, go to properties, linker, input, additional dependencies: you want to add "ChatMessageBuilder.lib" Depending on how your project is set up, you may need to add a relative path. - You should be good to go now! ****** Usage ****** ChatMessageBuilder has the following functions -ChatMessageBuilder(void); -Constructor, creates an instance of ChatMessageBuilder for you to use -string makeroomMessage(const string roomID); -Returns a properly formatted XML string that commands the chat server to try and create a room with the ROOMID you suppplied. -string killroomMessage(const string roomID); -Returns a properly formatted XML string that commands the chat server to kill the room with the specified roomID -string addplayerMessage(const string name, string url); -Returns a properly formatted XML string that commands the chat server to add the player with the specified name, and url to your chat room -string kickplayerMessage(const string url); -Returns a properly formatted XML string that commands the chat server to kick the player with the specified url from the chat room -string chatMessage(string message, const bool htmlParams[3]); -Returns a properly formatted XML string that commands the chat server to relay the supplied message with given (optional) html params to the other people in your chatroom ****** Sample Code ****** ChatMessageBuilder mb = ChatMessageBuilder(); mb.makeroomMessage("1002"); returns "" mb.killroomMessage("1002"); returns "" remember that after the initial room setup, roomID is carried in the ACLMessage conversation-id mb.addPlayerMessage("Joe" "http://myaddress:port"); returns "" mb.addPlayerMessage("http://myaddress:port"); returns "" mb.chatMessage("Here is my \"quote\"" htmlParams); returns " EXPLANATION OF SUPPORTED MARKUP: -The idea is that player clients would provide a set of check boxes that would allow them to choose any/all of the following text decorations. Note ONLY the following are supported: -BOLD -ITALIC -BLINK -UNDERLINE It is expected that the formatting would come in as an array of boolean values: bool htmlParams[4]; htmlParams[0] = false; // bold htmlParams[1] = false; // italic htmlParams[2] = false; // blink htmlParams[3] = true; // underline If you were to feeld this htmlParams array into the chatMessage function, the HTML field in the resulting string would be formatted with underline tags. Please keep in mind that support for display of the HTML is up to the player agent for implementation. If you aren't supporting HTML in your agent, please supply the chatMessage function with an array set to false. That should do it for this DLL. Users should be able to promptly take the string that these functions return, place it in an ACLMessage with a proper conversation-id and performative, then ship it off to the chat Server where the request will be processed, and a response will be sent. If you are experiencing any problems with this DLL, please don't hesitate to contact us via our website: http://www.cs.utah.edu/~jfinlins/agentsmith/