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

137 commits

Author SHA1 Message Date
David Cernat
538ccf15cf [Client] Use higher interpolation distance for DedicatedPlayers
This makes up for the laggier-looking jumps since the changes to OpenMW's physics system.
2021-10-17 20:14:21 +02:00
David Cernat
3e582199fb [Client] Add createSpellGfx() method to MechanicsHelper
Use it to create spell GFX when adding active spells to dedicated players and actors.
2021-10-16 01:35:30 +02:00
David Cernat
3e81371e53 [General] Fix jump synchronization for players
This had been broken by fr3dz10's physics rewrites from the earlier part of the year that made it so dedicated players were always regarded by the movement solver as being on the ground.
2021-10-09 18:11:57 +02:00
David Cernat
7393e3def6 [General] Add and use getShortDescription() for ESM::Cell
ESM::Cell's getDescription() method was modified by aa5161f99e despite being used heavily by TES3MP. All instances of it in the TES3MP code have now been changed into the newly added getShortDescription() that is identical to the previous getDescription().
2021-09-17 19:14:55 +02:00
David Cernat
3f3fe66fde [General] Track casters of spells in SpellsActive packets
Also simplify sending of SpellsActive packets slightly.
2021-07-21 18:14:31 +02:00
David Cernat
a4b180f65a [Client] Don't send SpellsActive packets for spells received from server 2021-07-06 17:22:19 +02:00
David Cernat
294f64d12d [General] Track timestamps for spells in SpellsActive packets
This makes it possible to remove a specific effect in effect stacks by checking its timestamp.
2021-07-04 12:54:11 +02:00
David Cernat
767287ae51 [General] Track stacking spells in SpellsActive packets 2021-06-10 13:27:52 +02:00
David Cernat
da16c211a4 [Client] Make potion effects work with SpellsActive packets, part 2 2021-06-06 20:18:44 +02:00
David Cernat
b3c40913f6 [Client] Remove 'using namespace std' from multiplayer-related code
This brings TES3MP in line with https://gitlab.com/OpenMW/openmw/-/merge_requests/664
2021-03-20 23:21:40 +02:00
David Cernat
5d7ca14e7e [Client] Set DedicatedPlayer's anim flags when its Ptr is enabled 2020-11-23 16:27:41 +02:00
David Cernat
58c04530e7 [General] Implement PlayerSpellsActive packet, part 2
The packet can now set the active spells of DedicatedPlayers.
2020-11-17 13:00:02 +02:00
David Cernat
30b179c2dd [Client] Add die() method to DedicatedPlayer 2020-11-15 01:30:13 +02:00
David Cernat
cd835104b7 [Client] Add resurrect() method to DedicatedPlayer 2020-11-15 00:44:10 +02:00
David Cernat
1083fa5196 [Client] Reorder DedicatedPlayer's functions 2020-11-14 23:02:30 +02:00
David Cernat
ec2e51825e [Client] Set DedicatedPlayer's dynamic stats when its Ptr is enabled
Previously, players often started out in knockout animations when their Ptrs were first enabled because their fatigue started out at 0 and only updated itself afterwards.
2020-11-11 15:13:14 +02:00
David Cernat
4389d4417a [Client] Add setStatsDynamic() method to DedicatedPlayer 2020-11-11 14:55:55 +02:00
David Cernat
f568220abc [Client] Initialize DedicatedPlayers in placeholder interior cell 2020-08-27 20:05:27 +02:00
David Cernat
c99e20e3b4 [Client] Equip items silently for newly met dedicated players/actors 2020-05-25 21:50:19 +03:00
David Cernat
5ca2c83b02 [Client] Fix additional resurrection problems caused by 6450d84473 2019-12-03 11:42:56 +02:00
David Cernat
446c22723e [General] Set default values for some variables in BasePlayer 2019-12-01 18:42:56 +02:00
David Cernat
1283d5d487 [General] Synchronize TCL state for players
Additionally, only purge temporary levitation effect for DedicatedPlayers if one has been added.
2019-12-01 18:13:24 +02:00
David Cernat
c702eab93c [Client] Fix declarations hiding class members 2019-11-30 12:51:48 +02:00
David Cernat
aa06056d00 [Client] Add createRecord() function to RecordHelper 2019-10-16 13:14:32 +03:00
David Cernat
835ae816a1 [Client] Use a template to combine RecordHelper's existence checks 2019-10-15 08:47:54 +03:00
David Cernat
17020fc13a [Client] Use a template to combine RecordHelper override functions 2019-10-15 07:21:48 +03:00
David Cernat
9350e1d484 [General] Split up Attack packets into Attack and Cast ones
Create an entirely new PlayerCast packet for that purpose, but rename the already existing but unused ActorInteraction into ActorCast.
2019-08-25 09:35:23 +03:00
David Cernat
95a5607509 Add OpenMW commits up to 22 Feb 2019
# Conflicts:
#	CMakeLists.txt
#	apps/openmw/mwmechanics/spellcasting.cpp
#	apps/openmw/mwscript/containerextensions.cpp
2019-08-21 17:29:24 +03:00
David Cernat
0339958e21 [General] Rename Log class into TimedLog 2019-08-19 21:39:33 +03:00
David Cernat
57f84914c3 [Client] Prevent permanent deletion of player markers on cell changes 2019-07-14 22:42:55 +03:00
David Cernat
77952440f6 [Client] Clean up handling of draw states 2019-06-19 08:24:53 +03:00
David Cernat
3effd5f1ff [General] Update positions for dead players on other clients
Dead players will now show up at the correct cell and position for living players, making server scripts that allow players to revive each other much more functional.
2019-03-24 03:52:05 +02:00
David Cernat
f100a660d4 [General] Fix ranged attack sync when using last throwing weapon or ammo 2018-09-24 11:30:53 +03:00
David Cernat
3f304866fd [Client] Use clearer variable names in DedicatedPlayer::setEquipment() 2018-09-24 10:11:42 +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
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
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
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
892d71ce71 [General] Reimplement weather synchronization to allow soft transitions
Although weather sync was added by Koncord to the rewrite in fd721143e2 in a way that used surprisingly few lines of code, it relied on the server requesting weather states every second from authority players and sending them to non-authority players, while also allowing only very sudden weather transitions across regions, i.e. if there was one player in the Ascadian Isles who had stormy weather, and another player with clear weather in the Bitter Coast Region walked across to the Ascadian Isles, that player was instantly made to have stormy weather with no kind of transition at all.

My approach solves both of those problems. It solves the packet spam by only sending weather updates to the server when weather changes happen or when there are new arrivals to a weather authority's region, and it allows for both sudden weather transitions when players teleport to a region and for soft, gradual transitions when players walk across to a region. It is inspired by my previous actor sync, and uses a WorldRegionAuthority packet to set players as region authorities in a similar way to how ActorAuthority sets players as cell AI authorities. Weather changes are created only by the region authority for a given region, and weather packets are also only sent by that authority.

However, it should be noted that gradual weather transitions are used by default in this implementation. To use sudden weather transitions, the serverside Lua scripts need to forward WorldWeather packets with the forceWeather boolean set to true. That is, however, already handled by our default Lua scripts in situations where it makes sense.
2018-07-21 05:20:26 +03:00
David Cernat
59a56ca35e [Client] Disallow clients from scaling their associated players
Additionally, display messages when trying to scale players.
2018-07-12 03:29:38 +03:00
David Cernat
b9520c11da [General] Rework PlayerEquipment packets so they are of minimal size
Moreover, rename BaseNetCreature's equipedItems into equipmentItems.

(cherry picked from commit d1ad0c91f8)
2018-04-20 22:46:16 +03:00
David Cernat
50fe54af5d [Client] Update DedicatedPlayer creature if displayCreatureName changes 2018-04-17 15:23:10 +03:00
David Cernat
a01fc577f1 [Client] Add setAttributes() and setSkills() methods to DedicatedPlayer 2018-04-13 16:59:48 +03:00
David Cernat
716809f2db [Client] Prevent errors from NPC-only packets for DedicatedPlayers 2018-04-13 16:23:42 +03:00
David Cernat
68ee64902d [Client] Track & use previous race & creatureRefId for DedicatedPlayers 2018-04-13 16:16:43 +03:00
David Cernat
acb1335d78 [Client] Make creature disguises update correctly 2018-04-13 11:30:38 +03:00
David Cernat
70f9cb535e [General] Use RecordHelper methods to create and update DedicatedPlayers 2018-04-13 08:37:06 +03:00
David Cernat
72463cfdb6 [Client] Refresh equipment for DedicatedPlayers when setting base info
Additionally, move default fatigue value to DedicatedPlayer initialization.
2018-04-10 19:02:55 +03:00