Wednesday, September 23, 2020

Cross-compiling Rust To Linux On Mac

In my last blog post I said I wanted to spend some time learning new things. The first of those is Rust. I had previously tried learning it, but got distracted before I got very far.

Since one of the things I'd use Rust for is web pages, I decided to learn how to compile to WebAssembly, how to interface with Javascript, and how to use WebSockets. At home, I use a Mac to work on my web projects, so for Rust I am compiling a native server and a wasm client. But I also wanted to try running this on redblobgames.com, which is a Linux server. How should I compile to Linux? My first thought was to use my Linux machine at home. I can install the Rust compiler there and compile the server on that machine. Alternatively, I could use a virtual machine running Linux. Both of these options seemed slightly annoying.

I've been curious how much work it would take to cross-compile, and I found this great post from Tim Ryan. My setup is simpler than his, so I didn't need everything he did. I started with these commands from his blog post:

rustup target add x86_64-unknown-linux-musl brew install FiloSottile/musl-cross/musl-cross mkdir -p .cargo cat >>.cargo/config <<EOF [target.x86_64-unknown-linux-musl] linker = "x86_64-linux-musl-gcc" EOF 

I then compiled for Linux:

TARGET_CC=x86_64-linux-musl-gcc cargo build --release --target=x86_64-unknown-linux-musl 

Unfortunately this failed with an error about OpenSSL. Tim's post has a solution to this. Before implementing that complicated solution I realized that I should't need SSL/TLS anyway. My server talks regular websockets, not secure websockets, and then I use nginx to proxy them into secure websockets. So I disabled the secure websockets with this in Cargo.toml, the file that has the Rust project configuration:

[target.'cfg(target_arch = "x86_64")'.dependencies] tungstenite = { version = "0.9", default-features = false, features = [] } 

At first I tried features = [] but that wasn't good enough. I needed to also use default-features = false to disable the TLS. With this, the binary built, and I was able to run it on Linux!

So now I have a Makefile that builds the wasm client, the Mac server for local testing, and the Linux server for production. Fun!

BUILD = build  RS_SRC = $(shell find src -type f -name '*.rs') Cargo.toml WASM = target/wasm32-unknown-unknown/debug/rust_chat_server.wasm  run-server: target/debug/chat_server  # local testing server  RUST_BACKTRACE=1 cargo run --bin chat_server  target/debug/chat_server: $(RS_SRC)  # production server  cargo build --bin chat_server  target/x86_64-unknown-linux-musl/release/chat_server: $(RS_SRC)  TARGET_CC=x86_64-linux-musl-gcc cargo build \      --release --target=x86_64-unknown-linux-musl  $(WASM): $(RS_SRC)  cargo build --lib --target wasm32-unknown-unknown  $(BUILD)/rust_chat_server_bg.wasm: $(WASM) index.html  wasm-bindgen --target no-modules $< --out-dir $(BUILD)  mkdir -p $(BUILD)  cp index.html $(BUILD)/ 

My Cargo.toml file is kind of terrible but it works so far for building the three outputs:

[package] name = "rust_chat_server" version = "0.1.0" authors = ["Amit Patel <redblobgames@gmail.com>"] edition = "2018"  [lib.'cfg(target_arch = "wasm32")'] crate-type = ["cdylib"]  [[bin]] name = "chat_server" path = "src/chat_server.rs"  [dependencies] wasm-bindgen = "0.2" serde = { version = "1.0", features = ["derive"] } bincode = "1.2"  [target.'cfg(target_arch = "x86_64")'.dependencies] tungstenite = { version = "0.9", default-features = false, features = [] } 

That's it for now. I'm not a big fan of writing client-server code in large part because I want my pages to still work in thirty years, and that's best if there's no server component. But I want to spend time this year learning things for myself rather than trying to produce useful tutorials, so I'm going to explore this.

Tim's blog post was a huge help. Without it, I would've compiled the server on Linux. Thanks Tim!

I've placed it on github.

Tuesday, September 22, 2020

Recent Gaming, Online Edition

I'd be lying if I said I didn't miss face to face gaming - even though I haven't been doing nearly as much of it these last few years. But as I've mentioned before, I've been able to scratch that itch by playing online at portals  like BoardGameArena.com and boiteajeux.net. Here are some of the games I've been playing online lately:

Yokohama

This popular TMG title is in private Beta right now, and I've been able to get several games in. It's nice to be able to play before the general release and give feedback about not just bugs, but suggestions to make the implementation better.

La Granja

I played this "modern classic" when it came out, and thought it was fine, but I wasn't sure what all the hype was about. It has recently been released on BGA, and the implementation is pretty good. I've gotten a few games in so far, and while I am enjoying it, I'm still not sure it's worth the fuss. So far, the more I play it, the better I like it.

Teotihuacan

I very much enjoyed Tzolkin, so I had automatic interest in Teotihuacan by one of the same designers, as it was touted as a "spiritual sequel" (I hate that term!). When it came out, I never really had a chance to play it, and pretty soon I stopped hearing about it. When I recently found out it was in Alpha at BGA I was excited to finally get a chance to play! I'm currently about 2 games in  and I am enjoying it pretty well. Interestingly, Teotihuacan sort of scoops 2 of my own designs! It has dice "workers" that level up when you use them, which is the main mechanism of my worker placement game Apotheosis, and it is a big rondel made of tiles, like the latest version of the Isle of Trains board game that Dan and I are working on.

In addition to those newer titles, I have been playing some old standbys on BGA as well:

Stone Age

Every time I play Stone Age, I remember how good a game it really is. I haven't played in a while, so it was fun to explore a starvation strategy again (some say in competitive games starvation isn't viable, but in a casual game I crushed everyone with it), and in another game I did the opposite -- I managed to get a bunch of farms right away.

Race For The Galaxy

Another solid title that I haven't really played much since Eminent Domain came about, RftG is a great game. I still think I prefer it 2-player because of the additional agency and ability to sort of combo plays.

Hanabi

I've even tried some Hanabi on BGA. I doubt I'd enjoy that with random people, but with my two Hanabi friends it was a blast. We played a bunch of games, but kinda stopped when we got a perfect 30 points (including the multicolor suit), with no bombs, and almost all of our clues left -- can't possibly do much better than that!

Sunday, September 13, 2020

To Become An International Gamer.

 

The 2013 Protea Esports Team - South Africa's most successful esports team to date.
The team consisted of (back row) Marco Botha, Lyrene Kรผhn (Team Captain), Yolandi Williams, Myburg Brink
(front row) Willem Strศfeldt, Conradie van Heerden, Kyle Rhoodie
Mind Sport South Africa (MSSA) gives gamers from South Africa the opportunity to expand the world of esport. The MSSA operates at every level of esports - from grass-root level all the way through to selecting national teams to officially represent South Africa in international events. 

Over the last number years, gaming in South Africa has increased tremendously in terms of both quality and quantity of players. 

The MSSA has sent international teams to represent South Africa at IESF's World Championships every year since 2009.

To become an expert gamer, there are a few steps to follow:
  1. You need to choose a game that you enjoy and that is played at international competition.
  2. If it is a team game, you will need to find a committed club that has teams that are as committed as what you are.
  3. You/your team will need to practice 1000's of hours to refine your skill and to achieve perfect synergy with your team.
  4. The best way to practice is to hire a coach who has the credentials to take you further.
  5. You/your team will need to take participate in as many events as possible. You need to be objective about your results. Log your results into  a log book, analyse your games, and analyse the games of other teams.
  6. Remember there is always a better way of doing something.  Never say 'no' to constructive criticism and always compare yourself to the best.
  7. Never stop training. Remember that while you are sleeping, there is someone out there training.
  8. Never be discouraged by defeats. Instead learn from your defeats and re-evaluate your game plan.
  9. Participate in MSSA events to qualify for the National Team Trials (NTT). It is from the participants at such NTT that the official South African Protea Esports Team is selected.
  10. Once a member of the official South African Protea Esports Team you have earned your entry ticket to true international competition. 
Good luck and have fun.

Also read:

PUBG MOBILE LITE 0.12.0 APK+OBB

PUBG MOBILE LITE 0.12.0 APK+OBB



===============================================


PUBG MOBILE LITE 0.12.0 APK+OBB :- 


(460MB ONLY)

=======================================

Please Install "7-zip and WINRAR" to extract the files.

๐Ÿ’˜ Download Winrar :-
๐ŸŒน  (32bit PC)
๐ŸŒน  (64bit PC)

๐Ÿ’˜ Visual C++ Redistributable 2012 :-
๐ŸŒน Download

If your PC has no net framework then, you can
download net framework from here :-

๐Ÿ’˜ net framework 4.6
๐ŸŒน Download

๐Ÿ’˜ IMPORTANT ๐Ÿ’˜:-
๐ŸŒน ALWAYS DISABLE YOUR ANTIVIRUS BEFORE EXTRACTING THE FILES.
----------------------------------------------

Thank You For Watching My Video.....

We Are Thank Full To You...

And Don't Forget To Subscribe To My Channel...

And Keep Visiting Our Channel, Keep Supporting Our Channel, And Keep Loving Our Channel ...

Thank You So Much................
----------------------------------------------------------------------

THANK YOU SOO MUCH FOR VISITING OUR SITE.

Friday, September 04, 2020

Ep 25: Top Faves With Dave Goes To The Library II: Nonfiction Is Live!

Ep 25: Top Faves with Dave goes to the Library II: Nonfiction
https://soundcloud.com/user-989538417/episode-25-top-faves-with-dave-goes-to-the-library-ii
We talk with Dave Tubbs about the nonfiction books that inspire our gaming.

The Veteran Wargamer is brought to you by Kings Hobbies and Games
https://www.facebook.com/Special-Artizan-Service-Miniatures-1791793644366746/

Join the conversation at https://theveteranwargamer.blogspot.com, email theveteranwargamer@gmail.com, Twitter @veteranwargamer

Follow Dave Tubbs on Twitter @frmrsldrfgtplyr

Other companies we mentioned:
The Face of Battle - John Keegan https://www.amazon.com/Face-Battle-Study-Agincourt-Waterloo/dp/0140048979
Commands and Colors https://www.commandsandcolors.net/
Baccus https://www.baccus6mm.com/

The French Foreign Legion: A Complete History of the Legendary Fighting Force - Douglas Porch https://www.amazon.com/French-Foreign-Legion-Complete-Legendary/dp/161608068X

The Templars: The Dramamtic History of the Knights Templar  - Pierce Paul Read https://www.amazon.com/Templars-Dramatic-Powerful-Military-Crusades/dp/0312555385

The Soviet Army FM Series - US Army Google it for a ton of PDFs
PFC C-in-C http://www.pfc-cinc.com/front_page.html
PicoArmor https://www.picoarmor.com/

The Last Battle - Cornelius Ryan https://www.amazon.com/Last-Battle-Classic-History-Berlin/dp/0684803291
Rommel - Sam Mustafa https://sammustafa.com/rommel/
Rapid Fire! http://www.rapid-fire-uk.com/

Homage to Catalonia - George Orwell https://www.amazon.com/Homage-Catalonia-George-Orwell/dp/0156421178
A World Aflame https://ospreypublishing.com/a-world-aflame-interwar-wargame-rules-1918-39
Empress Miniatures http://www.empressminiatures.com/page9.htm

Bombs Away: The Story of a Bomber Team -  John Steinbeck https://www.amazon.com/Bombs-Away-Bomber-Penguin-Classics/dp/0143105914
B-17: Queen of the Skies - Avalon Hill https://boardgamegeek.com/boardgame/1032/b-17-queen-skies

The Bear Went Over the Mountain - Lester Grau https://www.amazon.com/Bear-Went-Over-Mountain-Afghanistan/dp/1304069451
The Other Side of the Mountain - Lester Grau and Ali Ahmad Jalali https://www.amazon.com/Other-Side-Mountain-Mujahideen-Soviet-Afghan/dp/1907521054/ref=pd_lpo_sbs_14_t_0?_encoding=UTF8&psc=1&refRID=46F0GWG2NTQZAZ30GFF3
Force on Force - Ambush Alley Games http://www.ambushalleygames.net/force-on-force-core-rules-pdf/
Plastic Soldier Company http://theplasticsoldiercompany.co.uk/index.php?main_page=product_info&cPath=93_94_95&products_id=1673
Battlefront - Team Yankee http://team-yankee.com/

Pegasus Bridge - Stephen Ambrose https://www.amazon.com/Pegasus-Bridge-June-6-1944/dp/0671671561
Stargrunt https://shop.groundzerogames.co.uk/rules.html
Tomorrow's War  http://www.ambushalleygames.net/tomorrows-war/
Cadian Imperial Guard - GW http://solegends.com/citcat1998us/c1998usp281-02.htm
Ork Kommandos - GW http://solegends.com/citcat1998us/c1998usp356-02.htm

Queen Victoria's Little Wars - Byron Farwell https://www.amazon.com/Queen-Victorias-Little-Byron-Farwell/dp/0393302350
The Sword and the Flame - Sergeants Three http://www.sergeants3.com/
Perry Miniatures https://www.perry-miniatures.com/

History of Rome - Livy https://www.amazon.com/Livy-Early-History-Penguin-Classics/dp/0140448098
The Twelve Caesars - Suetonius - Translated by Robert Graves https://www.amazon.com/Twelve-Caesars-Penguin-Classics/dp/0140440720/ref=sr_1_1?s=books&ie=UTF8&qid=1506815887&sr=1-1&keywords=twelve+caesars+robert+graves
Our Word is Our Weapon - Subcommandante Marcos https://www.amazon.com/Our-Word-Weapon-Selected-Writings/dp/1583224726/ref=sr_1_sc_1?s=books&ie=UTF8&qid=1506815906&sr=1-1-spell&keywords=sub+commandante+marcos
AK47 - Rules and figures by Peter Pig http://www.peterpig.co.uk/ak47.html
SASM - Operator Juarez http://www.kingshobbiesandgames.com/Operator-Juarez-s/188.htm
Greece and Rome at War - Peter Connolly https://www.amazon.com/Greece-Rome-War-Peter-Connolly/dp/1848329415
The Black Devil Brigade - Joseph Springer https://www.amazon.com/Black-Devil-Brigade-Special-Service/dp/0935553509/ref=sr_1_1?s=books&ie=UTF8&qid=1506816045&sr=1-1&keywords=black+devil+brigade+springer
Paddy Whacked: The Untold Story of the Irish Mob - J.T. English https://www.amazon.com/Paddy-Whacked-Untold-American-Gangster/dp/0060590033/ref=sr_1_1?s=books&ie=UTF8&qid=1506816098&sr=1-1&keywords=paddy+whacked
Mad Dogs With Guns - Howard Whitehouse https://ospreypublishing.com/mad-dogs-with-guns


Music courtesy bensound.com. Recorded with zencastr.com. Edited with Audacity. Make your town beautiful; get a haircut.