Pravda

Changes On Branch spoof
Login

Changes On Branch spoof

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch spoof Excluding Merge-Ins

This is equivalent to a diff from 51d2b8d26e to d41794db3f

2025-03-28
15:38
Not sure what I'm committing. Leaf check-in: d41794db3f user: david tags: spoof
2024-03-27
08:03
Fixed some warnings and comments. Leaf check-in: 51d2b8d26e user: david tags: trunk
2024-03-26
09:06
Adapting the structure to deal with more complex games and merging Spoof, but not ready yet. check-in: 223ad50bdb user: david tags: trunk
08:17
Merged improvements made on Rps and Dice into the Spoof branch and got things in order. check-in: d7057bb24d user: david tags: spoof

Changes to src/main.rs.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    time::{sleep, Duration},
};
use tokio_util::sync::CancellationToken;

mod dice;
mod game;
mod rps;
//mod spoof;

/// Admin account. It can send administrative commands.
const ADMIN: &str = "modulux@node.isonomia.net";

/// Quit command.
const QUIT: &str = "!QUIT!";








|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    time::{sleep, Duration},
};
use tokio_util::sync::CancellationToken;

mod dice;
mod game;
mod rps;
mod spoof;

/// Admin account. It can send administrative commands.
const ADMIN: &str = "modulux@node.isonomia.net";

/// Quit command.
const QUIT: &str = "!QUIT!";

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#[tokio::main]
async fn main() -> Result<()> {
    let token = CancellationToken::new();
    let token2 = token.clone();

    // This channel sends events from the fedi API and game events to the main event loop.
    let (cs, mut cr) = mpsc::unbounded_channel();
    // let spoof = spoof::Spoof::new(cs.clone(), token.clone());
    let dice = dice::Dice::new(cs.clone(), token.clone());

    // g is a vector of games.
    let mut g: Vec<Box<dyn Game>> = vec![Box::new(rps::Rps::new(cs.clone(), token.clone()))];

    // We add Rock Paper Scissors..
    // If you write another game you need to create a file, use mod, and add it like this.
    // g.push(Box::new(spoof));
    g.push(Box::new(dice));

    let web_client = ClientBuilder::new()
        .user_agent("Werewolf 0.1")
        .build()
        .expect("Problem building Reqwest client.");








|







|







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#[tokio::main]
async fn main() -> Result<()> {
    let token = CancellationToken::new();
    let token2 = token.clone();

    // This channel sends events from the fedi API and game events to the main event loop.
    let (cs, mut cr) = mpsc::unbounded_channel();
    let spoof = spoof::Spoof::new(cs.clone(), token.clone());
    let dice = dice::Dice::new(cs.clone(), token.clone());

    // g is a vector of games.
    let mut g: Vec<Box<dyn Game>> = vec![Box::new(rps::Rps::new(cs.clone(), token.clone()))];

    // We add Rock Paper Scissors..
    // If you write another game you need to create a file, use mod, and add it like this.
    g.push(Box::new(spoof));
    g.push(Box::new(dice));

    let web_client = ClientBuilder::new()
        .user_agent("Werewolf 0.1")
        .build()
        .expect("Problem building Reqwest client.");