Update StarNetPackets.cpp
This commit is contained in:
parent
951fe787c4
commit
a5788e7585
@ -132,7 +132,6 @@ struct Packet {
|
|||||||
virtual ~Packet();
|
virtual ~Packet();
|
||||||
|
|
||||||
virtual PacketType type() const = 0;
|
virtual PacketType type() const = 0;
|
||||||
virtual String const& typeName() const = 0;
|
|
||||||
|
|
||||||
virtual void readLegacy(DataStream& ds);
|
virtual void readLegacy(DataStream& ds);
|
||||||
virtual void read(DataStream& ds) = 0;
|
virtual void read(DataStream& ds) = 0;
|
||||||
@ -156,7 +155,6 @@ struct PacketBase : public Packet {
|
|||||||
static PacketType const Type = PacketT;
|
static PacketType const Type = PacketT;
|
||||||
|
|
||||||
PacketType type() const override { return Type; }
|
PacketType type() const override { return Type; }
|
||||||
String const& typeName() const override { return PacketTypeNames.getRight(Type); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ProtocolRequestPacket : PacketBase<PacketType::ProtocolRequest> {
|
struct ProtocolRequestPacket : PacketBase<PacketType::ProtocolRequest> {
|
||||||
|
@ -751,7 +751,7 @@ void WorldClient::handleIncomingPackets(List<PacketPtr> const& packets) {
|
|||||||
|
|
||||||
for (auto const& packet : packets) {
|
for (auto const& packet : packets) {
|
||||||
if (!inWorld() && !is<WorldStartPacket>(packet))
|
if (!inWorld() && !is<WorldStartPacket>(packet))
|
||||||
Logger::error("WorldClient received packet type {} while not in world", packet->typeName());
|
Logger::error("WorldClient received packet type {} while not in world", PacketTypeNames.getRight(packet->type()));
|
||||||
|
|
||||||
if (auto worldStartPacket = as<WorldStartPacket>(packet)) {
|
if (auto worldStartPacket = as<WorldStartPacket>(packet)) {
|
||||||
initWorld(*worldStartPacket);
|
initWorld(*worldStartPacket);
|
||||||
|
Loading…
Reference in New Issue
Block a user