Note that GM_GUI in the KS_final_client.ca was missing a required interface. You need to update Development to get the latest copy and then paste into CompUnitEnvironment.
Updated table below to properly include all discussed amendments in class today.
Final templates for component interfaces:
TableManagerGUI | @Provide({IVisualRepresentation.class,IProcessMessage.class,IUserContext.class})
@Require({IProcessMessage.class,IIconImage.class,IUserIcon.class}) |
UserManagerGUI | @Provide({IVisualRepresentation.class,ISubscribe.class,IUserContext.class,IIconImage.class,IUserIcon.class}) @Require({IProcessMessage.class,IUserSelect.class}) @Property("ImageRoot") |
RoomGUI | @Provide({IConnectionHandler.class,
IProcessMessage.class,ISubscribe.class})
@Require({IProcessMessage.class,IConnection.class,IVisualRepresentation.class,IUserContext.class,ILocal.class,IShutdown.class}) @Property("RatedPort", "UnratedPort", "PracticePort") |
GameManagerGUI |
|
TableManager | @Provide({IProcessMessage.class,ISubscribe.class}) @Require({IOutput.class,ILocal.class}) @Property("ReportDirectory", "ReportName") |
UserManager | @Provide({IProcessMessage.class,ISubscribe.class,IAuthorization.class}) @Require({IOutput.class,IDisconnectUser.class,ILocal.class,IUM_DB.class}) @Property("Icon", "ReportDirectory", "ReportName") |
PluginManager | @Provide({IProcessMessage.class,ISubscribe.class,IUpdateStats.class}) @Require({IOutput.class,IPM_DB.class}) @Property("PluginDirectory", "ReportDirectory", "ReportName", "isAdmin") |
GameManager |
@Provide({IProcessMessage.class,ISubscribe.class}) @Require({IGM_DB.class,IUM_DB.class,ILocal.class,IOutput.class,IUpdateStats.class}) @Property("RoomType") -- one of "Rated", "Unrated", "Practice" @Property("ReportDirectory", "ReportName") |
DatabaseManager | @Provide({IUM_DB.class,IPM_DB.class,IGM_DB.class}) |
UMGUI must support the customizable property "ImageRoot" which will contain the prefix of a URL which points to the base directory where image icons are to be found. See SampleUMGUI in Development/bb/client
For reasons that are not apparent until you see the code for my RoomGUI, you must ensure that TMGUI and UMGUI are activated before RoomGUI.
Note that UMGUI must provide BOTH IUserIcon and IIconImage.
Note that TMGUI components must ensure their getName() returns "Table Manager" exactly!
Note that UMGUI components must ensure their getName() returns "User Manager" exactly!
These are dependencies that never made it into the documentation. Rats!
Uploaded revised components. Note that 'RoomGUI' now supports commands:
UserManager on the server side must now require IDisconnectUser to be able to respond to kick commands. I have provided (and will soon upload) sample UM component to show how to access functionality, together with revised RoomGUI to deal with simple commands generated to server.
How do you debug components that you are working on?
Once you package your component, run FoundationSWT and launch the installer. You will be
Now you need to browse to the directory within which you had packager export its generated files and select the Component Description (CD) file. If this is the first time you have installed the component (likely) click on Install button. If you are updating a prior installation (perhaps) click on Update button.
Now edit the CA file you are using so that your component is the one being instantiated. Here is an example:
<!-- Heineman original is
name="roomgui" class="gui.sample.Sample" url="http://www.wpi.edu/~heineman/CS3733/Development/components"/>
-->
<COMPONENT name="roomgui" class="gui.sample.Sample" version="1.0"/>
Note how you replace the 'url' tag with a 'version' tag that refers to the version you are using.
Now you need to do one last thing, which is to confirm that your launch configuration for FoundationSWT adds your project to the build path. In this way, any changes to the component will be automatically be detected the next time you run. Note how Development is already in the "User Entries" so it is picked up.
UserManager GUI components must be sure to provide both IUserIcon and IIconImage
Confusion in some interfaces have resulted in more confusion. I'll try to clarify here and fix the mistakes.
From the point of view of PluginManager, a variation can record the number of
wins and losses it has. This is an indication of how difficult a variation it
is. Thus IStat getTies and setTies are
deprecated, since they have no need for existence!
From the point of view of GameManager, when a set of players play a variation in head-to-head competition, there is either a single WINNER or a TIE between a set of players. However, the gameManager does not need to update this stat with the plugin manager, thus IUpdateStats2.update is a deprecated since ties are not relevant.
Time to deal with the protocol dealing with tables and games and the dreaded join,leave,left,joined, etc. These cut across numerous components, so worth getting right. Comments/corrections to come to class on Thursday.
Question regarding disconnection. When a client terminates the connection, the s_ipc component detects it and ensures that a logout command is sent to mbus so it can be acted upon by other components.
Added new interface IPlugin2 which extends IPlugin to expose an installed date when the variation was first installed. Since IPlugin is not an interface that is either @Provides or @Requires then you can simply check via instanceof to see if the database manager has returned a class capable of supporting the date; if so, then it is available.
Added new interface IUpdateStats2 which extends IUpdateStats and exposes the ability to set (Wins,Losses,Ties) whereas IUpdateStats only handled (Wins,Losses). If your component previously Provided IUpdateStats, you should also try to Provide IUpdateStats2. If your component previously required IUpdateStats, then you should also try to Require IUpdateStats2.
When at runtime the component Requiring IUpdateStats determines what to do, it can then perform a runtime instanceof check (one of the few times to use instanceof) to determine if it can updated (Wins, Losses and Ties) or just (Wins, Losses).
Note change to Left request
Updated my interfaces for the sample TM_GUI and UM_GUI to show how to use the IIconImage interface. Note that the ks_client.ca file is updated to include this new linkage.
Ok. Good news. I now have a fully working version of the skeleton Kombat Solitaire working from within the CompUnit component technology.
To access, follow this tutorial.