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

556 commits

Author SHA1 Message Date
David Cernat
16662d772b [General] Synchronize death animations for players 2019-11-29 12:52:47 +02:00
David Cernat
47443e19cb [General] Use compression for string values used in Attack packets 2019-11-29 11:19:24 +02:00
David Cernat
140c1c9c12 [General] Use hard synchronization for melee attack animations
Previously, each client chose its own attack animations for DedicatedPlayers and DedicatedActors based on the direction they were walking in, which however led to desyncs for players with "Always Use Best Attack" enabled and for creatures which pick their attack animations randomly.
2019-11-29 10:39:57 +02:00
David Cernat
b352983348 [General] Include actor refIds in ActorDeath packets 2019-11-27 11:18:08 +02:00
David Cernat
8f7a267129 [General] Add scale and bloodType to creature records in RecordDynamic 2019-11-10 09:20:45 +02:00
David Cernat
afb9bd7eb5 [General] Implement script records for RecordDynamic packets 2019-11-09 21:34:09 +02:00
David Cernat
20d1e7654c [General] Create SystemPacket category and move Handshake packet to it 2019-11-09 05:12:00 +02:00
David Cernat
b97322b4b1 [General] Modernize packet style for PlayerInventory 2019-10-26 14:01:08 +03:00
David Cernat
cbe58b1c24 [General] Modernize packet style for PlayerFaction 2019-10-26 11:42:40 +03:00
David Cernat
0e94eb8b74 [General] Use regular ints for weather states for consistency w/ OpenMW 2019-10-24 20:08:08 +03:00
David Cernat
904f804ea2 [General] Modernize packet style for PlayerSpellbook 2019-10-24 19:27:37 +03:00
David Cernat
4f9e6b0e3e [General] Modernize packet style for PlayerCellState 2019-10-23 17:46:21 +03:00
David Cernat
96a71c1ced [General] Modernize packet style for PlayerBook 2019-10-23 02:02:27 +03:00
David Cernat
d66bca8605 [General] Modernize packet style for PlayerTopic 2019-10-23 01:24:13 +03:00
David Cernat
0206d1813c [General] Modernize packet style for PlayerQuickKeys 2019-10-21 16:55:21 +03:00
David Cernat
4f98d67ed4 [General] Modernize packet style for PlayerJournal 2019-10-21 07:01:36 +03:00
David Cernat
d163f1b6da [General] Turn WorldKillCount into a Worldstate packet
Rename the old WorldKillCount that was a Player packet into PlayerPlaceholder. Rename the unused CellCreate that was a Worldstate packet into WorldKillCount. On the server, move kill count-related script functions from QuestFunctions to WorldstateFunctions.
2019-10-08 11:09:08 +03:00
David Cernat
031acffcbe [General] Implement cell records for RecordDynamic packets, part 1
New interior cells can be now be created that are either blank or based on existing interior cells.
2019-09-28 13:12:48 +03:00
David Cernat
0d51eb5b23 [General] Use unsigned ints for refNums & mpNums in packets 2019-09-19 08:44:33 +03:00
David Cernat
e424bd9bc3 [General] Implement ClientScriptSettings packet, part 2
The packet can now set which client globals get packets sent about them when their values change on clients.
2019-09-14 09:37:19 +03:00
David Cernat
3acfbad55d [General] Implement ClientScriptSettings packet, part 1
For starters, the new packet can set which client scripts have all of their variables synchronized between players. The previous hardcoded list of IDs for synchronized scripts has been removed.
2019-09-09 10:28:35 +03:00
David Cernat
25e27ccb95 [General] Use placeholder packet ID for unused CellCreate packet 2019-09-09 10:22:20 +03:00
David Cernat
95967ea289 [General] Rename unused ObjectReset packet into ObjectHit 2019-09-01 08:30:03 +03:00
David Cernat
9b1fbcc6f9 [General] Use correct packet ID in PacketActorCast 2019-08-28 06:35:19 +03:00
David Cernat
e15428e139 [General] Remove "created by" stamps added by IntelliJ 2019-08-26 12:33:28 +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
0339958e21 [General] Rename Log class into TimedLog 2019-08-19 21:39:33 +03:00
David Cernat
ab93b5ddc5 [General] Use PlayerItemUse packets when using items through quick keys 2019-08-16 05:50:07 +03:00
David Cernat
ae5200cbb2 [General] Implement light records for RecordDynamic packets 2019-08-14 21:10:53 +03:00
David Cernat
14af0be657 [General] Include AI alarm & flee for creatures/NPCs in RecordDynamic 2019-08-07 11:21:22 +03:00
David Cernat
ef432d1419 [General] Include AI services for creatures/NPCs in RecordDynamic 2019-08-07 10:44:07 +03:00
David Cernat
18e2a14645 [General] Implement tool-related records for RecordDynamic packets 2019-08-04 17:53:18 +03:00
David Cernat
4100d93dea [General] Implement ingredient records for RecordDynamic packets 2019-08-03 06:19:22 +03:00
David Cernat
247d2fad30 [General] Implement activator & static records for RecordDynamic packets 2019-08-01 09:48:57 +03:00
David Cernat
e9336e53fc [General] Implement container and door records for RecordDynamic packets 2019-07-27 03:45:50 +03:00
David Cernat
4183373f53 [General] Update credits 2019-07-20 15:13:10 +03:00
David Cernat
ef68a72ba6 [General] Set hasCellData to true for PacketConsoleCommand 2019-07-19 20:10:28 +03:00
David Cernat
1b1ce1b27a [General] Change version to 0.7.1 2019-07-17 13:39:50 +03:00
uramer
6cb4d5ec35 [General] Implement CellReset packet, stage 1 2019-03-24 13:23:13 +01:00
David Cernat
03d377ec54
Merge pull request #518 from TES3MP/0.7.0-alpha
[General] Rename CellReplace packet into CellReset
2019-03-22 21:36:07 +02:00
David Cernat
8ff2d1b829 [General] Rename CellReplace packet into CellReset 2019-03-22 21:33:34 +02:00
David Cernat
cb82318c36 [General] Fix problems with Utils::getArchitectureType() 2019-03-22 03:09:11 +02:00
David Cernat
828c52138f [Documentation] Update readme and credits
According to some legal advice I've received, the "TES3MP Team" is too ambiguous of a legal entity, so – with Koncord's agreement – the copyright is now assigned specifically to us, the project's developers.
2019-02-19 17:29:29 +02:00
David Cernat
69e7d3f2a7 [Documentation] Update credits 2019-02-14 13:07:54 +02:00
David Cernat
c058dce346 [General] Clarify meaning of commit hash displayed on start 2019-01-31 13:39:06 +02:00
David Cernat
e96091fd6b [General] Use more consistent variable names for password, address, etc. 2018-12-30 17:23:12 +02:00
David Cernat
9fe54aa8c6 [General] Add getArchitectureType() to multiplayer Utils
Additionally, rename getOperatingSystem() into getOperatingSystemType() for clarity.
2018-12-17 11:46:51 +02:00
David Cernat
da6b89c185 [General] Add getOperatingSystem() to multiplayer Utils 2018-12-17 10:47:34 +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
995d20348f [General] Always use correct ranged weapon & ammo for ranged attack sync
Previously, the player's currently selected weapon was being used in ranged attacks as in the original melee-oriented attack sync, which meant that shooting one type of projectile and then equipping another while the old projectile was still in the air turned the old projectile into the new projectile upon impact.

Additionally, avoid running most of the code in MechanicsHelper::assignAttackTarget() for non-hitting melee and ranged attacks.
2018-09-23 02:30:31 +03:00
David Cernat
db39c62e89 [Documentation] Update credits 2018-09-21 10:23:54 +03:00
David Cernat
b5f46ada73 [General] Synchronize projectile speed for ranged attacks
This is done by including the final attackStrength used for ranged attacks in packets and then applying it in WeaponAnimation::releaseArrow() on other clients.
2018-09-18 01:13:48 +03:00
David Cernat
fcd31bf4a6 [General] Fix problems with the synchronization of ranged attacks
Projectile hits now send Attack packets with RANGED attacks, and their success or failure is now synchronized.

Strike enchantments no longer require a valid victim to be synchronized.

Additional debug messages have been added for attacks.
2018-09-11 11:56:45 +03:00
David Cernat
8012d0d7b7 [General] Include hit position in PlayerAttack and ActorAttack packets 2018-09-08 05:29:49 +03:00
David Cernat
3bd8aa82fe [General] Reduce inventory-sending hooks to just 2 in ContainerStore
Whenever an item is added to or removed from the player's ContainerStore, that player sends a PlayerInventory packet with just that addition or removal.

This eliminates all the unnecessary packet spam related to oversized PlayerInventory packets that had existed in one form or another since the initial implementation of inventory sync in 1b259e2d33

Additionally, move booleans from BasePlayer to LocalPlayer when they are only needed on the client, and make the usage of the isReceivingQuickKeys boolean consistent with the new isReceivingInventory boolean by having them both in the processors of their associated packets.
2018-08-28 05:01:52 +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
David Cernat
8c40010c87 [General] Add missing inventoryBaseId to creatures in RecordDynamic 2018-07-30 10:59:03 +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
2dbf3893c0 [General] Compress item refIds in PlayerEquipment packets 2018-07-28 01:50:44 +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
c3ff273a22 [General] Add getVectorSize() and resetVector() to Utils 2018-07-26 20:01:58 +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
ea8a41160c [General] Make ActorAttack packet consistent with PlayerAttack
Additionally, fix a typo in PlayerAttack where a boolean argument was outside of the parentheses it should have been in.
2018-07-24 22:43:00 +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
3165c84db4 [General] Rework PACKET_ORIGIN enum
Additionally, comment out reading of originClientScript in ObjectPacket for now.
2018-07-22 22:43:40 +03:00
David Cernat
9e6459043b [General] Fix typo related to originClientScript in ObjectPacket 2018-07-22 20:29:27 +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
715cac807d [General] Add compareFloats to Utils 2018-07-22 15:23:23 +03:00
David Cernat
cb6c37a26d [General] Replace doubles with floats in BaseStructs and BaseWorldstate 2018-07-22 14:20:20 +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
20e0100706 [General] Rework Attack packets and add synchronization for item magic 2018-07-21 14:41:27 +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
9823a77bf2 [General] Turn PlayerRegionAuthority into WorldRegionAuthority
WorldRegionAuthority is a Worldstate packet.
2018-07-17 09:21:13 +03:00
David Cernat
72d286473b [General] Move credits integrity error message to new ErrorMessages file
Additionally, use correct log level for credit integrity message on server.
2018-07-16 03:21:14 +03:00
David Cernat
0b5cb15f71 [General] Turn GameWeather into WorldWeather, now a WorldstatePacket 2018-07-16 02:20:43 +03:00
David Cernat
646111d998 [General] Use correct credits checksum and move it to Version.hpp 2018-07-16 01:05:56 +03:00
David Cernat
22b2b7a9c6 [General] Add Utils methods for checksums 2018-07-15 22:39:57 +03:00
David Cernat
3649cf553f [General] Rename PlayerKillCount into WorldKillCount
This should clarify the real meaning of the packet and its associated event.

The event itself has been renamed from OnPlayerKillCount to OnWorldKillCount.
2018-07-15 05:34:59 +03:00
David Cernat
6ebe09375f [General] Implement ObjectActivate packet & associated script functions 2018-07-15 03:16:04 +03:00
David Cernat
81b160cae8 [General] Add placeholder for ObjectActivate packet 2018-07-15 01:08:31 +03:00
David Cernat
61da0d2475 [General] Turn PlayerInteraction into PlayerInput 2018-07-15 00:36:07 +03:00
David Cernat
32b6134fad [General] Add placeholder for CellReplace packet 2018-07-15 00:17:13 +03:00
David Cernat
a471f5e452 [General] Turn CellCreate into a Worldstate packet 2018-07-14 23:51:49 +03:00
David Cernat
ae55ee7f0b [General] Add getNumberOfDigits to Utils in components 2018-07-14 23:51:49 +03:00
David Cernat
528bd26a3b [General] Allow followers to follow non-authority players through cells 2018-07-13 21:27:29 +03:00
David Cernat
09da24f1ea [General] Rename all instances of refNumIndex into refNum
This creates symmetry with mpNum and should cause less confusion in the future.
2018-07-13 04:12:03 +03:00
David Cernat
bdf2f03c4f [General] Remove unnecessary MapChanges struct from BaseWorldstate 2018-07-12 05:06:31 +03:00
David Cernat
ceea65f666 [General] Change pre-rewrite's version to 0.7.0-alpha 2018-07-11 19:35:28 +03:00
David Cernat
bff6e9e235 [General] Implement ActorAI packet, part 5
Allow repetition for AiWander package to be turned on and off.
2018-07-10 23:18:32 +03:00
David Cernat
00c13ae96c [General] Implement ActorAI packet, part 4
The server can now make actors activate players and objects, at least in theory. In practice, OpenMW''s AiActivate package needs to be worked so it allows specific objects as targets instead of just refIds.
2018-07-10 07:07:37 +03:00
David Cernat
0e13207afe [General] Implement ActorAI packet, part 3
The server can now cancel actor AI, make actors travel to a location, make actors wander, and make actors get escorted by a player or another actor.
2018-07-10 05:07:58 +03:00
David Cernat
5baef09f79 [General] Implement ActorAI packet, part 2
The server can now make actors start combat with players or other actors.
2018-07-10 02:47:52 +03:00
David Cernat
3ed9d89280 [General] Use separate variables for video & music filenames in packets 2018-07-07 14:40:35 +03:00
David Cernat
c075496748 [General] Replace deathReason in death packets with a killer variable
Add serverside script functions for determining the killers of both players and actors.

Use unsigned ints for script functions returning an object or actor's refNumIndex or mpNum.

Remove updateDeadState() from LocalPlayer and make its code part of updateStatsDynamic() for simplicity.
2018-07-05 22:24:51 +03:00
David Cernat
f02492a593 [General] Temporarily include target names in mwmp::Target
These will be removed once the server can get the names matching refIds by reading content files.
2018-07-05 19:40:28 +03:00
David Cernat
32ad8ef2f0 [General] Fix incorrect capitalization in ObjectMove directives 2018-07-05 06:07:10 +03:00
David Cernat
bbb461a5e5 [General] Make sure data in guiMessageBox is compressed 2018-07-05 02:56:32 +03:00
Koncord
79903c455c [General] Allow different types for vectorContains 2018-07-04 01:31:45 +08:00