简体   繁体   中英

Minecraft Server Query Protocol. What does SessionId field identify?

I'm writing some app with this protocol . And I don't understand what does SessionId field identify. There are two ways.

First, it's used to identify an every single request-response packages pair and I should generate it again for every request.

Or, it's used to identify clients which tries to get status of server and I should generate it once for every server I connect to.

Are there any ideas?

Okay. I got it. SessionId can contain any Int32 number if SessionId & 0x0f0f0f0f == SessionId. What it identifies is about what you want to do. All ways is correct.

For my project I generate it randomly for each packet I send.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM