Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 2
Please check the settings in the CodeRabbit UI or the
|
Segfaultd
force-pushed
the
refactor/modern-memory-4-plugins
branch
from
November 16, 2026 11:43
50e293d to
f887476
Compare
Segfaultd
force-pushed
the
refactor/modern-memory-5-table-extensions
branch
from
November 16, 2026 11:43
64f2cb0 to
b4a5c4e
Compare
DataStructures::Table becomes MafiaNet::Table in mafianet/table.h. Rows live in a std::map<unsigned, std::unique_ptr<Row>> (ascending row id, as the B+ tree iterated) exposed through GetRows(); GetListHead() and the Page iteration are gone. Row::cells is std::vector<std::unique_ptr< Cell>>, List parameters are std::vector, and Row's copy is deleted explicitly (it is exported). Table keeps a deep copy, now also as a copy constructor. ds_table.h, ds_table.cpp and ds_bplus_tree.h are deleted. Behaviour fixes made while rewriting: - SortTable sorts stably: rows tied on every sort column keep row id order. The OrderedList version dropped them (RakAssert in Debug) and left the tail of the output array unwritten. - RemoveRows frees the rows it removes; AddRow returns nullptr for an existing id in every overload; GetRowByIndex reaches every row. - A cell buffer carries one trailing zero byte, so a binary value compared as a string cannot read past it; Set() copes with its own buffer as input. TableSerializer rejects malformed peer input instead of asserting or reading out of bounds: a truncated row count, unchecked row/cell reads, an out-of-range cell index, a duplicate row id, an unknown column type or filter operation, a failed ReadAlignedBytesSafeAlloc and too many filter queries now all return false. A zero-length BINARY cell is written as a length-0 blob instead of tripping RakAssert. FilterQuery value-initializes its fields. The serialized bytes of existing tables are unchanged (TableSerializerGolden). New table_serializer fuzz harness and corpus; Lobby2 and the samples are updated to the new API.
Lobby2 messages, Lobby2Server/Client, the Rooms plugin, the PostgreSQL and Steam back ends and PostgreSQLInterface no longer use DataStructures. - List -> std::vector, Queue -> std::deque, Map -> std::map, Multilist -> std::vector. - Lobby2Server::users stays a sorted std::vector (index lookups); GetUsers() returns const std::vector<User *>&. Admin and ranking address sets are std::set<SystemAddress>. - RoomsPlugin participants are a std::map keyed by handle that owns them through std::unique_ptr; RoomsPlugin is non-copyable. - The room and quick-join sort lists are sorted vectors filled through InsertSortedUnique(), which keeps the old OrderedList binary search: RoomsSortByTimeThenTotalSlots and the QuickJoinUser comparators are not strict weak orders. - AllGamesRoomsContainer::SearchByFilter and the PerGameRoomsContainer sort helpers take std::vector<Room *>&. - Lobby2Client_Steam::GetRoomMembers fills a std::set<uint64_t>; Steam room members are std::maps keyed by address and by Steam ID. - Every length that goes on the wire keeps its explicit 16/32-bit cast.
- RPC3: local functions and slots are std::unordered_maps owning their entries through std::unique_ptr. HashIndex handles become pointers: GetLocalSlot()/GetLocalFunction() return nullptr when unregistered, and InvokeSignal() takes a LocalSlot*. Slot objects are a vector sorted by LocalSlotObjectComp. Keys are built without RakString's printf-style constructor, since identifiers come from the network. RPC3 is non-copyable. - SQLite3Plugin: SQLite3Table rows are std::vector<std::unique_ptr<SQLite3Row>>; dbHandles is a vector sorted by dbIdentifier, looked up through the new protected GetDBHandleIndex(). The row and column counts on the wire stay 32-bit. - Autopatcher: the connection pool and waiting queue are std::deques, patchingUsers a std::vector.
ComprehensivePCGame, MasterServer, PHPDirectoryServer2, TestDLL and the self-scaling Autopatcher samples no longer use DataStructures. PHPDirectoryServer2 keeps its fields in a std::map, so GetField() and the uploaded form keep their column-name order.
The integration fixtures' destroy lists and TestHelpers' Standard*Prep take std::vector; the last ds_list.h includes in Tests are gone.
CallRoomCallbacks kept an iterator into roomMembersById while NotifyNewMember/NotifyDroppedMember ran user callbacks synchronously. A callback that leaves the room (Console_LeaveRoom_Steam -> NotifyLeaveRoom -> ClearRoom) cleared the map and left the iterator dangling. The old index loop re-checked the size and stopped. Merge over a local copy of the member map instead.
ProfanityFilter and RoomTypes call strcpy, strpbrk, strspn and friends but got <cstring> only through ds_list.h and ds_table.h, which ProfanityFilter.h and RoomTypes.h no longer include. GCC on Linux then failed to build Lobby2.
Segfaultd
force-pushed
the
refactor/modern-memory-5-table-extensions
branch
from
November 16, 2026 13:58
b4a5c4e to
d44d4d3
Compare
Segfaultd
force-pushed
the
refactor/modern-memory-4-plugins
branch
from
November 16, 2026 13:58
f887476 to
81ee9cd
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
table.h/table.cpp) rewritten onstd::map<unsigned, std::unique_ptr<Row>>withGetRows()table_serializerfuzz harness and corpusNotes
Not built locally: Samples/Rooms, the Steam glue, MSVC-only samples and the database samples (several include headers that don't exist, on master too). Windows CI is the first real check for those.
Test plan
-Werrorbuild; unit tests plus the Reliability/Simulated/RakPeer/Encrypt/Mtu/Split integration testsCommits
Stack, merge in order: 1/6 safety net, 2/6 allocator, 3/6 core transport, 4/6 plugins, 5/6 Table + extensions, 6/6 delete DataStructures. Each PR targets the branch of the one before it. Breaking change for the next major version; no version bump yet.