Lobby System Template for a multiplayer java game, with chat and other features, using JavaFX and socket TCP (will be extended to UDP).

Overview

Downloads Contributors Forks Stargazers Issues MIT License LinkedIn GitHub followers

JavaFX-MultiplayerLobbySystem

JavaFX lobby system for multiplayer games with chat, ready toggle and kick buttons, using socket TCP by default.

Demo

Server Client
Create New Room (Server) Join Existing Room (Client)

Execution

  1. Download the latest release.
  2. Extract the content of the archive.
  3. Execute the Launcher.

Features

Feature Description Demo
Listen server The network topology that has been used is the Listen server: a client can become the server, and will host the game for other clients. Basically, when a client creates a new room it becomes a server, hosting the connection for other clients that will send a request and join the room. This solution could be a problem in case of a game that requires low latency (e.g. FPS), since the client that hosts the match doesn't experience any, but for a boardgame it's perfect, considering it can be built on TCP and the latency isn't a issue at all. Listen server scheme
Nickname & IP address validation The nickname and address validations happen when the user types a key in the textfields as well as when he confirms (that's because the user could cut the text from the field, without typing any key, and the button would remain enabled). Validation example
Server: set min and max room size Before creating the room, the server can choose its size: how many users it can contain and how many are required to start the game. Room size example
Server: open/close the room The server can decide whether to close or open the room at will, preventing new users from joining or not. Open/close room example
Client: set ready/not ready The clients can set their state to ready or not ready. If everyone is ready, and the minimum user required is reached, the game can start. Ready/Not ready example
Server: kick a user The server can kick any user out of the room. This is useful when the minimum users required to start the game is reached, but someone won't set their state to ready. Kick user example
Server: ban a user The server can ban any user out of the room. Ban user example
Chat The chat allows users to communicate in real time, showing the timestamp of the messages and the user that sent it. The chat also shows when users connect or disconnect and when they get kicked out from the server. Chat example
Disconnection When the server leave the room or close the application, each connected user get disconnected. Disconnection example

Documentation

Read the full docs.

  • main schemes

Roadmap

to add:

  • update User list in server, when someone send the READY.
  • add arrow to identify which user a particular client is
  • refactor: use only one listView and put an HBox inside it(?)
  • add on close function to disconnect and stop the threads before closing the app
  • add "start game" button which enables when the room has the minimum users required
  • add open/close checkbox to allow users to join
  • check if the users get disconnected properly when closing the app by the Launcher
  • change the "this.client != null" check with NavState.MP_CLIENT (same for the server)
  • fix Join Existing Room validation
  • move Controller methods (in a proper order)
  • fix KickUser (removes the server too). The problem was that goBack(), instead of switchToMP, closed the connection, so client sent KICK and DISCONNECT before closing the socket
  • fix exception print stack (handle them in a more proper way)
  • catch Connection Reset
  • SocketException: Interrupted function call: accept failed, thrown when we back from the server room, when no one has been accepted yet
  • add a ban list (nickname/IP)
  • automatic textarea scrolling, to last message
  • add banned user throws null pointer exception on Linux, fix it
  • show private and public IP address and be able to copy it
  • chat text message check length before sending (not more than 200 char?)
  • add copy in clipboard when clicking on a username (inside a room)
  • server can enable/disable the chat(?)
  • add timer after sending READY message
  • fix gui components to have proper dimension
  • add Datagram (UDP) variant
  • add HTTP/websocket variant(?)
  • create a logger (?) and log messages to file too
  • create a class for my Spinner (MikyllSpinner ?)
  • add an headless server to handle the room list (when a server creates a room it's inserted into the list, and the client can access that list to see those rooms)
  • use this template for CluedoApp

Built With

For the implementation I used Java 11 and JavaFX 11, Eclipse IDE (2020-03 (4.15.0)), and SceneBuilder to create the gui (FXML).

Java version: JavaSE-11 (jdk-11.0.11)
JavaFX version: JavaFX 11 (javafx-sdk-11.0.2)

References

You might also like...

CSGO cheat made in Java using JavaFX as the overlay and JNA for memory manipulation

CSGO cheat made in Java using JavaFX as the overlay and JNA for memory manipulation

CSGO-CHEAT CSGO cheat made in Java using JavaFX as the overlay and JNA for memory manipulation FEATURES RCS Triggerbot No Flash Third Person Rank Reve

Dec 28, 2022

Nightmare-text - This is a simple lib that help to create, titles, actionbars, hovers and click actions chat components.

Nightmare text This is a simple lib that help to create, titles, actionbars, hovers and click actions chat components. Setup public final class Testin

Mar 9, 2022

An image annotation desktop-application written in Java using the JavaFX application platform.

An image annotation desktop-application written in Java using the JavaFX application platform.

This is an image annotation desktop-application written in Java using the JavaFX application platform. It allows you to create bounding box annotations using rectangular and polygonal shapes. Annotations can be imported and saved from/to JSON files, Pascal VOC format XML-files or YOLO format TXT-files.

Dec 4, 2022

An IDE built specifically for Modding Minecraft Java Edition, containing many useful features that will be helpful for modders.

Modding-IDE An IDE built specifically for Modding Minecraft Java Edition, containing many useful features that will be helpful for modders. Trello: ht

Jul 16, 2022

An IDE built specifically for Modding Minecraft Java Edition, containing many useful features that will be helpful for modders.

Railroad IDE Railroad IDE is an IDE that is made specifically for Minecraft Development including Forge Mods, and Fabric Mods! This IDE is made to hel

Dec 8, 2022

Android Resource Manager application to manage and analysis your app resources with many features like image resize, Color, Dimens and code Analysis

Android Resource Manager application to manage and analysis your app resources with many features like image resize, Color, Dimens and code Analysis

AndroidResourceManager Cross-Platform tools to manage your resources as an Android Developer, AndroidResourceManager - ARM provide five main services

Nov 16, 2022

A template project for Keycloak Customizations

Keycloak Project Example Introduction This repository contains a project setup for keycloak based projects. This setup serves as a starting point to s

Jan 4, 2023

A maven plugin to include features from jmeter-plugins.org for JMeterPluginsCMD Command Line Tool to create graphs, export csv files from jmeter result files and Filter Result tool.

A maven plugin to include features from jmeter-plugins.org for JMeterPluginsCMD Command Line Tool to create graphs, export csv files from jmeter result files and Filter Result tool.

jmeter-graph-tool-maven-plugin A maven plugin to create graphs using the JMeter Plugins CMDRunner from JMeter result files (*.jtl or *.csv) or using F

Nov 3, 2022

Experimenting with awesome React Native + Expo features.

Experimenting with awesome React Native + Expo features.

Expo Mega Demo Experimenting with new awesome React Native + Expo features. Work in progress. More info soon. A preview video (click the image): Core

Dec 29, 2022
Comments
  • New feature ban list

    New feature ban list

    implemented the ban list feature: +the server can ban a user's IP to kick him out and prevent him from joining the room again +fixed private IP display in server

    opened by mikyll 0
  • half setup the allow_users_to_rejoin option

    half setup the allow_users_to_rejoin option

    When creating a new room, the user can select a checkbox to choose if he wants to allow a user to rejoin after being kicked out from the room, or not. Many implementations can be possible: -mantaining a private list inside the Server class, which adds an user to the "fake-banned-list" (and maybe has a limited size, so it doesn't steal too many resources, even if the User class is really small, so that shouldn't be a problem); -ban only the nickname or the IP address, or both; -probably more others.

    opened by mikyll 0
  • Separate create join room

    Separate create join room

    Separated the creation of a new room from the joining of an existing one: now they're placed in different view (different vbox) and the code has been split. +added a state variable to track down the view in which the user is currently situated, during the menu navigation.

    opened by mikyll 0
Releases(v1.1)
Owner
Michele Righi
Bachelor's Degree in Software Engineering. University of Bologna
Michele Righi
DataFX - is a JavaFX frameworks that provides additional features to create MVC based applications in JavaFX by providing routing and a context for CDI.

What you’ve stumbled upon here is a project that intends to make retrieving, massaging, populating, viewing, and editing data in JavaFX UI controls ea

Guigarage 110 Dec 29, 2022
null 4 Oct 21, 2022
Tray Icon implementation for JavaFX applications. Say goodbye to using AWT's SystemTray icon, instead use a JavaFX Tray Icon.

FXTrayIcon Library intended for use in JavaFX applications that makes adding a System Tray icon easier. The FXTrayIcon class handles all the messy AWT

Dustin Redmond 248 Dec 30, 2022
The snake and Ladders Game 🎲 for two players made using JavaFx with important concepts of OOPs🐍 🪜

The snake and Ladders Game made using JavaFx with important concepts of OOPs, done as a project for Advanced Programming course (CSE201) under Prof. Koteswar Rao Jerripothula

null 2 Sep 5, 2022
Flash cards app using JavaFX, Scene Builder and persistence using Serialization with JAVA IO API

Flashcards - JavaFX , Scene Builder, Serialized Persistence JAVA IO API Main Scene that will show all the Decks in Flash Card App Add or Edit Cards in

Ali Raja 3 Nov 28, 2022
Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE 8 and provides the functionalities to use and handle easily Tiles in your JavaFX application.

Lib-Tile Intention Lib-Tile is a multi Maven project written in JavaFX and NetBeans IDE and provides the functionalities to use and handle easily Tile

Peter Rogge 13 Apr 13, 2022
Tetromino is a Tetris-like game written in Java with JavaFX.

Tetromino Link to original project in university's GitLab Tetromino is a Tetris-like game written in Java with JavaFX made by Jonas and myself during

Tobias Helmrich 2 Dec 13, 2021
Checkers game. Server and Client. Client's app handled in JavaFX. Play with radom player or against AI.

Checkers-JavaFX-and-Sockets Checkers game. Server and Client. Client's app handled in JavaFX. Play with radom player or against AI. If you want to pla

Jakub Bednarski 1 Mar 30, 2022
A maven-based JavaFX Asteroids game based on a tutorial from Lee Stemkoski

JavaFX Asteroids About This is a maven-based project which implements a JavaFX Asteroids Game. The code is based on a tutorial from Lee Stemkoski whic

null 2 Mar 2, 2022
JavaFX based Connect4 Game.

Connect4 [email protected] https://github.com/MitchellGray100/Connect4 JavaFX Connect4 Game. Local 2 Player or 1 Player (With AI). It's Connec

Mitchell Gray 3 Jan 6, 2022