Skip to content

Commit

Permalink
smallfix, add shrubs for sound
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeVN committed Nov 13, 2024
1 parent 0fcfb22 commit e1afb40
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 160 deletions.
5 changes: 5 additions & 0 deletions assets/public/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sounds/*.mp3
sounds/*.ogg
sounds/*.mpeg
sounds/*.webm
sounds/unconverted
14 changes: 14 additions & 0 deletions assets/public/sounds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Sounds
Put your sound files here. The show will play the sounds located in this directory. Your files shoudd be in WebM format with Opus encoding. Use the script provided if you want to convert into that format using `ffmpeg`.

|Part|Name (without `.webm`) |Purpose |Sample (O22)|
|-------|----|----------|------------|
|Mở đầu|`op-introduction`|Nhạc giới thiệu cuộc thi|[Olympia Wiki](https://static.wikia.nocookie.net/duong-len-dinh-olympia/images/a/ad/Gi%E1%BB%9Bi_thi%E1%BB%87u_cu%E1%BB%99c_thi_O22.mp3/revision/latest?cb=20231228154537&path-prefix=vi)|
|Khởi động|`khoidong-start`|Nhạc bắt đầu phần khởi động|[Olympia Wiki](https://static.wikia.nocookie.net/duong-len-dinh-olympia/images/6/6e/K%C4%90_b%E1%BA%AFt_%C4%91%E1%BA%A7u_O22.mp3/revision/latest?cb=20221126152556&path-prefix=vi)|
|Khởi động|`khoidong-ready`|Nhạc chuẩn bị bắt đầu phần thi khởi động của thí sinh|[Olympia Wiki: Chuẩn bị](https://static.wikia.nocookie.net/duong-len-dinh-olympia/images/1/18/K%C4%90_chu%E1%BA%A9n_b%E1%BB%8B_left_O9.mp3/revision/latest?cb=20210209032349&path-prefix=vi) + [Olympia Wiki: Mở câu hỏi](https://static.wikia.nocookie.net/duong-len-dinh-olympia/images/0/0d/K%C4%90_m%E1%BB%9F_c%C3%A2u_h%E1%BB%8Fi_left_O11.mp3/revision/latest?cb=20220312044044&path-prefix=vi)|
|Khởi động|`khoidong-threesecs`|Âm thanh đếm giờ 3s|[Olympia Wiki](https://static.wikia.nocookie.net/duong-len-dinh-olympia/images/d/d9/K%C4%90_3s_ch%E1%BB%9D_t%C3%ADn_hi%E1%BB%87u_O22.mp3/revision/latest?cb=20220309113358&path-prefix=vi)|
|Khởi động|`khoidong-bgm`|Nhạc nền trong các phần thi của Khởi động|[Olympia Wiki](https://static.wikia.nocookie.net/duong-len-dinh-olympia/images/7/7c/K%C4%90_60s_left_O10.mp3/revision/latest?cb=20221219045625&path-prefix=vi)|
|Khởi động|`khoidong-correct`|Trả lời đúng|[Olympia Wiki](https://static.wikia.nocookie.net/duong-len-dinh-olympia/images/b/b9/K%C4%90_%C4%91%C3%BAng_left_O10.mp3/revision/latest?cb=20220711040233&path-prefix=vi)|
|Khởi động|`khoidong-incorrect`|Trả lời sai|[Olympia Wiki](https://static.wikia.nocookie.net/duong-len-dinh-olympia/images/6/6a/V%C4%90_sai_left_O7.ogg/revision/latest?cb=20201216152804&path-prefix=vi)|
|Khởi động|`khoidong-bell`|Thí sinh bấm chuông|[Olympia Wiki](https://static.wikia.nocookie.net/duong-len-dinh-olympia/images/b/b8/K%C4%90_t%C3%ADn_hi%E1%BB%87u_tr%E1%BA%A3_l%E1%BB%9Di_O22.mp3/revision/latest?cb=20230625155418&path-prefix=vi)|
|Khởi động|`khoidong-complete`|Hoàn thành phần thi (cắt đoạn cuối `khoidong-bgm`)|Không có|
Binary file removed bun.lockb
Binary file not shown.
7 changes: 3 additions & 4 deletions engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ version = "2.0.0"
edition = "2021"
resolver = "2"
authors = [
"Nguyễn Tri Phương <triph@teamfalco.org>",
"Nguyễn Thế Việt <duchiru@teamfalco.org>",
"Nguyễn Tri Phương <triphuong@falcolabs.org>",
]
license = "GPL-3.0"
repository = "https://github.com/teamfalco/owl"
repository = "https://github.com/falcolabs/owl"
description = "Harlem-Peeker common code, often networking"


Expand Down Expand Up @@ -68,7 +67,7 @@ serde_json = { version = "1.0", optional = true }
serde_repr = {version = "0.1", optional = true}
axum = { version = "0.7.5", features = ["ws"], optional = true }
axum-extra = { version = "0.9.3", features = ["typed-header"], optional = true }
tower = { version = "0.4", optional = true }
tower = { version = "0.4", optional = true, features = ["util"]}
tower-http = { version = "0.5.2", features = [
"cors",
"fs",
Expand Down
1 change: 1 addition & 0 deletions engine/src/api/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub enum Packet {
}

impl Packet {
#[deprecated]
pub fn into_packet<T: 'static>(name: String, data: T) -> Packet {
// WARNING: HAZMAT SUIT REQUIRED - UNSAFE HELL
unsafe {
Expand Down
3 changes: 0 additions & 3 deletions engine/src/net.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
//! Module dealing with server-client communications,
//! through the ground breaking novel cutting-edge revolutionary
//! lighting fast easy to use lightweight technology of WebSocket.
pub mod webservice_ws;
pub mod wspy;

pub use self::webservice_ws::{Callback, MessageHandler};
139 changes: 0 additions & 139 deletions engine/src/net/webservice_ws.rs

This file was deleted.

2 changes: 1 addition & 1 deletion engine/src/net/wspy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use pyo3::prelude::*;
use std::{net::SocketAddr, path::PathBuf, sync::Arc};
use tokio::fs;
use tokio::sync::Mutex;
use tower::ServiceExt;
use tower::util::ServiceExt;
use tower_http::services::ServeDir;

pub type MessageHandler = std::sync::mpsc::Sender<RawRequest>;
Expand Down
Binary file removed frontend/bun.lockb
Binary file not shown.
3 changes: 1 addition & 2 deletions frontend/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ name = "client"
version = "2.0.0"
authors = [
"Nguyễn Tri Phương <triph@teamfalco.org>",
"Nguyễn Thế Việt <duchiru@teamfalco.org>",
]
license = "GPL-3.0"
repository = "https://github.com/teamfalco/owl"
repository = "https://github.com/falcolabs/owl"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/panel/SubmitJudger.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="vertical">
{#each $states.answers as { name, verdict }}
<div class="horizontal">
{#each [true, false, null] as r}
{#each [true, false] as r}
<button
class="btn smol code"
class:accent={verdict == r}
Expand Down
43 changes: 37 additions & 6 deletions frontend/src/components/player/VCNV.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Peeker, Connection, GameMaster, StateManager } from "$lib";
import { Peeker, Connection, GameMaster, StateManager, CallProcedure } from "$lib";
import { readable, writable, type Readable } from "svelte/store";
import Load from "../Load.svelte";
import TitleBar from "../TitleBar.svelte";
Expand Down Expand Up @@ -28,8 +28,17 @@
<VcnvMain {states} {conn} {gm} />
</div>
{/if}
<div class="bottom">
<button
class="btn answercnv"
class:activated={$states.highlighted.includes(gm.username)}
on:click={async () => {
await conn.send(CallProcedure.name("vcnv::bell").string("token", gm.authToken).number("timeMs", Date.now()).build());
}}>Chuông trả lời CNV</button
>
<ScoreBar {players} {states} />
</div>
</div>
<div class="bottom"><ScoreBar {players} {states} /></div>
</Load>
</div>

Expand All @@ -41,22 +50,44 @@
background: var(--bg-gradient);
}
.btn {
font-family: var(--font);
font-size: var(--font-normal);
color: var(--text);
padding: 1rem;
margin-left: 0;
user-select: none;
cursor: pointer;
background-color: var(--bg-dark-2);
border: 2px var(--accent) solid;
border-radius: var(--radius-1);
transition: 100ms ease-in-out;
width: fit-content;
}
.activated {
background-color: var(--accent);
}
.btn:hover {
background-color: var(--accent);
}
.center-box {
display: flex;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
flex-direction: column;
transform: translateY(2rem);
transform: translateY(4rem);
}
.bottom {
position: absolute;
transform: translateY(-5rem);
width: 100%;
display: flex;
align-items: center;
justify-content: center;
width: 100vw;
gap: 15vw;
}
</style>
1 change: 0 additions & 1 deletion frontend/src/components/player/VCNVMain.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { CallProcedure, GameMaster, type Connection, type StateManager } from "$lib";
import { writable, type Writable } from "svelte/store";
import TimerBar from "../TimerBar.svelte";
import { onMount } from "svelte";
export let conn: Connection;
export let gm: GameMaster;
Expand Down
3 changes: 3 additions & 0 deletions server/logic/khoidong.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def __init__(self) -> None:
)
)

# Resets the highlighted list when game stage is changed.
self.stage.subscribe(lambda _: self.highlighted.set([]))

def _seperated(self, _show: penguin.Show) -> engine.Status:
return engine.Status.RUNNING

Expand Down
2 changes: 1 addition & 1 deletion server/logic/tangtoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self) -> None:
self.preload_list = self.rpc.use_state("preload_list", {})
self.prompt = self.rpc.use_state(
"prompt",
"Sắp xếp các hình minh họa vào vị trí tương ứng để hoàn thiện sơ đồ quá trình nguyên phân ở tế bào động vật",
"Các thí sinh hãy chuẩn bị",
)
self.highlighted = self.rpc.use_state("highlighted", [])
self.DEFAULT_ANSWERS: list[PlayerAnswer] = []
Expand Down
5 changes: 3 additions & 2 deletions server/logic/vcnv.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def __init__(self) -> None:
"bell",
self.bell,
[
("target", engine.PortableType.STRING),
("clientTime", engine.PortableType.NUMBER),
("token", engine.PortableType.STRING),
("timeMs", engine.PortableType.NUMBER),
],
),
]
Expand Down Expand Up @@ -222,6 +222,7 @@ def verdict(

def bell(self, _, call: engine.Packet.CallProcedure, handle: engine.IOHandle, _2):
target = call.data.str_argno(0)
# TODO - check timeMs also
engine.log_info(
f"{target} pressed bell on {datetime.time().isoformat("microseconds")}"
)
Expand Down

0 comments on commit e1afb40

Please sign in to comment.