Changed in commit b1d81e2dc54596fff7efa31fd874134c3c2671a3, sizes must now be provided to minimize the amount of strlen's performed by protobuf internally.
m_RecvBuffer.max_size() can be very large, just check on RCON_MAX_PAYLOAD_SIZE (1 MiB), if its larger than that, then the stream has definitely being desynced or malformed. Also drop the client on null payloads because the payload should never be 0.
Old regression that was caused by implementing the ability to disconnect the socket from anywhere in the rcon code, but it was never accounted for in CNetConBase::ProcessBuffer() and CNetConBase::Recv(). ProcessBuffer() must return directly when ProcessMessage() failed, and Recv() must break out if ProcessBuffer() returned false.
- All serializations now expect exact buffer lengths (which we knew for every call, but didn't make use of).
- The prefix is now also constructed directly into the send buffer
- The send buffer copies have been completely removed, the data that has been rendered into the only existing buffer will be used directly.
Don't recalculate the length of each text on the lines displayed when pushing it to the draw list. Also use the already calculated length for intermediate operations.
- Fetch field name strlen at compile time using rapidjson's string refs.
- Use from_chars to do string to number conversions which isn't locale aware, for maximum speed.
Future planned porting of effects assets will be moved into this rpak file. This pak file loads directly after effects.rpak is loaded, and only if it was loaded.
common_roots.rpak is loaded directly after common_early.rpak, and is necessary to store player layouts (these must be loaded before common.rpak is loaded to preserve the correct order of the linked list).
Make sure that every pak is fully loaded before we continue with the level load. Previously we would only wait on paks loaded by CommonPakData_s, but we should also wait on paks loaded by CustomPakData_s. This fixes all rare crash cases caused by this.
Due to the rework on repak and the ability to rebuilt entire map rpaks in original quality, we no longer need to do the hack of unloading paks in FIFO order. Properly unload all SDK paks in the same order engine paks are unloaded, which is FILO.
Custom level paks are now also loaded after mp_lobby.rpak, this allows custom level paks to use assets from mp_lobby too without having to copy them over.
Text typically gets truncated on concommands/convars with long help texts, this code is also very old. Increasing the buffer sizes fixed the problem. Code now also logs the usage texts if this is available (usage texts is newer than this code, so it was never taken into account).
This reverts commit 9b2034d897e68e2c8677df739e14c77a59901652.
Squirrel coroutines cannot stop during native code execution, it can only happen after a native call has been completed which means that commit 9b2034d897e68e2c8677df739e14c77a59901652 is unnecessary. Revert back to using static objects as this is a lot more performant than allocating/freeing the message each time an event occurs.
Reported by @dr3murr
CClientEntityList::GetClientNetworkable() and CClientEntityList::GetClientEntity() lacked a proper clamp on the 'entNum' parameter. CClientEntityList::GetClientEntity() only handled entNum == -1 cases prior to this patch.
The validation code uses internal structures of the Miles Sound System which is different for each version of the sound engine versions we support, which makes switching banks impossible without recompiling the SDK. The bank patches rarely fail, but if we decide to keep this we should seek for an alternative approach i.e. using the DLL interfaces directly.
We must always use the remainder when writing out padding. The bug was that it would still do the full count or PAD_BUF_SIZE at all times even though the remainder is 20 for example. This fixes the last few rare alignment problems.
- Drop the need for the ImGui logger sink, we can just use the buffer we already rendered into for the terminal sink.
- Remove ANSI rows inserted by the logger before file logging using offsets and ranges to significantly improve the performance.
- For ANSI row constants, use std::string so appending can use the precomputed string length instead of running strlen() each time internally.
Network addresses should always be stored as base only (without their port numbers), since all additional data can change on reconnects which will make comparisons impossible.