A NetWork-based Tic-Tac-Toe application that consists mainly of two applications server and a client. The Game has nice-looking user interfaces. The Application is done mainly using JavaFX
the server has an MS-SQL-SERVER
database that stores all the information about the players. and The games they are played. The application was designed using the MVC pattern. The communication between the server and the client in this game is done using JSON objects
to make it easy to send and receive requests and responses.
-
Nice looking User Interface
-
Register to the game
-
server side validation
-
play with
ai computer
-
updated list with full information about the registered players
-
The ability to
Chat
with any player in the list -
The ability to
play
with any player in the list -
Updated list of the whole single and multi mode game history
-
The ability to replay any previous game from the
history
list -
in Server Application you have the same players list with the ability to
toggle
server tatus
-
Sign up and Sign in as a first time player
-
Every player have a bonus points he gain after wining any game or lose if when he lose the game
-
players are classifed according to the bonus points to several ranks
bronze
,silver
,gold
,platinum
,Diamond
,Master
,Grand Master
,Challenger
-
the way that the players gain and lose the points differ in each rank.
-
player can play in
single mode game
withai
-
Every player will have an updated list of the whole players in the server database this with the information of their
name
,bonus points
,rank
,status[online, offline]
,in Game or not
,in chat or not
-
The player can click on any player in the list and
play
orchat
with him only if this player isonline
and if the player is not ingame
or inchat
. -
The server handle all most of the possible senarios that can happen in the appication during the game or because of any issue.
-
The player can replay any game from the history.
- in this game the client is actualy nothing
- The
Server
is the big boss her :)
The client application consists mainly of 4 packages
-
controllers
: This pacakage is Responsible for dealing with the game views -
models
: This package is for storing the data of the entities that send from the serverplayer
singleModeHistory
multiModeHistory
-
netwok
:` This package is the responsable for every thing it has the classes That responsable for dealiing with the serverClient
this object is the responsable for open a socket with the server- it has an
acceptResponse
method that have arunnable
object that keep reading the buffer to accept a response from t he server - once it read a request it pass it to the next object to handle it
ResponseHandler
- The
client
also has asendRequest
function that sends a request to the server as a json string so the server can parse it and send a response after it.
- it has an
ResponseHandler
This object has a functionhandleResponse
that takes a response from the server and do a certin action according to this response.RequestCreator
this is a utility class that is responsable for creating the json objects and return a string to be send to the server.
The big boss in this app The server is the responsable for every thing
- validating player data
- connecting with the database
- stablish the conection between players
- reciving the message from player and send it to the other one etc...
The server has mainly 4 packages
-
database
This package is the responsable for dealing with the database and it has mainly utility classDatabaseManager
that do every thingDatabaseManager
this class is the responsable for managing anyCRUD
operatin throw the application life cycle
-
network
same as the client this package it the responsable for dealing with all the clients in connected to the server. it has mainly 4 objects to do this.- Server this calss is the responsable for accepting new clients socket then passing it to the next object
playerHandler
playerHandler
each client has a playerHandler for him to acceptReqeust and send a response from him this object has 2 main methods to do thiAcceptReqeust
it's the opposite of theAcceptRespoonse
of the client this method takes a request as a json from the client and pass it to the next ObjectRequestHandler
to handle this request and return immediatelty a certainresponse
to send it back to the client.
RequestHandler
This object is a class that have handleRequest method that takes the user request and sends an approbriate response to theplayer
with the help of the next object.ResponseCreator
it's a utility class that create aresponse
as ajson object
to be send to theplayer
- Server this calss is the responsable for accepting new clients socket then passing it to the next object
-
gameLogic
this package has 3 classes that mainly control the game and chat processsingleModeGameHandler
multiModeGameHandler
chatRoomHandler
Server must be oppendd first because without oppening the server the client won't be able to go to his login screen and he will get an error
After opening the server you will have the whole players list with the status of each player
this is the first view in the client app and it won't go to the login
view if the server isn's oppend if the player
tried to login when server is down he will get an error message
if the player is new to the game he can register first
if the password dosn't match he will got an error
If the server is opened so the player will go to the authontication stage
if the player name is wrong he will get an error from server
and if the password is wrong he will also get an error
after the player login successfuly he will get the welcome screen and informed with the information with his current rank and bonus points
player can play with the computer and specify the difficulty
final.single.mode.view.mp4
player can navigate to the online home view to see the players list and if their is player online he can send a private chat invitation or game invitation to him
send chat invitation process
chat.video.mp4
send game invitation process
gameTest3.mp4
player also can navigate to his histry to start see his previous game with the ability to click on any game and play it
history.video.mp4
- First Clone The Project
- Create the database schema
- you have to use Microsoft sql server
- go to the /'00 Project Materials'/'00 Database'/'02 Database quires' and open 'new Database Schema.sql' file in your database management studio
- after creating the data base you have to add user to the database
- username: ayman
- password: @01208538504@
- databaename: TicTacToe
- or simbly create new database but in this case you have to change the configuration in DatabaseManager.openDatabaseConnection Method
- After creating the database you can now build and run the server project using netbeans or intellij idea as a maven project
- you can lunch the Client App using the executable jar file or using netbeans or intellij idea
- You can download the jar file from this link: https://drive.google.com/drive/folders/1kxtF2Oac1KPSkNlT367PQZKnHkjNJ6Zg?usp=sharing
- if you have any problems in running the game feel free to contact us
- note that the server is runing by default on port 9000 you can change this in the Server class
- note: you will never be able to try the game without the server you have to open the server first
Ayman kheirEldeen | Ahmed ElShopaky | |
Reem Adel | Dina Reda | Mai Emad |