forked from lavina/lavina
wip
This commit is contained in:
parent
361946bc35
commit
a740dc80fe
|
@ -20,5 +20,4 @@ addresses = []
|
||||||
[cluster.metadata]
|
[cluster.metadata]
|
||||||
node_id = 0
|
node_id = 0
|
||||||
main_owner = 0
|
main_owner = 0
|
||||||
test_owner = 0
|
rooms = {}
|
||||||
test2_owner = 0
|
|
||||||
|
|
|
@ -124,8 +124,7 @@ impl TestServer {
|
||||||
metadata: ClusterMetadata {
|
metadata: ClusterMetadata {
|
||||||
node_id: 0,
|
node_id: 0,
|
||||||
main_owner: 0,
|
main_owner: 0,
|
||||||
test_owner: 0,
|
rooms: Default::default(),
|
||||||
test2_owner: 0,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let core = LavinaCore::new(metrics.clone(), cluster_config, storage.clone()).await?;
|
let core = LavinaCore::new(metrics.clone(), cluster_config, storage.clone()).await?;
|
||||||
|
@ -148,8 +147,7 @@ impl TestServer {
|
||||||
metadata: ClusterMetadata {
|
metadata: ClusterMetadata {
|
||||||
node_id: 0,
|
node_id: 0,
|
||||||
main_owner: 0,
|
main_owner: 0,
|
||||||
test_owner: 0,
|
rooms: Default::default(),
|
||||||
test2_owner: 0,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let TestServer {
|
let TestServer {
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
|
use prometheus::Registry as MetricsRegistry;
|
||||||
|
|
||||||
use crate::{Authenticated, XmppConnection};
|
use crate::{Authenticated, XmppConnection};
|
||||||
use lavina_core::player::{PlayerConnection, PlayerId};
|
use lavina_core::clustering::{ClusterConfig, ClusterMetadata};
|
||||||
|
use lavina_core::player::PlayerConnection;
|
||||||
use lavina_core::repo::{Storage, StorageConfig};
|
use lavina_core::repo::{Storage, StorageConfig};
|
||||||
use lavina_core::LavinaCore;
|
use lavina_core::LavinaCore;
|
||||||
use prometheus::Registry as MetricsRegistry;
|
|
||||||
use proto_xmpp::bind::{BindRequest, BindResponse, Jid, Name, Resource, Server};
|
use proto_xmpp::bind::{BindRequest, BindResponse, Jid, Name, Resource, Server};
|
||||||
|
|
||||||
pub(crate) struct TestServer {
|
pub(crate) struct TestServer {
|
||||||
|
@ -19,7 +21,15 @@ impl TestServer {
|
||||||
db_path: ":memory:".into(),
|
db_path: ":memory:".into(),
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
let core = LavinaCore::new(metrics.clone(), storage.clone()).await?;
|
let cluster_config = ClusterConfig {
|
||||||
|
metadata: ClusterMetadata {
|
||||||
|
node_id: 0,
|
||||||
|
main_owner: 0,
|
||||||
|
rooms: Default::default(),
|
||||||
|
},
|
||||||
|
addresses: vec![],
|
||||||
|
};
|
||||||
|
let core = LavinaCore::new(metrics.clone(), cluster_config, storage.clone()).await?;
|
||||||
Ok(TestServer { metrics, storage, core })
|
Ok(TestServer { metrics, storage, core })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +37,15 @@ impl TestServer {
|
||||||
self.core.shutdown().await?;
|
self.core.shutdown().await?;
|
||||||
|
|
||||||
let metrics = MetricsRegistry::new();
|
let metrics = MetricsRegistry::new();
|
||||||
let core = LavinaCore::new(metrics.clone(), self.storage.clone()).await?;
|
let cluster_config = ClusterConfig {
|
||||||
|
metadata: ClusterMetadata {
|
||||||
|
node_id: 0,
|
||||||
|
main_owner: 0,
|
||||||
|
rooms: Default::default(),
|
||||||
|
},
|
||||||
|
addresses: vec![],
|
||||||
|
};
|
||||||
|
let core = LavinaCore::new(metrics.clone(), cluster_config, self.storage.clone()).await?;
|
||||||
|
|
||||||
Ok(TestServer {
|
Ok(TestServer {
|
||||||
metrics,
|
metrics,
|
||||||
|
|
|
@ -167,8 +167,7 @@ impl TestServer {
|
||||||
metadata: ClusterMetadata {
|
metadata: ClusterMetadata {
|
||||||
node_id: 0,
|
node_id: 0,
|
||||||
main_owner: 0,
|
main_owner: 0,
|
||||||
test_owner: 0,
|
rooms: Default::default(),
|
||||||
test2_owner: 0,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let core = LavinaCore::new(metrics.clone(), cluster_config, storage.clone()).await?;
|
let core = LavinaCore::new(metrics.clone(), cluster_config, storage.clone()).await?;
|
||||||
|
|
Loading…
Reference in New Issue