// the first element of the list should be an atom, telling us the command
if ( ( list.getElement(0) instanceof GdlAtom ) == false )
{
throw new IllegalArgumentException("First element of message received in list is not an atom! Got: " + list.getElement(0) );
}
GdlAtom command = (GdlAtom) list.getElement(0);
String matchId = list.getElement(1).toString();
System.out.println(matchId);
RequestHandler result = null;
if ( command.equals("start") )
{
result = new StartRequestHandler(socket, header, list, matchId);
}
else if ( command.equals("play") )
{
result = new PlayRequestHandler(socket, header, list, matchId);
}
else if ( command.equals("stop") )
{
result = new StopRequestHandler(socket, header, list, matchId);
}
else if ( command.equals("kill") )
{
// FIXME: make this more secure!!!
result = new KillRequestHandler(socket, header, list, matchId);
}
else