summaryrefslogtreecommitdiffstats
path: root/game/shared/protocol.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-09-11 13:48:31 +0500
committeruntodesu <kirill@untode.su>2025-09-11 13:48:31 +0500
commitaaed751bf4430bf4b9b30cef532b8753b9f639ce (patch)
tree16bc751c272ba27ad53ec48dbdd3a6d9e6a8d4c2 /game/shared/protocol.cc
parent96bd73ae020ecca1f94698744c77498a89ad19f7 (diff)
downloadvoxelius-aaed751bf4430bf4b9b30cef532b8753b9f639ce.tar.bz2
voxelius-aaed751bf4430bf4b9b30cef532b8753b9f639ce.zip
Replace most of C strings with string_view
Diffstat (limited to 'game/shared/protocol.cc')
-rw-r--r--game/shared/protocol.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/game/shared/protocol.cc b/game/shared/protocol.cc
index f8a9ba8..34b7034 100644
--- a/game/shared/protocol.cc
+++ b/game/shared/protocol.cc
@@ -424,18 +424,18 @@ void protocol::decode(entt::dispatcher& dispatcher, const ENetPacket* packet, EN
}
}
-ENetPacket* protocol::utils::make_disconnect(const char* reason, enet_uint32 flags)
+ENetPacket* protocol::utils::make_disconnect(std::string_view reason, enet_uint32 flags)
{
protocol::Disconnect packet;
- packet.reason = std::string(reason);
+ packet.reason = reason;
return protocol::encode(packet, flags);
}
-ENetPacket* protocol::utils::make_chat_message(const char* message, enet_uint32 flags)
+ENetPacket* protocol::utils::make_chat_message(std::string_view message, enet_uint32 flags)
{
protocol::ChatMessage packet;
packet.type = protocol::ChatMessage::TEXT_MESSAGE;
- packet.message = std::string(message);
+ packet.message = message;
return protocol::encode(packet, flags);
}