Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Project Logo

GoBang Multiplayer

A classic 5-in-a-row strategy game featuring real-time multiplayer, persistent profiles, and interactive matchmaking.

Explore the Documentation »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Lessons Learned
  3. Getting Started
  4. Usage
  5. Contact
  6. Acknowledgments

About The Project

Gameplay Demos

tp2GameDemo.mp4

Web Application Gameplay


tp1gameDemo.mp4

Console Sockets Gameplay


If the embedded videos above are not displaying correctly, click here to watch/download the video demos »


This repository contains GoBang Multiplayer, an academic project developed from scratch for the Infraestruturas Computacionais Distribuídas course at ISEL (Instituto Superior de Engenharia de Lisboa), in collaboration with Martim Ramos.

The primary goal of this project is to implement a robust client-server architecture to support a real-time multiplayer board game. It evolved from a pure Java Socket console application (TP1) to a full Web application served via Apache Tomcat using JSP and Servlets (TP2), managing user registration, logins, and dynamic matchmaking with XML-based persistence.

(back to top)


Built With

  • Java
  • Apache Tomcat
  • XML
  • JSP / Servlets
  • HTML5

(back to top)


Features & Key Highlights

  • Client-Server Architecture: Reliable real-time communication between multiple clients and a central server using TCP Sockets.
  • Web Migration (TP2): Seamless transition from a console-based app to a dynamic web interface using JSP and HTTP Sessions.
  • Persistent Data Management: Secure storage of player profiles, statistics, and game history using XML and XSD validation.
  • Dynamic Matchmaking: Players can choose opponents randomly or by specific username, with automatic session handling.
  • Leaderboards & Profiles: Features a dynamic "Quadro de Honra" for rankings and customizable user profiles with background colors.

Registration Process Demos

tp2ProcessoLogInRegistro.mp4

Web Registration Process


tp1CONSOLEREGESTIRANDLOGINPROCESS.mp4

Console Registration Process

(back to top)


Lessons Learned

  • Socket Programming: Consolidated knowledge on handling concurrent TCP connections and threading in Java.
  • State Management in Web Apps: Learned how to effectively manage HTTP sessions and state across multiple JSP pages.
  • XML Parsing and Validation: Mastered DOM manipulation and strict data validation using XML Schemas (XSD).
  • Separation of Concerns: Understood the importance of separating backend logic (Java) from presentation layers (Console/HTML).

(back to top)


Getting Started

Follow these instructions to set up a local copy of the project on your machine.

Prerequisites

  • Java Development Kit (JDK) 11 or higher
  • Apache Tomcat (v9.0 or higher recommended)
  • Git
  • An IDE such as Eclipse or IntelliJ IDEA

Installation & Running Locally

  1. Clone the repository:

    git clone https://github.com/GuilhermeGraca/java-gobang-multiplayer.git
  2. For TP1 (Console Sockets):

    • Open the tp1-java-sockets folder in your IDE.
    • Run Server.java to start the backend.
    • Run multiple instances of Client.java to simulate players connecting.
    • Playing on a Local Network (LAN): By default, the client connects to localhost. If you want to play with a friend on the same local network, you may need to edit a single line of code in Client.java to point to the server's local IP address (e.g., 192.168.x.x) instead of "127.0.0.1".
  3. For TP2 (Web Application):

    • Import the tp2-java-jsp project into your IDE.
    • Configure your Apache Tomcat server in the IDE and add the project to it.
    • Start the server and navigate to http://localhost:8080/tp2-java-jsp/paginaPrincipal.jsp.
    • Alternatively, deploy the provided tp2-java-jsp.war file from the war-files/ directory directly into Tomcat's webapps folder.
    • Playing on a Local Network (LAN): You can play with others on the same network by sharing your local IP address (e.g., http://192.168.x.x:8080/tp2-java-jsp/paginaPrincipal.jsp). Make sure your firewall allows incoming connections on port 8080.

(back to top)


Usage

  • Registration & Login: Create a new account with a nickname, password, nationality, and profile picture.
  • Customization: Change your profile background color and update your details anytime.
  • Playing: Select "random" or type an opponent's name. The game features a 30-second timer per turn to maintain fluid gameplay.
  • Rankings: Check the "Quadro de Honra" to see the top players sorted by victories and average play time.

(back to top)


Contact

Guilherme Graça - LinkedIn - GitHub

Project Link: https://github.com/GuilhermeGraca/java-gobang-multiplayer

(back to top)


Acknowledgments

  • ISEL (Instituto Superior de Engenharia de Lisboa) - For providing the academic environment and resources.
  • Course Professor - Porfírio Filipe, for the guidance in the Infraestruturas Computacionais Distribuídas course.
  • Martim Ramos - For the great collaboration throughout the development of this project.

(back to top)

About

A real-time GoBang (5-in-a-row) multiplayer game featuring a Java Sockets backend and a dynamic Web interface using JSP, Servlets, and XML persistence

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages