Changed all game struct suffixes from _s to _t.

This commit is contained in:
Caball
2024-12-30 23:05:06 +01:00
parent 0090d894c4
commit d0003da606
18 changed files with 135 additions and 135 deletions
+10 -10
View File
@@ -20,7 +20,7 @@ namespace network
return callbacks;
}
bool handle_command(game::netadr_s* address, const char* command, game::msg_t* message)
bool handle_command(game::netadr_t* address, const char* command, game::msg_t* message)
{
const auto cmd_string = utils::string::to_lower(command);
auto& callbacks = get_callbacks();
@@ -61,7 +61,7 @@ namespace network
a.jmp(0x1402C64EE);
}
int net_compare_base_address(const game::netadr_s* a1, const game::netadr_s* a2)
int net_compare_base_address(const game::netadr_t* a1, const game::netadr_t* a2)
{
if (a1->type == a2->type)
{
@@ -83,12 +83,12 @@ namespace network
return false;
}
int net_compare_address(const game::netadr_s* a1, const game::netadr_s* a2)
int net_compare_address(const game::netadr_t* a1, const game::netadr_t* a2)
{
return net_compare_base_address(a1, a2) && a1->port == a2->port;
}
void reconnect_migrated_client(game::mp::client_t*, game::netadr_s* from, const int, const int, const char*, const char*, bool)
void reconnect_migrated_client(game::mp::client_t*, game::netadr_t* from, const int, const int, const char*, const char*, bool)
{
// This happens when a client tries to rejoin after being recently disconnected, OR by a duplicated guid
// We don't want this to do anything. It decides to crash seemingly randomly
@@ -107,14 +107,14 @@ namespace network
get_callbacks()[utils::string::to_lower(command)] = callback;
}
int dw_send_to_stub(const int size, const char* src, game::netadr_s* addr)
int dw_send_to_stub(const int size, const char* src, game::netadr_t* addr)
{
sockaddr s = {};
game::NetadrToSockadr(addr, &s);
return sendto(*game::query_socket, src, size, 0, &s, 16) >= 0;
}
void send(const game::netadr_s& address, const std::string& command, const std::string& data, const char separator)
void send(const game::netadr_t& address, const std::string& command, const std::string& data, const char separator)
{
std::string packet = "\xFF\xFF\xFF\xFF";
packet.append(command);
@@ -124,7 +124,7 @@ namespace network
send_data(address, packet);
}
void send_data(const game::netadr_s& address, const std::string& data)
void send_data(const game::netadr_t& address, const std::string& data)
{
if (address.type == game::NA_LOOPBACK)
{
@@ -136,12 +136,12 @@ namespace network
}
}
bool are_addresses_equal(const game::netadr_s& a, const game::netadr_s& b)
bool are_addresses_equal(const game::netadr_t& a, const game::netadr_t& b)
{
return net_compare_address(&a, &b);
}
const char* net_adr_to_string(const game::netadr_s& a)
const char* net_adr_to_string(const game::netadr_t& a)
{
if (a.type == game::NA_LOOPBACK)
{
@@ -286,7 +286,7 @@ namespace network
if (!game::environment::is_dedi())
{
// we need this on the client for RCon
on("print", [](const game::netadr_s& address, const std::string& message)
on("print", [](const game::netadr_t& address, const std::string& message)
{
if (address != party::get_target())
{