Commit Graph
163 Commits
Author SHA1 Message Date
David Cernat 6df875f9c2 [General] Use inventoryHelper.addItem() whenever possible
This fixes a significant bug where every custom potion created through regular gameplay was placed in its own slot in the player's inventory table, which – combined with the record removal logic in BasePlayer:SaveInventory() – made links to custom potions get removed prematurely.

Additionally, add debug information for every item change in BasePlayer:SaveInventory()
2018-10-19 21:25:04 +03:00
David Cernat 0a071ccd2e [Player] Move handling of attributeSkillIncreases to correct functions
These were originally part of skill packets, but were moved to attribute packets in TES3MP/openmw-tes3mp@78441c769a without a corresponding change being made in the Lua scripts.
2018-10-18 20:05:42 +03:00
David Cernat 4928774737 [Player] Move handling of level progress to LoadLevel() & SaveLevel()
This now accounts for the fact that the level progress was moved from the PlayerSkill packet to the PlayerLevel packet in TES3MP/openmw-tes3mp@78441c769a
2018-10-12 22:05:04 +03:00
David Cernat 98f233a577 [Player] Add temporary fix for bug where health gets saved as 1 2018-10-10 16:42:22 +03:00
David Cernat e33a865e19 [Player] Don't use nil values for souls when saving inventory items
Previously, although player inventories without soul keys looked nicer and more compact, they complicateed the item-removal logic and caused item duplication.
2018-10-10 14:01:40 +03:00
David Cernat 1e9f69f980 [Player] Fix logic when iterating over spellbooks from previous versions 2018-10-09 11:28:01 +03:00
David CernatandGitHub 2c7a8c7039 Merge pull request #46 from robsob91/0.7.0
Fixed crash caused by variable name that wasn't updated
2018-10-08 14:40:59 +03:00
David Cernat b368b386d9 [General] Update names for script functions that clear packet vectors 2018-10-03 02:28:54 +03:00
David Cernat 837d9bfd71 [General] Use LoadItemChanges() instead of LoadInventory() when possible 2018-10-02 13:15:12 +03:00
David Cernat 601d3040ea [Player] Add LoadItemChanges() for sending minimalist inventory packets 2018-10-01 18:56:05 +03:00
David Cernat afa2d7d134 [General] Update usage of inventory script functions 2018-10-01 18:51:41 +03:00
David Cernat a3f390515f [General] Add and use AddPlayerInventoryItemChange() in PacketBuilder 2018-09-24 04:56:35 +03:00
David Cernat c15af56892 [General] Remove unnecessary usage of tes3mp.GetName() 2018-09-21 04:23:04 +03:00
David Cernat 46698c1d18 [General] Shorten long lines 2018-09-21 04:16:48 +03:00
David Cernat 4dc340480e [General] Change code style by using "not" operator whenever possible 2018-09-21 03:14:24 +03:00
David Cernat ef226ef026 [Player] Delete items & spells using invalid generated records on log in
Additionally, remove unused nil check in LoadInventory()
2018-09-18 07:20:34 +03:00
David Cernat 1af08f3e71 [Player] Avoid saving souls for items w/o souls when saving inventory 2018-09-16 00:30:32 +03:00
David Cernat a15c9ed5dd [Player] Clean nil values when removing links to records 2018-09-13 21:19:30 +03:00
David Cernat 4c9b9ffc44 [Player] Use correct log level for debug message when saving inventory 2018-09-10 23:56:29 +03:00
nop 612b472231 Renamed forgotten variable 2018-09-08 16:32:32 -07:00
David Cernat 1c3e9ac808 [General] Clean up logging by using easily adjustable log level values 2018-09-08 19:11:27 +03:00
David Cernat 9cd5dc8556 [General] Implement dynamic records, part 2
Records are now split into 2 categories: permanent records and generated records.

Permanent records are kept forever once created and are sent to all players when they join the server.

Generated records are linked to players, cells or other records, are deleted once those links disappear, and are only sent to players who encounter them. For instance, if a player creates hundreds of potions in a house and then drops the potions there, those potion records will only be sent to players who enter that house. If the potions are drunk and there are no longer any instances of them, their associated records are deleted.

By default, permanent records are created by using the /createrecord command after specifically setting an ID for the record about to be created.

Generated records are created through regular gameplay or by using the /createrecord command without specifying an ID for the record.
2018-08-30 03:32:58 +03:00
David Cernat 88d7f47799 [General] Rename settings.admin into settings.staffRank for players 2018-08-27 16:02:02 +03:00
David Cernat a54d498f76 [General] Add server owner rank & commands for promoting/demoting admins
Additionally, remove unused PromoteModerator() method in BasePlayer.
2018-08-27 15:33:27 +03:00
David Cernat d936960a33 [Player] Rermove menu-toggling no longer needed when denying equipment 2018-08-27 14:19:27 +03:00
David Cernat a6ef3e4604 [Player] Rework saving of player inventories for ADD & REMOVE actions 2018-08-21 10:17:52 +03:00
David Cernat a46e9b9e2b [General] Combine methods for saving spellbook packets into a single one 2018-08-18 11:35:32 +03:00
David Cernat e2c40eaa91 [Player] Turn spellbook into a regular array of spell IDs
Unlike what was thought when spellbook saving and loading was initially implemented, there is not going to be any extra information to store in player spellbooks, seeing as custom spell records have their own record store, so player spellbooks can be simplified.
2018-08-14 08:00:30 +03:00
David Cernat 426187a171 [General] Implement dynamic records, part 1
A new RecordStore class has been implemented, used for saving and loading spell, potion, enchantment, creature, NPC, armor, book, clothing, miscellaneous and weapon record data, as well as accompanying magical effects (for spells, potions and enchantments), inventory items (for creatures and NPCs) and body parts (for armor and clothing). RecordStore data is kept in the new data/recordstore folder.

The OnRecordDynamic event has been implemented in eventHandler, with records received from players first being saved to their associated RecordStores, then being forwarded to players with their new server-set ids, and finally having their associated items added to the players they were received from.

Utility methods for getting and loading RecordStores have been added to logicHandler.

The commands /storerecord and /createrecord have been implemented for on-the-fly record creation.

The help menu has been expanded with examples for creating records.

All records are currently "global", i.e. when players join the server, they receive all the records created on it. This is a temporary, flawed approach that will be replaced with the correct approach in part 2.
2018-07-31 17:46:29 +03:00
David Cernat bbf32a8544 [General] Save and load souls for cell objects and player items 2018-07-26 22:40:26 +03:00
David Cernat 764bb6245d [General] Rename variable i into index in Player and World methods 2018-07-24 23:27:21 +03:00
David Cernat 27af81bb34 [General] Implement weather sync and setting of region authorities 2018-07-21 05:34:25 +03:00
David Cernat b1116ca23d [Player] Reload time when player logs in or registers
This prevents the player from being out of sync after spending too much time at the log in prompt.
2018-07-21 01:55:28 +03:00
David Cernat 4bbc27cbc9 [Player] Don't crash when players have a nil location
This makes it easier to clear all location data.
2018-07-14 20:46:14 +03:00
David Cernat 9500e68461 [Player] Rename Registered() into Register() 2018-07-14 20:10:02 +03:00
David Cernat c3407bac45 [General] Rename refIndex into uniqueIndex
This helps improve clarity by preventing confusion between the refNum and the combination of a refNum and an mpNum that is now called the uniqueIndex.
2018-07-13 04:31:38 +03:00
David Cernat 4f85106acf [Player] Avoid having overly long lines 2018-07-11 03:35:42 +03:00
David Cernat 5ff3d2f0a1 [General] Rename remaining logic-handling myMod into logicHandller 2018-07-11 03:23:21 +03:00
David Cernat fc9d803d99 [General] Remove unnecessary semicolons for consistency 2018-07-07 13:27:15 +03:00
David Cernat 4b3fbd1172 [Player] Use consistent variable name for resurrection timer ID 2018-07-06 02:27:49 +03:00
David Cernat 3b58f1e442 [General] Use suicide as death reason correctly for actors and players 2018-07-06 02:24:08 +03:00
David Cernat 169c93eebd [General] Use new killer script functions to determine death reasons 2018-07-05 22:26:39 +03:00
David Cernat 74f49ea11c [General] Rename questFixer into contentFixer 2018-07-04 21:16:53 +03:00
David Cernat 114c572f95 [General] Simplify storage of summons for players
Additionally, remove them from the players' stored summons when they are deleted from their corresponding cells.
2018-07-03 23:27:21 +03:00
David Cernat 4234d7134d [General] Delete summons of players who disconnect 2018-07-03 21:45:24 +03:00
David Cernat 5bafd596c3 [Config] Implement playersRespawn setting 2018-07-03 01:17:34 +03:00
David Cernat 2ed9302da0 [Player] Use correct log levels for game setting debug 2018-06-27 20:22:58 +03:00
David Cernat b3e13b7e11 [Player] Don't try to set position or rotation if values become nil 2018-06-27 01:28:34 +03:00
David Cernat 775f77201d [General] Add option for sharing map exploration, part 1
Progress in exterior exploration is, as before, always saved to the data files of players. However, if config.shareMapExploration is enabled, that progress is now saved to and loaded from the world's data file instead.
2018-06-26 23:37:22 +03:00
David Cernat 57c4899c4f [General] Update map saving/loading to new system 2018-06-07 12:50:06 +03:00