Skip to content

Commit

Permalink
Versione 0.3d
Browse files Browse the repository at this point in the history
*Implementato un nuovo pattern di gioco fino al punteggio 800
*Nuovo boss (nuovo file domande più difficile)
*Nuova fase intermedia tra primo e secondo boss con nuovo file domande
*Implementato path e ip in locale

Co-Authored-By: camillo-yyy <[email protected]>
  • Loading branch information
YacineBoussoufa and camillo-yyy committed Jan 20, 2022
1 parent 61540da commit aad7c9a
Show file tree
Hide file tree
Showing 114 changed files with 6,477 additions and 6,103 deletions.
40 changes: 40 additions & 0 deletions Docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# QuizGame

## Modalità di gioco
L’utente dopo aver scelto il suo nickname in-game, viene posto di fronte a una
serie di domande alla quale dovrà rispondere correttamente inserendo la
risposta nell’apposito contenitore testuale. L’utente inizia la partita con un
punteggio standard di 100 punti. Ogni domanda ha un suo valore in termini di
punteggio ed un numero di tentativi massimi. Se l’utente indovinerà la
domanda il punteggio salirà del valore di essa, se invece al termine dei tentativi
non ci sarà riuscito il suo punteggio decrementerà del medesimo valore. Il
termine della partita viene sancito nel momento in cui il giocatore esaurisce i
suoi punti (0 punti) e il punteggio massimo raggiunto verrà registrato, insieme
al suo nickname, in una classifica globale con tutti gli altri giocatori.

## Architettura dell’applicazione
Al fine di realizzare un’applicazione che fosse indipendente dalla piattaforma su
cui viene avviata e che potesse mostrare le caratteristiche dei socket, threading
e oggetti è stata utilizzata un’architettura di comunicazione client/server.
Il server implementa la tecnica del multi-threading per consentire la
connessione di più client connessi contemporaneamente. La connessione e il
trasferimento dei dati per ogni thread è implementata attraverso l’IPC dei
Socket i quali, in questo caso, lavorano sul protocollo TCP/IP.
Le informazioni che il server e i client si scambiano vengono racchiuse
attraverso una classe condivisa Messaggio la quale contiene tutti i dati relativi
al funzionamento del gioco (vedere progettazione ad oggetti).
Il server mette a disposizione questo servizio sulla porta 6076, la quale è stata
definita in maniera standard per semplificare la connessione.

## Implementazioni di sicurezza lato server
Per evitare un affollamento di troppe connessioni contemporanee è stato scelto
preventivamente di limitare il numero di thread creabili a 10. E’ stata inoltre
implementata una sleep di 5 secondi dopo l’allocazione di un thread per
evitare flooding di richieste.

## Interfacciamento con Web Server
Al termine della partita ogni thread accede in scrittura ad un file XML in cui
scrive i migliori punteggi degli utenti. Tale file è letto dall’interprete php nel
momento in cui viene richiesta la pagina web relativa al gioco, la quale è
disponibile in rete attraverso un Web Server Apache in esecuzione sulla stessa
macchina sulla porta 8289.
6 changes: 0 additions & 6 deletions Quizv0.3c/QuizClient/Quiz/build/built-jar.properties

This file was deleted.

6 changes: 0 additions & 6 deletions Quizv0.3c/QuizServer/QuizServer/build/built-jar.properties

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file removed Quizv0.3c/QuizServer/QuizServer/dist/QuizServer.jar
Binary file not shown.
32 changes: 0 additions & 32 deletions Quizv0.3c/QuizShare/QuizShare/dist/README.TXT

This file was deleted.

Binary file not shown.

This file was deleted.

40 changes: 40 additions & 0 deletions Quizv0.3d/QuizClient/Quiz/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# QuizGame

## Modalità di gioco
L’utente dopo aver scelto il suo nickname in-game, viene posto di fronte a una
serie di domande alla quale dovrà rispondere correttamente inserendo la
risposta nell’apposito contenitore testuale. L’utente inizia la partita con un
punteggio standard di 100 punti. Ogni domanda ha un suo valore in termini di
punteggio ed un numero di tentativi massimi. Se l’utente indovinerà la
domanda il punteggio salirà del valore di essa, se invece al termine dei tentativi
non ci sarà riuscito il suo punteggio decrementerà del medesimo valore. Il
termine della partita viene sancito nel momento in cui il giocatore esaurisce i
suoi punti (0 punti) e il punteggio massimo raggiunto verrà registrato, insieme
al suo nickname, in una classifica globale con tutti gli altri giocatori.

## Architettura dell’applicazione
Al fine di realizzare un’applicazione che fosse indipendente dalla piattaforma su
cui viene avviata e che potesse mostrare le caratteristiche dei socket, threading
e oggetti è stata utilizzata un’architettura di comunicazione client/server.
Il server implementa la tecnica del multi-threading per consentire la
connessione di più client connessi contemporaneamente. La connessione e il
trasferimento dei dati per ogni thread è implementata attraverso l’IPC dei
Socket i quali, in questo caso, lavorano sul protocollo TCP/IP.
Le informazioni che il server e i client si scambiano vengono racchiuse
attraverso una classe condivisa Messaggio la quale contiene tutti i dati relativi
al funzionamento del gioco (vedere progettazione ad oggetti).
Il server mette a disposizione questo servizio sulla porta 6076, la quale è stata
definita in maniera standard per semplificare la connessione.

## Implementazioni di sicurezza lato server
Per evitare un affollamento di troppe connessioni contemporanee è stato scelto
preventivamente di limitare il numero di thread creabili a 10. E’ stata inoltre
implementata una sleep di 5 secondi dopo l’allocazione di un thread per
evitare flooding di richieste.

## Interfacciamento con Web Server
Al termine della partita ogni thread accede in scrittura ad un file XML in cui
scrive i migliori punteggi degli utenti. Tale file è letto dall’interprete php nel
momento in cui viene richiesta la pagina web relativa al gioco, la quale è
disponibile in rete attraverso un Web Server Apache in esecuzione sulla stessa
macchina sulla porta 8289.
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="QuizClient" default="default" basedir=".">
<description>Builds, tests, and runs the project QuizClient.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="QuizClient-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="QuizClient" default="default" basedir=".">
<description>Builds, tests, and runs the project QuizClient.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="QuizClient-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
6 changes: 6 additions & 0 deletions Quizv0.3d/QuizClient/Quiz/build/built-jar.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Thu, 20 Jan 2022 21:17:07 +0100


C\:\\Users\\Yacine\\Desktop\\Quizv0.3d\\Quizv0.3d\\QuizClient\\Quiz=

C\:\\Users\\Yacine\\Desktop\\Quizv0.3d\\Quizv0.3d\\QuizShare\\QuizShare=
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ the projects runtime path.
* To set a main class in a standard Java project, right-click the project node
in the Projects window and choose Properties. Then click Run and enter the
class name in the Main Class field. Alternatively, you can manually type the
class name in the manifest Main-Class element.
class name in the manifest Main-Class element.
Binary file not shown.
Loading

0 comments on commit aad7c9a

Please sign in to comment.