28.06.2013 Views

Papers in PDF format

Papers in PDF format

Papers in PDF format

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

some other details about the environment and we present rules to be known to play the TRESSETTE, an onl<strong>in</strong>e<br />

game at ‘A Cant<strong>in</strong>a i Bifarelli.<br />

Server architecture.<br />

The server consists of a Java stand-alone multithreaded application which manages the communication with<br />

Java applets clients via sockets. It’s architecture is outl<strong>in</strong>ed <strong>in</strong> [Fig. 1].<br />

Figure 1: Server architecture.<br />

The MasterServer is the ma<strong>in</strong> process; it starts offspr<strong>in</strong>g threads and manages the GameSocket.<br />

The StatusServer handles the StatusSocket <strong>in</strong> order to satisfy a client request of server status parameters value.<br />

The ChatServer handles the ChatSocket; it associates two sockets (Input and Output) and a thread to any<br />

connected client and it sends any received message to all clients.<br />

The GameServer handles a s<strong>in</strong>gle card game and it is started by the MasterServer as soon as a new player<br />

arrives <strong>in</strong>to an empty room. A thread is associated to any player and it handles two sockets for the client-server<br />

communications.<br />

Communication protocols.<br />

We have considered three protocols:<br />

StatusProtocol (SP), for the StatusServer and StatusClient communication;<br />

ChatProtocol (CP), for the ChatServer and ChatClient communication;<br />

GameProtocol (GP), for the GameServer and GameClient communication.<br />

In the SP case, the client which is connected on the StatusSocket receives back a str<strong>in</strong>g message from the<br />

server of the follow<strong>in</strong>g <strong>format</strong>:<br />

STATUS: ||...|.<br />

Such a str<strong>in</strong>g is then <strong>in</strong>terpreted and graphically displayed by the client for the end-user.<br />

In the CP case, the client sends on the ChatInputSocket a str<strong>in</strong>g of the type:<br />

USERNAME: <br />

where nickname is the name chosen by the end-user. The client sends messages on the same socket with the<br />

<strong>format</strong>:<br />

PUBMESSAGE: <br />

and it receives from the server other client messages on the ChatOutputSocket with the <strong>format</strong>:<br />

PUBMESSAGE: <br />

Therefore, the server simply collects the <strong>in</strong>com<strong>in</strong>g messages, labels them with the appropriate nickname and<br />

transmits them to all clients.<br />

The GP is actually a set of protocols each one of them is relevant to a particular card game. At the time be<strong>in</strong>g<br />

the only card game implemented <strong>in</strong> ‘A Cant<strong>in</strong>a i Bifarelli is TRESSETTE.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!