Planeshift
cachemanager.h
Go to the documentation of this file.
1 /*
2  * cachemanager.h
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef __CACHEMANAGER_H__
21 #define __CACHEMANAGER_H__
22 
23 //=============================================================================
24 // Crystal Space Includes
25 //=============================================================================
26 #include <csutil/stringarray.h>
27 #include <csutil/hash.h>
28 #include <csgeom/vector3.h>
29 
30 //=============================================================================
31 // Project Space Includes
32 //=============================================================================
33 #include "util/slots.h"
34 #include "util/gameevent.h"
35 
38 
39 //=============================================================================
40 // Local Includes
41 //=============================================================================
42 #include "icachedobject.h"
43 
44 class psSectorInfo;
45 class Client;
46 class EntityManager;
47 class psGuildInfo;
48 class psGuildAlliance;
49 class psSkillInfo;
50 class psAccountInfo;
51 class psQuest;
52 class psAttack;
53 class psAttackDefault;
54 class psTradePatterns;
55 class psTradeProcesses;
58 class psTradeAutoContainers;
59 class psItemSet;
60 class psCommandManager;
61 class psSpell;
62 class psItemStats;
63 class psItem;
64 class RandomizedOverlay;
65 
66 struct CraftTransInfo;
68 struct CombinationSet;
69 struct CraftComboInfo;
70 struct psItemAnimation;
71 struct psItemCategory;
72 struct psWay;
73 struct Faction;
74 struct psTrait;
75 struct psRaceInfo;
76 struct Stance;
77 struct MathScript;
78 
80 {
81  int id;
82  float c [3][4];
83  csString weapontype;
84 };
85 
88 {
89  csString string;
90  int flag;
91 
92  psItemStatFlags(const char* s, int f) : string(s), flag(f) { }
93  void Set(const char* s,int f)
94  {
95  string=s;
96  flag=f;
97  }
98 };
99 
100 // HACK TO GET AROUND BAD INCLUSION OF PSCHARACTER.H IN DRMESSAGE.H KWF
101 #ifndef __PSMOVEMENT_H__
102 struct psCharMode
104 {
105  uint32 id;
106  csString name;
107  csVector3 move_mod;
108  csVector3 rotate_mod;
109  csString idle_animation;
110 };
111 
113 struct psMovement
114 {
115  uint32 id;
116  csString name;
117  csVector3 base_move;
118  csVector3 base_rotate;
119 };
120 #endif
121 
132 {
133  uint32 id;
134  csString limit_type;
135  int min_score;
136  csString value;
137 };
138 
139 
148 {
149 private:
150  csString value;
151  csHash<optionEntry,csString> subOptions;
152 public:
157  void setValue(const csString newValue)
158  {
159  value = newValue;
160  }
164  csString getValue()
165  {
166  return value;
167  }
172  {
173  return atof(value);
174  }
179  {
180  return atoi(value);
181  }
187  csVector3 getValueAsVector();
194  bool getValueAsVector(csVector3 &vector);
203  bool setOption(const csString path, const csString value);
213  optionEntry* getOption(const csString path);
221  optionEntry* getOptionSafe(const csString path, const csString fallback);
222 };
223 
235 {
236 public:
237  CacheManager();
238  ~CacheManager();
239 
243  psSectorInfo* GetSectorInfoByName(const char* name);
244  psSectorInfo* GetSectorInfoByID(unsigned int id);
245  csHash<psSectorInfo*>::GlobalIterator GetSectorIterator();
247 
249  {
250  return commandManager;
251  }
252 
256  typedef csPDelArray<psTrait>::Iterator TraitIterator;
257  psTrait* GetTraitByID(unsigned int id);
258  psTrait* GetTraitByName(const char* name);
259  TraitIterator GetTraitIterator();
261 
265  size_t GetRaceInfoCount();
266  psRaceInfo* GetRaceInfoByIndex(int idx);
267  psRaceInfo* GetRaceInfoByID(unsigned int id);
268  psRaceInfo* GetRaceInfoByNameGender(const char* name,PSCHARACTER_GENDER gender);
269  psRaceInfo* GetRaceInfoByNameGender(unsigned int id, PSCHARACTER_GENDER gender);
270  psRaceInfo* GetRaceInfoByMeshName(const csString &meshname);
272 
276  psSkillInfo* GetSkillByID(unsigned int id);
277  size_t GetSkillAmount();
278  psSkillInfo* GetSkillByName(const char* name);
279 
281  void GetSkillsListbyCategory(csArray <psSkillInfo*> &listskill,int category);
283 
287  const char* FindCommonString(unsigned int id);
288  unsigned int FindCommonStringID(const char* name);
289  inline void AddCommonStringID(const char* name)
290  {
291  FindCommonStringID(name);
292  }
293 
298  csStringSet* GetMsgStrings()
299  {
300  return &msg_strings;
301  }
302 
311  void GetCompressedMessageStrings(char* &data, unsigned long &size,
312  uint32_t &num_strings, csMD5::Digest &digest);
314 
318  psGuildInfo* FindGuild(unsigned int id);
319  psGuildInfo* FindGuild(const csString &name);
320  bool CreateGuild(const char* guildname, Client* client);
321  void RemoveGuild(psGuildInfo* which);
323 
327  psGuildAlliance* FindAlliance(unsigned int id);
328  bool CreateAlliance(const csString &name, psGuildInfo* founder, Client* client);
329  bool RemoveAlliance(psGuildAlliance* which);
331 
335  psQuest* GetQuestByID(unsigned int id);
336  psQuest* GetQuestByName(const char* name);
337  psQuest* AddDynamicQuest(const char* name, psQuest* parentQuest, int step);
338 
339 
341  bool UnloadQuest(int id);
342 
344  bool LoadQuest(int id);
345  csHash<psQuest*>::GlobalIterator GetQuestIterator();
347 
348 
352  psAttack *GetAttackByID(unsigned int id);
353  psAttack *GetAttackByName(const char *name);
354  csArray<psAttack*>GetAllAttacks();
356  bool UnloadAttack(int id);
357 
359  bool LoadAttack(int id);
360  csHash<psAttack *>::GlobalIterator GetAttackIterator();
362 
373  psAccountInfo* GetAccountInfoByID(AccountID accountid);
374 
380  psAccountInfo* GetAccountInfoByCharID(PID charid);
381 
389  psAccountInfo* GetAccountInfoByUsername(const char* username);
390 
396  bool UpdateAccountInfo(psAccountInfo* ainfo);
397 
403  unsigned int NewAccountInfo(psAccountInfo* ainfo);
405 
407  bool PreloadAll(EntityManager* entitymanager);
408  void UnloadAll();
409 
410  // Item categories
411  psItemCategory* GetItemCategoryByID(unsigned int id);
412  psItemCategory* GetItemCategoryByName(const csString &name);
413 
419  {
420  return itemCategoryList.Get(pos);
421  }
426  {
427  return itemCategoryList.GetSize();
428  }
429 
430  // Item Animations
431  csPDelArray<psItemAnimation>* FindAnimationList(int id);
432 
433  // Ways
434  psWay* GetWayByID(unsigned int id);
435  psWay* GetWayByName(const csString &name);
436 
437  // attack types
438  psAttackType *GetAttackTypeByID(unsigned int id);
439  psAttackType *GetAttackTypeByName(csString name);
440 
441  // weapon types
442  psWeaponType*GetWeaponTypeByID(unsigned int id);
443  psWeaponType *GetWeaponTypeByName(csString name);
444 
445  // Factions
446  Faction* GetFaction(const char* name);
447  Faction* GetFaction(int id);
448  Faction* GetFactionByName(const char* name);
449  csHash<Faction*, int> &GetFactionHash()
450  {
451  return factions_by_id;
452  }
453 
454  // Progression Scripts
455  ProgressionScript* GetProgressionScript(const char* name);
456 
457  // Math scripts
458  MathScript* GetMaxCarryWeight() { return maxCarryWeight; }
459  MathScript* GetMaxCarryAmount() { return maxCarryAmount; }
460  MathScript* GetMaxRealmScript() { return maxRealmScript; }
461  MathScript* GetMaxManaScript() { return maxManaScript; }
462  MathScript* GetMaxHPScript() { return maxHPScript; }
463  MathScript* GetStaminaCalc() { return staminaCalc; }
464  MathScript* GetExpSkillCalc() { return expSkillCalc; }
465  MathScript* GetStaminaRatioWalk() { return staminaRatioWalk; }
466  MathScript* GetStaminaRatioStill() { return staminaRatioStill; }
467  MathScript* GetStaminaRatioSit() { return staminaRatioSit; }
468  MathScript* GetStaminaRatioWork() { return staminaRatioWork; }
469  MathScript* GetStaminaCombat() { return staminaCombat; }
470  MathScript* GetDodgeValueCalc() { return dodgeValueCalc; }
471  MathScript* GetArmorSkillsPractice() { return armorSkillsPractice; }
472  MathScript* GetCharLevelGet() { return charLevelGet; }
473  MathScript* GetSkillValuesGet() { return skillValuesGet; }
474  MathScript* GetBaseSkillValuesGet() { return baseSkillValuesGet; }
475  MathScript* GetSetBaseSkillsScript() { return setBaseSkillsScript; }
476  MathScript* GetCalcDecay() { return calc_decay; }
477  MathScript* GetCalcItemPrice() { return calcItemPrice; }
478  MathScript* GetCalcItemSellPrice() { return calcItemSellPrice; }
479  MathScript* GetPlayerSketchLimits() { return playerSketchLimits; }
480  MathScript* GetSpellPowerLevel() { return spellPowerLevel; }
481  MathScript* GetManaCost() { return manaCost; }
482  MathScript* GetCastSuccess() { return castSuccess; }
483  MathScript* GetResearchSuccess() { return researchSuccess; }
484  MathScript* GetSpellPractice() { return spellPractice; }
485  MathScript* GetDoDamage() { return doDamage; }
486  MathScript* GetStaminaMove() { return staminaMove; }
487  MathScript* GetFamiliarAffinity() { return msAffinity; }
488 
489  // Spells
490  typedef csPDelArray<psSpell>::Iterator SpellIterator;
491  psSpell* GetSpellByID(unsigned int id);
492  psSpell* GetSpellByName(const csString &name);
493  SpellIterator GetSpellIterator();
494 
498  csPDelArray<CombinationConstruction>* FindCombinationsList(uint32 patternid);
500 
502  csPDelArray<psTradeTransformations>* FindTransformationsList(uint32 patternid, uint32 targetid);
503  bool PreloadUniqueTradeTransformations();
504  csArray<uint32>* GetTradeTransUniqueByID(uint32 id);
505  bool PreloadTradeProcesses();
506  csArray<psTradeProcesses*>* GetTradeProcessesByID(uint32 id);
507  bool PreloadTradePatterns();
508  csArray<psTradePatterns*> GetTradePatternByItemID(uint32 id);
509  psTradePatterns* GetTradePatternByName(csString name);
510  csString CreateTransCraftDescription(psTradeTransformations* tran, psTradeProcesses* proc);
511  csString CreateComboCraftDescription(CombinationConstruction* combArray);
512  csString CreateComboCraftDescription(Result* combArray);
513  csArray<CraftTransInfo*>* GetTradeTransInfoByItemID(uint32 id);
514  csArray<CraftComboInfo*>* GetTradeComboInfoByItemID(uint32 id);
516 
520  psItemStats* GetBasicItemStatsByName(csString name);
522 
524  psItemStats* GetBasicItemStatsByID(uint32 id);
525  psItemStats* CopyItemStats(uint32 id, csString newName);
526 
528  uint32 BasicItemStatsByNameExist(csString name);
529  size_t ItemStatsSize(void)
530  {
531  return itemStats_IDHash.GetSize();
532  }
533 
535  void CacheNameChange(csString oldName, csString newName);
536 
537  bool LoadWorldItems(psSectorInfo* sector, csArray<psItem*> &items);
538 
539  float GetArmorVSWeaponResistance(const char* armor_type, const char* weapon_type);
540  float GetArmorVSWeaponResistance(psItemStats* armor, psItemStats* weapon);
541 
542  void RemoveInstance(psItem* &item);
543  void RemoveItemStats(psItemStats* &itemStats);
544 
545  PSITEMSTATS_STAT ConvertAttributeString(const char* attributestring);
546 
548  const char* Attribute2String(PSITEMSTATS_STAT s);
550 
551  PSSKILL ConvertSkillString(const char* skillstring);
552  PSSKILL ConvertSkill(int skill_id);
553  PSCHARACTER_GENDER ConvertGenderString(const char* genderstring);
555 
556  //Tips
557  void GetTipByID(int id, csString &tip);
558  unsigned int GetTipLength();
559 
561 
562  // Bad names
563  size_t GetBadNamesCount();
564  const char* GetBadName(int pos);
565  void AddBadName(const char*);
566  void DelBadName(const char*);
567 
569  csArray<psItemStatFlags> ItemStatFlagArray;
570 
571  const char* MakeCacheName(const char* prefix, uint32 id);
572  void AddToCache(iCachedObject* obj, const char* name, int max_cache_time_seconds);
573  iCachedObject* RemoveFromCache(const char* name);
574 
575  const csPDelArray<psCharMode> &GetCharModes() const
576  {
577  return char_modes;
578  }
579  const csPDelArray<psMovement> &GetMovements() const
580  {
581  return movements;
582  }
583  const psCharMode* GetCharMode(size_t id) const
584  {
585  return char_modes[id];
586  }
587  const psMovement* GetMovement(size_t id) const
588  {
589  return movements[id];
590  }
591  uint8_t GetCharModeID(const char* name);
592  uint8_t GetMovementID(const char* name);
593 
595  uint32_t NextEffectUID()
596  {
597  return ++effectID;
598  }
599 
601  const psCharacterLimitation* GetLimitation(size_t index);
602 
604  csArray<Stance> stances;
605 
607  csArray<csString> stanceID;
608 
609  void AddItemStatsToHashTable(psItemStats* newitem);
610 
618  optionEntry* getOption(const csString path)
619  {
620  return rootOptionEntry.getOption(path);
621  }
622 
631  optionEntry* getOptionSafe(const csString path, const csString value)
632  {
633  return rootOptionEntry.getOptionSafe(path,value);
634  }
635 
642  {
643  return lootRandomizer;
644  }
645 
652  void ApplyItemModifiers(psItemStats* baseItem, RandomizedOverlay* overlay, csArray<uint32_t> &modifierIds)
653  {
654  lootRandomizer->ApplyModifier(baseItem, overlay, modifierIds);
655  }
656 
662  void RandomizeItem(psItem* item, float maxCost, size_t numModifiers)
663  {
664  lootRandomizer->RandomizeItem(item, maxCost, false, numModifiers);
665  }
666 
671  {
672  return PreloadOptions();
673  }
674 
675 protected:
676  uint32_t effectID;
677  char CacheNameBuffer[15];
678 
679  bool PreloadSectors();
680  bool PreloadRaceInfo();
681  bool PreloadSkills();
682  bool PreloadAttacks();
686  bool PreloadOptions();
687  bool PreloadLimitations();
688  bool PreloadTraits();
689  bool PreloadItemCategories();
690  bool PreloadWays();
691  bool PreloadAttackTypes();
692  bool PreloadWeaponTypes();
694  void PreloadFactionCharacterEvents(const char* script, Faction* faction);
695  bool PreloadFactions();
696  bool PreloadScripts(EntityManager* entitymanager);
697  bool PreloadMathScripts();
698  bool PreloadSpells();
699  bool PreloadItemStatsDatabase();
700  bool PreloadItemAnimList();
701  bool PreloadQuests();
702  bool PreloadTradeCombinations();
703  bool PreloadTradeTransformations();
704  bool PreloadTips();
705  bool PreloadBadNames();
706  bool PreloadArmorVsWeapon();
707  bool PreloadMovement();
708  bool PreloadStances();
709  void PreloadCommandGroups();
710 
711 
717  bool PreloadLootModifiers();
718 
720  bool PreloadCraftMessages();
721 
728  bool UniqueInsertIntoItemArray(csArray<uint32>* finalItems, uint32 itemID);
729 
740  int Contains(csArray<uint32>* list, uint32 id);
741 
755  bool FindFinalItem(csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* txItemHash, csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* rxItemHash, csArray<uint32>* finalItems, uint32 itemID, csArray<uint32>* itemStack);
756 
770  bool ReconcileFinalItems(csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* txItemHash, csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* rxItemHash, csArray<uint32>* finalItems, csArray<uint32>* craftBookItems, uint32 resultID, uint32 patternID, csArray<uint32>* itemStack);
771 
781  bool loadTradeTransformationsByPatternAndGroup(Result* result, csHash<csHash<csPDelArray<psTradeTransformations> *,uint32> *,uint32>* txResultHash, csHash<csHash<csPDelArray<psTradeTransformations> *,uint32> *,uint32>* txItemHash);
782 
791  bool freeTradeTransformationsByPatternAndGroup(csHash<csHash<csPDelArray<psTradeTransformations> *,uint32> *,uint32>* txItemHash, csHash<csHash<csPDelArray<psTradeTransformations> *,uint32> *,uint32>* txResultHash);
792 
801  bool DescribeTransformation(psTradeTransformations* t, csArray<CraftTransInfo*>* newArray);
802 
811  bool DescribeMultiTransformation(csPDelArray<psTradeTransformations>* rArray, csArray<CraftTransInfo*>* newArray);
812 
821  bool DescribeCombination(Result* combinations, csArray<CraftTransInfo*>* newArray);
822 
835  bool ListProductionSteps(csArray<CraftTransInfo*>* newArray, csHash<csHash<csPDelArray<psTradeTransformations>*, uint32> *,uint32>* txResultHash, csArray<uint32>* finalItems, uint32 itemID, uint32 patternID, uint32 groupID, csArray<uint32>* itemStack);
836 
844  void CacheCraftTransforms(psMsgCraftingInfo* tradePattern, int patternID, int group);
845 
853  void CacheCraftCombos(psMsgCraftingInfo* tradePattern, int patternID, int group);
854 
855  PSTRAIT_LOCATION ConvertTraitLocationString(const char* locationstring);
856 
857  class psCacheExpireEvent; // forward decl for next decl
858 
860  {
861  csString name;
864  };
865 
872  {
873  protected:
874  bool valid;
876 
877  public:
878  psCacheExpireEvent(int delayticks,CachedObject* object);
879  void CancelEvent()
880  {
881  valid = false;
882  }
883  virtual void Trigger();
884  };
885 
890  csHash<CachedObject*, csString> generic_object_cache;
891 
892  // Common strings data.
893  csStringSet msg_strings;
898 
899  csHash<psSectorInfo*> sectorinfo_by_id;
900  csHash<psSectorInfo*> sectorinfo_by_name;
901  csPDelArray<psTrait > traitlist;
902  csPDelArray<psRaceInfo > raceinfolist;
903 
904  csHash<psSkillInfo*, int> skillinfo_IDHash;
905  csHash<psSkillInfo*, csString> skillinfo_NameHash;
906  csHash<psSkillInfo*, int> skillinfo_CategoryHash;
907 
908  csPDelArray<psItemCategory > itemCategoryList;
909  csPDelArray<psWay > wayList;
910  csPDelArray<psAttackType > attackTypeList;
911  csPDelArray<psWeaponType > weaponTypeList;
912  csHash<Faction*, int> factions_by_id;
913  csHash<Faction*, csString> factions;
914  csHash<ProgressionScript*,csString> scripts;
915  csPDelArray<psSpell > spellList;
916  //csArray<psItemStats *> basicitemstatslist;
917  csHash<psItemStats*,uint32> itemStats_IDHash;
918  csHash<psItemStats*,csString> itemStats_NameHash;
919  csPDelArray<csPDelArray<psItemAnimation > > item_anim_list;
920  csHash<psGuildInfo*> guildinfo_by_id;
921  csHash<psGuildAlliance*> alliance_by_id;
922  csHash<psAttack *> attacks_by_id;
923  csHash<psQuest *> quests_by_id;
924  csHash<psTradePatterns *,uint32> tradePatterns_IDHash;
925  csHash<psTradePatterns *,csString> tradePatterns_NameHash;
926  csHash<csArray<psTradeProcesses*> *,uint32> tradeProcesses_IDHash;
927  csHash<csPDelArray<CombinationConstruction> *,uint32> tradeCombinations_IDHash;
928  csHash<csHash<csPDelArray<psTradeTransformations> *,uint32> *,uint32> tradeTransformations_IDHash;
929  csHash<csArray<uint32> *,uint32> tradeTransUnique_IDHash;
930  csHash<csArray<CraftTransInfo*> *,uint32> tradeCraftTransInfo_IDHash;
931  csHash<csArray<CraftComboInfo*> *,uint32> tradeCraftComboInfo_IDHash;
932  csArray<csString> tips_list;
933  csStringArray bad_names;
934  csPDelArray<ArmorVsWeapon> armor_vs_weapon;
935  csPDelArray<psCharMode> char_modes;
936  csPDelArray<psMovement> movements;
937  csPDelArray<psCharacterLimitation> limits;
940 
972 };
973 
974 
975 #endif
uint32_t effectID
Definition: cachemanager.h:676
MathScript * GetDodgeValueCalc()
Definition: cachemanager.h:470
This class stores an array of LootModifiers and randomizes loot stats.
csHash< Faction *, int > factions_by_id
Definition: cachemanager.h:912
optionEntry * getOptionSafe(const csString path, const csString fallback)
Does the same of getOption, but, in case the entry is missing, an empty option will be added to the t...
MathScript * GetCastSuccess()
Definition: cachemanager.h:482
The generic cache sets timers for each object added to the cache, then if the object is not removed b...
Definition: cachemanager.h:871
Defines all the info about crafting for an item.
Definition: messages.h:5302
Manages CEL entities on the server.
Definition: entitymanager.h:77
csHash< csArray< CraftTransInfo * > *, uint32 > tradeCraftTransInfo_IDHash
Definition: cachemanager.h:930
csArray< csString > stanceID
Map of locations.
Definition: cachemanager.h:607
size_t ItemStatsSize(void)
Definition: cachemanager.h:529
csPDelArray< psAttackType > attackTypeList
Definition: cachemanager.h:910
void setValue(const csString newValue)
Sets the value of this specific option to a newvalue.
Definition: cachemanager.h:157
MathScript * GetMaxRealmScript()
Definition: cachemanager.h:460
csHash< CachedObject *, csString > generic_object_cache
This cache is intended to keep database-loaded objects in memory for a time after we are done with th...
Definition: cachemanager.h:890
csHash< Faction *, int > & GetFactionHash()
Definition: cachemanager.h:449
MathScript * GetFamiliarAffinity()
Definition: cachemanager.h:487
ProgressionScript is the imperative script container.
Definition: scripting.h:78
SlotNameHash slotNameHash
Definition: cachemanager.h:560
unsigned int PSITEMSTATS_SLOTLIST
Definition: psitemstats.h:159
This class holds the master list of all trade transformatations possible in the game.
Definition: pstrade.h:101
Represents a skill an NPC, player or pet can learn.
Definition: psskills.h:72
csHash< psTradePatterns *, csString > tradePatterns_NameHash
Definition: cachemanager.h:925
uint32_t num_compressed_strings
Definition: cachemanager.h:896
psCommandManager * commandManager
Definition: cachemanager.h:938
MathScript * calcItemSellPrice
Definition: cachemanager.h:962
optionEntry rootOptionEntry
Definition: cachemanager.h:939
MathScript * GetDoDamage()
Definition: cachemanager.h:485
LootRandomizer * lootRandomizer
A pointer to the lootrandomizer mantained by the cachemanager.
Definition: cachemanager.h:941
This struct holds data for generic attack types This could be for example an assassin attack which wo...
Definition: psattack.h:60
psCommandManager * GetCommandManager()
Definition: cachemanager.h:248
MathScript * GetResearchSuccess()
Definition: cachemanager.h:483
MathScript * GetExpSkillCalc()
Definition: cachemanager.h:464
csPDelArray< csPDelArray< psItemAnimation > > item_anim_list
Definition: cachemanager.h:919
A MathScript is a mini-program to run.
Definition: mathscript.h:442
MathScript * maxRealmScript
Definition: cachemanager.h:944
csVector3 base_rotate
rotation for this
Definition: cachemanager.h:118
bool ReloadOptions()
Reloads the server_options.
Definition: cachemanager.h:670
void ApplyItemModifiers(psItemStats *baseItem, RandomizedOverlay *overlay, csArray< uint32_t > &modifierIds)
Applies on a randomized overlay structure, starting with the base item stats passed, the modifier ids passed.
Definition: cachemanager.h:652
csHash< csArray< CraftComboInfo * > *, uint32 > tradeCraftComboInfo_IDHash
Definition: cachemanager.h:931
csVector3 rotate_mod
rotation multiplier
Definition: cachemanager.h:108
csStringSet msg_strings
Definition: cachemanager.h:893
csHash< Faction *, csString > factions
Definition: cachemanager.h:913
csHash< psItemStats *, uint32 > itemStats_IDHash
Definition: cachemanager.h:917
MathScript * spellPractice
Definition: cachemanager.h:968
This class rappresents an option tree which comes from the server_options table.
Definition: cachemanager.h:147
MathScript * maxManaScript
Definition: cachemanager.h:945
MathScript * GetBaseSkillValuesGet()
Definition: cachemanager.h:474
A data storage class to contain all information associated with an account.
Definition: psaccountinfo.h:44
This class holds all information for one quest with its reference to parent quest, list of steps, lockoutime, sub quests, ...
Definition: psquest.h:67
MathScript * GetStaminaRatioStill()
Definition: cachemanager.h:466
Holds data for a guild.
Definition: psguildinfo.h:159
MathScript * GetStaminaRatioSit()
Definition: cachemanager.h:467
A character movement and its properties.
Definition: psmovement.h:62
LootRandomizer * getLootRandomizer()
Returns a pointer to the loot randomizer which is hosted within the cache manager.
Definition: cachemanager.h:641
csVector3 move_mod
motion multiplier
Definition: cachemanager.h:107
MathScript * GetMaxHPScript()
Definition: cachemanager.h:462
MathScript * spellPowerLevel
Definition: cachemanager.h:964
csArray< psItemStatFlags > ItemStatFlagArray
Translation table for Flag strings (from db) into bit codes.
Definition: cachemanager.h:569
csHash< psGuildInfo * > guildinfo_by_id
Definition: cachemanager.h:920
Each item contains craft information about a craft combination.
Definition: pstrade.h:479
MathScript * castSuccess
Definition: cachemanager.h:966
csPDelArray< psTrait >::Iterator TraitIterator
Definition: cachemanager.h:256
unsigned long compressed_msg_strings_size
Definition: cachemanager.h:895
csString getValue()
Get the value of this specific option.
Definition: cachemanager.h:164
csHash< csHash< csPDelArray< psTradeTransformations > *, uint32 > *, uint32 > tradeTransformations_IDHash
Definition: cachemanager.h:928
Each weapon specifies what anims can be used with it.
Definition: psitemstats.h:222
MathScript * maxCarryWeight
A pointer maintained by MathScriptEngine.
Definition: cachemanager.h:942
csPDelArray< psCharacterLimitation > limits
All the limitations based on scores for characters.
Definition: cachemanager.h:937
optionEntry * getOption(const csString path)
Wrapper for the getOption method of the root optionEntry stored in cachemanager.
Definition: cachemanager.h:618
MathScript * setBaseSkillsScript
Definition: cachemanager.h:959
PSITEMSTATS_STAT
Definition: psitemstats.h:69
This class allows CacheManager to yield a list of qualifying values given a player&#39;s score at somethi...
Definition: cachemanager.h:131
A guild alliance between 2+ guilds.
Definition: psguildinfo.h:731
float c[3][4]
Definition: cachemanager.h:82
csPDelArray< psItemCategory > itemCategoryList
Definition: cachemanager.h:908
MathScript * staminaRatioWalk
The stamina regen ration while walking script.
Definition: cachemanager.h:949
Represents an Attack.
Definition: psattack.h:82
void Set(const char *s, int f)
Definition: cachemanager.h:93
PSTRAIT_LOCATION
Define the player controled base customization that their model can have.
Definition: charmessages.h:24
Defines characteristics of a race associated to an NPC, player or pet.
Definition: psraceinfo.h:58
Represent a visual feature of character customization like hair style, color of eyes, skin color, ...
Definition: pstrait.h:41
MathScript * staminaRatioWork
The stamina regen ration while working script.
Definition: cachemanager.h:952
csPDelArray< psRaceInfo > raceinfolist
Definition: cachemanager.h:902
csHash< psSkillInfo *, int > skillinfo_CategoryHash
Definition: cachemanager.h:906
MathScript * GetMaxCarryWeight()
Definition: cachemanager.h:458
csHash< psSectorInfo * > sectorinfo_by_id
Sector info list hashed by sector id.
Definition: cachemanager.h:899
psItemCategory * GetItemCategoryByPos(size_t pos)
Gets an item category by its position in the array.
Definition: cachemanager.h:418
MathScript * GetStaminaCombat()
Definition: cachemanager.h:469
void AddCommonStringID(const char *name)
Definition: cachemanager.h:289
MathScript * staminaCombat
Definition: cachemanager.h:953
MathScript * doDamage
Definition: cachemanager.h:969
csHash< psSkillInfo *, csString > skillinfo_NameHash
Definition: cachemanager.h:905
MathScript * GetPlayerSketchLimits()
Definition: cachemanager.h:479
PSSKILL
Definition: psskills.h:44
int min_score
What must a player score to earn this ability.
Definition: cachemanager.h:135
csMD5::Digest compressed_msg_strings_digest
Definition: cachemanager.h:897
MathScript * GetCalcDecay()
Definition: cachemanager.h:476
csStringSet * GetMsgStrings()
Returns the message strings hash table.
Definition: cachemanager.h:298
MathScript * staminaCalc
The stamina calc script.
Definition: cachemanager.h:947
MathScript * manaCost
Definition: cachemanager.h:965
const psMovement * GetMovement(size_t id) const
Definition: cachemanager.h:587
MathScript * armorSkillsPractice
Script to set the practice points for armor skills.
Definition: cachemanager.h:955
MathScript * researchSuccess
Definition: cachemanager.h:967
csArray< Stance > stances
List of stances.
Definition: cachemanager.h:604
MathScript * GetStaminaRatioWalk()
Definition: cachemanager.h:465
int getValueAsInt()
Get the value of this specific option in int format.
Definition: cachemanager.h:178
csHash< psSkillInfo *, int > skillinfo_IDHash
Definition: cachemanager.h:904
This class holds the master list of all trade patterns possible in the game.
Definition: pstrade.h:403
optionEntry * getOptionSafe(const csString path, const csString value)
Wrapper for the getOptionSafe method of the root optionEntry stored in cachemanager.
Definition: cachemanager.h:631
csPDelArray< psWeaponType > weaponTypeList
Definition: cachemanager.h:911
A list of the flags mapped to their IDs.
Definition: cachemanager.h:87
Represents a spell.
Definition: psspell.h:74
Each item has a list of items required for its construction.
Definition: pstrade.h:444
char * compressed_msg_strings
Definition: cachemanager.h:894
optionEntry * getOption(const csString path)
Gets an option entry in the tree.
csString idle_animation
animation when not moving
Definition: cachemanager.h:109
csPDelArray< psWay > wayList
Definition: cachemanager.h:909
This is a wrapper class for result sets which makes syntax for getting at the data easier and also us...
Definition: psdatabase.h:132
MathScript * staminaMove
Definition: cachemanager.h:970
Definition: psspell.h:52
PSCHARACTER_GENDER
Definition: charmessages.h:14
MathScript * GetMaxCarryAmount()
Definition: cachemanager.h:459
csString string
Definition: cachemanager.h:89
const csPDelArray< psCharMode > & GetCharModes() const
Definition: cachemanager.h:575
csString value
What is the name of the ability they earn.
Definition: cachemanager.h:136
csString weapontype
Definition: cachemanager.h:83
This class collects data of a netclient.
Definition: client.h:95
csHash< psQuest * > quests_by_id
Definition: cachemanager.h:923
MathScript * msAffinity
Definition: cachemanager.h:971
A hash map class that stores a name->ID of sockets.
Definition: slots.h:91
csHash< csArray< uint32 > *, uint32 > tradeTransUnique_IDHash
Definition: cachemanager.h:929
csHash< csPDelArray< CombinationConstruction > *, uint32 > tradeCombinations_IDHash
Definition: cachemanager.h:927
uint32_t NextEffectUID()
Used to track effect IDs.
Definition: cachemanager.h:595
csVector3 base_move
motion for this
Definition: cachemanager.h:117
A character mode and its properties.
Definition: psmovement.h:53
const psCharMode * GetCharMode(size_t id) const
Definition: cachemanager.h:583
csPDelArray< psCharMode > char_modes
Definition: cachemanager.h:935
MathScript * GetManaCost()
Definition: cachemanager.h:481
MathScript * GetStaminaCalc()
Definition: cachemanager.h:463
This class holds the master list of all trade combinations possible in the game.
Definition: pstrade.h:50
MathScript * baseSkillValuesGet
Script to get the base skill values.
Definition: cachemanager.h:958
size_t GetItemCategoryAmount()
Gets the size of the item category array.
Definition: cachemanager.h:425
This class handles the permission system such as Game Masters and Role play masters.
MathScript * GetStaminaMove()
Definition: cachemanager.h:486
csHash< psSectorInfo * > sectorinfo_by_name
Sector info list hashed by sector name.
Definition: cachemanager.h:900
void RandomizeItem(psItem *item, float maxCost, size_t numModifiers)
Randomizes the passed item.
Definition: cachemanager.h:662
MathScript * GetStaminaRatioWork()
Definition: cachemanager.h:468
uint32 id
unique id
Definition: cachemanager.h:133
This huge class stores all the properties of any object a player can have in the game.
Definition: psitemstats.h:463
MathScript * playerSketchLimits
Definition: cachemanager.h:963
csPDelArray< psSpell > spellList
Definition: cachemanager.h:915
MathScript * staminaRatioStill
The stamina regen ration while standing script.
Definition: cachemanager.h:950
csHash< psAttack * > attacks_by_id
Definition: cachemanager.h:922
csHash< psGuildAlliance * > alliance_by_id
Definition: cachemanager.h:921
This class manages the caching of data that is unchanging during server operation.
Definition: cachemanager.h:234
This class holds the master list of all trade processes possible in the game.
Definition: pstrade.h:230
csArray< csString > tips_list
List for the tips.
Definition: cachemanager.h:932
MathScript * GetCalcItemPrice()
Definition: cachemanager.h:477
MathScript * GetSkillValuesGet()
Definition: cachemanager.h:473
csPDelArray< psMovement > movements
Definition: cachemanager.h:936
csHash< psTradePatterns *, uint32 > tradePatterns_IDHash
Definition: cachemanager.h:924
double getValueAsDouble()
Get the value of this specific option in double format.
Definition: cachemanager.h:171
Stores the randomized stats from the loot randomizer, it could be used to apply any global special ef...
Definition: psitem.h:171
Contains information about sectors from the server perspective.
Definition: pssectorinfo.h:46
csHash< psItemStats *, csString > itemStats_NameHash
Definition: cachemanager.h:918
csPDelArray< psSpell >::Iterator SpellIterator
Definition: cachemanager.h:490
csHash< ProgressionScript *, csString > scripts
Definition: cachemanager.h:914
MathScript * GetSpellPowerLevel()
Definition: cachemanager.h:480
MathScript * dodgeValueCalc
Script for calculating dodge value.
Definition: cachemanager.h:954
psCacheExpireEvent * event
Definition: cachemanager.h:863
MathScript * GetSetBaseSkillsScript()
Definition: cachemanager.h:475
MathScript * GetCharLevelGet()
Definition: cachemanager.h:472
csPDelArray< ArmorVsWeapon > armor_vs_weapon
Definition: cachemanager.h:934
MathScript * charLevelGet
Script to get the current char level.
Definition: cachemanager.h:956
All scheduled events must inherit from this class.
Definition: gameevent.h:36
MathScript * maxHPScript
Definition: cachemanager.h:946
MathScript * GetArmorSkillsPractice()
Definition: cachemanager.h:471
An ingame faction group.
Definition: factions.h:41
const csPDelArray< psMovement > & GetMovements() const
Definition: cachemanager.h:579
MathScript * calcItemPrice
Definition: cachemanager.h:961
MathScript * expSkillCalc
The exp calc script to assign experience on skill ranking.
Definition: cachemanager.h:948
MathScript * staminaRatioSit
The stamina regen ration while sitting script.
Definition: cachemanager.h:951
psItemStatFlags(const char *s, int f)
Definition: cachemanager.h:92
csPDelArray< psTrait > traitlist
Definition: cachemanager.h:901
csString limit_type
&#39;SKETCH&#39; limitations all have this word here
Definition: cachemanager.h:134
MathScript * GetCalcItemSellPrice()
Definition: cachemanager.h:478
MathScript * GetSpellPractice()
Definition: cachemanager.h:484
Each item contains craft information about a craft transformation step.
Definition: pstrade.h:467
csStringArray bad_names
Definition: cachemanager.h:933
MathScript * skillValuesGet
Script to get the current skill values.
Definition: cachemanager.h:957
csHash< csArray< psTradeProcesses * > *, uint32 > tradeProcesses_IDHash
Definition: cachemanager.h:926
MathScript * maxCarryAmount
A pointer maintained by MathScriptEngine.
Definition: cachemanager.h:943
MathScript * calc_decay
This is the particular calculation for decay.
Definition: cachemanager.h:960
MathScript * GetMaxManaScript()
Definition: cachemanager.h:461
This class embodies item instances in the game.
Definition: psitem.h:238