Improve formatting more and slow federation feed down

This commit is contained in:
Sakuhl 2018-04-04 14:46:43 +02:00
parent 0cb96b3e65
commit 235b0d501e

View File

@ -103,7 +103,7 @@ pub fn federation_livefeed() {
let mut timestamp = territories.as_object().unwrap().get("request").unwrap().as_object().unwrap().get("timestamp").unwrap().as_u64().unwrap(); let mut timestamp = territories.as_object().unwrap().get("request").unwrap().as_object().unwrap().get("timestamp").unwrap().as_u64().unwrap();
loop { loop {
thread::sleep_ms(10_000); thread::sleep_ms(30_000); // 30 s
let resp = reqwest::get("https://api.wynncraft.com/public_api.php?action=territoryList").unwrap(); let resp = reqwest::get("https://api.wynncraft.com/public_api.php?action=territoryList").unwrap();
let new_territories: Value = serde_json::from_reader(resp).unwrap(); let new_territories: Value = serde_json::from_reader(resp).unwrap();
@ -133,8 +133,8 @@ pub fn federation_livefeed() {
for listener in federationfeed_listeners for listener in federationfeed_listeners
.load::<FederationfeedListener>(&connection) .load::<FederationfeedListener>(&connection)
.expect("Error loading listeners") { .expect("Error loading listeners") {
let _ = ChannelId(listener.id as u64).say(format!("Assigned owned by others: {:?} let _ = ChannelId(listener.id as u64).say(format!("Assigned owned by others: {}
FFA owned by others: {:?}", FFA owned by others: {}",
assigned_owned_by_enemies.join(", "), assigned_owned_by_enemies.join(", "),
ffa_owned_by_enemies.join(", ") ffa_owned_by_enemies.join(", ")
)); ));