mirror of
https://github.com/stefanocasazza/ULib.git
synced 2025-09-28 19:05:55 +08:00
sync
This commit is contained in:
parent
ba1d88f85e
commit
07b3b28d34
|
@ -98,7 +98,7 @@ for (i = 0, ++n; i < n; ++i)
|
|||
ptr += sz;
|
||||
|
||||
u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','/','t'));
|
||||
u_put_unalignedp16(ptr+8, U_MULTICHAR_CONSTANT16('d','>'));
|
||||
u_put_unalignedp16(ptr+8, U_MULTICHAR_CONSTANT16('r','>'));
|
||||
ptr += 10;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,12 @@ while (true)
|
|||
}
|
||||
|
||||
#ifdef AS_cpoll_cppsp_DO
|
||||
USP_PUTS_CHAR('[');
|
||||
(void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
|
||||
|
||||
char* s = UClientImage_Base::wbuffer->data();
|
||||
char* ptr = UClientImage_Base::wbuffer->pend();
|
||||
|
||||
*ptr++ = '[';
|
||||
#endif
|
||||
|
||||
if (bpgsql) pvworld_update->sort(World::cmp_obj);
|
||||
|
@ -120,18 +125,30 @@ while (true)
|
|||
}
|
||||
|
||||
#ifdef AS_cpoll_cppsp_DO
|
||||
USP_PRINTF("{\"id\":%u,\"randomNumber\":%u}", pworld->id, pworld->randomNumber);
|
||||
u_put_unalignedp32(ptr, U_MULTICHAR_CONSTANT32('{','"','i','d'));
|
||||
u_put_unalignedp16(ptr+4, U_MULTICHAR_CONSTANT16('"',':'));
|
||||
|
||||
ptr = u_num2str32(pworld->id, ptr+6);
|
||||
|
||||
u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64(',','"','r','a','n','d','o','m'));
|
||||
u_put_unalignedp64(ptr+8, U_MULTICHAR_CONSTANT64('N','u','m','b','e','r','"',':'));
|
||||
|
||||
ptr = u_num2str32(pworld->randomNumber, ptr+16);
|
||||
|
||||
*ptr++ = '}';
|
||||
#endif
|
||||
|
||||
if (++i == num_queries) break;
|
||||
|
||||
#ifdef AS_cpoll_cppsp_DO
|
||||
USP_PUTS_CHAR(',');
|
||||
*ptr++ = ',';
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef AS_cpoll_cppsp_DO
|
||||
USP_PUTS_CHAR(']');
|
||||
*ptr++ = ']';
|
||||
|
||||
UClientImage_Base::wbuffer->size_adjust(ptr - s);
|
||||
#else
|
||||
USP_OBJ_JSON_stringify(*pvworld_update);
|
||||
#endif
|
||||
|
|
|
@ -98,7 +98,7 @@ for (i = 0, ++n; i < n; ++i)
|
|||
ptr += sz;
|
||||
|
||||
u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','/','t'));
|
||||
u_put_unalignedp16(ptr+8, U_MULTICHAR_CONSTANT16('d','>'));
|
||||
u_put_unalignedp16(ptr+8, U_MULTICHAR_CONSTANT16('r','>'));
|
||||
ptr += 10;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,12 @@ while (true)
|
|||
}
|
||||
|
||||
#ifdef AS_cpoll_cppsp_DO
|
||||
USP_PUTS_CHAR('[');
|
||||
(void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
|
||||
|
||||
char* s = UClientImage_Base::wbuffer->data();
|
||||
char* ptr = UClientImage_Base::wbuffer->pend();
|
||||
|
||||
*ptr++ = '[';
|
||||
#endif
|
||||
|
||||
if (bpgsql) pvworld_update->sort(World::cmp_obj);
|
||||
|
@ -120,18 +125,30 @@ while (true)
|
|||
}
|
||||
|
||||
#ifdef AS_cpoll_cppsp_DO
|
||||
USP_PRINTF("{\"id\":%u,\"randomNumber\":%u}", pworld->id, pworld->randomNumber);
|
||||
u_put_unalignedp32(ptr, U_MULTICHAR_CONSTANT32('{','"','i','d'));
|
||||
u_put_unalignedp16(ptr+4, U_MULTICHAR_CONSTANT16('"',':'));
|
||||
|
||||
ptr = u_num2str32(pworld->id, ptr+6);
|
||||
|
||||
u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64(',','"','r','a','n','d','o','m'));
|
||||
u_put_unalignedp64(ptr+8, U_MULTICHAR_CONSTANT64('N','u','m','b','e','r','"',':'));
|
||||
|
||||
ptr = u_num2str32(pworld->randomNumber, ptr+16);
|
||||
|
||||
*ptr++ = '}';
|
||||
#endif
|
||||
|
||||
if (++i == num_queries) break;
|
||||
|
||||
#ifdef AS_cpoll_cppsp_DO
|
||||
USP_PUTS_CHAR(',');
|
||||
*ptr++ = ',';
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef AS_cpoll_cppsp_DO
|
||||
USP_PUTS_CHAR(']');
|
||||
*ptr++ = ']';
|
||||
|
||||
UClientImage_Base::wbuffer->size_adjust(ptr - s);
|
||||
#else
|
||||
USP_OBJ_JSON_stringify(*pvworld_update);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user