Forms API, part 1: add Player->sendForm() and Form interface

There's no implementation here yet, but that can come later. This lays the ground for allowing plugins to have an integrated method to send forms, as well as a solution to the ID conflict problem.

A built in implementation should not be a concretion and it should be able to be swapped for third party implementations. This enables the possiblity to do so.
This commit is contained in:
Dylan K. Taylor
2018-08-14 16:06:55 +01:00
parent d98a6e566c
commit df8e10cad9
4 changed files with 123 additions and 1 deletions

View File

@ -239,7 +239,7 @@ class PlayerNetworkSessionAdapter extends NetworkSession{
}
public function handleModalFormResponse(ModalFormResponsePacket $packet) : bool{
return false; //TODO: GUI stuff
return $this->player->onFormSubmit($packet->formId, json_decode($packet->formData, true));
}
public function handleServerSettingsRequest(ServerSettingsRequestPacket $packet) : bool{