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

617 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
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
76468dc8c6 [Server] Remove remnant of hardcoded container sync 2018-04-03 01:35:07 +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
b249162ca1 [General] Implement setting of enforced client log level in GameSettings
Certain servers do not want the players to have debug information about the locations and actions of other players, so a client's log level can now be enforced by the server via the GameSettings packet.
2018-03-11 04:50:59 +02:00
David Cernat
a3a341fee6 [Server] Reimplement 4ebfcc4a21 for 0.6 2018-03-10 22:19:44 +02:00
David Cernat
60f686ee43 [General] Implement setting of physics framerate as part of GameSettings 2018-02-14 05:53:44 +02:00
David Cernat
74765b3ace [General] Implement selected spell sync as part of PlayerMiscellaneous 2018-02-06 06:36:46 +02:00
David Cernat
029dfc56ba [General] Implement player scale as part of PlayerShapeshift 2018-02-01 02:11:45 +02:00
David Cernat
66078bfea7 [General] Implement Mark location sync as part of PlayerMiscellaneous 2018-01-31 04:50:29 +02:00
David Cernat
989f6e6b51 [General] Implement PlayerReputation packet 2018-01-30 22:55:29 +02:00
David Cernat
88ae0772cf [Server] Initialize new processors and fix issues with RecordDynamic 2018-01-30 22:51:35 +02:00
David Cernat
02af7f6ba1 [General] Add placeholders for new packet types 2018-01-29 22:32:51 +02:00
David Cernat
420dab10e1 [General] Track objects directly placed by players in ObjectPlace
This allows the OnPCDrop variable to get set correctly even when object placements have to go through the server first in order to gain a unique multiplayer index (mpNum).

Among other things, this makes it possible to roll marijuana joints in the popular mod "Tribunal Code Patch".
2018-01-28 17:46:51 +02:00
David Cernat
9935f56d46 [General] Use doubles instead of ints for enchantmentCharge
Additionally, include enchantmentCharges for items  in PlayerEquipment packets.
2018-01-17 08:10:49 +02:00
David Cernat
1cf2f35a28 [Server] Add script functions to set & get plugin enforcement state 2018-01-02 16:33:18 +02:00
David Cernat
47a3dc9ff2 [Server] Add broadcast argument to functions for sending WorldPackets 2017-12-30 21:52:30 +02:00
David Cernat
1e2517698d [Server] Send player speech and animation packets only to nearby players 2017-12-29 06:17:45 +02:00
David Cernat
cac2c6c1e8 Merge pull request #360 from TES3MP/0.6.1-openmw-updates while resolving conflicts 2017-12-25 02:25:01 +02:00
David Cernat
993081ba1e [General] Add enchantmentCharge to worldObjects and items 2017-12-23 13:16:38 +02:00
David Cernat
e97c9f72a2 [General] Rework getting/clearing of skill modifiers as with attributes 2017-12-04 15:06:27 +02:00
David Cernat
2944be18ae [Server] Actually, turn SetAttributeModifier into ClearAttributeModifier
There's no way SetAttributeModifier() was going to make sense if, say, a player had drunk 3 different potions fortifying the same attribute and was wearing equipment fortifying it as well. How would one change the sum modifier of those while accounting for each specific effect's duration and magnitude?

The only workable solution is to allow the server to clear the modifier.
2017-12-02 09:19:33 +02:00
David Cernat
e8d636ebc3 [Server] Rework Get/SetAttributeCurrent into Get/SetAttributeModifier
As seen here, attributes don't use the concept of current values, but rather of value modifiers and value damage:

https://github.com/OpenMW/openmw/blob/master/apps/openmw/mwmechanics/stat.cpp#L217
2017-11-30 22:37:06 +02:00
David Cernat
c9c363ebef [General] Allow GameSettings to set bed & wilderness resting separately 2017-11-30 12:18:15 +02:00
David Cernat
3508a16836 [General] Use GameSettings packet to set ability to rest and wait 2017-11-27 07:39:02 +02:00
David Cernat
6668b9ab42 [General] Implement ConsoleCommand packet 2017-11-23 00:21:47 +02:00
David Cernat
be25decee2 [General] Implement PlayerSpeech packet 2017-10-31 15:19:14 +02:00
David Cernat
413893aa51 [General] Implement PlayerAnimPlay packet 2017-10-27 09:10:29 +03:00
David Cernat
50d5fffb7f [General] Add and implement PlayerQuickKeys packet 2017-10-25 07:21:00 +03:00
David Cernat
a94d4ce6f5 Merge pull request #323 from TES3MP/0.6.1
Add hotfix commit for 0.6.1 from 23 Oct 2017
2017-10-24 19:34:34 +03:00
David Cernat
3aedc2e5bc [Server] Don't automatically share PlayerTopic packets between players 2017-10-23 19:39:35 +03:00
David Cernat
ec2c964ae1 Merge pull request #311 from TES3MP/0.6.1
Add hotfix commit for 0.6.1 from 10 Oct 2017
2017-10-10 06:26:33 +03:00
David Cernat
f532ab241d [Server] Avoid duplicates of the same player in a cell's loaders 2017-10-10 05:48:56 +03:00
David Cernat
3d38da0e85 [Server] Put includes in a specific order 2017-10-08 05:17:14 +03:00
David Cernat
61b1a59814 [General] Move server's version printing method to Utils 2017-10-08 04:16:30 +03:00
Koncord
74c9a26d16 [Server] Fix "wrong packet with id: 14" 2017-09-02 14:01:11 +08:00
David Cernat
ac3254d85f [General] Don't send PlayerAttribute and PlayerSkill packets as werewolf
This will prevent the server from overwriting a player's human form stats with their werewolf form stats.

Additionally, share PlayerShapeshift packets last when exchanging data with another player.
2017-08-31 18:21:38 +03:00
David Cernat
98a7769b91 Merge branch 'master' into 0.6.0 2017-08-31 15:44:27 +03:00
David Cernat
499c7db121 [Server] Initialize interiors correctly if exterior 0, 0 has been loaded 2017-08-31 14:48:23 +03:00
David Cernat
833d2a5dbe Merge pull request #277 from TES3MP/0.6.0
Add hotfix commits for 0.6.0 up to 29 Aug 2017, part 1
2017-08-29 19:32:21 +03:00
David Cernat
92553b8e29 [Server] Log startup errors by not deleting logger too early 2017-08-29 19:30:37 +03:00
David Cernat
cffd985038 Merge pull request #266 from TES3MP/0.6.0
Add hotfix commits for 0.6.0 up to 18 Aug 2017
2017-08-18 07:45:36 +03:00
David Cernat
0820b7e92b [Server] Add GetCaseInsensitiveFilename() script function
Additionally, make header order consistent in script function files.
2017-08-18 07:13:08 +03:00
David Cernat
0e2038f045 [General] Record and get player positions before their last cell change 2017-08-04 21:45:52 +03:00
Unknown
bfbfbeac43 Added networking and saving for custom spells 2017-07-31 03:45:47 +10:00
David Cernat
c9550fc560 [Server] Use case-insensitive filename comparison for plugins
Additionally, clarify the comments related to plugin comparison.
2017-07-28 06:57:15 +03:00
David Cernat
9d05063af4 [General] Add server script functions for banning & unbanning IPs
Additionally, use a more informative message for the client when trying to connecting to a server that it is banned from.
2017-07-27 19:29:17 +03:00
David Cernat
d543edbd9a [Server] Make sure players are initialized as non-werewolves 2017-07-26 06:01:48 +03:00
David Cernat
cd8d064761 [Server] Add PlayerShapeshift to PlayerCellChange's information exchange 2017-07-25 18:44:06 +03:00
David Cernat
8b79cdd4f4 [Server] Document script functions, part 3
Also reorder functions in Cells and CharClass so they are consistent with the rest.
2017-07-25 18:07:09 +03:00