diff --git a/server/src/main.rs b/server/src/main.rs index a114b40..08d96e5 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -147,6 +147,7 @@ async fn main() ]).ok(); cache.cache_file_group("text/javascript", "/.js", &[ "www/js/const.js", + "www/js/language.js", "www/js/util.js", "www/js/game_asset.js", "www/js/game.js", diff --git a/server/src/manager/data.rs b/server/src/manager/data.rs index 3435fd1..940702e 100644 --- a/server/src/manager/data.rs +++ b/server/src/manager/data.rs @@ -482,11 +482,12 @@ pub async fn thread_system(mut app:App, bus:Bus) } // SessionRetire - QRPacketData::QSessionRetire(_request) => { + QRPacketData::QSessionRetire(request) => { + println!("Request: Session Retire"); - // - // Not implemented - // + if let Some(_session) = app.sessions.get_mut(&request.token) { + + } Some(QRPacket::new(0, QRPacketData::None)) } @@ -564,10 +565,8 @@ pub async fn thread_system(mut app:App, bus:Bus) } } - println!("sendblock"); if request.status != STATUS_ERROR { for packet in packets { - println!("sendto: {}", packet.id); app.send_response(packet).await; } diff --git a/www/js/game.js b/www/js/game.js index b4f1135..a132247 100644 --- a/www/js/game.js +++ b/www/js/game.js @@ -224,7 +224,7 @@ GAME.Game = class { let hex = this.board.tiles[piece.tile].hex; // Check if column has militia. - if(piece.piece == GAME.Const.PieceId.Militia) { + if(piece.piece == GAME.Const.PieceId.Militia && !piece.promoted) { this.board.columns[hex.x].militia[piece.player] = true; } diff --git a/www/js/interface.js b/www/js/interface.js index 51d26f6..0aced5d 100644 --- a/www/js/interface.js +++ b/www/js/interface.js @@ -821,6 +821,15 @@ const INTERFACE = { INTERFACE_DATA.mirror = !INTERFACE_DATA.mirror; INTERFACE.draw(); }, + + retire() { + if(INTERFACE_DATA.online) { + MESSAGE_COMPOSE([ + OpCode.SessionRetire, + INTERFACE_DATA.token, + ]); + } + } }; INTERFACE.Radius = 2.0 / Math.sqrt(3.0); diff --git a/www/js/language.js b/www/js/language.js new file mode 100644 index 0000000..4864ee8 --- /dev/null +++ b/www/js/language.js @@ -0,0 +1,18 @@ +const LANGUAGE = { }; + +LANGUAGE.Term = class { + constructor(en, jp) { + this.data = [ en, jp ]; + } +}; + +LANGUAGE.Terms = { + Dawn: new Term( "Dawn", "暁" ), + Dusk: new Term( "Dusk", "黄昏" ), + + Handle: new Term( "Handle", "" ), + Secret: new Term( "Secret", "" ), + + Browse: new Term( "Resume", "" ), + Resume: new Term( "Resume", "" ), +}; diff --git a/www/js/scene.js b/www/js/scene.js index ec9ddf1..068a909 100644 --- a/www/js/scene.js +++ b/www/js/scene.js @@ -503,7 +503,7 @@ const SCENES = { if(data === null) { return false; } let buttons_bottom = [ ]; - if(data.mode != 2) { buttons_bottom.push(UI.button("Retire", () => { })); } + if(data.mode != 2) { buttons_bottom.push(UI.button("Retire", () => { INTERFACE.retire(); })); } buttons_bottom.push(UI.button("Back", () => { LOAD(SCENES.Browse) })); UI.nav([