Commit Graph
34 Commits
Author SHA1 Message Date
SchnibbselandGitHub 5c6055c864 Update logicHandler.lua 2018-10-11 09:52:58 +02:00
David Cernat a68ce6b6c7 [LogicHandler] Always allow admins to use console without kicking them 2018-10-10 20:15:02 +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 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 6684326e5e [General] Rename BaseWorld's loadedRegions into storedRegions
There was a discrepancy in the meaning of "loaded" between the LoadedCells table and BaseWorld's loadedRegions table. The former contained only currently loaded cells, while the latter contained all the regions that had ever been loaded since the start of the server. To remove the inconsistency, the latter has been renamed.
2018-08-27 23:16:01 +03:00
David Cernat 2ab7ec43df [General] Add /regions command to display loaded regions & authorities
Additionally, clean up guiIds.
2018-08-27 22:13:31 +03:00
David Cernat a3a61e11af [LogicHandler] Print chat names for players loading/unloading regions 2018-08-26 07:29:50 +03:00
David Cernat 4c6baf93cf [General] Move code for reading effects to new PacketReader 2018-08-13 06:23:08 +03:00
David Cernat 13acf0e097 [PacketBuilder] Rename AddAIActorToPacket into AddAIActor 2018-08-12 06:12:37 +03:00
David Cernat a0ae5016f6 [General] Rework arguments for AI data & packet methods 2018-08-12 05:43:41 +03:00
David Cernat 857248e57d [General] Reuse disallowedNameStrings for custom item names
Players are not just prevented from using certain strings in their own names, but also prevented from using them in the names of the items they create through regular gameplay.

logicHandler's IsPlayedNameAllowed method has been renamed into IsNameAllowed to reflect the change.
2018-08-12 03:27:57 +03:00
David Cernat 999ac67cb8 [General] Add config option for coloring Admin and Mod denoters in chat
Change the order of requires in serverCore so that colors are loaded before the config.

Update wording in logicHandler.CreateObjectAtLocation() description so it refers to an object list instead of an event.
2018-08-05 20:56:30 +03:00
David Cernat 27fff5ce9f Merge branch '0.7.0' of https://github.com/TES3MP/CoreScripts into 0.7.0 2018-08-01 23:50:07 +03:00
David CernatandGitHub 66c1c00e3c Merge pull request #44 from Atkana/0.7.0
Make CreateObjectAtLocation and CreateObjectAtPlayer return uniqueIndex of created item
2018-07-31 19:07:51 +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
AtkanaandGitHub ebfcb9ccd9 Make CreateObjectAtLocation and CreateObjectAtPlayer return uniqueIndex of created item 2018-07-30 09:13:15 +01:00
David Cernat 943f2bfabc [LogicHandler] When authority is gone, give it to lowest ping visitor 2018-07-27 01:35:05 +03:00
David Cernat c5d6f5a204 [General] Set cell description in initialization instead of logicHandler 2018-07-26 22:42:43 +03:00
David Cernat cff423fc6f [LogicHandler] Add IsPlayedAllowedConsole() and IsPacketFromConsole()
Additionally, declare packetOriginEnums as a local in DoesPacketOriginRequireLoadedCell()
2018-07-23 21:04:18 +03:00
David Cernat 95b4849d95 [General] Save certain data to unloaded cells if its origin is valid
More specifically, Container, ObjectState and ObjectLock packets that were sent as a result of clientside dialogue or global scripts will be saved to serverside cell data.

With the new container sync that requires all items to be stored in the serverside cell data before they can be removed by clients, quests adding items to containers such as the Thieves Guild's "Loot the Mages Guild" were broken. This commit fixes them.
2018-07-23 06:57:58 +03:00
David Cernat 850a5bbe16 [General] Ignore empty regions when setting region authority 2018-07-21 18:27:27 +03:00
David Cernat 27af81bb34 [General] Implement weather sync and setting of region authorities 2018-07-21 05:34:25 +03:00
David Cernat 403aed98b7 [Config] Add config.pingDifferenceRequiredForAuthority option 2018-07-17 23:34:45 +03:00
David Cernat 54b857a037 [LogicHandler] Remove TestFunction 2018-07-17 02:23:00 +03:00
David Cernat 61ed6ac15f [LogicHandler] Avoid saving AI packages with ACTIVATE action 2018-07-15 03:32:47 +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 482c66338b [General] Update script functions to use RefNum instead of RefNumIndex
Although the old functions still work, the ones without the word "Index" in them help provide more clarity through symmetry with the MpNum functions.
2018-07-13 04:15:58 +03:00
David Cernat fa1286f3a3 [General] Replace deprecated actor and object list functions w/ new ones 2018-07-13 01:38:57 +03:00
David Cernat fc3141369a [LogicHandler] When setting AI for actors, send packet to all visitors 2018-07-11 22:18:01 +03:00
David Cernat 8037b6f940 [General] Clean up AI-setting and save AI packets to cell object data 2018-07-11 20:18:28 +03:00
David Cernat 49aa163630 [LogicHandler] Avoid having overly long lines 2018-07-11 03:26:53 +03:00
David Cernat 5ff3d2f0a1 [General] Rename remaining logic-handling myMod into logicHandller 2018-07-11 03:23:21 +03:00