Commit graph

20 commits

Author SHA1 Message Date
Robert Müller ab4e737a57 Fix misaligned int loads in CUnpacker::GetUncompressedInt
Use `mem_copy` instead of dereferencing potentially misaligned address as `int`.
2023-11-21 21:57:06 +01:00
Robert Müller 51e3c37c03 Use mem_copy instead of for-loop in CPacker::AddRaw
Using `memcpy` is faster, assuming the compiler doesn't already transform the loop to `memcpy` automatically.
2023-11-21 21:49:29 +01:00
Robert Müller c5e336f5e2 Fix off-by-one error when adding raw data to buffer
One byte too few could be added to packers as raw data. Detected by the new test cases.
2023-05-03 19:13:39 +02:00
Robert Müller fd4491b307 Use bool instead of int 2023-05-03 18:02:38 +02:00
Robert Müller ef48a2fde4 Use sizeof(int) instead of 4 2023-05-03 17:59:36 +02:00
c0d3d3v 59436b5e6d
Add default values to extended Net Objects 2022-06-27 01:11:19 +02:00
Robert Müller 31533d5e2a Organize engine-shared includes 2022-05-29 20:02:22 +02:00
Robert Müller 66d64ec3fd Add size checks to CVariableInt::Pack and ::Unpack 2022-03-05 20:49:55 +01:00
Robert Müller 07a8d21224 fix argument order in test, use constant 2021-12-27 23:41:52 +01:00
def 3be8a592e5 Run clang-format
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:

$ python scripts/fix_style.py
2020-09-26 21:50:15 +02:00
heinrich5991 5b669bcb32 Only send valid UTF-8 over the network 2020-09-03 18:50:23 +02:00
Learath 807c92f1a4 Generate the 0.7 protocol 2020-06-19 20:27:15 +03:00
heinrich5991 1d81d56850 Introduce new, vanilla-compatible server info protocol
This means that we have a reliable and fast way to query for extended info,
while also not wasting network bandwidth.

The protocol is designed to be extensible, there's four bytes space for
encoding more request types (currently zeroed), and there's one string in each
response packet and one string for each player available (currently the empty
string).

The protocol itself has no problems with more than 64 players, although the
current client implementation will drop the player info after the 64th player,
because it uses a static array for storage.

Also fixes #130, the player list is just sorted each time new player info
arrives.
2017-03-29 12:56:13 +02:00
H-M-H e351080dd3 removed double semicolons 2016-05-04 00:24:54 +02:00
oy f0e09f50d9 improved chat msg spam protection 2013-04-01 20:30:58 +02:00
oy 06115dd49d added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
oy d9ce720387 made engine an interface 2011-02-27 15:03:57 +01:00
Sworddragon fc9211c777 Updated copyrights 2010-11-20 21:26:06 +01:00
oy 7503c64237 made unpacking of net strings more strict - prevents possible malformed output 2010-08-12 15:22:07 +02:00
Magnus Auvinen 72c06a2589 copied refactor to trunk 2010-05-29 07:25:38 +00:00
Renamed from src/engine/e_packer.cpp (Browse further)