Build Status

Rusty Sword Arena: A Crash Course in Rust

This is the companion repository to the half-day tutorial for OSCON 2019. (The links you need during OSCON are in the Resources section at the bottom)

Just watching the training will be entertaining and informative, but you will truly learn a lot more if you actually dig in and do some coding! This repository is for you hands-on-learners who are ready to roll.

Preparation - DO THIS BEFORE OSCON

I use macOS, and that is what I developed Rusty Sword Arena on. Everything ought to be able to work on major Linux distributions and Windows. Please do the following preparation before OSCON so we can focus our time on learning Rust. Please contact me ASAP if you have trouble with anything on this page.

Install Rust

We will be using Rust 1.35.0 or newer for Rusty Sword Arena.

You should get somewhat similar output (versions may be newer) if you run commands like the ones below. If you get a version older than 1.35.0, then run rustup update to install a newer version.

```shell $ rustc --version rustc 1.35.0 (3c235d560 2019-05-20)

$ cargo --version cargo 1.35.0 (6f3e9c367 2019-04-04) ```

If you have any trouble with installation or running the commands above, please contact me before OSCON!!!

Install Other Dependencies

ZeroMQ 4.1.x or later is used under-the-hood for networking. It's abstracted away, so you will not actually deal with it other than making sure the library portion of it is installed so Rust can find it.

On Linux, the alsa development libraries are needed for sound.

macOS

Make sure you have Homebrew installed and then run bash brew install pkgconfig zmq

CentOS

```bash

czmq-devel is in EPEL (Extra Packages for Linux), so if you haven't installed it, do

sudo yum install -y epel-release

...then you can actually install the dependencies

sudo yum install -y czmq-devel alsa-lib-devel ```

Debian/Ubuntu

Run the following AND follow the instructions for Debian/Ubuntu in the ZeroMQ's download documentation (you might need to create an /etc/apt/sources.list.d/zeromq.list file if you don't have a sources.list file on Debian 9) :

bash sudo apt install libasound2-dev sudo apt install pkgconf

Other Operating Systems

Follow the instructions in ZeroMQ's download documentation 4.1.x or later for your operating system.

See if everything is working

*THIS IS THE IMPORTANT PART!* Following these steps will download a few hundred dependencies, which is really important to do before OSCON because when a hundred people do it at the same time at the conference the IT folks freak out and scold me. :wink: Also, this will ensure that you have a working environment so that you will be able to listen during the tutorial instead of trying to get this stuff working.

If you got through all those steps without anything crashing, then you are all ready for OSCON. We are going to learn Rust while making our own game client similar to this reference implementation. ✨🎉✨

Prepare to Learn

Please do each of the following before OSCON (see the How To Learn Rust page for details on all of these) - [ ] Choose an IDE (or Editor) and configure it with Rust support and customize it to your liking - [ ] Choose one place to "find answers" and either introduce yourself (if it's a forum, IRC, etc.) or find the answer to one question you have. - [ ] Try doing something in Rust! If you don't have a better idea, then just do this: - cargo new message - cd message - cargo run - Edit src/main.rs and change the message. - cargo run again to see your new message. - [ ] Check out the descriptions of the tools and books.

Resources

Now you are ready for the tutorial! You are going to make your own game client far Rusty Sword Arena!