File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 10
10
*****************************************************************************/
11
11
12
12
#include " StdInc.h"
13
+ #include < net/CNet.h>
13
14
#define DECLARE_PROFILER_SECTION_multiplayersa_init
14
15
#include " profiler/SharedUtil.Profiler.h"
15
16
Original file line number Diff line number Diff line change @@ -235,6 +235,34 @@ class NetBitStreamInterfaceNoVersion : public CRefCountable
235
235
WriteLength (value.length ());
236
236
return WriteStringCharacters (value, value.length ());
237
237
}
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
+ }
238
266
#endif
239
267
240
268
// Read characters into a std::string
You can’t perform that action at this time.
0 commit comments