sepalani / MH3SP

Monster Hunter 3 (~tri) Server Project
GNU Affero General Public License v3.0
195 stars 19 forks source link

Implemented Warping #93

Open kbarkevich opened 1 year ago

kbarkevich commented 1 year ago

This PR handles warping in the following cases:

"Different Server" warps are a multi-step process that periodically checks to see if the destination is full (or empty, in the case of a city.) The steps are as follows:

  1. RecLayerJump/AnsLayerJump (Game initiates warp. First check to see if destination is valid happens.)
  2. ReqLayerJumpReady/NtcLayerJumpReady (Game asks to initiate Server->Server hop, does so using standard FMP disconnect/connect sequences upon reply with Ntc packet. Second check to see if destination is valid happens.)
  3. ReqLayerJumpGo/NtcLayerJumpGo (Game, now having completed the Server->Server hop, asks to enter their destination Gate/City. Third check to see if destination is valid happens.)

Testing has shown that the process is able to be gracefully aborted through an AnsAlert packet at any step. For example, if the Server->Server jump is completed, and then the process is aborted, the user will be returned to the "server select" screen. If the process is aborted before the Server->Server jump is completed, the user will remain in their current location.

TODO in a future PR: Implementation of Gate locking at the relevant steps. Currently, City locking is implemented.