Skip to content

Commit 1ac4ca5

Browse files
committed
Fix build server compilation
1 parent ea6c9b1 commit 1ac4ca5

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Client/multiplayer_sa/multiplayersa_init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*****************************************************************************/
1111

1212
#include "StdInc.h"
13+
#include <net/CNet.h>
1314
#define DECLARE_PROFILER_SECTION_multiplayersa_init
1415
#include "profiler/SharedUtil.Profiler.h"
1516

Shared/sdk/net/bitstream.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,34 @@ class NetBitStreamInterfaceNoVersion : public CRefCountable
235235
WriteLength(value.length());
236236
return WriteStringCharacters(value, value.length());
237237
}
238+
#else
239+
// Write characters from a std::string
240+
void WriteStringCharacters(const std::string& value, uint uiLength)
241+
{
242+
dassert(uiLength <= value.length());
243+
// Send the data
244+
if (uiLength)
245+
Write(&value.at(0), uiLength);
246+
}
247+
248+
// Write a string (incl. ushort size header)
249+
template <typename SizeType = unsigned short>
250+
void WriteString(const std::string& value)
251+
{
252+
// Write the length
253+
auto length = static_cast<SizeType>(value.length());
254+
Write(length);
255+
256+
// Write the characters
257+
return WriteStringCharacters(value, length);
258+
}
259+
260+
// Write a string (incl. variable size header)
261+
void WriteStr(const std::string& value)
262+
{
263+
WriteLength(value.length());
264+
return WriteStringCharacters(value, value.length());
265+
}
238266
#endif
239267

240268
// Read characters into a std::string

0 commit comments

Comments
 (0)