Begin "implementing" configuration stage
Some checks failed
Build & Test / nix-build (push) Failing after 11s
Some checks failed
Build & Test / nix-build (push) Failing after 11s
This commit is contained in:
parent
7526ffae62
commit
38da310fd8
@ -227,7 +227,17 @@ defmodule Amethyst.Server.Configuration do
|
||||
end
|
||||
|
||||
## HANDLING
|
||||
def handle({:serverbound_plugin_message, channel, data}, client) do
|
||||
handle_plugin_message(channel, data, client)
|
||||
end
|
||||
def handle(tuple, _) do
|
||||
Logger.error("Unhandled but known packet #{elem(tuple, 0)}")
|
||||
end
|
||||
defp handle_plugin_message("minecraft:brand", data, _client) do
|
||||
{[brand], ""} = Read.start(data) |> Read.string |> Read.stop
|
||||
Logger.info("Client using brand: #{brand}")
|
||||
end
|
||||
defp handle_plugin_message("amethyst:hello", _data, _client) do
|
||||
Logger.info("Client is Amethyst aware! Hello!")
|
||||
end
|
||||
end
|
||||
|
@ -116,8 +116,8 @@ defmodule Amethyst.Server.Login do
|
||||
transmit({:login_success, uuid, name, [], false}, client)
|
||||
end
|
||||
end
|
||||
def handle({:login_acknowledged}, _client) do
|
||||
raise RuntimeError, "Configuration stage is not implemented."
|
||||
def handle({:login_acknowledged}, client) do
|
||||
Amethyst.Server.Configuration.serve(client)
|
||||
end
|
||||
def handle(tuple, _) do
|
||||
Logger.error("Unhandled but known packet #{elem(tuple, 0)}")
|
||||
|
Loading…
Reference in New Issue
Block a user