Skip to content

Multiplayer hangman written in Rust using raylib and UDP sockets

Notifications You must be signed in to change notification settings

yuv418/multihangman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MultiHangman

Screenshot

(Yes, the UI will be improved.)

Multiplayer hangman, Written in Rust™.

This program has two parts: the client and the server. The server uses UDP, and runs on port 22565 (hmm), but you can change this by editing the code. Connecting to custom servers coming soon.

Here's how to set it up.

Server

You don't need any special external libraries to build the server. Simply cargo build or cargo run.

Changing the Server Bind Address

Edit udpserver/src/lib.rs. See the code snippet and comment below.

17        let socket = UdpSocket::bind("0.0.0.0:22565")?; // ← Edit the "0.0.0.0:22566" on this line.
18        let mut games = Mutex::new(vec![]);
19        let mut users = Mutex::new(vec![]);

Client

You'll need cmake installed to build this. On Linux and OS X, you can install cmake from your package manager of choice. On Windows, you could install CMake from its website, or however else you want. Make sure to add cmake to your PATH variable if you install it from the website.

You should just be able to run cargo run afterwards.

Note: Make sure that the server is running before the client, since the client cannot handle a server connection failure gracefully yet.

Changing the Server Address in the Client

You have to modify udpclient/src/main.rs. See the code snippet and comment below:

26 let font = Font::from_file(font_path).unwrap();
27 let mut client = HangmanClient::new("127.0.0.1:22565").unwrap(); // ← Change the "127.0.0.1:22565" on this line.

Current state: extremely experimental and everything is unimplemented

Note: The font used by this project might not be licensed correctly. This will be fixed.

About

Multiplayer hangman written in Rust using raylib and UDP sockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published