mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 11:12:29 +00:00
fix(whoa): update thunderbrew to use the refactored squall error/validation and bc allocation macros
This commit is contained in:
parent
1aeacd0d2e
commit
46843880ef
66 changed files with 459 additions and 457 deletions
|
|
@ -34,6 +34,7 @@ target_link_libraries(net
|
|||
client
|
||||
event
|
||||
PUBLIC
|
||||
bc
|
||||
common
|
||||
storm
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
#include "net/connection/WowConnectionNet.hpp"
|
||||
#include "net/connection/WowConnectionResponse.hpp"
|
||||
#include "util/HMAC.hpp"
|
||||
#include <bc/Memory.hpp>
|
||||
#include <common/DataStore.hpp>
|
||||
#include <common/Time.hpp>
|
||||
#include <storm/Error.hpp>
|
||||
#include <storm/Memory.hpp>
|
||||
#include <storm/String.hpp>
|
||||
#include <storm/Thread.hpp>
|
||||
#include <algorithm>
|
||||
|
|
@ -102,8 +102,7 @@ int32_t WowConnection::InitOsNet(bool (*fcn)(const NETADDR*), void (*threadinit)
|
|||
|
||||
numThreads = std::min(numThreads, 32);
|
||||
|
||||
auto networkMem = SMemAlloc(sizeof(WowConnectionNet), __FILE__, __LINE__, 0x0);
|
||||
auto network = new (networkMem) WowConnectionNet(numThreads, threadinit);
|
||||
auto network = NEW(WowConnectionNet, numThreads, threadinit);
|
||||
|
||||
WowConnection::s_network = network;
|
||||
WowConnection::s_network->PlatformInit(useEngine);
|
||||
|
|
@ -182,8 +181,7 @@ void WowConnection::CheckAccept() {
|
|||
fcntl(sock, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
|
||||
auto connMem = SMemAlloc(sizeof(WowConnection), __FILE__, __LINE__, 0x0);
|
||||
auto conn = new (connMem) WowConnection(sock, reinterpret_cast<sockaddr_in*>(&addr), this->m_response);
|
||||
auto conn = NEW(WowConnection, sock, reinterpret_cast<sockaddr_in*>(&addr), this->m_response);
|
||||
conn->AddRef();
|
||||
|
||||
this->AddRef();
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@
|
|||
#include "net/grunt/Command.hpp"
|
||||
#include "net/srp/SRP6_Random.hpp"
|
||||
#include <cstring>
|
||||
#include <new>
|
||||
#include <storm/Memory.hpp>
|
||||
#include <bc/Memory.hpp>
|
||||
#include <storm/String.hpp>
|
||||
|
||||
Grunt::Command<Grunt::ClientLink> Grunt::s_clientCommands[] = {
|
||||
|
|
@ -381,8 +380,7 @@ void Grunt::ClientLink::Connect(const char* a2) {
|
|||
|
||||
this->SetState(1);
|
||||
|
||||
auto connectionMem = SMemAlloc(sizeof(WowConnection), __FILE__, __LINE__, 0x0);
|
||||
auto connection = new (connectionMem) WowConnection(this, nullptr);
|
||||
auto connection = NEW(WowConnection, this, nullptr);
|
||||
|
||||
this->m_connection = connection;
|
||||
this->m_connection->SetType(WOWC_TYPE_STREAM);
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
#include "net/grunt/ClientLink.hpp"
|
||||
#include "net/login/LoginResponse.hpp"
|
||||
#include <cstring>
|
||||
#include <new>
|
||||
#include <storm/Memory.hpp>
|
||||
#include <bc/Memory.hpp>
|
||||
#include <storm/String.hpp>
|
||||
|
||||
GruntLogin::~GruntLogin() {
|
||||
|
|
@ -75,7 +74,7 @@ void GruntLogin::GetLogonMethod() {
|
|||
|
||||
auto passwordLen = SStrLen(this->m_password);
|
||||
memset(this->m_password, 0, passwordLen);
|
||||
SMemFree(this->m_password, __FILE__, __LINE__, 0);
|
||||
FREE(this->m_password);
|
||||
this->m_password = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
@ -108,8 +107,8 @@ void GruntLogin::GetVersionProof(const uint8_t* versionChallenge) {
|
|||
void GruntLogin::Init(LoginResponse* loginResponse) {
|
||||
this->m_loginResponse = loginResponse;
|
||||
|
||||
auto clientLinkMem = SMemAlloc(sizeof(Grunt::ClientLink), __FILE__, __LINE__, 0x0);
|
||||
auto clientLink = new (clientLinkMem) Grunt::ClientLink(*this);
|
||||
auto clientLink = NEW(Grunt::ClientLink, *this);
|
||||
|
||||
this->m_clientLink = clientLink;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include "net/login/Login.hpp"
|
||||
#include "net/login/LoginResponse.hpp"
|
||||
#include <cstring>
|
||||
#include <bc/Memory.hpp>
|
||||
#include <common/DataStore.hpp>
|
||||
#include <storm/Memory.hpp>
|
||||
#include <storm/String.hpp>
|
||||
|
||||
Login::~Login() {
|
||||
|
|
@ -32,7 +32,7 @@ void Login::SetLogonCreds(const char* accountName, const char* password) {
|
|||
|
||||
if (this->m_password) {
|
||||
memset(this->m_password, 0, SStrLen(this->m_password));
|
||||
SMemFree(this->m_password, __FILE__, __LINE__, 0x0);
|
||||
FREE(this->m_password);
|
||||
}
|
||||
|
||||
this->m_password = SStrDupA(password, __FILE__, __LINE__);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue