-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
420e35a
commit 49011eb
Showing
8 changed files
with
106 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use std::sync::Arc; | ||
|
||
use tokio::{sync::mpsc::UnboundedSender, task::JoinSet}; | ||
|
||
use crate::{ | ||
error::Error, | ||
obs::LayoutFile, | ||
settings::Settings, | ||
state::{self, Project}, | ||
CommandMessage, | ||
}; | ||
|
||
pub mod discord; | ||
pub mod therun; | ||
pub mod web; | ||
|
||
pub fn init_integrations( | ||
tasks: &mut JoinSet<Result<(), Error>>, | ||
command_sender: UnboundedSender<CommandMessage>, | ||
settings: Arc<Settings>, | ||
layouts: Arc<LayoutFile>, | ||
project: Arc<Project>, | ||
) { | ||
// Add TheRun.gg module to tasks | ||
if project.integrations.contains(&state::Integration::TheRun) { | ||
for player in &project.players { | ||
let therun = player | ||
.therun | ||
.to_owned() | ||
.unwrap_or(player.stream.split('/').last().unwrap().to_string()); | ||
tasks.spawn(therun::create_player_websocket_monitor( | ||
player.name.clone(), | ||
therun.to_string(), | ||
command_sender.clone(), | ||
)); | ||
} | ||
} | ||
|
||
// Add discord integration to tasks | ||
if project.integrations.contains(&state::Integration::Discord) { | ||
tasks.spawn(discord::init_discord( | ||
command_sender.clone(), | ||
settings.clone(), | ||
project.clone(), | ||
layouts.clone(), | ||
)); | ||
} | ||
|
||
// Add webserver to tasks | ||
tasks.spawn(web::run_http_server(command_sender.clone())); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.