1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 23:19:56 +00:00
Commit graph

16293 commits

Author SHA1 Message Date
David Cernat
5bd2244898 [Client] Uninitialize DedicatedActors instantly in some situations
When LocalActors briefly become DedicatedActors as the result of a server script, the DedicatedActors are immediately uninitialized to avoid bugs like them jumping in place or rotating slightly.

Additionally, the playing of animations and sounds received in packets for DedicatedActors is no longer done during their next update, but is instead done instantly when the packets are received.
2018-08-16 03:50:41 +03:00
David Cernat
5fd4113978 [General] Implement sending of ActorSpeech packets from server scripts 2018-08-13 20:39:03 +03:00
David Cernat
338efdb705 [General] Fix issues with MechanicsHelper::getItemPtrFromStore() 2018-08-11 19:00:02 +03:00
David Cernat
aec0c5bd49 [Server] Make capitalization consistent for AI-related script functions 2018-08-11 18:57:36 +03:00
David Cernat
9598212aad [Client] Don't add bound items to inventory as a result of item packets
Additionally, don't include bound items when sending PlayerInventory packets.
2018-08-11 16:05:37 +03:00
David Cernat
a3b9274365 [Client] Make it possible to check if an item ID belongs to a bound item 2018-08-11 16:02:09 +03:00
David Cernat
a1933e7bc2 [Client] Don't declare variable twice in LocalPlayer's setEquipment()
The variable equipmentItem is identical to currentItem, so it should not have been added in commit 58a6a8c3bc

Addditionally, use a more descriptive variable name than "a" for item Ptrs.
2018-08-11 15:28:03 +03:00
David Cernat
5d66a9bb66 [Client] Fix path to MechanicsHelper in ProcessorPlayerItemUse 2018-08-09 22:33:22 +03:00
David Cernat
8df08c7d10 [General] Implement PlayerItemUse packet
Players can no longer unilaterally use items on themselves in their inventory. When they try to use an item, they send a PlayerItemUse packet to the server with the item's details. A serverside script can then check the item and either send the packet back to make the item use go through or drop it.
2018-08-09 18:25:20 +03:00
David Cernat
888e1dfff8 [General] Allow setting of AI fight & dynamic stats in record packets
Additionally, allow the setting of the Autocalc flag for an NPC record based on an existing record.
2018-08-05 11:00:25 +03:00
Koncord
d03722b3f4 [Browser] Rework browser for improved stability & clarity
(cherry picked from commits 5c79e7106f, 57353cdfff, 15723adb9a, 01a5196a92, ed75563a94, 3839a2dcfd, 1fd16ba69c, 66283943c5, ba8613a179, 5b8f4f3e92, 35b771b19e, 043eb224e2, 05fac2f67d)
2018-08-05 07:20:12 +03:00
David Cernat
6498bcb22b [Server] Add script functions for getting player draw & sneak states 2018-08-03 18:26:44 +03:00
David Cernat
b57807407a [General] Implement RecordDynamic packet, part 1
Spell, potion, enchantment, creature, NPC, armor, book, clothing, miscellaneous and weapon record data can now be sent in a RecordDynamic packet. Additionally, the packets include data related to associated magical effects (for spells, potions and enchantments), data related to default inventory contents (for creatures and NPCs) and data related to body parts affected (for armor and clothing).

The server now has associated script functions for setting most of the details of the above, with the main exception being individual creature and NPC stats.

Records can either be created entirely from scratch or can use an existing record (set via the baseId variable) as a starting point for their values. In the latter case, only the values that are specifically set override the starting values. Creature and NPC records also have an inventoryBaseId that can be used on top of the baseId to base their inventories on another existing record.

The client's RecordHelper class has been heavily expanded to allow for the above mentioned functionality.

When players create spells, potions and enchantments as part of regular gameplay, they send RecordDynamic packets that provide the server with the complete details of the records that should be created. When they create enchantments, they also provide the server with armor, book, clothing and weapon records corresponding to the items they've enchanted.

This functionality added by this packet was originally supposed to be exclusive to the rewrite, but I've gone ahead and tried to provide it for the pre-rewrite in a way that can mostly be reused for the rewrite.
2018-07-30 10:56:26 +03:00
David Cernat
2332423527 [Client] Fix extra qualification error in CellRef when compiling w/ GCC 2018-07-27 21:56:45 +03:00
David Cernat
7136329a94 [Client] Add World::updatePtrsWithRefId() method
This makes it possible to "reload" the Ptrs in active cells when changes happen to the ESM record that they are based on. In practice, the old Ptrs are deleted, their RefNums and MpNums are blanked out, and new Ptrs are created that use the same RefNum and MpNum as before.

The above has required me to also add a method called setRefNum() to CellRef to allow setting a RefNum on the fly.

There may be a more elegant implementation available for updatePtrsWithRefIds(), but it requires additional research.
2018-07-27 21:42:08 +03:00
David Cernat
9497c7f6f2 [Client] Add back mistakenly removed setting of mpNums for spawns 2018-07-27 00:36:05 +03:00
David Cernat
25fcd09780 [Client] Add doesNpcExist() method to RecordHelper 2018-07-26 23:57:42 +03:00
David Cernat
7995466e3c [Client] Check validity of refIds in ObjectSpawn packets
This reverts c7bcf70c32 because it provides a better solution to the problem solved there, while solving another related problem as well.
2018-07-26 23:57:22 +03:00
David Cernat
8d286657d4 [Client] Update messages when unilaterally creating custom objects 2018-07-26 23:32:31 +03:00
David Cernat
c7bcf70c32 [Client] Ignore ObjectSpawn packets trying to spawn non-actors 2018-07-26 22:41:04 +03:00
David Cernat
d93b67ef21 [General] Sync soul refIds for items and add related script functions 2018-07-26 22:37:04 +03:00
David Cernat
f52364e05c [Client] Always create new references for new creature disguises
Previously, attempts to reuse the same reference for multiple creature disguises led to movement animation issues, as well as a dynamic_cast error in Creature::getInventoryStore() that made a DedicatedPlayer vanish completely when they first lost their creature disguise, then disguised themselves as a creature that could not hold weapons and then disguised themselves as a creature that could hold weapons.
2018-07-26 21:08:12 +03:00
David Cernat
60bc7447d9 [Client] Rework RecordHelper and add methods for other record types
The usage of const_cast has been replaced with usage of MWWorld::getModifiableStore() and ESMStore::overrideRecord()

Methods whose names started with "update" now start with "override", for consistency with ESMStore's overrideRecord()

New methods have been added for "overriding" enchantment, potion and spell records, which actually leads to them being created with their already set refIds if they haven't been created yet, as per the description of ESMStore::overrideRecord(): "Insert a record with set ID, and allow it to override a pre-existing static record."

Usage of RecordHelper methods has been updated in DedicatedPlayer.
2018-07-26 21:01:59 +03:00
David Cernat
4e78642273 [Client] Add getModifiableStore() to MWWorld 2018-07-26 20:05:36 +03:00
David Cernat
d778bc3b8a [Server] Turn readWorldstate and writeWorldstate into static variables 2018-07-26 20:03:42 +03:00
David Cernat
b4802e4201 [General] Use Time struct for time in BaseWorldstate 2018-07-26 19:01:27 +03:00
David Cernat
a4b588d1b5 [General] Add optional timestamps to journal entries in PlayerJournal 2018-07-26 04:36:12 +03:00
David Cernat
b79221efcc [Server] Rename variable i into index in ActorFunctions 2018-07-24 21:29:40 +03:00
David Cernat
8fbed1f808 [General] Remove custom data from PlayerSpellbook packet
It has never made sense to have custom spell data in PlayerSpellbook packets, so it has been removed.
2018-07-24 20:58:55 +03:00
David Cernat
2e0b6e4e3e [Server] Rename variable i into index in script function arguments
Additionally, rename i into index in LangLua.
2018-07-24 20:14:51 +03:00
David Cernat
65de028e0d
Merge pull request #462 from OpenMW/master
Add OpenMW commits up to 23 Jul 2018
2018-07-23 23:19:17 +03:00
David Cernat
74fa1d0f01 [Client] Fix manual setting of inertial force
Actors who are on the ground have their inertial force ignored, so they are now made to not be regarded as being on the ground in World::setInertialForce()
2018-07-23 23:04:41 +03:00
David Cernat
b69e6b96e6 [Client] Use verbose logging level for LocalActor debug 2018-07-23 22:11:59 +03:00
David Cernat
36ac2d9de4 [Client] Set packetOrigin for all ObjectList packets sent 2018-07-23 01:39:43 +03:00
David Cernat
692ee01340 [Client] Add ScriptController w/ contextType-to-packetOrigin method 2018-07-23 00:48:23 +03:00
David Cernat
63a86f145d [Client] Record type of each InterpreterContext for later checking 2018-07-23 00:46:07 +03:00
David Cernat
d4a84ac34a [Server] Update script function descriptions for ObjectList origin 2018-07-22 23:08:32 +03:00
David Cernat
3dc2d1b214 [General] Add packetOrigin and originClientScript to ObjectList packets
Additionally, add script functions for getting the packetOrigin and originClientScript of received ObjectList packets.
2018-07-22 18:38:05 +03:00
David Cernat
b891acd46e [Client] Send Container packets when items are added/removed via scripts
Additionally, disable unilateral addition and removal of items on clients, and expect the server to reply back with an approved addition or removal.
2018-07-22 17:04:17 +03:00
David Cernat
2189ea1a63 [Client] Clean up sending of Container packets 2018-07-22 16:43:27 +03:00
David Cernat
8c0b75d9f4 [Client] Limit PlayerEquipment packets sent by recharging enchantments 2018-07-22 15:30:40 +03:00
David Cernat
18f8725d33 [Client] Remove tab character that somehow made its way into a comment 2018-07-22 10:29:14 +03:00
David Cernat
038757b91a [General] Temporarily revert to original rotation animation sync
I originally added rotation animation sync as part of commit 068a45be87. Unfortunately, it meant the PlayerPosition packets were now twice as large as they had been before, which was less than ideal for such a frequently sent packet, which is why Koncord switched to a more optimized approach in commits 5f30dfd5db and d67db1a9bd.

Recently, there have since been some rotation animation problems in OpenMW, which have broken the way Koncord's approach looks. My original approach still looks somewhat okay, so I'm switching back to it until we can figure out how to reuse it under the current circumstances.
2018-07-21 19:27:36 +03:00
Marc Zinnschlag
ddd5cbd17c Initialise lock state of newly opened subviews (fixes issue #4520) 2018-07-21 17:38:11 +02:00
David Cernat
3944c8aec6 [Client] Ignore WorldRegionAuthority packets that have an empty region 2018-07-21 18:28:31 +03:00
David Cernat
99e64bdcd7 [Client] Remove unused localWeather variable from Worldstate 2018-07-21 16:25:49 +03:00
David Cernat
cd1fc590a7 [Client] Differentiate itemPtr from actor Ptr in DedicatedPlayer method
This fixes a mistake from 8f7da49152
2018-07-21 16:14:07 +03:00
David Cernat
5466092582 [Client] Reduce log level for actor cell changes 2018-07-21 14:41:48 +03:00
David Cernat
20e0100706 [General] Rework Attack packets and add synchronization for item magic 2018-07-21 14:41:27 +03:00
David Cernat
0f0e8b7c08 [Client] Adjust log levels used for weather and global map 2018-07-21 12:08:31 +03:00