Respect result of Amethyst.API.Game.login/2
All checks were successful
Build & Test / nix-build (push) Successful in 1m33s
All checks were successful
Build & Test / nix-build (push) Successful in 1m33s
This commit is contained in:
parent
903d2fd3be
commit
acc814a056
@ -329,13 +329,16 @@ defmodule Amethyst.Server.Configuration do
|
||||
def handle({:acknowledge_finish_configuration}, client, state) do
|
||||
game = Application.fetch_env!(:amethyst, :default_game) |> Amethyst.GameCoordinator.find_or_create()
|
||||
state = Keyword.put(state, :game, game)
|
||||
Amethyst.API.Game.login(game, state)
|
||||
# TODO: All of this stuff should obviously not be hardcoded here
|
||||
Amethyst.Server.Play.transmit({:login,
|
||||
0, false, ["minecraft:overworld"], 0, 16, 16, false, true, true, 0,
|
||||
"minecraft:overworld", <<0::64>>, :spectator, nil, false, true, nil, 0, false
|
||||
}, client)
|
||||
Amethyst.Server.Play.serve(client, state)
|
||||
if Amethyst.API.Game.login(game, state) == :reject do
|
||||
raise RuntimeError, "Default game rejected login!"
|
||||
else
|
||||
# TODO: All of this stuff should obviously not be hardcoded here
|
||||
Amethyst.Server.Play.transmit({:login,
|
||||
0, false, ["minecraft:overworld"], 0, 16, 16, false, true, true, 0,
|
||||
"minecraft:overworld", <<0::64>>, :spectator, nil, false, true, nil, 0, false
|
||||
}, client)
|
||||
Amethyst.Server.Play.serve(client, state)
|
||||
end
|
||||
end
|
||||
# Serverbound Plugin Message https://wiki.vg/Protocol#Serverbound_Plugin_Message_(configuration)
|
||||
def handle({:serverbound_plugin_message, channel, data}, client, state) do
|
||||
|
@ -12,4 +12,3 @@ import Config
|
||||
level: :debug,
|
||||
format: "$date $time [$level] $metadata$message",
|
||||
metadata: []
|
||||
config :pre_commit, commands: ["test", "credo"]
|
||||
|
Loading…
Reference in New Issue
Block a user