https://github.com/ganeshsankaran/multi-user-dungeon
A Java implementation of a multi-user dungeon
https://github.com/ganeshsankaran/multi-user-dungeon
client multithreading server socket-programming
Last synced: about 2 months ago
JSON representation
A Java implementation of a multi-user dungeon
- Host: GitHub
- URL: https://github.com/ganeshsankaran/multi-user-dungeon
- Owner: ganeshsankaran
- Created: 2019-06-11T20:37:57.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-04T22:46:30.000Z (almost 7 years ago)
- Last Synced: 2025-03-12T07:45:29.438Z (over 1 year ago)
- Topics: client, multithreading, server, socket-programming
- Language: Java
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multi-User Dungeon
by Ganesh Sankaran
Developed using Java 8
Overview
MUD is split into server-side and client-side components, namely MUDServer.java
and MUDClient.java. MUDServer actively listens for users connecting from
MUDClient and creates new threads sharing memory containing information about
the other users as well as the distribution of rooms and users within the virtual
world.
Dependencies
- JDK 8
- A network connection
Deploying the Client and Server
Included are the files MUDServer.java, MUDClient.java, Coordinates.java,
Dungeon.java, and Room.java. Please note that MUDServer.java depends on
Coordinates.java, Dungeon.java, and Room.java, whereas MUDClient.java is designed
to run independently.
1. Obtaining the Source Code
a. Clone the Repository
git clone https://github.com/ganeshsankaran/multi-user-dungeon.git
2. Deploying the Server
a. Compile the server source code
javac MUDServer.java
b. Run the server
java MUDServer [world dimension] [maximum number of users]
Example:
java MUDServer 100 1000
3. Deploying the Client
a. Compile the client source code
javac MUDClient.java
b. Run the client
java MUDClient [server IP]
Example:
java MUDClient 127.0.0.1
Using the Client
When the MUDClient JFrame opens up, please enter a non-empty name that does
not contain parentheses or forward slashes. If your name has already been taken,
the client will prompt you for a different name immediately.
Most of the window’s area outputs information in response to the commands you
enter. For example, room descriptions, the names of users in your room, the
movement of users into and out of your room, and dialogs are displayed here.
In this implementation, the rooms are empty (containing no items). In addition, the
description of the rooms is just a pseudorandom number as a proof-of-concept.
Implementing items and the commands associated with them is simple, which can
be implemented using another data structure (such as a hash-table mapping the
item name to the number of that item available in the room) to store each room’s
items in the Room class.
Commands can be entered in the text field at the bottom of the window. The
following commands have been implemented thus far:
/say/[dialog]/tell/[username]/[dialog]/yell/[dialog]/north/south/east/west/up/down/quit