remove games.ini + create static/games dir + change debug station
This commit is contained in:
parent
b5db58812b
commit
d45f8d1148
3 changed files with 7 additions and 113 deletions
|
@ -1,111 +0,0 @@
|
||||||
path=static/games/
|
|
||||||
|
|
||||||
[Alisha Lara.json]
|
|
||||||
name=Alisha Lara
|
|
||||||
turns=143
|
|
||||||
players= "SimpleBot 2 (check if python is correct before executing)" "mybot2"
|
|
||||||
|
|
||||||
[Andre Head.json]
|
|
||||||
name=Andre Head
|
|
||||||
turns=1229
|
|
||||||
players= "mybot2" "SimpleBot 2 (check if python is correct before executing)" "mybot"
|
|
||||||
|
|
||||||
[Angela Sims.json]
|
|
||||||
name=Angela Sims
|
|
||||||
turns=221
|
|
||||||
players= "SimpleBot 2 (check if python is correct before executing)" "mybot2"
|
|
||||||
|
|
||||||
[Buford Humphrey.json]
|
|
||||||
name=Buford Humphrey
|
|
||||||
turns=174
|
|
||||||
players= "Subutai" "SimpleBot 1 (check if python is correct before executing)" "SimpleBot 2 (check if python is correct before executing)"
|
|
||||||
|
|
||||||
[Catalina Grant.json]
|
|
||||||
name=Catalina Grant
|
|
||||||
turns=202
|
|
||||||
players= "mybot" "SimpleBot 1 (check if python is correct before executing)" "SimpleBot 2 (check if python is correct before executing)"
|
|
||||||
|
|
||||||
[Cesar Jordan.json]
|
|
||||||
name=Cesar Jordan
|
|
||||||
turns=214
|
|
||||||
players= "Subutai" "SimpleBot 1 (check if python is correct before executing)"
|
|
||||||
|
|
||||||
[Chandra Garrett.json]
|
|
||||||
name=Chandra Garrett
|
|
||||||
turns=202
|
|
||||||
players= "SimpleBot 1 (check if python is correct before executing)" "SimpleBot 2 (check if python is correct before executing)"
|
|
||||||
|
|
||||||
[Cory Mooney.json]
|
|
||||||
name=Cory Mooney
|
|
||||||
turns=45
|
|
||||||
players= "SimpleBot 2 (check if python is correct before executing)" "SimpleBot 1 (check if python is correct before executing)"
|
|
||||||
|
|
||||||
[Deana Bishop.json]
|
|
||||||
name=Deana Bishop
|
|
||||||
turns=302
|
|
||||||
players= "mybot" "mybot2"
|
|
||||||
|
|
||||||
[game2.json]
|
|
||||||
name=game2
|
|
||||||
turns=110
|
|
||||||
players="bot_auto_player_full_rand" "adversary_auto_player_link_rand"
|
|
||||||
|
|
||||||
[Georgina Wiley.json]
|
|
||||||
name=Georgina Wiley
|
|
||||||
turns=302
|
|
||||||
players= "mybot2" "mybot"
|
|
||||||
|
|
||||||
[hungergames.json]
|
|
||||||
name=hungergames
|
|
||||||
turns=119
|
|
||||||
players=
|
|
||||||
|
|
||||||
[Jeannie Swanson.json]
|
|
||||||
name=Jeannie Swanson
|
|
||||||
turns=251
|
|
||||||
players= "SimpleBot 1 (check if python is correct before executing)" "SimpleBot 2 (check if python is correct before executing)" "mybot2" "mybot"
|
|
||||||
|
|
||||||
[Joanne Blair.json]
|
|
||||||
name=Joanne Blair
|
|
||||||
turns=202
|
|
||||||
players= "mybot2" "mybot" "SimpleBot 1 (check if python is correct before executing)" "SimpleBot 2 (check if python is correct before executing)"
|
|
||||||
|
|
||||||
[large.json]
|
|
||||||
name=large
|
|
||||||
turns=1166
|
|
||||||
players=
|
|
||||||
|
|
||||||
[Lester Berg.json]
|
|
||||||
name=Lester Berg
|
|
||||||
turns=1132
|
|
||||||
players= "mybot" "mybot2" "SimpleBot 2 (check if python is correct before executing)"
|
|
||||||
|
|
||||||
[Lindsey Farrell.json]
|
|
||||||
name=Lindsey Farrell
|
|
||||||
turns=461
|
|
||||||
players= "jens" "SimpleBot 2 (check if python is correct before executing)" "dinkske" "SimpleBot 1 (check if python is correct before executing)"
|
|
||||||
|
|
||||||
[Pansy Le.json]
|
|
||||||
name=Pansy Le
|
|
||||||
turns=417
|
|
||||||
players= "Subutai" "SimpleBot 1 (check if python is correct before executing)" "SammyBot"
|
|
||||||
|
|
||||||
[pietmap.json]
|
|
||||||
name=pietmap
|
|
||||||
turns=2788
|
|
||||||
players=
|
|
||||||
|
|
||||||
[Randell Wolfe.json]
|
|
||||||
name=Randell Wolfe
|
|
||||||
turns=300
|
|
||||||
players= "mybot" "SimpleBot 2 (check if python is correct before executing)"
|
|
||||||
|
|
||||||
[spiral2.json]
|
|
||||||
name=spiral2
|
|
||||||
turns=537
|
|
||||||
players=
|
|
||||||
|
|
||||||
[standard_game.json]
|
|
||||||
name=standard_game
|
|
||||||
turns=82
|
|
||||||
players="bot_auto_player_full_rand" "adversary_auto_player_orfirst_rand"
|
|
|
@ -5,7 +5,7 @@ use serde_json;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::fs::File;
|
use std::fs::{File, create_dir};
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
mod pw_config;
|
mod pw_config;
|
||||||
|
@ -33,6 +33,11 @@ impl PlanetWarsGame {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|p| (p.name.clone(), p.id))
|
.map(|p| (p.name.clone(), p.id))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
if let Err(_) = create_dir("static/games") {
|
||||||
|
println!("'static/games' already exists");
|
||||||
|
}
|
||||||
|
|
||||||
let file = File::create(format!("static/games/{}", location)).unwrap();
|
let file = File::create(format!("static/games/{}", location)).unwrap();
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
|
|
||||||
const network = new vis.Network(container, data, options);
|
const network = new vis.Network(container, data, options);
|
||||||
|
|
||||||
var ws = new WebSocket('ws://127.0.0.1:3012');
|
var ws = new WebSocket(`ws://${window.location.hostname}:3012`);
|
||||||
ws.onmessage = function (event) {
|
ws.onmessage = function (event) {
|
||||||
handle_event(JSON.parse(event.data));
|
handle_event(JSON.parse(event.data));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue