Commit Graph

466 Commits (sol2-server-rewrite)

Author SHA1 Message Date
David Cernat 28f1c1b0d3 [General] Rework CharGen slightly for clarity purposes
Previously, charGenStage.end was doing double duty as both the variable indicating the number of CharGen stages and – when set to 0 – the variable indicating that CharGen was over. The latter role is now filled by a new boolean.

(cherry picked from commit 926106cf8c)
7 years ago
David Cernat ed15d9ebf5 Merge pull request #406 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/Script/Functions/Mechanics.cpp
	apps/openmw-mp/Script/Functions/Mechanics.hpp
	components/openmw-mp/Base/BasePlayer.hpp
7 years ago
David Cernat 70f9cb535e [General] Use RecordHelper methods to create and update DedicatedPlayers 7 years ago
David Cernat 2390744b45 Merge pull request #404 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/Player.hpp
	apps/openmw-mp/Script/Functions/Mechanics.cpp
	apps/openmw-mp/Script/Functions/Mechanics.hpp
	apps/openmw-mp/Script/Functions/Settings.hpp
	apps/openmw-mp/Script/Functions/Stats.cpp
	apps/openmw-mp/Script/Functions/Stats.hpp
	components/openmw-mp/Base/BasePlayer.hpp
7 years ago
David Cernat bdc9132e7c [General] Add SetResetStats server script function
Add reading and writing of resetStats variable to PlayerBaseInfo Packet

Fix typos in various server script function descriptions
7 years ago
David Cernat 73dea494c4 [General] Allow changes from PlayerBaseInfo without player stat reset 7 years ago
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.
7 years ago
David Cernat c3b44e11fb
Merge pull request #402 from TES3MP/0.6.3
Add 0.6.3 commits up to 5 Apr 2018
7 years ago
David Cernat 34be9383e5 [General] Add isPlayer boolean to targets in packets 7 years ago
David Cernat a86c68c5a1 [General] Add sync for ranged weapon & projectile strike enchantments 7 years ago
David Cernat 3f8d94b030 [General] Synchronize strike enchantments in combat 7 years ago
David Cernat 3d5860d6f4 Merge pull request #396 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/Player.cpp
	apps/openmw-mp/Script/Functions/Settings.cpp
	apps/openmw-mp/Script/Functions/Settings.hpp
	apps/openmw-mp/Script/Functions/World.cpp
	apps/openmw-mp/Script/Functions/World.hpp
	apps/openmw/mwgui/container.cpp
	apps/openmw/mwmp/LocalActor.cpp
	apps/openmw/mwmp/LocalPlayer.cpp
	apps/openmw/mwmp/WorldEvent.cpp
	apps/openmw/mwmp/processors/world/ProcessorContainer.hpp
	components/openmw-mp/Base/BaseEvent.hpp
	components/openmw-mp/Log.cpp
	components/openmw-mp/Log.hpp
7 years ago
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.
7 years ago
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.
7 years ago
David Cernat 7ec08e125b Merge pull request #394 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/Script/Functions/Settings.cpp
	apps/openmw-mp/Script/Functions/Settings.hpp
7 years ago
Koncord 6f7771d97e [General] Move similar functions to BasePacketController
Simplify ContainsPacket and fix GetPacket
7 years ago
Koncord 9dae748a76 [General] Change type of GUIMessageBox::id to uint64_t 7 years ago
David Cernat 60f686ee43 [General] Implement setting of physics framerate as part of GameSettings 7 years ago
David Cernat ac374a8ef9 Merge pull request #384 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
 	apps/openmw-mp/Player.cpp
	apps/openmw-mp/Script/Functions/Mechanics.cpp
	apps/openmw-mp/Script/Functions/Mechanics.hpp
	apps/openmw-mp/Script/Functions/Quests.cpp
	apps/openmw-mp/Script/Functions/Quests.hpp
	apps/openmw-mp/Script/ScriptFunctions.hpp
	apps/openmw-mp/processors/player/ProcessorRecordDynamic.hpp
	apps/openmw/mwmp/LocalPlayer.hpp
	apps/openmw/mwmp/WorldEvent.cpp
	apps/openmw/mwworld/worldimp.cpp
	components/openmw-mp/Base/BasePlayer.hpp
7 years ago
David Cernat 74765b3ace [General] Implement selected spell sync as part of PlayerMiscellaneous 7 years ago
David Cernat 029dfc56ba [General] Implement player scale as part of PlayerShapeshift 7 years ago
David Cernat 66078bfea7 [General] Implement Mark location sync as part of PlayerMiscellaneous 7 years ago
David Cernat 989f6e6b51 [General] Implement PlayerReputation packet 7 years ago
David Cernat bdafa8e9ab
Merge pull request #380 from TES3MP/0.6.3
Add 0.6.3 commits up to 30 Jan 2018
7 years ago
David Cernat 3d80e2db62 [General] Add placeholders for new packet types, part 2 7 years ago
David Cernat 5858e05362 Merge pull request #378 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/CMakeLists.txt
	apps/openmw-mp/Script/ScriptFunctions.hpp
	components/CMakeLists.txt
7 years ago
David Cernat 02af7f6ba1 [General] Add placeholders for new packet types 7 years ago
David Cernat 1a8a518897 Merge pull request #376 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	README.md
	apps/openmw-mp/Script/Functions/World.cpp
	apps/openmw/mwmp/LocalPlayer.cpp
	apps/openmw/mwmp/LocalPlayer.hpp
	apps/openmw/mwworld/scene.cpp
	components/openmw-mp/Version.hpp
7 years ago
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".
7 years ago
David Cernat 613adf6b30 [General] Update version to 0.6.3 7 years ago
Koncord 6197636fac [General] Fix "using after move" warning 7 years ago
Koncord 0e97b769f9 [General] Change type of Object::enchantmentCharge 7 years ago
Koncord 7e5b929ea2 [General] Rework PacketPlayerFaction 7 years ago
Koncord 29ba07fe8c [General] Rework PacketPlayerInventory
Save the Action for each item. Now you can add or remove multiple items
7 years ago
Koncord de0bb3cdab [General] Change type of Item::enchantmentCharge to float 7 years ago
Koncord 0780329a59 [General] Fix typo 7 years ago
Koncord f1e2bc01f6 [General] Use floats instead of doubles for enchantmentCharge 7 years ago
Koncord 1e25a122c9 [General] Use RELIABLE_ORDERED only when jumping 7 years ago
David Cernat a037193e79 Merge pull request #372 from TES3MP/0.6.2 while resolving conflicts
Conflicts:
	apps/openmw-mp/Script/Functions/Actors.cpp
	apps/openmw-mp/Script/Functions/Actors.hpp
	apps/openmw-mp/Script/Functions/Items.cpp
	apps/openmw-mp/Script/Functions/Items.hpp
	apps/openmw-mp/Script/Functions/World.cpp
	apps/openmw-mp/Script/Functions/World.hpp
	apps/openmw/mwmp/WorldEvent.cpp
	components/openmw-mp/Packets/Player/PacketPlayerEquipment.cpp
	components/openmw-mp/Version.hpp
7 years ago
David Cernat 28f47c4f81 [General] Update version to 0.6.2-hotfixed 7 years ago
David Cernat 9935f56d46 [General] Use doubles instead of ints for enchantmentCharge
Additionally, include enchantmentCharges for items  in PlayerEquipment packets.
7 years ago
Kyle Cooley ba4d2bd5fe Merge remote-tracking branch 'origin/master' into LibIssues 7 years ago
Kyle Cooley fcd4d8b842 Fix build for gcc-5.4.0 7 years ago
Koncord 35922e4898 [General] Change "enum ACTOR_ACTION" to "enum class Action" 7 years ago
Koncord ef0384b296 [General] Simplify ProxyMasterPacket 7 years ago
Koncord 647661daf9 [General] Minor fixes in Master packets 7 years ago
Koncord c4949ac5d9 [General] Change regular enums to enum class 7 years ago
Koncord 5777759aae [General] Change enum QuickKey::QUICKKEY_TYPE to enum class 7 years ago
David Cernat 09958681cd Merge pull request #363 from TES3MP/0.6.2 while resolving conflicts, 2nd try 7 years ago
David Cernat cac2c6c1e8 Merge pull request #360 from TES3MP/0.6.1-openmw-updates while resolving conflicts 7 years ago
David Cernat 993081ba1e [General] Add enchantmentCharge to worldObjects and items 7 years ago
Koncord 077a3d06b3 [General] Change type of BasePlayer::resurrectType to ResurrectType 7 years ago
Koncord 1ef6ad6215 [General] Add weather struct and packet 7 years ago
Koncord 122a30c183 [General] Change type of refNumIndex & mpNum to unsigned 7 years ago
Koncord f35d35741e [General] Remove redundant code
Remove BaseEvent::worldObjectCount
Remove BaseActor::count
Use foreach loops in packets and processors
Remove redundant "&" in CellController::get().getCell() calls
7 years ago
Koncord 2cb0ea20f0 [General] Modernize packets
Use explicit for constructors
Use override instead virtual for inherited methods
Mark final derived classes as "final"
7 years ago
Koncord aa183e6844 [General] Introduce chat channels 7 years ago
David Cernat fc5e883160 [General] Rework PlayerStatsDynamic packets so they are of minimal size 7 years ago
David Cernat d1ad0c91f8 [General] Rework PlayerEquipment packets so they are of minimal size
Moreover, rename BaseNetCreature's equipedItems into equipmentItems.
7 years ago
David Cernat c9c363ebef [General] Allow GameSettings to set bed & wilderness resting separately 7 years ago
David Cernat bd9e8bd10f [General] Simplify storing of attribute and skill index changes 7 years ago
David Cernat 720ef5f6c5 [General] Use consistent code style 7 years ago
Koncord b55bb445dd [General] Change underlying type of the WidgetType to uint8_t 7 years ago
Koncord a546d99000 [General] Fix type 7 years ago
Koncord 1841562553 [General] Minor cleanup of the World Packets 7 years ago
Koncord 744b8cf168 [General] Minor cleanup of the Actor Packets 7 years ago
Koncord e44fcdc0b3 [General] Cleanup Player packets 7 years ago
David Cernat 3508a16836 [General] Use GameSettings packet to set ability to rest and wait 7 years ago
David Cernat a796f81444 [General] Add and use utility function for int value checks in vectors 7 years ago
Koncord c276ff4bd9 [General] Add packet GUIWindow 7 years ago
David Cernat b0965f094a [General] Rework PlayerAttribute packets so they are of minimal size
Previously, whenever a single attribute value changed for a player, that player then sent a PlayerAttribute packet with all values for all 8 attributes.

This did not cause anywhere as much packet spam as PlayerSkill used to, but there was no good reason not to fix it as well.
7 years ago
David Cernat ef79a98544 [General] Rework PlayerSkill packets so they are of minimal size
Previously, whenever a single skill value changed for a player, that player then sent a PlayerSkill packet with all values for all 27 skills, plus the player's progress towards the next level and the bonuses to each attribute on the next level up as the result of sklll increases thus far.

This commit makes PlayerSkill contain only the values of specific skills, moves the player's progress towards the next level to PlayerLevel packets, and moves the bonuses to each attribute on the next level up to PlayerAttribute packets.

Players now also send a PlayerSkill packet whenever their progress towards a new point in a skill changes. This was previously avoided so as to not have massive packet spam.
7 years ago
David Cernat 6668b9ab42 [General] Implement ConsoleCommand packet 7 years ago
David Cernat 926106cf8c [General] Rework CharGen slightly for clarity purposes
Previously, charGenStage.end was doing double duty as both the variable indicating the number of CharGen stages and – when set to 0 – the variable indicating that CharGen was over. The latter role is now filled by a new boolean.
7 years ago
Koncord 7ab01b66e4 [General] Rewrite Log class 7 years ago
Koncord d15c674584 [General] Move getFilenameTimestamp() to Utils 7 years ago
David Cernat 2ca4017371 [Client] Force position updates for players in animations 7 years ago
David Cernat be25decee2 [General] Implement PlayerSpeech packet 7 years ago
David Cernat 605b06c303 [General] Find actor speech captions instead of sending them in packets 7 years ago
David Cernat 413893aa51 [General] Implement PlayerAnimPlay packet 7 years ago
Koncord 916ada108f [General] Modernize Log utility
* Reverse Log levels
* Add LOG_TRACE
* Spawn instance of Log in Get() function
7 years ago
David Cernat 50d5fffb7f [General] Add and implement PlayerQuickKeys packet 7 years ago
David Cernat 8c47d63b08 [General] Update version to 0.6.2 7 years ago
Koncord d702845026 [General] Fix Clang warnings in Log.hpp 7 years ago
Koncord 6cb9c3c713 [General] Remove explicit specifier 7 years ago
Koncord 5c79e7106f [Browser] Minor improvements 7 years ago
David Cernat 4845599bda Merge pull request #308 from TES3MP/master while resolving conflicts
# Conflicts:
#	apps/openmw-mp/main.cpp
7 years ago
David Cernat 182f8c1f06 [General] Print client version on startup 7 years ago
David Cernat 61b1a59814 [General] Move server's version printing method to Utils 7 years ago
David Cernat cccbe753d7 [General] Update version to 0.7-alpha 7 years ago
Koncord 045dc566ea Merge branch 'master' into new-script-api 7 years ago
David Cernat ccb15cc09e [Client] When players die, make guards willing to arrest them again 7 years ago
Koncord f5e23d5fc6 [General] Empty strings should be sent too 7 years ago
Koncord d904628103 [General] Avoid limitation of 512 symbols in RakString Ctor 7 years ago
Koncord 510e657c93 Merge branch 'master' into new-script-api 7 years ago
Koncord 060ebe3d4a [Server] Init isWerewolf variable
Comment unused code
7 years ago
David Cernat 08df8f8d83 [General] Update version to 0.6.1 7 years ago
David Cernat 98a7769b91 Merge branch 'master' into 0.6.0 7 years ago
Koncord 54f5104345 [General] Escape format for strings 7 years ago
David Cernat cca4991e74 [Utils] Use consistent names for utility functions added by tes3mp 7 years ago