Launch Kombat Solitaire from within Foundation

In the examples I have shown in class, I have consistently shown CompUnit components running in "raw form", that is, just being run within a Java application. I now have the framework in place to enable all component groups to begin to envision how their own components are to be placed into the architecture.

Preliminaries

  1. Make sure you Team -> Update the CompUnitEnvironment. You need access to the latest version of Foundation as well as its supporting system components.
  2. Make sure you Team -> Update StandAlone. I had to make some modifications to enable the GameManagerGUI groups to begin to make progress
  3. Make sure you Team -> Update Framework. I updated some of the core components
  4. Make sure you Team -> Update Development. I added some sample GUI components as well as provided some standard libraries that will be needed for the ongoing project.
  5. Make sure you have the SWT project checked out from the "compunit.cvs.sourceforge.net" repository. This is needed for supporting FoundationSWT. If you have a Macintosh there may yet be lingering issues for which I apologize. I am currently going through my code and removing all SWT references but it won't be done in time!

Each group should consider doing all coding on your group project within a new package that you add to the Development project. Doing so will enable you to immediately begin working on the coding. If you choose to put your code in a separate project, make sure you set up the Build Path and other dependencies exactly as I have done.

Note that when I make any changes you can immediately retrieve them by simply selecting Team -> Update on the Development project, but ONLY if you do your work in a separate package within the project. Don't make changes to the existing classes that I am writing -- make changes in your own project area.

Tutorial for downloading and launching sample KS

Copy Component Assembly (CA) files

Within the Development project you will find an application folder. Inside there you will see two files:

You should copy these files and place them within CompUnitEnvironment/applications. The reason I have not done this for you is that CompUnitEnvironment is a generic, globally available project from the compunit.cvs.sourceforge.net area and I don't want to expose our KS project to the outside world just yet.

Now you should launch FoundationSWT (help? see these instructions). If you have properly updated your CompUnitEnvironment project you will see two windows appear:

Somewhere in the explored tree in the panel on the left you should find the two CA files that you have just copied.

Launch KS Server

Select "KS_2008_server.ca" and click on Execute. You should immediately begin to see a large number of messages on the Eclipse console (these are debugging messages) and you should see in the Downloader window a bunch of messages, together with progress as reported in the progress task bar.

Once the application has properly launched, you will see "ks_server" under the "Active Applications" and the final line on the console output window should say something like:

Accepting calls on 7878

This confirms you are running the stripped-down version of the KombatSolitaire server on your computer.

Launch KS Client

Select "KS_2008_client.ca" and click on Execute. Once again, you will see a large number of messages on the Eclipse console and in the Downloader window. If you had previously closed the downloader window, it will pop back up again.

Success will happen when you see the following window:

Running a simple scenario

Click on "Connect" to connect. Note you can type at the bottom chat message commands that are sent to the server before returning to be output into the lobby output area.

You can click on the "Press Me" in the User Manager GUI to see the message "heineman: HELLO FROM USER MANAGER"

To show the direction we are now going, type the word "idiot" inside the text input area in the lobby where you had been chatting. Note that this will launch the Idiot solitaire plugin. Let's explain how this happened. To do so, we describe the system architecture.

Client-Side Architecture

Server-Side Architecture

TBA

Debug the running system

The best way to learn about the individual components is to run FoundationSWT in the debugger.

Once you have been able to run the example above, close down foundation. The simplest way to do this is to simply terminated the FoundationSWT application as it runs. To do this, look near the console window at the bottom and see the red square? Press it to terminate the running process (which should be FoundationSWT).

Instead of saying "Run -> Run as..." and selecting FoundationSWT, this time choose "Debug -> Debug as..." and select FoundationSWT.

We want to track the behavior of the system when the user types the word "idiot" and presses return in the main lobby.