@@ -355,34 +355,34 @@ SUBSYSTEM_DEF(codex)
355
355
/ datum / controller/ subsystem/ codex/ proc / prepare_search_database(drop_existing = FALSE )
356
356
if (GLOB . is_debug_server && ! FORCE_CODEX_DATABASE )
357
357
index_disabled = TRUE
358
- to_chat (world , span_debug (" Codex: Debug server detected. DB operation disabled. See _compile_options.dm." ))
358
+ to_chat (world , systemtext (" Codex: Debug server detected. DB operation disabled. See _compile_options.dm." ))
359
359
log_world (" Codex: Codex DB generation Skipped" )
360
360
return
361
361
#if FORCE_CODEX_DATABASE == TRUE
362
- to_chat (world , span_debug (" Codex: Debug server detected. Override flag set, Dropping and regenerating index." ))
362
+ to_chat (world , systemtext (" Codex: Debug server detected. Override flag set, Dropping and regenerating index." ))
363
363
log_world (" Codex: Codex DB generation forced by compile flag." )
364
364
drop_existing = TRUE
365
365
#endif
366
366
if (index_disabled)
367
367
message_admins (" Codex DB Indexing has been disabled, This doesn't seem right. Bailing." )
368
368
CRASH (" Attempted to prepare search database, but codex index was disabled." )
369
369
if (drop_existing)
370
- to_chat (world , span_debug (" Codex: Deleting old index..." ))
370
+ to_chat (world , systemtext (" Codex: Deleting old index..." ))
371
371
// Check if we've already opened one this round, if so, get rid of it.
372
372
if (codex_index)
373
373
log_world (" Codex: Deleting old index file." )
374
374
del (codex_index)
375
375
fdel (CODEX_SEARCH_INDEX_FILE )
376
376
else
377
- to_chat (world , span_debug (" Codex: Preparing Search Database" ))
377
+ to_chat (world , systemtext (" Codex: Preparing Search Database" ))
378
378
log_world (" Codex: Preparing Search Database" )
379
379
380
380
index_generating = TRUE
381
381
if (! rustg_file_exists(CODEX_SEARCH_INDEX_FILE ))
382
382
if (! drop_existing)
383
- to_chat (world , span_debug (" Codex: Database missing, building..." ))
383
+ to_chat (world , systemtext (" Codex: Database missing, building..." ))
384
384
else
385
- to_chat (world , span_debug (" Codex: Building new database..." ))
385
+ to_chat (world , systemtext (" Codex: Building new database..." ))
386
386
create_db ()
387
387
build_db_index ()
388
388
@@ -393,47 +393,47 @@ SUBSYSTEM_DEF(codex)
393
393
if (! cursor. Execute(codex_index))
394
394
index_disabled = TRUE
395
395
can_fire = FALSE
396
- to_chat (world , span_debug (" Codex: ABORTING! Database error: [ cursor. Error()] | [ cursor. ErrorMsg()] " ))
396
+ to_chat (world , systemtext (" Codex: ABORTING! Database error: [ cursor. Error()] | [ cursor. ErrorMsg()] " ))
397
397
CRASH (" Codex: ABORTING! Database error: [ cursor. Error()] | [ cursor. ErrorMsg()] " )
398
398
399
399
cursor. NextRow()
400
400
var /list /revline = cursor. GetRowData()
401
401
var /db_serial = revline[" revision" ]
402
402
if (db_serial != GLOB . revdata. commit)
403
403
if (db_serial == CODEX_SERIAL_FALLBACK )
404
- to_chat (world , span_debug (" Codex: Fallback Database Serial detected. Data may be inaccurate or out of date." ))
404
+ to_chat (world , systemtext (" Codex: Fallback Database Serial detected. Data may be inaccurate or out of date." ))
405
405
else
406
406
if (drop_existing)
407
407
CRASH (" Codex DB generation issue. Freshly generated index serial is bad. Is: [ db_serial] | Expected: [ GLOB . revdata. commit] " )
408
- to_chat (world , span_debug (" Codex: Database out of date, Rebuilding..." ))
408
+ to_chat (world , systemtext (" Codex: Database out of date, Rebuilding..." ))
409
409
prepare_search_database (TRUE ) // recursiveness funny,,
410
410
return
411
411
412
412
if (! drop_existing)
413
413
// Loading an old database, we need to flush the dynamic cache.
414
- to_chat (world , span_debug (" Codex: Flushing Dynamic Index" ))
414
+ to_chat (world , systemtext (" Codex: Flushing Dynamic Index" ))
415
415
cursor. Add(" DELETE FROM dynamic_codex_entries" ) // Without a where, this is functionally TRUNCATE
416
416
if (! cursor. Execute(codex_index))
417
- to_chat (world , span_debug (" Codex: ABORTING! Database error: [ cursor. Error()] | [ cursor. ErrorMsg()] " ))
417
+ to_chat (world , systemtext (" Codex: ABORTING! Database error: [ cursor. Error()] | [ cursor. ErrorMsg()] " ))
418
418
CRASH (" Codex: ABORTING! Database error: [ cursor. Error()] | [ cursor. ErrorMsg()] " )
419
419
420
420
421
421
index_generating = FALSE // The database is now in a safe stuff for us to begin processing dynamic entries.
422
422
423
423
424
424
if (drop_existing)
425
- to_chat (world , span_debug (" Codex: Collation complete.\n Codex: Index ready." ))
425
+ to_chat (world , systemtext (" Codex: Collation complete.\n Codex: Index ready." ))
426
426
else
427
- to_chat (world , span_debug (" Codex: Database Serial validated.\n Codex: Loading complete." ))
427
+ to_chat (world , systemtext (" Codex: Database Serial validated.\n Codex: Loading complete." ))
428
428
429
429
/ datum / controller/ subsystem/ codex/ proc / create_db()
430
430
// No index? Make one.
431
431
432
- to_chat (world , span_debug (" Codex: Writing new database file..." ))
432
+ to_chat (world , systemtext (" Codex: Writing new database file..." ))
433
433
// We explicitly store the DB in the root directory, so that TGS builds wipe it.
434
434
codex_index = new (CODEX_SEARCH_INDEX_FILE )
435
435
436
- to_chat (world , span_debug (" Codex: Writing Schema (1/3): Metadata" ))
436
+ to_chat (world , systemtext (" Codex: Writing Schema (1/3): Metadata" ))
437
437
// / Holds the revision the index was compiled for. If it's different then live, we need to regenerate the index.
438
438
var /static /create_info_schema = {"
439
439
CREATE TABLE "_info" (
@@ -444,10 +444,10 @@ SUBSYSTEM_DEF(codex)
444
444
var /database/query /init_cursor = new (create_info_schema)
445
445
446
446
if (! init_cursor. Execute(codex_index))
447
- to_chat (world , span_debug (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " ))
447
+ to_chat (world , systemtext (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " ))
448
448
CRASH (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " )
449
449
450
- to_chat (world , span_debug (" Codex: Writing Schema (2/3): Baked Index" ))
450
+ to_chat (world , systemtext (" Codex: Writing Schema (2/3): Baked Index" ))
451
451
// Holds all codex entries to enable accelerated text search.
452
452
var /static /create_codex_schema = {"
453
453
CREATE TABLE "codex_entries" (
@@ -460,10 +460,10 @@ SUBSYSTEM_DEF(codex)
460
460
461
461
init_cursor. Add(create_codex_schema)
462
462
if (! init_cursor. Execute(codex_index))
463
- to_chat (world , span_debug (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " ))
463
+ to_chat (world , systemtext (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " ))
464
464
CRASH (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " )
465
465
466
- to_chat (world , span_debug (" Codex: Writing Schema (3/3): Dynamic Index" ))
466
+ to_chat (world , systemtext (" Codex: Writing Schema (3/3): Dynamic Index" ))
467
467
// Holds all dynamic codex entries to enable accelerated text search.
468
468
var /static /create_dynamic_codex_schema = {"
469
469
CREATE TABLE "dynamic_codex_entries" (
@@ -476,7 +476,7 @@ SUBSYSTEM_DEF(codex)
476
476
477
477
init_cursor. Add(create_dynamic_codex_schema)
478
478
if (! init_cursor. Execute(codex_index))
479
- to_chat (world , span_debug (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " ))
479
+ to_chat (world , systemtext (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " ))
480
480
CRASH (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " )
481
481
482
482
@@ -485,19 +485,19 @@ SUBSYSTEM_DEF(codex)
485
485
if (! revid) // zip download, you're on your own pissboy, The serial is special and the database will never regenerate.
486
486
revid = CODEX_SERIAL_FALLBACK
487
487
488
- to_chat (world , span_debug (" Codex: Schema complete, Writing serial..." ))
488
+ to_chat (world , systemtext (" Codex: Schema complete, Writing serial..." ))
489
489
// Insert the revision header.
490
490
init_cursor. Add(" INSERT INTO _info (revision) VALUES (?)" , revid)
491
491
if (! init_cursor. Execute(codex_index))
492
- to_chat (world , span_debug (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " ))
492
+ to_chat (world , systemtext (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " ))
493
493
CRASH (" Codex: ABORTING! Database error: [ init_cursor. Error()] | [ init_cursor. ErrorMsg()] " )
494
494
495
495
/ datum / controller/ subsystem/ codex/ proc / build_db_index()
496
- to_chat (world , span_debug (" Codex: Building search index." ))
496
+ to_chat (world , systemtext (" Codex: Building search index." ))
497
497
498
498
var /database/query /cursor = new
499
499
var /total_entries = length(all_entries)
500
- to_chat (world , span_debug (" \t Codex: Collating [ total_entries] records..." ))
500
+ to_chat (world , systemtext (" \t Codex: Collating [ total_entries] records..." ))
501
501
var /record_id = 0 // Counter for debugging.
502
502
for (var /datum /codex_entry/entry as anything in all_entries)
503
503
cursor. Add(
@@ -509,12 +509,12 @@ SUBSYSTEM_DEF(codex)
509
509
)
510
510
511
511
if (! cursor. Execute(codex_index))
512
- to_chat (world , span_debug (" Codex: ABORTING! Database error: [ cursor. Error()] | [ cursor. ErrorMsg()] " ))
512
+ to_chat (world , systemtext (" Codex: ABORTING! Database error: [ cursor. Error()] | [ cursor. ErrorMsg()] " ))
513
513
CRASH (" Codex: ABORTING! Database error: [ cursor. Error()] | [ cursor. ErrorMsg()] " )
514
514
515
515
record_id++
516
516
if ((! (record_id % 100 )) || (record_id == total_entries))
517
- to_chat (world , span_debug (" \t Codex: [ record_id] / [ total_entries] ..." ))
517
+ to_chat (world , systemtext (" \t Codex: [ record_id] / [ total_entries] ..." ))
518
518
519
519
CHECK_TICK // We'd deadlock the server otherwise.
520
520
0 commit comments