diff --git a/client/Cargo.toml b/client/Cargo.toml index 64747aa..bb7521d 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -21,7 +21,7 @@ cef-sys = { path = "../cef-sys" } crossbeam-channel = "0.3.9" d3dx9 = { path = "../d3dx9" } winapi = { version = "0.3.8", features = ["d3d9", "winuser", "libloaderapi", "winver", "consoleapi", "memoryapi", "shlobj"] } -laminar = "0.3.2" +laminar = { git = "https://github.com/zottce/laminar.git" } messages = { path = "../messages" } quick-protobuf = "0.7.0" detour = { git = "https://github.com/darfink/detour-rs", rev = "3b6f17a" } diff --git a/client/src/network.rs b/client/src/network.rs index 799a51a..f5c2416 100644 --- a/client/src/network.rs +++ b/client/src/network.rs @@ -232,6 +232,14 @@ impl Network { } } + if let Some(addr) = self.connection_state.addr() { + let packet = packets::Got {}; + let packet = messages::try_into_packet(packet).unwrap(); + let packet = Packet::reliable_ordered(addr, packet, None); + + handle_result(self.socket.send(packet)); + } + handle_result( self.event_tx .send(Event::EmitEvent(packet.event_name.to_string(), list)), @@ -298,7 +306,7 @@ impl Network { let auth = packets::OpenConnection {}; let packet = messages::try_into_packet(auth).unwrap(); - let packet = Packet::unreliable_sequenced(address, packet, Some(1)); + let packet = Packet::unreliable_sequenced(address, packet, None); log::trace!("CEF Network: OpenConnection ({})", address); log::trace!( @@ -315,7 +323,7 @@ impl Network { }; let packet = messages::try_into_packet(auth).unwrap(); - let packet = Packet::unreliable_sequenced(address, packet, Some(1)); + let packet = Packet::unreliable_sequenced(address, packet, None); log::trace!("CEF Network: RequestJoin ({})", address); @@ -331,7 +339,7 @@ impl Network { }; let packet = messages::try_into_packet(emit).unwrap(); - let packet = Packet::unreliable_sequenced(address, packet, Some(1)); + let packet = Packet::unreliable_sequenced(address, packet, None); handle_result(self.socket.send(packet)); } @@ -345,7 +353,7 @@ impl Network { }; let packet = messages::try_into_packet(created).unwrap(); - let packet = Packet::unreliable_sequenced(address, packet, Some(1)); + let packet = Packet::unreliable_sequenced(address, packet, None); handle_result(self.socket.send(packet)); } diff --git a/server/Cargo.toml b/server/Cargo.toml index 5155c20..37f2eef 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] [dependencies] samp = { git = "https://github.com/zottce/samp-rs.git", branch = "potential-fix", features = ["encoding"] } -laminar = "0.3.2" +laminar = { git = "https://github.com/zottce/laminar.git" } log = "0.4.6" crossbeam-channel = "0.3.9" messages = { path = "../messages" } diff --git a/server/src/server.rs b/server/src/server.rs index a184bfd..c67b770 100644 --- a/server/src/server.rs +++ b/server/src/server.rs @@ -122,7 +122,7 @@ impl Server { self.event_tx.send(Event::Connected(client.id())); try_into_packet(response).map(|bytes| { - let packet = Packet::unreliable_sequenced(addr, bytes, Some(1)); + let packet = Packet::unreliable_sequenced(addr, bytes, None); self.sender.send(packet); }); } @@ -164,7 +164,7 @@ impl Server { let request = packets::OpenConnection {}; try_into_packet(request).map(|bytes| { - let packet = Packet::unreliable_sequenced(addr, bytes, Some(1)); + let packet = Packet::unreliable_sequenced(addr, bytes, None); self.sender.send(packet); }); } @@ -204,7 +204,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -224,7 +224,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -245,7 +245,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -266,7 +266,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -288,7 +288,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::reliable_ordered(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::reliable_ordered(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -309,7 +309,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -340,7 +340,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -361,7 +361,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -382,7 +382,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -403,7 +403,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); } @@ -427,7 +427,7 @@ impl Server { }; let bytes = try_into_packet(packet).unwrap(); - let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), Some(1)); + let packet = Packet::unreliable_sequenced(client.addr(), bytes.clone(), None); sender.send(packet); }); }