mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'imbris/ping-while-waiting-for-gamesync' into 'master'
Keep connection alive while waiting for initial sync See merge request veloren/veloren!1898
This commit is contained in:
commit
4e454d3215
@ -244,6 +244,7 @@ impl Client {
|
||||
ping_stream.send(PingMsg::Ping)?;
|
||||
|
||||
// Wait for initial sync
|
||||
let mut ping_interval = tokio::time::interval(core::time::Duration::from_secs(1));
|
||||
let (
|
||||
state,
|
||||
entity,
|
||||
@ -255,7 +256,12 @@ impl Client {
|
||||
recipe_book,
|
||||
max_group_size,
|
||||
client_timeout,
|
||||
) = match register_stream.recv().await? {
|
||||
) = match loop {
|
||||
tokio::select! {
|
||||
res = register_stream.recv() => break res?,
|
||||
_ = ping_interval.tick() => ping_stream.send(PingMsg::Ping)?,
|
||||
}
|
||||
} {
|
||||
ServerInit::GameSync {
|
||||
entity_package,
|
||||
time_of_day,
|
||||
|
Loading…
Reference in New Issue
Block a user