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

1072 commits

Author SHA1 Message Date
David Cernat
21c8821d05 [General] Ignore carriage returns in resources/version file 2019-12-03 13:21:10 +02:00
David Cernat
5ca2c83b02 [Client] Fix additional resurrection problems caused by 6450d84473 2019-12-03 11:42:56 +02:00
David Cernat
eeb3e4f938 [Client] Reset friendly hits when summoning a creature 2019-12-02 23:29:36 +02:00
David Cernat
753e310dd4 [General] Implement PlayerTeam packet 2019-12-02 19:08:03 +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
7120f41cfa [Client] Add creatures to summoner's creature map when they are missing
Additionally, adjust logging related to summons.
2019-12-01 15:02:04 +02:00
David Cernat
985d1f17e0 [Client] Use correct magnitude for active effect created for summons 2019-12-01 14:58:06 +02:00
David Cernat
d78bdefc01 [General] Include effect and spell ID for summons in ObjectSpawn packets 2019-12-01 13:31:11 +02:00
David Cernat
64c94346b6 [Client] Always send attack starts by actors immediately
Previously, creatures with fast attack animations would have their attack updated right after being started, which happened so quickly that it prevented the attack start from actually being sent by the client.
2019-11-30 15:50:05 +02:00
David Cernat
ed7fe859dd [Client] Set attackingOrSpell state instantly after Attack/Cast packets
It is no longer necessary to wait for the Actors::update() loop to set dedicated players and actors to their new states.
2019-11-30 15:03:51 +02:00
David Cernat
c702eab93c [Client] Fix declarations hiding class members 2019-11-30 12:51:48 +02:00
David Cernat
23d410f473 [General] Implement body part records for RecordDynamic packet 2019-11-29 14:06:17 +02:00
David Cernat
b3747839c0 [General] Add hasRace to record overrides in RecordsDynamic packet 2019-11-29 13:28:07 +02:00
David Cernat
16662d772b [General] Synchronize death animations for players 2019-11-29 12:52:47 +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
5a46b40e1a [Client] Stop switching drawstates when receiving ActorAttack packets
Previously, some of the spammier ActorAttack packets were overriding spellcasting animations with weapon attack animations.
2019-11-28 19:53:34 +02:00
David Cernat
ef944aa050 [Client] Remove unused redeclarations of localActors & dedicatedActors 2019-11-28 13:00:20 +02:00
David Cernat
06b4a4f97c [Client] Don't tie spellcasting for dedicated players/actors to anim end
When Koncord implemented spellcasting, he made it so only the act of initiating a spellcast was synchronized, leaving it to other clients to actually cast a spell for a dedicated player or actor once their spellcasting animation was over. This had led to a lot of desyncs and has always been inconsistent with the handling of attacks, so I've belatedly gone ahead and prevented the end of a spellcasting animation from having any effect for dedicated players and actors, making them cast a spell when an appropriate Cast packet is received from them instead.

Additionally, the logged messages in MechanicsHelper's handling of attacking and casting have been moved around slightly.
2019-11-28 10:34:34 +02:00
David Cernat
bbf9f20053 [Client] Stop sending WorldKillCount packets or incrementing local kills
This means the server scripts are now required to send a WorldKillCount packet as a reply to ActorDeath packets sent by clients. This gives the server full control over which kills are counted, while also solving the previous problem of kills being counted only for actors that had finished their death animations.
2019-11-27 11:21:29 +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
bde9f7b817 Add OpenMW commits up to 20 Oct 2019
# Conflicts:
#	apps/openmw/mwgui/recharge.cpp
#	apps/openmw/mwrender/globalmap.cpp
#	apps/openmw/mwrender/globalmap.hpp
#	apps/openmw/mwworld/inventorystore.cpp
2019-10-29 22:26:35 +02:00
David Cernat
adcac2675a [Client] Fix warnings related to destructors for processors 2019-10-26 16:43:08 +03:00
David Cernat
c9f3ee1819 [Client] Make PlayerResurrect use new resurrection handling from 6450d84473 2019-10-26 09:12:06 +03:00
Koncord
a74bf1baec [Client] Mark derived processor classes as final
(cherry picked from commit 7748e582a8)
2019-10-24 22:16:17 +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
1ab5916078 [Client] Reorder RecordHelper's overrideRecord() methods alphabetically 2019-10-17 06:58:56 +03:00
David Cernat
520cedb553 [Client] Use overrideRecord name for related functions in RecordHelper 2019-10-16 18:05:52 +03:00
David Cernat
2fc50d7280 [Client] Fix includes for RecordHelper 2019-10-16 15:34:25 +03:00
David Cernat
aa06056d00 [Client] Add createRecord() function to RecordHelper 2019-10-16 13:14:32 +03:00
David Cernat
13deaa88f2 [Client] Fix typo in code used for setting creature base inventories 2019-10-15 08:49: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
d113f81237 [Client] Set correct worldspace for cell overrides in RecordHelper 2019-10-13 13:42:03 +03:00
David Cernat
02bca3f52d [Client] Fix if check in ObjectList::setMemberShorts() 2019-10-11 21:53:53 +03:00
David Cernat
19418f4953 [Client] Don't ignore entire Actor packet if one actor can't be found 2019-10-11 21:29:21 +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
339428872e [Client] Fix infinite loop in CellController
Previously, using CellController::getCellStore() to get an unloaded CellStore would make its references get loaded in the process, with the CellStore's loadRefs() then running updateMergedRefs(), which in turn – before getting as far as setting the CellStore's state to State_Loaded – would call CellController::hasLocalAuthority() on its accompanying ESM::Cell, which would then run CellController::isActiveWorldCell(), which would then run CellController::getCellStore() to get the CellStore again, which – still being marked as unloaded – would run the whole loop again... and again.
2019-09-23 21:18:38 +03:00
David Cernat
d4df2948dd [Client] Use clearer wording for comment in GUIController 2019-09-23 20:30:33 +03:00
David Cernat
6828d83a42 [Client] Always hash input for password dialogs
Additionally, clean up repetitive code in GUIController.
2019-09-21 14:26:02 +03:00
David Cernat
cc25612b8d Add OpenMW commits up to 18 Sep 2019
# Conflicts:
#	apps/openmw/mwclass/container.cpp
#	apps/openmw/mwclass/door.cpp
#	apps/openmw/mwmechanics/security.cpp
#	apps/openmw/mwmechanics/spellcasting.cpp
#	apps/openmw/mwscript/miscextensions.cpp
2019-09-18 23:46:08 +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
ca67587b89 Add OpenMW commits up to 5 Sep 2019
# Conflicts:
#	apps/openmw/mwgui/container.cpp
#	apps/openmw/mwmechanics/actors.cpp
#	apps/openmw/mwworld/worldimp.hpp
2019-09-05 21:41:50 +03:00
David Cernat
190c404b38 [Client] Calculate spell success in more appropriate place
Previously, creatures with fast spellcasting animations would cast their spells before their success had actually been calculated, causing them to fail.
2019-09-02 23:50:56 +03:00
David Cernat
95967ea289 [General] Rename unused ObjectReset packet into ObjectHit 2019-09-01 08:30:03 +03:00
David Cernat
6dccdfe0c1 [Client] Load up TES3MP's settings in the same map as OpenMW's settings
This allows the "font size" property to be read when the chat window is created.
2019-08-28 06:37:33 +03:00
David Cernat
3a1e3cf0f5 [Client] Prevent chat key from switching to chat window while in console 2019-08-27 15:23:12 +03:00
David Cernat
a9f1481e5c [Client] Revert changes to key focus setting as per 56539fee4f 2019-08-27 15:22:11 +03:00
David Cernat
a52d32602d [Client] Fix code style in PlayerList 2019-08-27 09:29:43 +03:00
David Cernat
3e1c96a49c [Client] Fix crash by not trying to enable markers for invalid players 2019-08-26 21:10:02 +03:00
David Cernat
78a9a428a6 [Client] Remove unnecessary mwmp::Main::pressedKey() function
Additionally, add comment around where it was originally used.
2019-08-26 15:41:45 +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
353e7d530a Add OpenMW commits up to 18 Aug 2019
# Conflicts:
#	CMakeLists.txt
#	apps/openmw/mwmechanics/character.cpp
#	apps/openmw/mwmechanics/spellcasting.cpp
#	apps/openmw/mwworld/worldimp.hpp
2019-08-22 22:44:00 +03:00
David Cernat
b57c0bcafe Add OpenMW commits up to 6 June 2019
# Conflicts:
#	apps/openmw/mwgui/hud.cpp
#	apps/openmw/mwgui/jailscreen.cpp
#	apps/openmw/mwgui/waitdialog.cpp
#	apps/openmw/mwinput/inputmanagerimp.cpp
#	apps/openmw/mwworld/worldimp.hpp
2019-08-22 11:42:02 +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
cbba81df03 Add OpenMW commits up to 14 Nov 2018
# Conflicts:
#	.travis.yml
#	CI/before_install.linux.sh
#	CI/before_script.linux.sh
#	CMakeLists.txt
#	apps/openmw/CMakeLists.txt
#	apps/openmw/mwmechanics/mechanicsmanagerimp.cpp
#	apps/openmw/mwworld/containerstore.cpp
#	apps/openmw/mwworld/inventorystore.cpp
2019-08-21 09:04:36 +03:00
David Cernat
fba07194cf Add OpenMW commits up to 29 Oct 2018
# Conflicts:
#	apps/openmw/mwbase/world.hpp
#	apps/openmw/mwinput/inputmanagerimp.cpp
#	apps/openmw/mwmechanics/actors.cpp
#	apps/openmw/mwmechanics/aicombat.cpp
#	apps/openmw/mwmechanics/character.cpp
#	apps/openmw/mwworld/worldimp.cpp
#	apps/openmw/mwworld/worldimp.hpp
2019-08-20 13:15:00 +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
1d09763bad [Client] Allow blanking out the enchantment IDs of records using a base 2019-08-08 08:05:10 +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
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
01804af100 [Client] Add updateInventoryWindow() method to LocalPlayer 2019-06-09 01:00:01 +03:00
David Cernat
49fa35a516 [Client] Use ObjectActivate packets when picking up items from inventory 2019-06-09 01:00:01 +03:00
David Cernat
f29bfb6b8e [Client] Add debug for received kill counts 2019-05-22 23:20:44 +03:00
David Cernat
437854180c [Client] Clean up variable & function names in mwmp/Main.cpp 2019-04-25 04:29:54 +03:00
uramer
c89efd251c [General] Implement CellReset packet, stage 2 2019-04-07 01:27:15 +02:00
uramer
6cb4d5ec35 [General] Implement CellReset packet, stage 1 2019-03-24 13:23:13 +01: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
8ff2d1b829 [General] Rename CellReplace packet into CellReset 2019-03-22 21:33:34 +02:00
David Cernat
9fc4c83858 [Client] Send skill/attribute packets when skills/attributes are damaged 2019-03-20 18:40:46 +02:00
David Cernat
dcbc9d1831 [Client] Print cells for actor deaths 2019-02-21 21:51:02 +02:00
David Cernat
1df1515c7e [Client] Add logging for invalid enchantmentIds in RecordHelper 2019-01-23 01:04:59 +02:00
David Cernat
999ce857c7 [Client] Add logging for records ignored due to their invalid baseIds 2019-01-23 00:48:06 +02:00
David Cernat
db7e09f441 [Client] Use more consistent logging when reading dynamic record packets 2019-01-23 00:38:05 +02:00
David Cernat
0fa116b47d [Client] Remove useless lines in RecordHelper 2019-01-23 00:20:51 +02:00
David Cernat
6e47b65205 [Client] Set attribute increases & level progress after correct packets
Originally, the PlayerSkill packet contained skills, attribute increases and level progress. In 78441c769a, the attribute increases were moved to the PlayerAttribute packet and the level progress was moved to the PlayerLevel packet, but – due to an oversight – attribute increases and level progress were still being applied to the local player only when a PlayerSkill packet was received, based on whatever values were stored from the last PlayerAttribute and PlayerLevel packets.
2019-01-11 14:26:13 +02:00
David Cernat
8a99f215f6 [Client] Add LocalPlayer::sendItemChange() variant with mwmp::Item arg 2019-01-11 12:54:47 +02:00
David Cernat
db9c1b9882 [Client] Add MechanicsHelper::getItem() for getting mwmp::Item from Ptr 2019-01-11 12:53:26 +02:00
David Cernat
43f195f0c7 [Client] Use clearer debug for actor initializations 2019-01-05 23:27:35 +02:00
David Cernat
d83160523f [Client] Add items required for item magic casting when they are missing 2018-12-31 06:55:35 +02:00
David Cernat
433a69a588 [Client] Send all data for newly initialized LocalActors at least once 2018-12-31 04:36:59 +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
343dd8b5ea [Client] Fix addition of items to player inventories
Previously, multiple stacks of the same item ID could overwrite data in each other because of how the logic in ContainerStore::add() works. For example, a stack of 5 grand soul gems with no souls would get added to the player, then the attempt to add a grand soul gem with a particular soul would retrieve the previous stack first before setting all of it to that soul, resulting in 6 grand soul gems with that soul.
2018-12-26 13:41:19 +02:00
David Cernat
d05a82a734 [Client] Avoid repetitive code when unequipping items in resurrection 2018-12-04 03:55:03 +02:00
David Cernat
b39e3f518b [Client] Use correct log levels for inventory and dynamic record packets 2018-11-30 23:38:16 +02:00
Testman
6b3f598837
Use more descriptive terminology for chat modes
Changed "Chat disabled" to "Chat hidden", "Chat enabled" to "Chat visible" and "Chat in hidden mode" to "Chat appearing when needed".
2018-11-17 16:54:14 +01:00
David Cernat
e834a4ec74 [Client] Find closest enchantmentCharge in getItemPtrFromStore()
Enchanted inventory items continuously recharge their enchantment charges, which getItemPtrFromStore() should account for.

Additionally, prevent framelistener errors caused by PlayerItemUse packets about non-existent items.
2018-11-13 20:36:31 +02:00
Koncord
e5e13b21ae [Client] Fix crash on drag&drop 2018-10-28 16:56:04 +08:00
David Cernat
17f13872aa [Client] Use forceUpdate correctly in LocalPlayer::updateStatsDynamic()
Previously, the forceUpdate argument was useless, preventing dynamic stats from being sent by certain newly created characters.
2018-10-22 13:22:23 +03:00
David Cernat
d9dd7073cf [General] Send certain packets only when logged in
Previously, client mods adding packet-sending scripts to the spawn area made clients send the associated packets as soon as they inputted their character name when joining a server using those mods. This made the clients either get disconnected for not replying to a handshake first, or it made them get kicked for sending object packets that are disallowed for players who are not logged in.

To fix this, LocalPlayer's hasFinishedCharGen() has been replaced with isLoggedIn(), because the former was already returning true when players inputted their names.
2018-10-13 15:36:13 +03:00
David Cernat
66d666d60c [Client] Use less confusing terminology when displaying plugin mismatch 2018-10-13 14:40:49 +03:00
Sam Hellawell
df1667b6e4 Cleanup fix for equip item crash on Linux
Signed-off-by: Sam Hellawell <sshellawell@gmail.com>
2018-10-11 21:49:24 +01:00
Sam Hellawell
1e171ad9fd Fix crash when equipping item on linux
Signed-off-by: Sam Hellawell <sshellawell@gmail.com>
2018-10-11 20:13:22 +01:00
David Cernat
e402a17757 [Client] Don't cast non-weapons to weapons in isUsingRangedWeapon()
This makes lockpicks and probes work again.
2018-10-09 09:54:13 +03: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
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
490303dc0b [Client] Clean up MechanicsHelper::processAttack() slightly
The debug is now more descriptive and some code is now skipped for non-ranged attacks.
2018-09-15 04:11:43 +03:00
David Cernat
af49f711ca [Client] Add isUsingRangedWeapon() method to MechanicsHelper 2018-09-14 13:21:45 +03:00
David Cernat
3f6ca6f22b [Client] Bring drawState fallback for actors up-to-date w/ attack types 2018-09-11 15:12:11 +03:00
David Cernat
9d2cf6629b [Client] Fix logic for hand-to-hand attack sync 2018-09-11 15:07:44 +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
31a9b77f34 [Client] Reset hitPosition in MechanicsHelper::resetAttack() 2018-09-10 12:34:33 +03:00
David Cernat
8012d0d7b7 [General] Include hit position in PlayerAttack and ActorAttack packets 2018-09-08 05:29:49 +03:00
David Cernat
113002ca19 [Client] Return early when processing actors that can't be initialized 2018-09-05 20:03:35 +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
03832f933b [Client] Send only individual items in PlayerInventory packets
For a long time, whenever a PlayerInventory packet was sent, it contained all the items in the player's inventory, because that's how Koncord originally implemented it and I always had too many other priorities to go back and rework it.

From now on, clients only send PlayerInventory packet with the one item added or removed, with the single exception being trading with merchants, where the entire inventory is still sent for the time being.
2018-08-21 10:10:06 +03:00
David Cernat
45b011452e [Client] Combine methods for sending spell packets into a single one 2018-08-21 01:20:30 +03:00
David Cernat
140e0ed52c [Client] Also clear aiActors when clearing ActorList 2018-08-20 20:54:34 +03:00
David Cernat
aed4ca2fd2 [Client] Allow use of baseId for more record types
Additionally, don't allow new enchantment records to be created if they have no effects, to avoid a crash.
2018-08-20 15:24:20 +03:00
David Cernat
7efee0e968 [Client] Fix GCC build 2018-08-20 10:15:30 +03:00
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
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
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
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
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
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
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
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
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
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
David Cernat
f1315ef30d [Cllient] Differentiate itemPtr from actor Ptr in DedicatedActor methods
2427a4f877 mistakenly used the variable name "ptr" for both the actor and the items in that actor's inventory.
2018-07-21 10:16:51 +03:00
David Cernat
b6324e3532 [Client] Clean up debug for spell usage 2018-07-21 09:41:36 +03:00
David Cernat
421d0e7a99 [Client] Make forceWeather false by default for client-sent weather 2018-07-21 05:21:26 +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
0b5cb15f71 [General] Turn GameWeather into WorldWeather, now a WorldstatePacket 2018-07-16 02:20:43 +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
f13705e8be [Client] Improve debug for ObjectActivate and ConsoleCommand 2018-07-15 04:09:19 +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
743933134d [Client] Simplify sending of ActorAI packets for uninitialized actors 2018-07-14 01:00:27 +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
6c1173d598 [Client] Rename searchPtrViaRefIndex into searchPtrViaUniqueIndex 2018-07-13 04:33:54 +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
6316f1e590 [Client] Add ActorList methods for sending ActorAI packets
Additionally, use consistent capitalization for AI-related methods.
2018-07-12 20:48:47 +03:00
David Cernat
0fd8f7660b [Client] Replace LocalActor arg with BaseActor in ActorList functions 2018-07-12 20:15:04 +03:00
David Cernat
bdf2f03c4f [General] Remove unnecessary MapChanges struct from BaseWorldstate 2018-07-12 05:06:31 +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
8ca29dbaac [Client] Fix remaining mistakes in debug for received ActorAI packets 2018-07-11 23:11:37 +03:00
David Cernat
25f7a55495 [Client] Improve debug for received ActorAI packets 2018-07-11 19:54:56 +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
2e31c212c0 [Client] Make any ActorAI packet override an actor's desire to fight 2018-07-10 11:33:07 +03:00
David Cernat
79ee976c95 [Client] Implement ACTIVATE action in DedicatedActor::setAI()
Additionally, clean up usage of CreatureStats in DedicatedActor.
2018-07-10 11:31:51 +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
5628f3b977 [Client] Fix debug for DedicatedActor::setAI() 2018-07-10 02:05:10 +03:00
David Cernat
b86155dc11 [Client] Allow AiFollow package to have infinite distance when desired 2018-07-10 01:40:57 +03:00
David Cernat
864c66d1d4 [Client] Make sure hasAiTarget is set correctly for DedicatedActors 2018-07-10 01:35:38 +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
509882b5f6 [Client] Rework MechanicsHelper::getTarget() to avoid crashes 2018-07-07 11:43:57 +03:00
David Cernat
4eb72eecb1 [Client] Fix crash for invalid CellRefs in MechanicsHelper::getTarget() 2018-07-06 18:39:14 +03:00
David Cernat
4b30a44816 [Client] Compare crimeTime and deathTime when NPCs forgive player crimes
Previously, all crime witnesses stopped being hostile to a respawning player for as long as the player's diedSinceArrestAttempt was true. That meant that, in an area with no guards to arrest the player, crime witnesses did not enage in combat with the player at all ever again until diedSinceArrestAttempt became false.

This commit makes it so the time of the last crime is recorded for each witness, and that is then compared with the time of the LocalPlayer's last death for a one-time crime forgiveness during that player's current life.

This is essentially a gameplay adjustment for "singleplayer with respawns," and will have to be reworked to make sense for every player in multiplayer, though that requires reworking the crime system as a whole and is thus on hold.
2018-07-06 14:17:54 +03:00
David Cernat
c23fc3446f [Client] Avoid sending map tiles for Wilderness cells 2018-07-06 03:54:34 +03:00
David Cernat
17c234d9ca [Client] Use initial values for LocalPlayer and LocalActor killers 2018-07-06 02:07:55 +03:00
David Cernat
97cd3effa7 [Client] Make actor debug consistent with object debug 2018-07-06 00:32:45 +03:00