mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
feat(capture): read replica constructions, serializations and destructions
ReplicaDecoder mirrors Entity::WriteBaseReplicaData and each component's Serialize, keeps what each network ID is per world instance, and shows the rest as bits when no layout fits. CaptureTool links the game: game messages are decoded (and compared in replays), and decode --cdserver reads replica packets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,11 @@ namespace CaptureTools {
|
||||
return fields.contains(name);
|
||||
}
|
||||
|
||||
json RecordJson(const Record& record, size_t index, int64_t startUs, bool fields) {
|
||||
uint64_t ReplicaConnection(const PacketRecordHeader& h) {
|
||||
return (static_cast<uint64_t>(h.zoneId) << 48) ^ (static_cast<uint64_t>(h.instanceId) << 32) ^ h.cloneId;
|
||||
}
|
||||
|
||||
json RecordJson(const Record& record, size_t index, int64_t startUs, bool fields, const json* replicaFields) {
|
||||
const auto& h = record.header;
|
||||
json out{
|
||||
{"i", index},
|
||||
@@ -130,7 +134,8 @@ namespace CaptureTools {
|
||||
out["object"] = std::to_string(decoded.objectId);
|
||||
}
|
||||
if (decoded.failed) out["unreadable"] = true;
|
||||
if (fields && decoded.fields) out["fields"] = *decoded.fields;
|
||||
if (fields && replicaFields) out["fields"] = *replicaFields;
|
||||
else if (fields && decoded.fields) out["fields"] = *decoded.fields;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user