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

255 commits

Author SHA1 Message Date
David Cernat
7f435ceeac Add OpenMW commits up to 1 Nov 2020
# Conflicts:
#   CMakeLists.txt
#   apps/openmw/main.cpp
#   apps/openmw/mwclass/container.hpp
#   apps/openmw/mwclass/creature.hpp
#   apps/openmw/mwclass/npc.hpp
#   apps/openmw/mwdialogue/dialoguemanagerimp.hpp
#   apps/openmw/mwdialogue/journalimp.hpp
#   apps/openmw/mwgui/container.cpp
#   apps/openmw/mwgui/dialogue.hpp
#   apps/openmw/mwgui/mainmenu.cpp
#   apps/openmw/mwgui/windowmanagerimp.hpp
#   apps/openmw/mwmechanics/aiactivate.hpp
#   apps/openmw/mwmechanics/mechanicsmanagerimp.hpp
#   apps/openmw/mwscript/containerextensions.cpp
#   apps/openmw/mwscript/interpretercontext.hpp
#   components/CMakeLists.txt
2020-11-01 23:17:59 +02:00
Alexei Dobrohotov
f1b7cd5404 Don't reset temporarily hidden container window 2020-10-22 02:12:31 +03:00
AnyOldName3
df178ed97c Merge branch 'container-regressions' into 'master'
Fix container regressions

See merge request OpenMW/openmw!346

(cherry picked from commit b0aee6f83d4cddb0116284b197913f9687dd9cee)

95e7a22d fix container regressions
2020-10-16 22:55:10 +00:00
David Cernat
68837aaf4a Add OpenMW commits up to 15 Oct 2020
# Conflicts:
#   .travis.yml
#   CI/before_script.linux.sh
#   CMakeLists.txt
#   apps/openmw/mwgui/containeritemmodel.cpp
#   apps/openmw/mwgui/tradewindow.cpp
#   apps/openmw/mwphysics/actor.cpp
#   apps/openmw/mwworld/actionteleport.cpp
#   apps/openmw/mwworld/containerstore.cpp
2020-10-15 19:51:39 +02:00
Assumeru
72549651e0
Rework container resolution (#3006)
* Rework container resolution

* add optional argument to getCount

* remove now-redundant changes

* undo worldimp changes

* move save-fixing code to InventoryState

* replace Rng instances with Seeds
2020-10-13 17:46:32 +02:00
David Cernat
0eedf8fd9f Add OpenMW commits up to 30 Sep 2020
# Conflicts:
#   apps/openmw/mwmechanics/aicombat.cpp
#   apps/openmw/mwmechanics/character.cpp
#   apps/openmw/mwmechanics/summoning.cpp
#   components/CMakeLists.txt
2020-09-30 13:32:15 +02:00
Andrei Kortunov
67eace1028 Use struct instead of tuple 2020-08-29 11:24:08 +04:00
David Cernat
25a632c650 Add OpenMW commits up to 13 Apr 2020
# Conflicts:
#	CMakeLists.txt
#	README.md
#	apps/openmw/engine.cpp
#	apps/openmw/mwclass/creaturelevlist.cpp
#	apps/openmw/mwgui/quickkeysmenu.cpp
2020-04-13 19:53:42 +03:00
Capostrophic
96a447ee3a Show the soulgem soul in count dialog (feature #5362) 2020-04-12 11:55:00 +03:00
David Cernat
038c5b8231 [Client] Rename ObjectList's addObject() into addBaseObject() 2020-01-23 16:40:04 +02:00
David Cernat
296c04af71 [Client] Combine ObjectList's getBaseObject() and getObjectFromPtr() 2020-01-23 16:18:49 +02:00
David Cernat
59a38164ea [Client] Add generic objects to ObjectList using addObjectGeneric() 2020-01-23 09:03:40 +02:00
David Cernat
989188c171 [Client] Remove ObjectList's confusing addObjectDelete() function 2020-01-22 14:35:51 +02:00
David Cernat
d2ba4a12d9 [Client] Simplify container sending with new addContainerItem() methods 2020-01-16 14:00:30 +02:00
David Cernat
51f0acbaf5 [Client] Improve logging for Container packets 2020-01-16 10:32:48 +02:00
David Cernat
0c98c5d09e Add OpenMW commits up to 19 Nov 2019
# Conflicts:
#	apps/openmw/mwmechanics/aipursue.cpp
#	apps/openmw/mwmechanics/summoning.cpp
2019-11-19 17:16:48 +02:00
Capostrophic
120b7dcd2f Clean up summoned creatures when corpses are disposed 2019-11-12 21:44:46 +03:00
David Cernat
05b5a7b32d [Client] Trigger crimes when using take all on containers 2019-10-29 21:17:01 +02: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
Andrei Kortunov
b6044d231a Handle death event manually before disposing a corpse if a death animation was not finished yet (feature #5146) 2019-08-27 22:42:41 +04:00
David Cernat
ed05125f6a Add OpenMW commits up to 2 Aug 2019
# Conflicts:
#	apps/openmw/mwmechanics/combat.cpp
2019-08-22 15:38:15 +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
8729c3c5e3 Add OpenMW commits up to 9 Mar 2019
# Conflicts:
#	.travis.yml
#	CI/before_script.linux.sh
#	README.md
#	apps/openmw/mwgui/jailscreen.cpp
#	apps/openmw/mwscript/animationextensions.cpp
#	apps/openmw/mwscript/guiextensions.cpp
#	apps/openmw/mwscript/miscextensions.cpp
#	apps/openmw/mwscript/soundextensions.cpp
2019-08-21 19:04:04 +03:00
David Cernat
6fdef4fd0a Add OpenMW commits up to 1 Jan 2019
# Conflicts:
#	.travis.yml
#	CMakeLists.txt
#	apps/openmw/mwbase/world.hpp
#	apps/openmw/mwphysics/physicssystem.hpp
#	apps/openmw/mwworld/worldimp.cpp
#	apps/openmw/mwworld/worldimp.hpp
2019-08-21 14:37:54 +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
056591b957 Add OpenMW commits up to 14 Sep 2018
# Conflicts:
#	apps/openmw/mwgui/container.cpp
#	apps/openmw/mwworld/worldimp.hpp
2019-08-20 12:14:57 +03:00
David Cernat
0339958e21 [General] Rename Log class into TimedLog 2019-08-19 21:39:33 +03:00
Capostrophic
56539fee4f Partially revert "Get rid of redundant setKeyFocusWidget() method" 2019-06-09 02:12:44 +03:00
Andrei Kortunov
faf940546b Get rid of redundant setKeyFocusWidget() method 2019-05-17 19:09:40 +04:00
Andrei Kortunov
27737d4258 Fix an exception during reload when container windows is active.
It is a regression in the animated containers feature.
2019-05-13 17:59:32 +04:00
Andrei Kortunov
3032b177a1 Remove redundant includes 2019-02-23 08:02:12 +04:00
Andrei Kortunov
a53333c3d5 Native animated containers support (feature #4730) 2018-12-13 23:11:16 +04:00
David Cernat
afd17e5a48 [Client] Don't finish drag & drop that is supposed to be unsuccessful
This prevents items from vanishing when your attempt to drop them in a full container is denied.
2018-12-06 18:11:52 +02:00
Andrei Kortunov
e06f0b797a Replace all NULLs to nullptr 2018-10-09 10:21:12 +04:00
Andrei Kortunov
9918212a1e Set focus to Close button when opening the container window (bug #4333) 2018-09-11 11:22:26 +04: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
a083439139 Merge pull request #469 from davidcernat/master while resolving conflicts
# Conflicts:
#	apps/openmw/main.cpp
#	apps/openmw/mwbase/world.hpp
#	apps/openmw/mwdialogue/dialoguemanagerimp.cpp
#	apps/openmw/mwmechanics/actors.cpp
#	apps/openmw/mwscript/dialogueextensions.cpp
#	apps/openmw/mwworld/worldimp.hpp
2018-08-20 14:08:44 +03:00
Andrei Kortunov
eeffe2e557 Check if item model exists inside drag and drop functions 2018-08-03 16:42:43 +04:00
Andrei Kortunov
a08048da4e Avoid dereference after null check 2018-08-01 19:30:30 +04: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
36ac2d9de4 [Client] Set packetOrigin for all ObjectList packets sent 2018-07-23 01:39:43 +03:00
David Cernat
2189ea1a63 [Client] Clean up sending of Container packets 2018-07-22 16:43:27 +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
c2411982d2 [Client] Log object refNumIndexes and mpNums in a consistent way 2018-07-04 21:54:11 +03:00
David Cernat
b81ca18316 [Client] Don't clear container Ptrs when disposing of corpses
The reason for this is that only the server should be determine whether a corpse can be disposed of or not.
2018-06-28 01:45:15 +03:00
David Cernat
fd05beef94 [Client] Don't delete disposed of corpses on client
Clients should instead await a server reply approving the deletion.
2018-06-20 02:01:19 +03:00
David Cernat
78234f9071 [General] Rename Event into ObjectList & WorldObject into BaseObject 2018-05-13 00:42:24 +03:00
David Cernat
6bf3a0be1e [General] Rename WorldPackets into ObjectPackets for clarity 2018-05-12 19:40:00 +03:00
David Cernat
d8b48f6cf4 [Client] Remove redundant container methods from CellController 2018-04-01 07:11:43 +03:00
David Cernat
5f6ddcfc59 [General] Rework container sync to prevent item duping
A main priority in TES3MP development is to avoid making major changes to OpenMW code, so as to avoid merge conflicts in the future. Whenever avoiding potential conflicts seems especially difficult for the proper implementation of a particular multiplayer feature, that multiplayer feature is often put off until later or partially implemented with the intent of being revisited in the future.

Container sync is the perfect example. Previously, the OpenMW code for container actions was kept exactly as it was, with clients unilaterally accepting their own container changes as per singleplayer-specific code, with only the addition that clients sent container packets every time they made a change in a container, packets which were then forwarded unquestioningly by the server to other players. This meant that two players clicking on the same item in a container at the same time both managed to take it, thus duplicating the item.

Immediately after the packets were already forwarded, server scripts were able to check for incorrect changes, such as the removal of more items than should have existed in a container, but they had to send their own packets that attempted to fix what had already been accepted on the initial client and then forwarded to all clients, which was quite onerous in some scenarios, such as when a player on a slow connection immediately dropped items in the world after taking them from a container (which is why the default TES3MP serverside scripts made no attempt at sending corrective packets at all, preferring to expect the matter to be solved in a later C++ implementation).

This commit fixes item duping in containers by preventing container actions from initially running on clients and by ending the automatic forwarding of container packets by the server. Instead, clients now send container packets that act as requests for container actions, and serverside scripts have to forward these requests themselves. In other words, without a matching Container event in the server's Lua scripts, players are completely unable to affect containers for themselves or for others.

To forward a received Container packet, the following line must be used in a Container event in the Lua scripts:

tes3mp.SendContainer(true, true)

When an invalid action count is used in a container request, the serverside scripts can amend it using the following new function:

tes3mp.SetReceivedContainerItemActionCount(objectIndex, itemIndex, actionCount)

Thus, the serverside scripts are able to allow only container actions that are correct based on their own recorded contents for that container.

The OpenMW code allowing unilateral container actions in mwgui/container.cpp is now prevented from executing. When a player's container request is returned to them, code in mwmp/WorldEvent.cpp simulates those container actions instead.
2018-03-26 19:27:36 +03:00