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

20786 commits

Author SHA1 Message Date
David Cernat
34893ff631 [Server] Split up handshake handling into multiple functions for debug
Unfortunately, the handshake attempt limit implemented in 4ebfcc4a21 for 0.7 and then ported over to 0.6 in a3a341fee6 does not appear to work properly, which is why gathering more information on it is important.
2018-04-09 15:25:50 +03:00
David Cernat
c132dc70d2 [Client] Make PlayerShapeshift turn DedicatedPlayers into creatures 2018-04-09 15:23:05 +03:00
David Cernat
141eb8b7c2 [Client] Streamline creation of references for DedicatedPlayers
Additionally, delete DedicatedPlayers who disconnect.

Previously, all disconnected DedicatedPlayers were still kept in memory, but never used again. There was code that suggested they were meant to be reused upon reconnecting, but that reuse had never actually been implemented, and would probably not be that useful anyway.
2018-04-08 15:02:43 +03:00
David Cernat
14f90e773d [Client] Split up creation of DedicatedPlayers into multiple methods
Additionally, print player guids using their string representations for consistency.

The creation and updating of DedicatedPlayer references remains very inelegant, but this commit is the first step towards fixing that.
2018-04-08 10:56:33 +03:00
David Cernat
c8abd11f5d [General] Move creature disguises for players to PlayerShapeshift packet
Additionally, make associated variables clearer, and move associated server script functions next to other shapeshifting functions.
2018-04-05 15:42:06 +03:00
David Cernat
34be9383e5 [General] Add isPlayer boolean to targets in packets 2018-04-05 12:48:53 +03:00
David Cernat
0eed05610b [Client] Fix autoequipping for creatures in WorldEvent::editContainers() 2018-04-03 15:22:51 +03:00
David Cernat
a86c68c5a1 [General] Add sync for ranged weapon & projectile strike enchantments 2018-04-03 14:12:27 +03:00
David Cernat
3f8d94b030 [General] Synchronize strike enchantments in combat 2018-04-03 10:27:02 +03:00
David Cernat
76468dc8c6 [Server] Remove remnant of hardcoded container sync 2018-04-03 01:35:07 +03:00
David Cernat
e3c43c6af7 Merge pull request #400 from OpenMW/master while resolving conflicts
# Conflicts:
#	apps/openmw/mwmechanics/spellcasting.cpp
2018-04-03 01:25:17 +03:00
scrawl
c6abec1e51
Merge pull request #1641 2018-04-02 17:53:30 +00:00
scrawl
0071878106
Merge pull request #1642 2018-04-02 17:45:54 +00:00
scrawl
d935e78f93
Merge pull request #1645 2018-04-02 17:39:23 +00:00
scrawl
c610b8acc8
Merge pull request #1649 2018-04-02 17:37:31 +00:00
scrawl
cd9f767e29
Merge pull request #1650 2018-04-02 17:32:40 +00:00
scrawl
9e176aba9f
Merge pull request #1652 2018-04-02 17:29:40 +00:00
scrawl
e73af18824
Merge pull request #1653 2018-04-02 17:29:04 +00:00
scrawl
8e37f6bf3e
Merge pull request #1656 2018-04-02 17:28:46 +00:00
scrawl
f36adfec5f
Merge pull request #1657 2018-04-02 17:28:12 +00:00
scrawl
80a8ef6d49
Merge pull request #1661 2018-04-02 17:18:39 +00:00
scrawl
0065f277ef
Merge pull request #1664 2018-04-02 17:17:37 +00:00
elsid
14daadded7
Add virtual destructors
To fix warnings:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:588:8: warning: delete called on non-final 'NifOsg::ControllerFunction' that has virtual functions but non-virtual destructor
      [-Wdelete-non-virtual-dtor]
              delete __p;
              ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:595:4: note: in instantiation of function template specialization
      'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<NifOsg::ControllerFunction *>' requested here
        : __shared_count(__p)
          ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:1079:17: note: in instantiation of function template specialization
      'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<NifOsg::ControllerFunction *>' requested here
        : _M_ptr(__p), _M_refcount(__p, typename is_array<_Tp>::type())
                       ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr.h:129:25: note: in instantiation of function template specialization 'std::__shared_ptr<NifOsg::ControllerFunction,
      __gnu_cxx::_S_atomic>::__shared_ptr<NifOsg::ControllerFunction, void>' requested here
        shared_ptr(_Yp* __p) : __shared_ptr<_Tp>(__p) { }
                               ^
/home/elsid/dev/openmw/components/nifosg/nifloader.cpp:242:39: note: in instantiation of function template specialization 'std::shared_ptr<NifOsg::ControllerFunction>::shared_ptr<NifOsg::ControllerFunction, void>' requested here
                callback->setFunction(std::shared_ptr<NifOsg::ControllerFunction>(new NifOsg::ControllerFunction(key)));
                                      ^

/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/unique_ptr.h:78:2: warning: delete called on non-final 'MWGui::ResponseCallback' that has virtual functions but non-virtual destructor
      [-Wdelete-non-virtual-dtor]
        delete __ptr;
        ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/unique_ptr.h:268:4: note: in instantiation of member function 'std::default_delete<MWGui::ResponseCallback>::operator()' requested here
          get_deleter()(__ptr);
          ^
/home/elsid/dev/openmw/apps/openmw/mwgui/dialogue.cpp:58:23: note: in instantiation of member function 'std::unique_ptr<MWGui::ResponseCallback, std::default_delete<MWGui::ResponseCallback> >::~unique_ptr' requested here
    PersuasionDialog::PersuasionDialog(ResponseCallback* callback)
                      ^
2018-04-01 21:51:59 +03:00
David Cernat
26a56d6a02 [Client] Include NPC/creature containers when adding all cell containers 2018-04-01 14:58:04 +03:00
David Cernat
1e3c4fd488 [Client] Fix ProcessorContainer typos caused by careless copy-pasting 2018-04-01 10:47:57 +03:00
David Cernat
7b97e8671d
Merge pull request #398 from OpenMW/master
Add OpenMW commits up to 30 March 2018
2018-04-01 10:04:04 +03:00
David Cernat
f80f3bd484 [Client] Make it possible to reply to requests about specific containers
Previously, a Container packet with a REQUEST action always made the client respond with the contents of all the containers in that cell.

The previous behavior now only happens for requests that have no WorldObjects attached, while requests that have WorldObjects attached get a reply with the contents of those specific containers.
2018-04-01 10:00:39 +03:00
David Cernat
ec1311fcb7 [Client] Make it possible to check whether a class has a ContainerStore 2018-04-01 09:33:07 +03:00
David Cernat
258e319acb [Client] Require InventoryStore for autoequipping actors 2018-04-01 09:02:26 +03:00
David Cernat
afe8c97cb9 [Client] Require InventoryStore for unequipping actors in editContainers 2018-04-01 08:41:57 +03:00
David Cernat
d8b48f6cf4 [Client] Remove redundant container methods from CellController 2018-04-01 07:11:43 +03:00
Capostrophic
baaf65bc2c Add vanilla enchanted weaponry behavior option, on by default (fixes #4136) 2018-03-31 11:46:23 +03:00
Bret Curtis
f97d094aa5
Merge pull request #1658 from xyzz/android-sdl-2.0.8
android: Update for sdl 2.0.8
2018-03-30 22:14:53 +02:00
Ilya Zhuravlev
fdcfbdbdd1 android: Update for sdl 2.0.8 2018-03-30 12:44:38 -04:00
Capostrophic
e6d9bce519 Implement fWerewolfHealth GMST (fixes #4142) 2018-03-30 19:27:18 +03:00
David Cernat
365f485e8d Merge pull request #397 from OpenMW/master while resolving conflicts
Conflicts:
	components/CMakeLists.txt
2018-03-30 10:28:52 +03:00
Capostrophic
76f50312f2
Remove a redundant check 2018-03-30 00:02:52 +03:00
Bret Curtis
5e6be0307e
Merge pull request #1651 from psi29a/remove_gles_but_keep_android
remove native GLESv* support, as it never worked; make things less co…
2018-03-29 20:39:51 +02:00
David Cernat
ac82124a5d Merge pull request #395 from OpenMW/master while resolving conflicts
# Conflicts:
#	apps/openmw/mwmechanics/actors.cpp
2018-03-29 07:28:30 +03:00
David Cernat
1c340568d2 [Client] Disallow resting if player has not finished chargen
Previously, players pressing T rapidly before logging in had the Wait screen show up for them.
2018-03-29 06:04:20 +03:00
Capostrophic
be542507f8
Make hasMaster() behavior consistent with isGameFile() (fixes #3618) 2018-03-28 15:43:51 +03:00
Simon
9193ff4d15
Reworded one of the descriptions 2018-03-28 13:59:05 +02:00
bret curtis
4890ecd357 remove native GLESv* support, as it never worked; make things less complicated as result, fixed lighting.glsl to work with gl2es thanks to ptitSeb 2018-03-27 20:20:40 +02:00
Capostrophic
2d119e834a Add vanilla absorb attribute behavior option, on by default (Fixes #4135) 2018-03-27 14:27:23 +03:00
Capostrophic
b6a2589e7b Don't apply harmful spell effects on the player in god mode (fixes #4264) 2018-03-27 14:02:14 +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
David Cernat
9165b12d78 [Client] Update inventory views when receiving inventory or equipment 2018-03-26 10:01:26 +03:00
Capostrophic
41f89c84f8 Don't move the player if opposite direction keys are held down at the same time (Fixes #4233) 2018-03-25 12:20:48 +03:00
David Cernat
bb15ee9215 [Client] Make it possible to get ContainerWindow from elsewhere in code 2018-03-24 09:00:15 +02:00
Bret Curtis
1e600de44e
Merge pull request #1640 from unelsson/typofix_updatecrimepersuit
Typofix: updateCrimePersuit -> updateCrimePursuit
2018-03-23 22:13:22 +01:00