MCPcopy Create free account
hub / github.com/Norbyte/bg3se / GetDatabaseContents

Method GetDatabaseContents

BG3Extender/Osiris/Debugger/Debugger.cpp:386–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384 }
385
386 ResultCode Debugger::GetDatabaseContents(uint32_t databaseId)
387 {
388 auto & dbs = (*globals_.Databases)->Db;
389 if (databaseId == 0 || databaseId > dbs.Size)
390 {
391 WARN("Debugger::GetDatabaseContents(): Invalid database ID %d", databaseId);
392 return ResultCode::InvalidDatabaseId;
393 }
394
395 if (!isPaused_) {
396 // Technically we can read rows anytime, but its not thread-safe and there
397 // is a slight chance of crashing.
398 WARN("Debugger::GetDatabaseContents(): Cannot read rows while story is running!");
399 return ResultCode::NotInPause;
400 }
401
402 auto & db = dbs.Elements[databaseId - 1];
403 auto const & facts = db->Facts;
404 auto head = facts.Head;
405 auto current = head->Next;
406
407 messageHandler_.SendBeginDatabaseContents(databaseId);
408 while (current != head) {
409 messageHandler_.SendDatabaseRow(databaseId, &current->Item);
410 current = current->Next;
411 }
412
413 messageHandler_.SendEndDatabaseContents(databaseId);
414
415 return ResultCode::Success;
416 }
417
418 ResultCode Debugger::ContinueExecution(DbgContinue_Action action, uint32_t breakpointMask, uint32_t flags)
419 {

Callers 1

Calls 3

SendDatabaseRowMethod · 0.80

Tested by

no test coverage detected