MephisTools / diablo2-protocol

Diablo 2 network protocol
MIT License
77 stars 19 forks source link

Check field of D2GS_LOGONRESPONSE #17

Closed rom1504 closed 5 years ago

louis030195 commented 5 years ago

https://bnetdocs.org/packet/177/mcp-creategame

The comment about the request id being incremented by 0x02 is misstated. The request id is incremented by 0x01 for each MCP_CREATEGAME request and 0x01 for each MCP_JOINGAME request. For example, if the MCP_CREATEGAME request fails, the subsequent request id would be 0x03.

clientDiablo.write('MCP_CREATEGAME', {
      requestId: 2,
      difficulty, // NORMAL, TODO : set diff with args
      unknown: 1,
      levelRestrictionDifference: 99,
      maximumPlayers: 8,
      gameName: gameName,
      gamePassword: gamePassword,
      gameDescription: 'gs ' + gameServer
    })

requestId should be dynamic, probably the issue with getting kicked by server

louis030195 commented 5 years ago

quitting client and relaunching seems to reset the requestId