feat: add smartcmd dedicated server
major bug: when connecting to the server a second time, it gets softlocked and keeps repeating ticking connection A\n in debug logs until it times out.
This commit is contained in:
146 files changed
+32837
-272
No files matched your search
@@ -0,0 +1,49 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "CliCommandWeather.h"
|
||||
|
||||
#include "../../ServerCliEngine.h"
|
||||
#include "../../ServerCliParser.h"
|
||||
#include "../../../../Minecraft.World/GameCommandPacket.h"
|
||||
#include "../../../../Minecraft.World/ToggleDownfallCommand.h"
|
||||
|
||||
namespace ServerRuntime
|
||||
{
|
||||
namespace
|
||||
{
|
||||
const char *kWeatherUsage = "weather";
|
||||
}
|
||||
|
||||
const char *CliCommandWeather::Name() const
|
||||
{
|
||||
return "weather";
|
||||
}
|
||||
|
||||
const char *CliCommandWeather::Usage() const
|
||||
{
|
||||
return kWeatherUsage;
|
||||
}
|
||||
|
||||
const char *CliCommandWeather::Description() const
|
||||
{
|
||||
return "Toggle weather via Minecraft.World command dispatcher.";
|
||||
}
|
||||
|
||||
bool CliCommandWeather::Execute(const ServerCliParsedLine &line, ServerCliEngine *engine)
|
||||
{
|
||||
if (line.tokens.size() != 1)
|
||||
{
|
||||
engine->LogWarn(std::string("Usage: ") + kWeatherUsage);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::shared_ptr<GameCommandPacket> packet = ToggleDownfallCommand::preparePacket();
|
||||
if (packet == nullptr)
|
||||
{
|
||||
engine->LogError("Failed to build weather command packet.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return engine->DispatchWorldCommand(packet->command, packet->data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "../IServerCliCommand.h"
|
||||
|
||||
namespace ServerRuntime
|
||||
{
|
||||
class CliCommandWeather : public IServerCliCommand
|
||||
{
|
||||
public:
|
||||
const char *Name() const override;
|
||||
const char *Usage() const override;
|
||||
const char *Description() const override;
|
||||
bool Execute(const ServerCliParsedLine &line, ServerCliEngine *engine) override;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user