-
Notifications
You must be signed in to change notification settings - Fork 25
/
cServerData.cpp
7250 lines (6870 loc) · 300 KB
/
cServerData.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "uox3.h"
#include "scriptc.h"
#include "ssection.h"
#include "Dictionary.h"
#include <filesystem>
#include <cstdint>
#include <limits>
#include <optional>
#include "IP4Address.hpp"
#if PLATFORM != WINDOWS
#include <netdb.h>
#include <arpa/inet.h>
#endif
#include "StringUtility.hpp"
#include "osunique.hpp"
using namespace std::string_literals;
//==================================================================================================
// constant data
//==================================================================================================
//==================================================================================================
const std::map<std::string, SI32> CServerData::uox3IniCaseValue
{
// these numbers dont have to be in order, and can skip aound
// they just CANT be repeated (now we could add some protection
// but they dont change that much, and there are a lot, so if you delete one
// dont worry about reusing it. Just keep adding up from the last one would
// be easiest.
// They key is that number HAS to match the case statement number
// in
//bool CServerData::HandleLine( const std::string& tag, const std::string& value )
// in cServerData.cpp (this file).
{"SERVERNAME"s, 1},
{"CONSOLELOG"s, 2},
{"COMMANDPREFIX"s, 3},
{"ANNOUNCEWORLDSAVES"s, 4},
{"BACKUPSENABLED"s, 5},
{"SAVESTIMER"s, 6},
{"SKILLCAP"s, 7},
{"SKILLDELAY"s, 8},
{"STATCAP"s, 9},
{"MAXSTEALTHMOVEMENTS"s, 10},
{"MAXSTAMINAMOVEMENTS"s, 11},
{"ARMORAFFECTMANAREGEN"s, 12},
{"CORPSEDECAYTIMER"s, 13},
{"WEATHERTIMER"s, 14},
{"SHOPSPAWNTIMER"s, 15},
{"DECAYTIMER"s, 16},
{"INVISIBILITYTIMER"s, 17},
{"OBJECTUSETIMER"s, 18},
{"GATETIMER"s, 19},
{"POISONTIMER"s, 20},
{"LOGINTIMEOUT"s, 21},
{"HITPOINTREGENTIMER"s, 22},
{"STAMINAREGENTIMER"s, 23},
{"BASEFISHINGTIMER"s, 24},
{"SCRIPTSDIRECTORY"s, 25},
{"JOINPARTMSGS"s, 26},
{"MAXPETOWNERS"s, 34},
{"MAXFOLLOWERS"s, 35},
{"MAXCONTROLSLOTS"s, 36},
{"MANAREGENTIMER"s, 37},
{"RANDOMFISHINGTIMER"s, 38},
{"SPIRITSPEAKTIMER"s, 39},
{"DIRECTORY"s, 40},
{"DATADIRECTORY"s, 41},
{"DEFSDIRECTORY"s, 42},
{"ACTSDIRECTORY"s, 43},
{"BACKUPDIRECTORY"s, 44},
{"MSGBOARDDIRECTORY"s, 45},
{"SHAREDDIRECTORY"s, 46},
{"LOOTDECAYSWITHCORPSE"s, 47},
{"GUARDSACTIVE"s, 49},
{"DEATHANIMATION"s, 27},
{"AMBIENTSOUNDS"s, 50},
{"AMBIENTFOOTSTEPS"s, 51},
{"INTERNALACCOUNTCREATION"s, 52},
{"SHOWOFFLINEPCS"s, 53},
{"ROGUESENABLED"s, 54},
{"PLAYERPERSECUTION"s, 55},
{"ACCOUNTFLUSH"s, 56},
{"HTMLSTATUSENABLED"s, 57},
{"SELLBYNAME"s, 58},
{"SELLMAXITEMS"s, 59},
{"TRADESYSTEM"s, 60},
{"RANKSYSTEM"s, 61},
{"CUTSCROLLREQUIREMENTS"s, 62},
{"CHECKITEMS"s, 63},
{"CHECKBOATS"s, 64},
{"CHECKNPCAI"s, 65},
{"CHECKSPAWNREGIONS"s, 66},
{"POSTINGLEVEL"s, 67},
{"REMOVALLEVEL"s, 68},
{"ESCORTENABLED"s, 69},
{"ESCORTINITEXPIRE"s, 70},
{"ESCORTACTIVEEXPIRE"s, 71},
{"MOON1"s, 72},
{"MOON2"s, 73},
{"DUNGEONLEVEL"s, 74},
{"CURRENTLEVEL"s, 75},
{"BRIGHTLEVEL"s, 76},
{"BASERANGE"s, 77},
{"BASETIMER"s, 78},
{"MAXTARGETS"s, 79},
{"MSGREDISPLAYTIME"s, 80},
{"MURDERDECAYTIMER"s, 81},
{"MAXKILLS"s, 82},
{"CRIMINALTIMER"s, 83},
{"MINECHECK"s, 84},
{"OREPERAREA"s, 85},
{"ORERESPAWNTIMER"s, 86},
{"RESOURCEAREASIZE"s, 87},
{"LOGSPERAREA"s, 88},
{"LOGSRESPAWNTIMER"s, 89},
{"STATSAFFECTSKILLCHECKS"s, 90 },
{"HUNGERRATE"s, 91},
{"HUNGERDMGVAL"s, 92},
{"MAXRANGE"s, 93},
{"SPELLMAXRANGE"s, 94},
{"DISPLAYHITMSG"s, 95},
{"MONSTERSVSANIMALS"s, 96},
{"ANIMALATTACKCHANCE"s, 97},
{"ANIMALSGUARDED"s, 98},
{"NPCDAMAGERATE"s, 99},
{"NPCBASEFLEEAT"s, 100},
{"NPCBASEREATTACKAT"s, 101},
{"ATTACKSTAMINA"s, 102},
{"LOCATION"s, 103},
{"STARTGOLD"s, 104},
{"STARTPRIVS"s, 105},
{"ESCORTDONEEXPIRE"s, 106},
{"DARKLEVEL"s, 107},
{"TITLECOLOUR"s, 108},
{"LEFTTEXTCOLOUR"s, 109},
{"RIGHTTEXTCOLOUR"s, 110},
{"BUTTONCANCEL"s, 111},
{"BUTTONLEFT"s, 112},
{"BUTTONRIGHT"s, 113},
{"BACKGROUNDPIC"s, 114},
{"POLLTIME"s, 115},
{"MAYORTIME"s, 116},
{"TAXPERIOD"s, 117},
{"GUARDSPAID"s, 118},
{"DAY"s, 119},
{"HOURS"s, 120},
{"MINUTES"s, 121},
{"SECONDS"s, 122},
{"AMPM"s, 123},
{"SKILLLEVEL"s, 124},
{"SNOOPISCRIME"s, 125},
{"BOOKSDIRECTORY"s, 126},
//{"SERVERLIST"s, 127},
{"PORT"s, 128},
{"ACCESSDIRECTORY"s, 129},
{"LOGSDIRECTORY"s, 130},
{"ACCOUNTISOLATION"s, 131},
{"HTMLDIRECTORY"s, 132},
{"SHOOTONANIMALBACK"s, 133},
{"NPCTRAININGENABLED"s, 134},
{"DICTIONARYDIRECTORY"s, 135},
{"BACKUPSAVERATIO"s, 136},
{"HIDEWHILEMOUNTED"s, 137},
{"SECONDSPERUOMINUTE"s, 138},
{"WEIGHTPERSTR"s, 139},
{"POLYDURATION"s, 140},
{"UOGENABLED"s, 141},
{"NETRCVTIMEOUT"s, 142},
{"NETSNDTIMEOUT"s, 143},
{"NETRETRYCOUNT"s, 144},
{"CLIENTFEATURES"s, 145},
{"OVERLOADPACKETS"s, 146},
{"NPCMOVEMENTSPEED"s, 147},
{"PETHUNGEROFFLINE"s, 148},
{"PETOFFLINETIMEOUT"s, 149},
{"PETOFFLINECHECKTIMER"s, 150},
{"ARCHERRANGE"s, 151},
{"ADVANCEDPATHFINDING"s, 152},
{"SERVERFEATURES"s, 153},
{"LOOTINGISCRIME"s, 154},
{"NPCRUNNINGSPEED"s, 155},
{"NPCFLEEINGSPEED"s, 156},
{"BASICTOOLTIPSONLY"s, 157},
{"GLOBALITEMDECAY"s, 158},
{"SCRIPTITEMSDECAYABLE"s, 159},
{"BASEITEMSDECAYABLE"s, 160},
{"ITEMDECAYINHOUSES"s, 161},
{"SPAWNREGIONSFACETS"s, 162},
{"PAPERDOLLGUILDBUTTON"s, 163},
{"ATTACKSPEEDFROMSTAMINA"s, 164},
{"DISPLAYDAMAGENUMBERS"s, 169},
{"CLIENTSUPPORT4000"s, 170},
{"CLIENTSUPPORT5000"s, 171},
{"CLIENTSUPPORT6000"s, 172},
{"CLIENTSUPPORT6050"s, 173},
{"CLIENTSUPPORT7000"s, 174},
{"CLIENTSUPPORT7090"s, 175},
{"CLIENTSUPPORT70160"s, 176},
{"CLIENTSUPPORT70240"s, 177},
{"CLIENTSUPPORT70300"s, 178},
{"CLIENTSUPPORT70331"s, 179},
{"CLIENTSUPPORT704565"s, 180},
{"CLIENTSUPPORT70610"s, 181},
{"EXTENDEDSTARTINGSTATS"s, 182},
{"EXTENDEDSTARTINGSKILLS"s, 183},
{"WEAPONDAMAGECHANCE"s, 184},
{"ARMORDAMAGECHANCE"s, 185},
{"WEAPONDAMAGEMIN"s, 186},
{"WEAPONDAMAGEMAX"s, 187},
{"ARMORDAMAGEMIN"s, 188},
{"ARMORDAMAGEMAX"s, 189},
{"GLOBALATTACKSPEED"s, 190},
{"NPCSPELLCASTSPEED"s, 191},
{"FISHINGSTAMINALOSS"s, 192},
{"RANDOMSTARTINGLOCATION"s, 193},
{"ASSISTANTNEGOTIATION"s, 194},
{"KICKONASSISTANTSILENCE"s, 195},
{"AF_FILTERWEATHER"s, 196},
{"AF_FILTERLIGHT"s, 197},
{"AF_SMARTTARGET"s, 198},
{"AF_RANGEDTARGET"s, 199},
{"AF_AUTOOPENDOORS"s, 200},
{"AF_DEQUIPONCAST"s, 201},
{"AF_AUTOPOTIONEQUIP"s, 202},
{"AF_POISONEDCHECKS"s, 203},
{"AF_LOOPEDMACROS"s, 204},
{"AF_USEONCEAGENT"s, 205},
{"AF_RESTOCKAGENT"s, 206},
{"AF_SELLAGENT"s, 207},
{"AF_BUYAGENT"s, 208},
{"AF_POTIONHOTKEYS"s, 209},
{"AF_RANDOMTARGETS"s, 210},
{"AF_CLOSESTTARGETS"s, 211},
{"AF_OVERHEADHEALTH"s, 212},
{"AF_AUTOLOOTAGENT"s, 213},
{"AF_BONECUTTERAGENT"s, 214},
{"AF_JSCRIPTMACROS"s, 215},
{"AF_AUTOREMOUNT"s, 216},
// 217 free
{"CLASSICUOMAPTRACKER"s, 218},
{"DECAYTIMERINHOUSE"s, 219},
{"PROTECTPRIVATEHOUSES"s, 220},
{"TRACKHOUSESPERACCOUNT"s, 221},
{"MAXHOUSESOWNABLE"s, 222},
{"MAXHOUSESCOOWNABLE"s, 223},
{"CANOWNANDCOOWNHOUSES"s, 224},
{"COOWNHOUSESONSAMEACCOUNT"s, 225},
{"ITEMSDETECTSPEECH"s, 226},
{"MAXPLAYERPACKITEMS"s, 227},
{"MAXPLAYERBANKITEMS"s, 228},
{"FORCENEWANIMATIONPACKET"s, 229},
{"MAPDIFFSENABLED"s, 230},
{"CORESHARDERA"s, 231},
{"ARMORCALCULATION"s, 232},
{"STRENGTHDAMAGEBONUS"s, 233},
{"TACTICSDAMAGEBONUS"s, 234},
{"ANATOMYDAMAGEBONUS"s, 235},
{"LUMBERJACKDAMAGEBONUS"s, 236},
{"RACIALDAMAGEBONUS"s, 237},
{"DAMAGEBONUSCAP"s, 238},
{"SHIELDPARRY"s, 239},
{"PARRYDAMAGECHANCE"s, 240},
{"PARRYDAMAGEMIN"s, 241},
{"PARRYDAMAGEMAX"s, 242},
{"ARMORCLASSDAMAGEBONUS"s, 243},
{"FREESHARDSERVERPOLL"s, 244},
{"ALCHEMYBONUSENABLED"s, 245},
{"ALCHEMYBONUSMODIFIER"s, 246},
{"NPCFLAGUPDATETIMER"s, 247},
{"JSENGINESIZE"s, 248},
{"USEUNICODEMESSAGES"s, 249},
{"SCRIPTDATADIRECTORY"s, 250},
{"THIRSTRATE"s, 251},
{"THIRSTDRAINVAL"s, 252},
{"PETTHIRSTOFFLINE"s, 253},
{"EXTERNALIP"s, 254},
{"BLOODDECAYTIMER"s, 255},
{"BLOODDECAYCORPSETIMER"s, 256},
{"BLOODEFFECTCHANCE"s, 257},
{"NPCCORPSEDECAYTIMER"s, 258},
{"HUNGERENABLED"s, 259},
{"THIRSTENABLED"s, 260},
{"TRAVELSPELLSFROMBOATKEYS"s, 261},
{"TRAVELSPELLSWHILEOVERWEIGHT"s, 262},
{"MARKRUNESINMULTIS"s, 263},
{"TRAVELSPELLSBETWEENWORLDS"s, 264},
{"TRAVELSPELLSWHILEAGGRESSOR"s, 265},
{"BANKBUYTHRESHOLD"s, 266},
{"NETWORKLOG"s, 267},
{"SPEECHLOG"s, 268},
{"NPCMOUNTEDWALKINGSPEED"s, 269},
{"NPCMOUNTEDRUNNINGSPEED"s, 270},
{"NPCMOUNTEDFLEEINGSPEED"s, 271},
{"CONTEXTMENUS"s, 272},
{"SERVERLANGUAGE"s, 273},
{"CHECKPETCONTROLDIFFICULTY"s, 274},
{"PETLOYALTYGAINONSUCCESS"s, 275},
{"PETLOYALTYLOSSONFAILURE"s, 276},
{"PETLOYALTYRATE"s, 277},
{"SHOWNPCTITLESINTOOLTIPS"s, 278},
{"FISHPERAREA"s, 279},
{"FISHRESPAWNTIMER"s, 280},
{"ARCHERYHITBONUS"s, 281},
{"ITEMSINTERRUPTCASTING"s, 282},
{"SYSMESSAGECOLOUR"s, 283},
{"AF_AUTOBANDAGE"s, 284},
{"AF_ENEMYTARGETSHARE"s, 285},
{"AF_FILTERSEASON"s, 286},
{"AF_SPELLTARGETSHARE"s, 287},
{"AF_HUMANOIDHEALTHCHECKS"s, 288},
{"AF_SPEECHJOURNALCHECKS"s, 289},
{"ARCHERYSHOOTDELAY"s, 290},
{"MAXCLIENTBYTESIN"s, 291},
{"MAXCLIENTBYTESOUT"s, 292},
{"NETTRAFFICTIMEBAN"s, 293},
{"TOOLUSELIMIT"s, 294},
{"TOOLUSEBREAK"s, 295},
{"ITEMREPAIRDURABILITYLOSS"s, 296},
{"HIDESTATSFORUNKNOWNMAGICITEMS"s, 297},
{"CRAFTCOLOUREDWEAPONS"s, 298},
{"MAXSAFETELEPORTSPERDAY"s, 299},
{"TELEPORTTONEARESTSAFELOCATION"s, 300},
{"ALLOWAWAKENPCS"s, 301},
{"DISPLAYMAKERSMARK"s, 302},
{"SHOWNPCTITLESOVERHEAD"s, 303},
{"SHOWINVULNERABLETAGOVERHEAD"s, 304},
{"PETCOMBATTRAINING"s, 305},
{"HIRELINGCOMBATTRAINING"s, 306},
{"NPCCOMBATTRAINING"s, 307},
{"GLOBALRESTOCKMULTIPLIER"s, 308},
{"SHOWITEMRESISTSTATS"s, 309},
{"SHOWWEAPONDAMAGETYPES"s, 310},
{"SHOWRACEWITHNAME"s, 311},
{"SHOWRACEINPAPERDOLL"s, 312},
{"WEAPONPARRY"s, 313},
{"WRESTLINGPARRY"s, 314},
{"COMBATHITCHANCE"s, 315},
{"CASTSPELLSWHILEMOVING"s, 316},
{"SHOWREPUTATIONTITLEINTOOLTIP"s, 317},
{"SHOWGUILDINFOINTOOLTIP"s, 318},
{"MAXPLAYERPACKWEIGHT"s, 319},
{"MAXPLAYERBANKWEIGHT"s, 320},
{"SAFECOOWNERLOGOUT"s, 321},
{"SAFEFRIENDLOGOUT"s, 322},
{"SAFEGUESTLOGOUT"s, 323},
{"KEYLESSOWNERACCESS"s, 324},
{"KEYLESSCOOWNERACCESS"s, 325},
{"KEYLESSFRIENDACCESS"s, 326},
{"KEYLESSGUESTACCESS"s, 327},
{"WEAPONDAMAGEBONUSTYPE"s, 328},
{"OFFERBODSFROMITEMSALES"s, 329},
{"OFFERBODSFROMCONTEXTMENU"s, 330},
{"BODSFROMCRAFTEDITEMSONLY"s, 331},
{"BODGOLDREWARDMULTIPLIER"s, 332},
{"BODFAMEREWARDMULTIPLIER"s, 333},
{"ENABLENPCGUILDDISCOUNTS"s, 334},
{"ENABLENPCGUILDPREMIUMS"s, 335},
{"AGGRESSORFLAGTIMER"s, 336},
{"PERMAGREYFLAGTIMER"s, 337},
{"STEALINGFLAGTIMER"s, 338},
{"SNOOPAWARENESS"s, 339},
{"APSPERFTHRESHOLD"s, 340},
{"APSINTERVAL"s, 341},
{"APSDELAYSTEP"s, 342},
{"APSDELAYMAXCAP"s, 343},
{"YOUNGPLAYERSYSTEM"s, 344},
{"YOUNGLOCATION"s, 345},
{"SECRETSHARDKEY"s, 346},
{"MOONGATEFACETS"s, 347},
{"AUTOUNEQUIPPEDCASTING"s, 348}
};
constexpr auto MAX_TRACKINGTARGETS = 128;
constexpr auto SKILLTOTALCAP = 7000;
constexpr auto SKILLCAP = 1000;
constexpr auto STATCAP = 225;
constexpr auto BIT_ANNOUNCESAVES = UI32( 0);
constexpr auto BIT_ANNOUNCEJOINPART = UI32( 1 );
constexpr auto BIT_SERVERBACKUP = UI32( 2 );
constexpr auto BIT_SHOOTONANIMALBACK = UI32( 3 );
constexpr auto BIT_NPCTRAINING = UI32( 4 );
constexpr auto BIT_LOOTDECAYSONCORPSE = UI32( 5 );
constexpr auto BIT_GUARDSENABLED = UI32( 6 );
constexpr auto BIT_PLAYDEATHANIMATION = UI32( 7 );
constexpr auto BIT_AMBIENTFOOTSTEPS = UI32( 8 );
constexpr auto BIT_INTERNALACCOUNTS = UI32( 9 );
constexpr auto BIT_SHOWOFFLINEPCS = UI32( 10 );
constexpr auto BIT_ROGUESTATUS = UI32( 11 );
constexpr auto BIT_SNOOPISCRIME = UI32( 12 );
constexpr auto BIT_PERSECUTIONSTATUS = UI32( 13 );
constexpr auto BIT_SELLBYNAME = UI32( 14 );
constexpr auto BIT_TRADESYSSTATUS = UI32( 15 );
constexpr auto BIT_RANKSYSSTATUS = UI32( 16 );
constexpr auto BIT_CUTSCROLLREQ = UI32( 17 );
constexpr auto BIT_SHOWHITMESSAGE = UI32( 18 );
constexpr auto BIT_ESCORTSTATUS = UI32( 19 );
constexpr auto BIT_MONSTERSVSANIMALS = UI32( 20 );
constexpr auto BIT_PETHUNGEROFFLINE = UI32( 21 );
constexpr auto BIT_HIDEWHILEMOUNTED = UI32( 22 );
constexpr auto BIT_OVERLOADPACKETS = UI32( 23 );
constexpr auto BIT_ARMORAFFECTMANAREGEN = UI32( 24 );
constexpr auto BIT_ANIMALSGUARDED = UI32( 25 );
constexpr auto BIT_ADVANCEDPATHFIND = UI32( 26 );
constexpr auto BIT_LOOTINGISCRIME = UI32( 27 );
constexpr auto BIT_BASICTOOLTIPSONLY = UI32( 28 );
constexpr auto BIT_GLOBALITEMDECAY = UI32( 29 );
constexpr auto BIT_SCRIPTITEMSDECAYABLE = UI32( 30 );
constexpr auto BIT_BASEITEMSDECAYABLE = UI32( 31 );
constexpr auto BIT_ITEMDECAYINHOUSES = UI32( 32 );
constexpr auto BIT_PAPERDOLLGUILDBUTTON = UI32( 33 );
constexpr auto BIT_ATTSPEEDFROMSTAMINA = UI32( 34 );
constexpr auto BIT_SHOWDAMAGENUMBERS = UI32( 35 );
// 37 free!
constexpr auto BIT_EXTENDEDSTARTINGSTATS = UI32( 38 );
constexpr auto BIT_EXTENDEDSTARTINGSKILLS = UI32( 39 );
constexpr auto BIT_ASSISTANTNEGOTIATION = UI32( 40 );
constexpr auto BIT_KICKONASSISTANTSILENCE = UI32( 41 );
constexpr auto BIT_CLASSICUOMAPTRACKER = UI32( 42 );
constexpr auto BIT_PROTECTPRIVATEHOUSES = UI32( 43 );
constexpr auto BIT_TRACKHOUSESPERACCOUNT = UI32( 44 );
constexpr auto BIT_CANOWNANDCOOWNHOUSES = UI32( 45 );
constexpr auto BIT_COOWNHOUSESONSAMEACCOUNT = UI32( 46 );
constexpr auto BIT_ITEMSDETECTSPEECH = UI32( 47 );
constexpr auto BIT_FORCENEWANIMATIONPACKET = UI32( 48 );
constexpr auto BIT_MAPDIFFSENABLED = UI32( 49 );
constexpr auto BIT_ARMORCLASSDAMAGEBONUS = UI32( 50 );
constexpr auto BIT_FREESHARDSERVERPOLL = UI32( 51 );
constexpr auto BIT_ALCHEMYDAMAGEBONUSENABLED = UI32( 52 );
constexpr auto BIT_PETTHIRSTOFFLINE = UI32( 53 );
constexpr auto BIT_USEUNICODEMESSAGES = UI32( 54 );
constexpr auto BIT_HUNGERSYSTEMENABLED = UI32( 55 );
constexpr auto BIT_THIRSTSYSTEMENABLED = UI32( 56 );
constexpr auto BIT_TRAVELSPELLSFROMBOATKEYS = UI32( 57 );
constexpr auto BIT_TRAVELSPELLSWHILEOVERWEIGHT = UI32( 58 );
constexpr auto BIT_MARKRUNESINMULTIS = UI32( 59 );
constexpr auto BIT_TRAVELSPELLSBETWEENWORLDS = UI32( 60 );
constexpr auto BIT_TRAVELSPELLSWHILEAGGRESSOR = UI32( 61 );
[[maybe_unused]] constexpr auto BIT_CONSOLELOG = UI32( 62 );
constexpr auto BIT_NETWORKLOG = UI32( 63 );
constexpr auto BIT_SPEECHLOG = UI32( 64 );
constexpr auto BIT_CONTEXTMENUS = UI32( 65 );
constexpr auto BIT_CHECKPETCONTROLDIFFICULTY = UI32( 66 );
constexpr auto BIT_SHOWNPCTITLESINTOOLTIPS = UI32( 67 );
constexpr auto BIT_ITEMSINTERRUPTCASTING = UI32( 68 );
constexpr auto BIT_STATSAFFECTSKILLCHECKS = UI32( 69 );
constexpr auto BIT_TOOLUSELIMIT = UI32( 70 );
constexpr auto BIT_TOOLUSEBREAK = UI32( 71 );
constexpr auto BIT_ITEMREPAIRDURABILITYLOSS = UI32( 72 );
constexpr auto BIT_HIDESTATSFORUNKNOWNMAGICITEMS = UI32( 73 );
constexpr auto BIT_CRAFTCOLOUREDWEAPONS = UI32( 74 );
constexpr auto BIT_TELEPORTTONEARESTSAFELOC = UI32( 75 );
constexpr auto BIT_ALLOWAWAKENPCS = UI32( 76 );
constexpr auto BIT_DISPLAYMAKERSMARK = UI32( 77 );
constexpr auto BIT_SHOWNPCTITLESOVERHEAD = UI32( 78 );
constexpr auto BIT_SHOWINVULNERABLETAGOVERHEAD = UI32( 79 );
constexpr auto BIT_PETCOMBATTRAINING = UI32( 80 );
constexpr auto BIT_HIRELINGCOMBATTRAINING = UI32( 81 );
constexpr auto BIT_NPCCOMBATTRAINING = UI32( 82 );
constexpr auto BIT_SHOWITEMRESISTSTATS = UI32( 83 );
constexpr auto BIT_SHOWWEAPONDAMAGETYPES = UI32( 84 );
constexpr auto BIT_SHOWRACEWITHNAME = UI32( 85 );
constexpr auto BIT_SHOWRACEINPAPERDOLL = UI32( 86 );
constexpr auto BIT_CASTSPELLSWHILEMOVING = UI32( 87 );
constexpr auto BIT_SHOWREPTITLEINTOOLTIP = UI32( 88 );
constexpr auto BIT_SHOWGUILDINFOINTOOLTIP = UI32( 89 );
constexpr auto BIT_SAFECOOWNERLOGOUT = UI32( 90 );
constexpr auto BIT_SAFEFRIENDLOGOUT = UI32( 91 );
constexpr auto BIT_SAFEGUESTLOGOUT = UI32( 92 );
constexpr auto BIT_KEYLESSOWNERACCESS = UI32( 93 );
constexpr auto BIT_KEYLESSCOOWNERACCESS = UI32( 94 );
constexpr auto BIT_KEYLESSFRIENDACCESS = UI32( 95 );
constexpr auto BIT_KEYLESSGUESTACCESS = UI32( 96 );
constexpr auto BIT_OFFERBODSFROMITEMSALES = UI32( 97 );
constexpr auto BIT_OFFERBODSFROMCONTEXTMENU = UI32( 98 );
constexpr auto BIT_BODSFROMCRAFTEDITEMSONLY = UI32( 99 );
constexpr auto BIT_ENABLENPCGUILDDISCOUNTS = UI32( 100 );
constexpr auto BIT_ENABLENPCGUILDPREMIUMS = UI32( 101 );
constexpr auto BIT_SNOOPAWARENESS = UI32( 102 );
constexpr auto BIT_YOUNGPLAYERSYSTEM = UI32( 103 );
constexpr auto BIT_AUTOUNEQUIPPEDCASTING = UI32( 104 );
// New uox3.ini format lookup
// January 13, 2001 - Modified: January 30, 2001 Converted to uppercase
// February 26 2002 - Modified: to support the AccountIsolation, and left out dir3ectory tags
// September 22 2002 - Added the "HIDEWHILEMOUNTED" tag to support hide fix
// September 06 2003 - Removed unused tags (heartbeat, wilderness, uoxbot, lagfix)
// October 16, 2003 - Removed unused tag (SAVEMODE) and added "WEIGHTPERSTR".
// April 3, 2004 - Added new tags, for UOG support, as well as new facet tags etc.
// June 15, 2004 - Added the new tags for the xFTPd, and xFTPc support.
// April 2, 2005 - Removed superfluous tags (BEGGINGTIMER, HUNGERDAMAGERATE, HUNGERTHRESHOLD, BEGGINGRANGE)
// September 13, 2005 - Added MAPCOUNT to the uox.ini to specify the number of maps UOX3 uses.
// November 20, 2005 - Removed USEFACETSAVES, MAP0, MAP1, MAP2, MAP3, USERMAP, FTPDENABLED,
// FTPDUSER, FTPDUSERLIMIT, FTPDBIND, FTPDROOT, FTPCENABLED, FTPCHOST,
// FTPCPORT, FTPCUSER, FTPCULFLAGS, and MAPCOUNT as they were unused.
// Added OVERLOADPACKETS option to uox.ini to toggle JS packet handling.
// December 13, 2005 - Changed uox.ini entry SHOWHIDDENNPCS to SHOWOFFLINEPCS to better reflect its function.
// Removed CACHEMULS from the uox.ini as it is no longer used.
// February 12, 2006 - Added NPCMOVEMENTSPEED to the UOX.ini to allow customization of NPC movement speeds.
// July 7, 2006 - PLAYERPERSECUTION in uox.ini (allows ghosts to drain mana from other players) set to 0 by default
// July 18, 2006 - Added uox.ini flag to disable/enable the A* Pathfinding routine: ADVANCEDPATHFINDING=0/1
// July 24, 2006 - Simplified many entries in uox.ini, making them easier to read.
// January 28, 2007 - Moved dynamic parts of [worldlight] section from uox.ini to their own output file in the /shared/ directory
// March 3, 2007 - Removed CLIENTSUPPORT from the uox.ini
// Allowed customization of supported client features via uox.ini
// CLIENTFEATURES
// SERVERFEATURES
// April 9, 2007 - Added a new setting to the uox.ini, LOOTINGISCRIME. If you set it to 0 looting corpses of innocent chars is not taken as a crime.
// June 10, 2007 - Added two new settings to the uox.ini, NPCRUNNINGSPEED and NPCFLEEINGSPEED, they work the same way as NPCMOVEMENTSPEED.
// July 28, 2007 - Added a new setting to the uox.ini: BASICTOOLTIPSONLY. If this is set to 1 the tooltips will only contain basic information, like the name and the weight of an item.
// February 7, 2010 - Added new UOX.INI settings:
// GLOBALITEMDECAY - Toggles on / off item decay on a global scale.Note that it does not remove the decay - status from items, it just resets the decay - timer when it reaches 0
// SCRIPTITEMSDECAYABLE - Toggles whether DFN - items will decay by default or not.Can be overriden by DECAY tag in item - DFNs
// BASEITEMSDECAYABLE - Toggles whether base - items will decay by default or not.Can be overriden by DECAY tag in harditems.dfn
// ITEMDECAYINHOUSES - Toggles default decay of non - locked down items inside multis( houses and boats )
// December 14, 20011 - Exposed CombatExplodeDelay to UOX.INI, and changed the default delay between targeting and damage for the Explosion spell from 0 to 2 seconds
// March 19, 2012 - Added support for packet 0xD7, SubCommand 0x28 - Guild button on paperdoll, which gives access to guild-functions if character belongs to a guild.
// Can be enabled / disabled through UOX.INI setting PAPERDOLLGUILDBUTTON = 0 / 1. Defaults to 0.
// Added new UOX.INI option to determine whether attack - speed bonuses are gained from Stamina( default ) or Dexterity: ATTACKSPEEDFROMSTAMINA = 1 / 0
// Added new UOX.INI option to control the displaying of damage - numbers in combat( previously used DISPLAYHITMSG for numbers too ) : DISPLAYDAMAGENUMBERS = 1 / 0
// Added a new section to UOX.INI - [clientsupport] - along with the following settings to determine approved client - versions for the server :
// CLIENTSUPPORT4000 = 0 / 1
// CLIENTSUPPORT5000 = 0 / 1
// CLIENTSUPPORT6000 = 0 / 1
// CLIENTSUPPORT6050 = 0 / 1
// CLIENTSUPPORT7000 = 0 / 1
// CLIENTSUPPORT7090 = 0 / 1
// CLIENTSUPPORT70160 = 0 / 1
// CLIENTSUPPORT70240 = 0 / 1
// NOTE: Each of these settings represent a range of clients, not just the individual versions mentioned.This means that CLIENTSUPPORT4000, for instance,
// will allow or disallow connections from clients 4.0.0 to 4.0.11f.Also note that while it is possible to enable support for all clients at the same time,
// it highly recommended to restrict support for client versions that match up to what the server is running.
// Added new UOX.INI option : EXTENDEDSTARTINGSTATS = 0 / 1
// If enabled, makes new characters start with 90 statpoints( selectable in clients 7.0.16.0 + only, lower versions only get 90 if using templates ) instead of 80.
// Added new UOX.INI option : EXTENDEDSTARTINGSKILLS = 0 / 1
// If enabled, allows for four starting skills( selectable in clients 7.0.16.0 + only, lower versions only get 4th skill if using templates ) instead of three
// November 14, 2012 - Fixed issue where DISPLAYDAMAGENUMBERS and ATTACKSPEEDFROMSTAMINA settings in UOX.INI were overwriting the DISPLAYHITMSG setting instead of their own respective settings
// November 10, 2013 - Added new UOX.INI settings for adjusting combat-speed on a global scale:
// GLOBALATTACKSPEED = 1 // for adjusting speed of melee and ranged attacks globally for all chars
// NPCSPELLCASTSPEED = 1 // for adjusting the overall speed of spellcasts for NPCs (base spellcast speed determined by SPADELAY tag in NPC dfns)
// Added new UOX.INI settings to make hardcoded damage to armor and weapons in combat more customizable :
// WEAPONDAMAGECHANCE = 17 // Chance of weapons taking damage when attacking
// WEAPONDAMAGEMIN = 0 // Minimum amount of damage a weapon takes if damaged in combat
// WEAPONDAMAGEMAX = 1 // Maximum amount of damage a weapon takes if damaged in combat
// ARMORDAMAGECHANCE = 25 // Chance of armor taking damage when defending
// ARMORDAMAGEMIN = 0 // Minimum amount of damage armor can take if damaged in combat
// ARMORDAMAGEMAX = 1 // Maximum amount of damage armor can take if damaged in combat
// September 12, 2015 - Added new UOX.INI setting for defining the amount of stamina lost when using the fishing skill
// FISHINGSTAMINALOSS = 2 // The amount of stamina lost when using the fishing skill
// November 24, 2019 - Added new uox.ini flag for choosing a random starting location for new players (from list in uox.ini)
// RANDOMSTARTINGLOCATION = 0 // 0 to disable (default), 1 to enable
// NOTE: Very important the first lookups required duplication or the search fails on them
//+++++++++++++++++++++++++++++++++++++++++++++++
auto CServerData::LookupINIValue( const std::string& tag ) -> SI32
{
auto iter = uox3IniCaseValue.find( tag );
if( iter != uox3IniCaseValue.end() )
{
return iter->second;
}
return std::numeric_limits<SI32>::max();
}
//o------------------------------------------------------------------------------------------------o
//| Function - CServerData::ResetDefaults()
//o------------------------------------------------------------------------------------------------o
//| Purpose - Reset server settings to default
//o------------------------------------------------------------------------------------------------o
auto CServerData::ResetDefaults() -> void
{
resettingDefaults = true;
serverList.resize( 1 ); // Set the initial count to hold one server.
ServerIP( "127.0.0.1" );
ServerPort( 2593 );
ExternalIP( "127.0.0.1" );
serverList[0].SetPort( 2593 );
ServerName( "My UOX3 Shard" );
SecretShardKey( "None" );
// Set default gcMaxBytes limit in MB per JS runtime
// If set too low, UOX3 might crash when reloading (full) JS engine
// JS API references describe it as "Maximum nominal heap before last ditch GC"
SetJSEngineSize( 256 );
// Send server-originating messages in Unicode format, if possible
UseUnicodeMessages( true );
ServerLanguage( DL_DEFAULT );
SystemTimer( tSERVER_POTION, 10 );
ServerMoon( 0, 0 );
ServerMoon( 1, 0 );
DungeonLightLevel( 15 );
WorldLightCurrentLevel( 0 );
WorldLightBrightLevel( 0 );
WorldLightDarkLevel( 12 );
ServerNetRcvTimeout( 3 );
ServerNetSndTimeout( 3 );
ServerNetRetryCount( 3 );
MaxClientBytesIn( 50000 );
MaxClientBytesOut( 200000 );
NetTrafficTimeban( 30 );
// Adaptive Performance System
APSPerfThreshold( 50 ); // Default to 50 simulation cycles as performance threshold
APSInterval( 100 ); // Default to APS checking performance at 250 ms intervals
APSDelayStep( 50 ); // Default to 25 ms as the value at which APS gradually increments the delay to NPC AI/movement checking
APSDelayMaxCap( 2000 ); // Default to 1500 ms as max cap on delay APS can introduce to NPC AI/movement checking
ServerSecondsPerUOMinute( 5 );
ServerTimeDay( 0 );
ServerTimeHours( 0 );
ServerTimeMinutes( 0 );
ServerTimeSeconds( 0 );
ServerTimeAMPM( 0 );
InternalAccountStatus( true );
YoungPlayerSystem( true );
CombatMaxRange( 10 );
CombatMaxSpellRange( 10 );
// load defaults values
SystemTimer( tSERVER_SHOPSPAWN, 300 );
SystemTimer( tSERVER_POISON, 180 );
SystemTimer( tSERVER_DECAY, 300 );
SystemTimer( tSERVER_DECAYINHOUSE, 3600 );
ServerSkillTotalCap( 7000 );
ServerSkillCap( 1000 );
ServerStatCap( 225 );
StatsAffectSkillChecks( false );
CorpseLootDecay( true );
ServerSavesTimer( 600 );
// Enable login-support only for latest available client by default
ClientSupport4000( false );
ClientSupport5000( false );
ClientSupport6000( false );
ClientSupport6050( false );
ClientSupport7000( false );
ClientSupport7090( false );
ClientSupport70160( false );
ClientSupport70240( false );
ClientSupport70300( false );
ClientSupport70331( false );
ClientSupport704565( false );
ClientSupport70610( true );
SystemTimer( tSERVER_INVISIBILITY, 60 );
SystemTimer( tSERVER_HUNGERRATE, 6000 );
HungerDamage( 2 );
HungerSystemEnabled( true );
SystemTimer( tSERVER_THIRSTRATE, 6000 );
ThirstDrain( 2 );
ThirstSystemEnabled( false );
ServerSkillDelay( 5 );
SystemTimer( tSERVER_OBJECTUSAGE, 1 );
SystemTimer( tSERVER_HITPOINTREGEN, 8 );
SystemTimer( tSERVER_STAMINAREGEN, 3 );
SystemTimer( tSERVER_MANAREGEN, 5 );
ArmorAffectManaRegen( true );
SnoopIsCrime( false );
SnoopAwareness( false );
SystemTimer( tSERVER_GATE, 30 );
MineCheck( 1 );
DeathAnimationStatus( true );
ShowOfflinePCs( true );
CombatDisplayHitMessage( true );
CombatDisplayDamageNumbers( true );
CombatAttackSpeedFromStamina( true );
CombatAttackStamina( -2 );
NPCTrainingStatus( true );
CharHideWhileMounted( true );
WeightPerStr( 3.5 );
SystemTimer( tSERVER_POLYMORPH, 90 );
ServerOverloadPackets( true );
AdvancedPathfinding( true );
LootingIsCrime( true );
ServerUOGEnabled( true );
FreeshardServerPoll( true );
ServerContextMenus( true );
SysMsgColour( 0x0048 );
CombatMonstersVsAnimals( true );
CombatAnimalsAttackChance( 2 );
CombatAnimalsGuarded( false );
CombatNPCBaseFleeAt( 20 );
CombatNPCBaseReattackAt( 40 );
ShootOnAnimalBack( false );
SellByNameStatus( false );
SkillLevel( 5 );
SellMaxItemsStatus( 250 );
CombatNpcDamageRate( 1 );
RankSystemStatus( true );
DisplayMakersMark( true );
CombatArcheryHitBonus( 10 );
CombatArcheryShootDelay( 1.0 );
CombatWeaponDamageChance( 17 );
CombatWeaponDamageMin( 0 );
CombatWeaponDamageMax( 1 );
CombatArmorDamageChance( 33 );
CombatArmorDamageMin( 0 );
CombatArmorDamageMax( 1 );
CombatParryDamageChance( 20 );
CombatParryDamageMin( 0 );
CombatParryDamageMax( 1 );
CombatBloodEffectChance( 75 );
GlobalAttackSpeed( 1.0 );
NPCSpellCastSpeed( 1.0 );
FishingStaminaLoss( 2 );
CombatArmorClassDamageBonus( false );
AlchemyDamageBonusEnabled( false );
AlchemyDamageBonusModifier( 5 );
PetCombatTraining( true );
HirelingCombatTraining( true );
NpcCombatTraining( false );
WeaponDamageBonusType( 2 );
CheckPetControlDifficulty( true );
SetPetLoyaltyGainOnSuccess( 1 );
SetPetLoyaltyLossOnFailure( 3 );
SystemTimer( tSERVER_LOYALTYRATE, 900 );
ItemsInterruptCasting( true );
auto curWorkingDir = std::filesystem::current_path().string();
auto wDir = oldstrutil::fixDirectory( curWorkingDir );
std::string tDir;
Directory( CSDDP_ROOT, wDir );
tDir = wDir + std::string( "muldata/" );
Directory( CSDDP_DATA, tDir );
tDir = wDir + std::string( "dfndata/" );
Directory( CSDDP_DEFS, tDir );
tDir = wDir + std::string( "accounts/" );
Directory( CSDDP_ACCOUNTS, tDir );
Directory( CSDDP_ACCESS, tDir );
tDir = wDir + std::string( "js/" );
Directory( CSDDP_SCRIPTS, tDir );
tDir = wDir + std::string( "js/jsdata" );
Directory( CSDDP_SCRIPTDATA, tDir );
tDir = wDir + std::string( "archives/" );
Directory( CSDDP_BACKUP, tDir );
tDir = wDir + std::string( "msgboards/" );
Directory( CSDDP_MSGBOARD, tDir );
tDir = wDir + std::string( "shared/" );
Directory( CSDDP_SHARED, tDir );
tDir = wDir + std::string( "html/" );
Directory( CSDDP_HTML, tDir );
tDir = wDir + std::string( "books/" );
Directory( CSDDP_BOOKS, tDir );
tDir = wDir + std::string( "dictionaries/" );
Directory( CSDDP_DICTIONARIES, tDir );
tDir = wDir + std::string( "logs/" );
Directory( CSDDP_LOGS, tDir );
// Expansion settings
ExpansionCoreShardEra( ER_LBR ); // Default to LBR expansion
ExpansionArmorCalculation( ER_CORE );
ExpansionStrengthDamageBonus( ER_CORE );
ExpansionTacticsDamageBonus( ER_CORE );
ExpansionAnatomyDamageBonus( ER_CORE );
ExpansionLumberjackDamageBonus( ER_CORE );
ExpansionRacialDamageBonus( ER_CORE );
ExpansionDamageBonusCap( ER_CORE );
ExpansionShieldParry( ER_CORE );
ExpansionWeaponParry( ER_CORE );
ExpansionWrestlingParry( ER_CORE );
ExpansionCombatHitChance( ER_CORE );
BuyThreshold( 2000 );
GuardStatus( true );
ServerAnnounceSaves( true );
WorldAmbientSounds( 5 );
ServerJoinPartAnnouncements( true );
ServerConsoleLog( true );
ServerNetworkLog( false );
ServerSpeechLog( false );
RogueStatus( true );
SystemTimer( tSERVER_WEATHER, 60 );
SystemTimer( tSERVER_LOGINTIMEOUT, 300 );
BackupRatio( 5 );
MaxStealthMovement( 10 );
MaxStaminaMovement( 15 );
SystemTimer( tSERVER_NPCFLAGUPDATETIMER, 10 );
PetOfflineTimeout( 5 );
PetHungerOffline( true );
SystemTimer( tSERVER_PETOFFLINECHECK, 600 );
ItemsDetectSpeech( false );
MaxPlayerPackItems( 125 );
MaxPlayerBankItems( 125 );
MaxPlayerPackWeight( 40000 ); // 400.00 stones
MaxPlayerBankWeight( 160000 ); // 1600.00 stones
ForceNewAnimationPacket( true );
MapDiffsEnabled( false );
TravelSpellsFromBoatKeys( true );
TravelSpellsWhileOverweight( false );
MarkRunesInMultis( true );
TravelSpellsBetweenWorlds( false );
TravelSpellsWhileAggressor( false );
CastSpellsWhileMoving( false );
AutoUnequippedCasting( false );
MaxControlSlots( 0 ); // Default to 0, which is equal to off
MaxFollowers( 5 );
MaxPetOwners( 10 );
ToolUseLimit( true );
ToolUseBreak( true );
ItemRepairDurabilityLoss( true );
HideStatsForUnknownMagicItems( true );
CraftColouredWeapons( false );
MaxSafeTeleportsPerDay( 1 );
TeleportToNearestSafeLocation( false );
AllowAwakeNPCs( true );
GlobalRestockMultiplier( 1.0 );
ShowItemResistStats( false );
ShowWeaponDamageTypes( true );
ShowReputationTitleInTooltip( true );
ShowGuildInfoInTooltip( true );
EnableNPCGuildDiscounts( true );
EnableNPCGuildPremiums( true );
CheckBoatSpeed( 0.65 );
CheckNpcAISpeed( 1 );
CutScrollRequirementStatus( true );
PlayerPersecutionStatus( false );
HtmlStatsStatus( -1 );
MsgBoardPostingLevel( 0 );
MsgBoardPostRemovalLevel( 0 );
// No replacement I can see
EscortsEnabled( true );
BasicTooltipsOnly( false );
ShowNpcTitlesInTooltips( true );
ShowNpcTitlesOverhead( true );
ShowInvulnerableTagOverhead( false );
ShowRaceWithName( true );
ShowRaceInPaperdoll( true );
GlobalItemDecay( true );
ScriptItemsDecayable( true );
BaseItemsDecayable( false );
SystemTimer( tSERVER_ESCORTWAIT, 900 );
SystemTimer( tSERVER_ESCORTACTIVE, 600 );
SystemTimer( tSERVER_ESCORTDONE, 600 );
AmbientFootsteps( false );
ServerCommandPrefix( '\'' );
CheckSpawnRegionSpeed( 30 );
CheckItemsSpeed( 1.5 );
NPCWalkingSpeed( 0.6 );
NPCRunningSpeed( 0.3 );
NPCFleeingSpeed( 0.4 );
NPCMountedWalkingSpeed( 0.3 );
NPCMountedRunningSpeed( 0.12 );
NPCMountedFleeingSpeed( 0.2 );
AccountFlushTimer( 5.0 );
// RESOURCES
ResourceAreaSize( 8 );
ResLogs( 3 );
ResLogTime( 600 );
ResOre( 10 );
ResOreTime( 600 );
ResFish( 10 );
ResFishTime( 600 );
//REPSYS
SystemTimer( tSERVER_CRIMINAL, 120 );
RepMaxKills( 4 );
SystemTimer( tSERVER_MURDERDECAY, 28800 );
SystemTimer( tSERVER_AGGRESSORFLAG, 120 );
SystemTimer( tSERVER_PERMAGREYFLAG, 0 ); // No duration by default
SystemTimer( tSERVER_STEALINGFLAG, 120 );
SystemTimer( tSERVER_COMBATIGNORE, 20 ); // Not in ini
//RepSys ---^
TrackingBaseRange( 10 );
TrackingMaxTargets( 20 );
TrackingBaseTimer( 30 );
TrackingRedisplayTime( 30 );
SystemTimer( tSERVER_FISHINGBASE, 10 );
SystemTimer( tSERVER_FISHINGRANDOM, 5 );
SystemTimer( tSERVER_SPIRITSPEAK, 30 );
TitleColour( 0 );
LeftTextColour( 0 );
RightTextColour( 0 );
ButtonCancel( 4017 );
ButtonLeft( 4014 );
ButtonRight( 4005 );
BackgroundPic( 5054 );
// Houses
ItemDecayInHouses( true );
ProtectPrivateHouses( true );
TrackHousesPerAccount( true );
CanOwnAndCoOwnHouses( true );
CoOwnHousesOnSameAccount( true );
MaxHousesOwnable( 1 );
MaxHousesCoOwnable( 10 );
SafeCoOwnerLogout( true );
SafeFriendLogout( true );
SafeGuestLogout( true );
KeylessOwnerAccess( true );
KeylessCoOwnerAccess( true );
KeylessFriendAccess( true );
KeylessGuestAccess( false );
// Bulk Order Deeds
OfferBODsFromItemSales( true );
OfferBODsFromContextMenu( false );
BODsFromCraftedItemsOnly( false );
BODGoldRewardMultiplier( 1.0 );
BODFameRewardMultiplier( 1.0 );
// Towns
TownNumSecsPollOpen( 3600 ); // one hour
TownNumSecsAsMayor( 36000 ); // 10 hours as mayor
TownTaxPeriod( 1800 ); // taxed every 30 minutes
TownGuardPayment( 3600 ); // guards paid every hour
SetClientFeature( CF_BIT_CHAT, true );
SetClientFeature( CF_BIT_UOR, true );
SetClientFeature( CF_BIT_TD, true );
SetClientFeature( CF_BIT_LBR, true );
SetClientFeature( CF_BIT_AOS, true );
SetClientFeature( CF_BIT_SIXCHARS, true );
SetClientFeature( CF_BIT_SE, true );
SetClientFeature( CF_BIT_ML, true );
SetClientFeature( CF_BIT_EXPANSION, true );
SetServerFeature( SF_BIT_CONTEXTMENUS, true );
SetServerFeature( SF_BIT_AOS, true );
SetServerFeature( SF_BIT_SIXCHARS, true );
SetServerFeature( SF_BIT_SE, true );
SetServerFeature( SF_BIT_ML, true );
// Disable spawn regions for all facets by default
SetSpawnRegionsFacetStatus( 0 );
// Enable Felucca by default
SetMoongateFacetStatus( 0, true );
// Enable Trammel by default
SetMoongateFacetStatus( 1, true );
// Enable Ilshenar by default
SetMoongateFacetStatus( 2, true );
// Set no assistant features as disabled by default
SetDisabledAssistantFeature( AF_ALL, false );
ExtendedStartingStats( true );
ExtendedStartingSkills( true );
ServerRandomStartingLocation( false );
ServerStartGold( 1000 );
ServerStartPrivs( 0 );
SystemTimer( tSERVER_CORPSEDECAY, 420 );
SystemTimer( tSERVER_NPCCORPSEDECAY, 420 );
SystemTimer( tSERVER_BLOODDECAYCORPSE, 210 ); // Default to half the decay timer of a npc corpse
SystemTimer( tSERVER_BLOODDECAY, 3 ); // Keep it short and sweet
startlocations.clear();
youngStartlocations.clear();
resettingDefaults = false;
}
//==================================================================================================
CServerData::CServerData()
{
Startup();
availableIPs = ip4list_t::available();
}
//==================================================================================================
auto CServerData::Startup() -> void
{
ResetDefaults();
}
//o------------------------------------------------------------------------------------------------o
//| Function - CServerData::ServerName()
//o------------------------------------------------------------------------------------------------o
//| Purpose - Gets/Sets server name. Sets to specified value, or to default name if no value specified
//o------------------------------------------------------------------------------------------------o
auto CServerData::ServerName() const -> const std::string&
{
return serverList[0].GetName();
}
auto CServerData::ServerName( const std::string &setname ) -> void
{
if( serverList.empty() )
{
serverList.resize( 1 );
}
serverList[0].SetName( setname );