Some patching up
All checks were successful
Build & Test / nix-build (push) Successful in 1m28s

This commit is contained in:
Kodi Craft 2024-09-04 13:13:34 +02:00
parent acc814a056
commit 9842195b8e
Signed by: kodi
GPG Key ID: 69D9EED60B242822
3 changed files with 5 additions and 2 deletions

View File

@ -31,6 +31,9 @@ defmodule Amethyst.API.Game do
`login/3` is called when a new player logs into a game instance. `login/3` is called when a new player logs into a game instance.
You may either :accept or :reject the player for whatever reason, avoid You may either :accept or :reject the player for whatever reason, avoid
rejecting the player in your default game as that will disconnect the player. rejecting the player in your default game as that will disconnect the player.
Note that if no new players can join for any reason, your game should return false from `joinable?/1`.
The PID received in 'from' will be the one that calls all callbacks The PID received in 'from' will be the one that calls all callbacks
caused directly by this player, such as their movement or interactions -- caused directly by this player, such as their movement or interactions --
You can expect that PID to never be used by any other player and that this same You can expect that PID to never be used by any other player and that this same

View File

@ -13,7 +13,7 @@ defmodule GameCoordinatorTestGame do
@impl true @impl true
def login(from, cfg, refs) do def login(from, cfg, refs) do
:ok :accept
end end
@impl true @impl true

View File

@ -12,7 +12,7 @@ defmodule Example.Game do
def login(from, cfg, refs) do def login(from, cfg, refs) do
Logger.info("Player logged in from #{inspect(from)}: #{inspect(cfg)}") Logger.info("Player logged in from #{inspect(from)}: #{inspect(cfg)}")
Logger.info("The refs for this game are #{inspect(refs)}") Logger.info("The refs for this game are #{inspect(refs)}")
:ok :accept
end end
@impl true @impl true