forked from lavina/lavina
Compare commits
2 Commits
a8a4b1c490
...
825d41fa3a
Author | SHA1 | Date |
---|---|---|
Nikita Vilunov | 825d41fa3a | |
Nikita Vilunov | 2fa1ddb7e6 |
|
@ -65,7 +65,7 @@ pub struct Services {
|
||||||
pub(crate) broadcasting: Broadcasting,
|
pub(crate) broadcasting: Broadcasting,
|
||||||
pub(crate) client: LavinaClient,
|
pub(crate) client: LavinaClient,
|
||||||
pub(crate) storage: Storage,
|
pub(crate) storage: Storage,
|
||||||
pub(crate) cluster_metadata: Arc<ClusterMetadata>,
|
pub(crate) cluster_metadata: ClusterMetadata,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LavinaCore {
|
impl LavinaCore {
|
||||||
|
@ -88,7 +88,7 @@ impl LavinaCore {
|
||||||
broadcasting,
|
broadcasting,
|
||||||
client,
|
client,
|
||||||
storage,
|
storage,
|
||||||
cluster_metadata: Arc::new(cluster_config.metadata),
|
cluster_metadata: cluster_config.metadata,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(LavinaCore {
|
Ok(LavinaCore {
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
use quick_xml::events::Event;
|
use quick_xml::events::Event;
|
||||||
|
|
||||||
use lavina_core::LavinaCore;
|
|
||||||
use lavina_core::room::RoomId;
|
use lavina_core::room::RoomId;
|
||||||
|
use lavina_core::LavinaCore;
|
||||||
use proto_xmpp::bind::{BindRequest, BindResponse, Jid, Name, Server};
|
use proto_xmpp::bind::{BindRequest, BindResponse, Jid, Name, Server};
|
||||||
use proto_xmpp::client::{Iq, IqError, IqErrorType, IqType};
|
use proto_xmpp::client::{Iq, IqError, IqErrorType, IqType};
|
||||||
use proto_xmpp::disco::{Feature, Identity, InfoQuery, Item, ItemQuery};
|
use proto_xmpp::disco::{Feature, Identity, InfoQuery, Item, ItemQuery};
|
||||||
|
|
|
@ -85,9 +85,9 @@ impl<'a> XmppConnection<'a> {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use anyhow::Result;
|
|
||||||
use crate::testkit::{expect_user_authenticated, TestServer};
|
use crate::testkit::{expect_user_authenticated, TestServer};
|
||||||
use crate::Authenticated;
|
use crate::Authenticated;
|
||||||
|
use anyhow::Result;
|
||||||
use lavina_core::player::PlayerId;
|
use lavina_core::player::PlayerId;
|
||||||
use proto_xmpp::bind::{Jid, Name, Resource, Server};
|
use proto_xmpp::bind::{Jid, Name, Resource, Server};
|
||||||
use proto_xmpp::client::Presence;
|
use proto_xmpp::client::Presence;
|
||||||
|
|
|
@ -29,11 +29,7 @@ pub struct ServerConfig {
|
||||||
pub listen_on: SocketAddr,
|
pub listen_on: SocketAddr,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn launch(
|
pub async fn launch(config: ServerConfig, metrics: MetricsRegistry, core: LavinaCore) -> Result<Terminator> {
|
||||||
config: ServerConfig,
|
|
||||||
metrics: MetricsRegistry,
|
|
||||||
core: LavinaCore,
|
|
||||||
) -> Result<Terminator> {
|
|
||||||
log::info!("Starting the http service");
|
log::info!("Starting the http service");
|
||||||
let listener = TcpListener::bind(config.listen_on).await?;
|
let listener = TcpListener::bind(config.listen_on).await?;
|
||||||
log::debug!("Listener started");
|
log::debug!("Listener started");
|
||||||
|
|
Loading…
Reference in New Issue