mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-14 19:38:41 -06:00
what the fuck
This commit is contained in:
parent
f3cdb841ea
commit
c9fcf889c3
|
@ -37,8 +37,10 @@ pub fn create_client(
|
||||||
pub fn connect_client(
|
pub fn connect_client(
|
||||||
mut client: UniqueViewMut<UdpClient>
|
mut client: UniqueViewMut<UdpClient>
|
||||||
) {
|
) {
|
||||||
|
if !client.0.has_not_made_connection_attempts() {
|
||||||
client.0.connect().unwrap();
|
client.0.connect().unwrap();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn update_client(
|
pub fn update_client(
|
||||||
mut client: UniqueViewMut<UdpClient>,
|
mut client: UniqueViewMut<UdpClient>,
|
||||||
|
@ -63,18 +65,12 @@ pub fn insert_client_events(
|
||||||
pub fn update_networking() -> Workload {
|
pub fn update_networking() -> Workload {
|
||||||
(
|
(
|
||||||
create_client.run_if_missing_unique::<UdpClient>(),
|
create_client.run_if_missing_unique::<UdpClient>(),
|
||||||
connect_client.run_if(client_needs_connect_call),
|
connect_client,
|
||||||
update_client,
|
update_client,
|
||||||
insert_client_events,
|
insert_client_events,
|
||||||
).into_workload()
|
).into_workload()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn client_needs_connect_call(
|
|
||||||
client: UniqueView<UdpClient>,
|
|
||||||
) -> bool {
|
|
||||||
client.0.has_not_made_connection_attempts()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn is_multiplayer(
|
pub fn is_multiplayer(
|
||||||
game_type: UniqueView<GameType>
|
game_type: UniqueView<GameType>
|
||||||
) -> bool {
|
) -> bool {
|
||||||
|
|
Loading…
Reference in a new issue