summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdeploy.sh6
-rw-r--r--page.html3
-rw-r--r--src/minesweeper.rs2
3 files changed, 4 insertions, 7 deletions
diff --git a/deploy.sh b/deploy.sh
index 6edc1e8..93b7b97 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -1,6 +1,2 @@
#!/bin/sh
-
-cargo build --release --target x86_64-unknown-linux-musl && \
- strip target/x86_64-unknown-linux-musl/release/websweeper && \
- rsync --progress page.html root@masba.net:/srv/tooling/
- rsync --progress target/x86_64-unknown-linux-musl/release/websweeper root@masba.net:/srv/tooling/
+rsync --progress page.html root@masba.net:/srv/tooling/
diff --git a/page.html b/page.html
index 78df322..6806e54 100644
--- a/page.html
+++ b/page.html
@@ -46,7 +46,7 @@
<script>
window.id = NaN;
let wsproto = (window.location.protocol == "https:")? "wss:": "ws:";
- let s = new WebSocket(`${wsproto}//${window.location.hostname}:${window.location.port}/ws`);
+ let s = new WebSocket(`${wsproto}//${window.location.hostname}:${window.location.port}${window.location.pathname}ws`);
let info_elem = document.getElementById("miscinfo");
let board_elem = document.getElementById("board");
let name = "deadbeef";
@@ -62,6 +62,7 @@
s.onopen = function(e) {
info_elem.innerHTML =
`<input id="name-in" type="text">
+ <input id="clr-in" type="color"></input>
<button onclick=register()>Join</button>`;
}
s.onmessage = function(e) {
diff --git a/src/minesweeper.rs b/src/minesweeper.rs
index 8a0ee8d..6f5b3b6 100644
--- a/src/minesweeper.rs
+++ b/src/minesweeper.rs
@@ -172,7 +172,7 @@ impl Board {
}
pub fn render(&self) -> Vec<u8> {
- let mut ret = vec![27];
+ let mut ret = vec![];
for y in 0..self.height {
for x in 0..self.width {
let c = &self.data[self.pos_to_off((x,y))];