refactor: remove basic type containers

This commit is contained in:
orng
2026-03-25 17:47:40 -05:00
parent f4a2db1252
commit f1ae42c659
36 changed files with 684 additions and 799 deletions

View File

@@ -1,8 +1,8 @@
#include "../../Platform/stdafx.h"
#include "../../IO/Streams/InputOutputStream.h"
#include "PacketListener.h"
#include "../../Util/BasicTypeContainers.h"
#include "GameCommandPacket.h"
#include <limits>
GameCommandPacket::GameCommandPacket() { length = 0; }
@@ -14,7 +14,7 @@ GameCommandPacket::GameCommandPacket(EGameCommand command, byteArray data) {
if (data.data != NULL) {
length = data.length;
if (length > Short::MAX_VALUE) {
if (length > std::numeric_limits<short>::max()) {
app.DebugPrintf("Payload may not be larger than 32K\n");
#ifndef _CONTENT_PACKAGE
__debugbreak();
@@ -31,7 +31,7 @@ void GameCommandPacket::read(DataInputStream* dis) {
command = (EGameCommand)dis->readInt();
length = dis->readShort();
if (length > 0 && length < Short::MAX_VALUE) {
if (length > 0 && length < std::numeric_limits<short>::max()) {
if (data.data != NULL) {
delete[] data.data;
}
@@ -52,4 +52,4 @@ void GameCommandPacket::handle(PacketListener* listener) {
listener->handleGameCommand(shared_from_this());
}
int GameCommandPacket::getEstimatedSize() { return 2 + 2 + length; }
int GameCommandPacket::getEstimatedSize() { return 2 + 2 + length; }