This documentation is aimed at helping you alter the communications engine to fit the need of new agent types. The communications files are gone through one at a time and all the places you need to change things to add functionality will be highlighted. While this documentation may not be 100% accurate it should give you a good idea of how to do what you want. This quarter we added the event "createAgentWithId" so this should show you where our changes were made. Don't forget to add any new function definitions to the appropriate header files. vrtypes.h This header file shows the shorthand used for variable decleration for the communications engine. Examinig the restof the code should give you some idea about where to use them. Note that chars are the same as uint8s You will occasionally get warnings from the complier about pointer types not matching, usually this is about passing between chars and uint8s. The warnings can usually be ignored. event.h You need to examine the list of enumerated types (EVENT_NULL etc). Any new event will need a new enumerated type go with it. Add these types to the end of the list as we have have some problems with adding them to the middle. Our best guess is that these types are referenced by their numerical value somewhere in the code. This means that adding a new type in the middle of the list can change the way the code behaves. Adding new types at the end of the list does not seem to cause any new problems Also in event.h you need to make changes to the definition of the event_t data structure. You will need to add the structure of the data your event contains to the union in the definition. The structures already there should give you some idea of what your new event data structure will need to look like. event.c You will need to create your own function with the in the event_functionName format. These funcitons tell whether a particular type of event needs an acknowledgement or not and that kind of thing. In general, cutting and pasting one of the pre-existing functions as a place to start, then adding what you need. You will also need to add your new event to the event_ToNetwork and event_FromNetwork functions. These functions write the event data structures to a buffer which is eventually sent across the network. Note that each different type of event has its own case statement. client.c (server side) You will also need to add in your new event into the client_HandleEvent function. comm.c (client side) You will also need to add functions to handle you new event to this file either as an additional case in comm_handleEvent or with a new comm_functionName Now that you should have a new event set up you can call this new event from the actual client/agent program (viewer.c). This is the file that actually controls the agent.