Allocate jobids randomly, Steam seems to do that now
This commit is contained in:
parent
70271a9ce0
commit
6e2eb1aea0
|
@ -55,8 +55,6 @@ pub async fn bootstrap_find_servers() -> eyre::Result<Vec<String>> {
|
|||
struct SessionInner {
|
||||
/// Steam ID of current user. When set to None we are not logged in
|
||||
steam_id: Option<u64>,
|
||||
/// Next jobid to use for messages that start a "job"
|
||||
next_jobid: u64,
|
||||
/// Realm we're connecting to. AIUI this corresponds to account universe.
|
||||
/// Should normally be 1 for Public
|
||||
realm: u32,
|
||||
|
@ -69,9 +67,9 @@ struct SessionInner {
|
|||
/// Waker for the sending thread
|
||||
send_waker: Option<Waker>,
|
||||
|
||||
/// Recievers waiting for responses by job id
|
||||
/// Recievers waiting for responses by jobid
|
||||
receive_wakers: HashMap<u64, Waker>,
|
||||
/// Messages ready for receivers by job id
|
||||
/// Messages ready for receivers by jobid
|
||||
/// TODO: Support multiple messages for same job ID
|
||||
receive_messages: HashMap<u64, CMRawProtoBufMessage>,
|
||||
|
||||
|
@ -81,9 +79,7 @@ struct SessionInner {
|
|||
|
||||
impl SessionInner {
|
||||
pub fn alloc_jobid(&mut self) -> u64 {
|
||||
let jobid = self.next_jobid;
|
||||
self.next_jobid += 1;
|
||||
jobid
|
||||
rand::random()
|
||||
}
|
||||
|
||||
pub fn wake_sender(&mut self) {
|
||||
|
@ -221,7 +217,6 @@ impl CMSession {
|
|||
|
||||
let inner = SessionInner {
|
||||
steam_id: None,
|
||||
next_jobid: 0,
|
||||
realm: 1,
|
||||
client_session_id: 0,
|
||||
send_queue: VecDeque::new(),
|
||||
|
|
Loading…
Reference in a new issue