Skip to content

Commit

Permalink
fuck laminar
Browse files Browse the repository at this point in the history
  • Loading branch information
Pycckue-Bnepeg committed Sep 4, 2021
1 parent d32511f commit 8ce3996
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
16 changes: 12 additions & 4 deletions client/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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!(
Expand All @@ -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);

Expand All @@ -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));
}
Expand All @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
26 changes: 13 additions & 13 deletions server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down Expand Up @@ -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);
});
}
Expand Down Expand Up @@ -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);
});
}
Expand All @@ -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);
});
}
Expand All @@ -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);
});
}
Expand All @@ -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);
});
}
Expand All @@ -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);
});
}
Expand All @@ -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);
});
}
Expand Down Expand Up @@ -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);
});
}
Expand All @@ -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);
});
}
Expand All @@ -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);
});
}
Expand All @@ -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);
});
}
Expand All @@ -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);
});
}
Expand Down

0 comments on commit 8ce3996

Please sign in to comment.