X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Fnet.qh;h=7b3f581b38f059cd4e4252905ae0dcf243983209;hb=e51ce3d45d2852ca793118fc73da9c25f789101f;hp=b1f5326a9bb5a441b5094de347cfe973086d5bd6;hpb=a1372cef7e6aa5fc6f92777b990c8adbf4723d19;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index b1f5326a9..7b3f581b3 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -50,7 +50,7 @@ STATIC_INIT(RegisterTempEntities_renumber) { FOREACH(TempEntities, true, it.m_id #ifdef CSQC #define REGISTER_NET_LINKED(id) \ - [[accumulate]] NET_HANDLE(id, bool isnew) \ + ACCUMULATE NET_HANDLE(id, bool isnew) \ { \ this = __self; \ this.sourceLoc = __FILE__ ":" STR(__LINE__); \ @@ -107,7 +107,6 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); } #ifdef SVQC const int MSG_ENTITY = 5; - .int Version; // deprecated, use SendFlags .int SendFlags; IntrusiveList g_uncustomizables; @@ -202,8 +201,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); } { if (g_buf == "") return; localcmd("\ncmd c2s \"", strreplace("$", "$$", g_buf), "\"\n"); - strunzone(g_buf); - g_buf = string_null; + strfree(g_buf); } #endif @@ -301,8 +299,12 @@ MACRO_END string s = string_null; yenc_single(b, s); string tmp = strcat(g_buf, s); - if (g_buf) strunzone(g_buf); - g_buf = strzone(tmp); + strcpy(g_buf, tmp); + } + void WriteShort(int to, int b) + { + WriteByte(to, (b >> 8) & 0xFF); + WriteByte(to, b & 0xFF); } #elif defined(SVQC) int ReadByte() @@ -311,6 +313,10 @@ MACRO_END ydec_single(g_buf, ret); return ret; } + int ReadShort() + { + return (ReadByte() << 8) | (ReadByte()); + } void WriteByte(int to, int b); #endif