Skip to content

ciprianefros/QuizzGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuizzGame

Introduction

QuizzGame is a client-server application designed to simulate a trivia game similar to Kahoot. Players answer general knowledge questions to accumulate points and compete against each other in lobbies of three participants. At the end of each game, the winner is announced to all players.

Key Features

  • Concurrency: Handles multiple clients and simultaneous games using multithreading.
  • Database Integration: Stores questions and leaderboards in a SQLite database.
  • Trivia API Integration: Dynamically fetches trivia questions using HTTP GET requests with libcurl.
  • Admin Settings: Allows an administrator to modify game settings and add new questions using a secure password.
  • TCP Communication: Implements a multithreaded TCP protocol for client-server interaction.
  • Secure Password Storage: Encrypts the admin password using SHA-256 with OpenSSL.

Technologies Used

  • SQLite: For question and leaderboard storage.
  • libcurl: To interact with the Trivia API.
  • cJSON: For JSON manipulation.
  • OpenSSL: For password hashing.
  • Multithreading: Ensures efficient handling of multiple clients.

Getting Started

Prerequisites

Ensure you have the following installed:

  • GCC compiler
  • SQLite development libraries
  • libcurl
  • OpenSSL development libraries
  • cJSON library

Building the Project

To compile all files, run the following command in the terminal:

make all

This will generate the server and client executables.

Running the Server

Start the server by executing:

./server

Connecting Clients

To connect a client, open a new terminal and run:

./client 127.0.0.1 2909

Here, 127.0.0.1 is the localhost address, and 2909 is the default port.

Gameplay Instructions

  1. Players connect to the server using the client application.
  2. Use the START GAME command to initiate a new trivia session.
  3. Players respond to questions within the allotted time.
  4. The server calculates scores and displays the leaderboard.
  5. At the end of the game, the winner is announced.

Admin Commands

  • SETTINGS: Access game settings (requires admin password: parola_admin).
  • LEADERBOARD: View the current leaderboard.
  • HELP: Display available commands.
  • QUIT: Disconnect from the server.

Project Structure

  • Server: Manages client connections, game sessions, and interacts with the database.
  • Client: Sends commands to the server and interacts with the user.
  • Database: Stores questions and leaderboard data.

Future Improvements

  • Integrate a graphical user interface for clients.
  • Optimize server message handling.
  • Enable question category selection.

License

QuizzGame is licensed under the GNU General Public License v3.0.

Copyright (C) 2025 QuizzGame Team

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Thank you for choosing QuizzGame! Enjoy the trivia experience.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors