Skip to content

UNO-Card-Game/uno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNO Multiplayer

UNO_Logo

This project is a backend service for a multiplayer Uno card game built in Go using WebSockets. It enables real-time gameplay and efficient management of concurrent sessions, making it easy for friends to connect and play together—no matter where they are.

Motivation

The main motivation behind this project is twofold:

  • Learning and exploration: Explore the power of WebSockets, concurrent programming, and the Go language through a hands-on project.
  • Play and Connect: Create a fun and engaging game that brings friends together, even when they’re miles apart.

Game Setup Guide

This guide provides step-by-step instructions to set up and run the Uno game.

Description

This is a backend service for a UNO card game multiplayer written in Go and based on WebSockets.

Installation

Install Task

Mac OS

brew install go-task

pip

pip install go-task-bin

npm

npm install -g @go-task/cli

RHEL/Fedora

dnf install go-task

Installation of the Server

Native

  1. Clone the repository:
git clone https://github.com/mahimdashora/UNO-game.git
cd UNO-game
  1. Install dependencies:
go mod tidy
  1. Build and run the server:
task build:binary
task run:server

Docker (Container)

  1. Clone the repository:
git clone https://github.com/UNO-Card-Game/uno.git
cd UNO-game
  1. Build the Docker image:
build:image
  1. Run the Docker container:
docker run -p 8080:8080 uno-server:latest

Step 2: Build and run the server

task build:server
task run:server

Environment Variables

PORT: Set this environment variable to run the server on a specific port. Default is 8080.

Example:

export PORT=8080
task run:server

Replace 8080 with your specific port number if needed.

Test WebSockets with Postman

  1. Open Postman and create a new WebSocket request.
  2. Enter the WebSocket URL: ws://localhost:8080/ws
  3. To create a Game Room lobby, use the following URL:
ws://localhost:8080/create?player_name=[NAME]&max_players=[MAX_PLAYER_COUNT]

Example:

ws://localhost:8080/create?player_name=Alice&max_players=2
  1. To join a Game Room lobby, use the following URL:
ws://localhost:8080/join?player_name=Bob&room_id=1234
ws://localhost:8080/join?player_name=Bob&room_id=1234

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published