Final project for CS4414
Rust
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Rust-Serv.md
game_server
game_server.rs
guess_number.rs
readme.md

readme.md

CS4414 (OS) Final Project

This is a server that allows for multiple users to join and play a game hosted by the server. To see how to create a game for this server, please read the instructions below.

--Game Creation--

Game creation for this server is easy! All you need to do in your file "game.rs" (where game can technically be any filename - in our implementation it is guess_number.rs) is implement a method with the following signature:

pub fn play(mut p1: TcpStream) {}

This method will allow the server to pass you the stream information of the user who wants to play the game. From this point, you use the TcpStream to communicate with the user rather than stdin and stdout. A few small changes need to be made to your copy of this server file as well... ctrl+f for the phrase "change#" to view these required tweaks. Your "game.rs" file must be in the same directory as this file, and it must be included in the game_server.rs file (our code has the line "mod guess_number;" on line 45).

To compile: rustc game_server.rs

To run: ./game_server.rs

To connect: enter "nc localhost 4414" into the terminal