Commit Graph

2754 Commits (ffi-server-rewrite)

Author SHA1 Message Date
David Cernat f481c85e07 [Client] Use ADD before REMOVE for PlayerInventory in repair/recharge
Previously, when recharging or repairing an item, the client sent a PlayerInventory packet to the server with the old version of the item that was supposed to be removed and then it sent a PlayerInventory packet with the new version of the item that was supposed to be added.

Unfortunately, the current CoreScripts make it so custom items using generated IDs have their records deleted when they are completely removed from the world, however briefly, even if they are added back immediately afterwards. In practice, this meant that – before this commit – recharging or repairing a custom item led to its removal from the player inventory stored on the server, followed by the deletion of its record, followed by its readdition to the inventory (but with the record staying deleted). Logging out and logging back in immediately prevented the player from receiving the item anymore because of its now non-existent record.
6 years ago
David Cernat 906d2a837d [Client] Send PlayerInventory packets when recharging items w/ soulgems 6 years ago
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.
6 years ago
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.
6 years ago
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.
6 years ago
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.
6 years ago
David Cernat 45b011452e [Client] Combine methods for sending spell packets into a single one 6 years ago
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
6 years ago
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.
6 years ago
Marc Zinnschlag fe19d8ff35 Merged pull request #1857 6 years ago
Andrei Kortunov 6202b4eca9 Do not touch GUI modes when taking screenshots (bug #4528) 6 years ago
Capostrophic e9e9c0dd6b Fix guild guide fast travelling to exteriors time 6 years ago
Capostrophic bcd9cc4baa Check the actor cell instead of the destination cell in fast travel price logic 6 years ago
Marc Zinnschlag b75b5d139a Merged pull request #1845 6 years ago
Capostrophic 7087bad580 Use special behavior for all topics with reserved names (bug #4557) 6 years ago
Andrei Kortunov b0f2e00e7f Make forcegreeting a non-op for non-actor objects (bug #4553) 6 years ago
Marc Zinnschlag 452a706047 Merged pull request #1837 7 years ago
Andrei Kortunov eeffe2e557 Check if item model exists inside drag and drop functions 7 years ago
Marc Zinnschlag eb5f558f6f Merged pull request #1839 7 years ago
Capostrophic 3ac030d75a
Handle explicit calls before handling quotes 7 years ago
Capostrophic fa6c205e5d Make tab autocompletion work with explicit reference calls 7 years ago
Andrei Kortunov 12144de8ed Initialize missing variables 7 years ago
Andrei Kortunov c0bed0fde2 Handle case when index < 0 7 years ago
Andrei Kortunov a08048da4e Avoid dereference after null check 7 years ago
Capostrophic ab29f9e13f Add permanent barter disposition change option (feature #3103) 7 years ago
Andrei Kortunov 0f2c3ecb17 Rescale player avatar (bug #4539) 7 years ago
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.
7 years ago
Capostrophic 9c8e284ead Fix quick key activation delay code (regression #4536) 7 years ago
David Cernat d93b67ef21 [General] Sync soul refIds for items and add related script functions 7 years ago
Capostrophic cac2bc768e
Fix NPC "can't teach more" message (bug #4494) 7 years ago
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.
7 years ago
David Cernat 36ac2d9de4 [Client] Set packetOrigin for all ObjectList packets sent 7 years ago
David Cernat 63a86f145d [Client] Record type of each InterpreterContext for later checking 7 years ago
David Cernat 2189ea1a63 [Client] Clean up sending of Container packets 7 years ago
David Cernat 21d5bb4d4e
Merge pull request #460 from OpenMW/master
Add 0.7.0 commits up to 20 Jul 2018
7 years ago
David Cernat b6db570d9c [Client] Display uniqueIndexes in a less confusing way in console 7 years ago
Andrei Kortunov edd5769022 Show magic items count in spells window (feature #4509) 7 years ago
David Cernat 6cb5ac6e63 Merge pull request #457 from OpenMW/master while resolving conflicts
Conflicts:
	CMakeLists.txt
	apps/openmw/engine.cpp
	apps/openmw/main.cpp
	apps/openmw/mwgui/windowmanagerimp.cpp
	apps/openmw/mwmechanics/character.cpp
	components/CMakeLists.txt
7 years ago
David Cernat 09da24f1ea [General] Rename all instances of refNumIndex into refNum
This creates symmetry with mpNum and should cause less confusion in the future.
7 years ago
Marc Zinnschlag ee759effce Merged pull request #1798 7 years ago
Andrei Kortunov c77c50e92b Make Equip console command to bypass most of restrictions (bug #4460) 7 years ago
David Cernat 4d4bced929 [Client] Allow singleplayer-only saves in main menu during multiplayer 7 years ago
terrabyte25 48296a7452
Update trainingwindow.cpp 7 years ago
David Cernat 6ff7fa525e [Client] Disable autosaving when waiting 7 years ago
Capostrophic bded697f07
Make Goodbye block using hyperlinks 7 years ago
David Cernat c2411982d2 [Client] Log object refNumIndexes and mpNums in a consistent way 7 years ago
David Cernat 7775780ad7 [Cllient] Update multiplayer code for handling quick keys 7 years ago
David Cernat a236ffc4be Merge pull request #456 from OpenMW/master while resolving conflicts
# Conflicts:
#	.travis.yml
#	README.md
#	apps/openmw/mwgui/quickkeysmenu.cpp
#	apps/openmw/mwmechanics/actors.cpp
#	apps/openmw/mwmechanics/combat.cpp
7 years ago
Thunderforge 7cbc4eeb49 Adding missing override keywords
Prevents compiler warnings such as this:

```
/Users/Will/CLionProjects/OpenMW/apps/openmw/mwgui/windowbase.hpp:65:22: warning: 'onOpen' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void onOpen();
                     ^
/Users/Will/CLionProjects/OpenMW/apps/openmw/mwgui/windowbase.hpp:38:22: note: overridden virtual function is here
        virtual void onOpen() {}
                     ^
```
7 years ago
Finbar Crago 5d9035c6b2 [Fixes #4482] Missing HandToHand on key quick key 0 (introduced in MR !11 for issue #4480)
because apparently i can't count to ten...
7 years ago