Commit Graph

258 Commits (coverity_scan)

Author SHA1 Message Date
David Cernat b5b5551fcd [Client] Add LocalPlayer::hasFinishedCharGen() method 8 years ago
David Cernat 97aabf4a7d [General] Sketch out sending of cell loading/unloading info in packets 8 years ago
David Cernat 158d606477 [General] Leave one blank line at the end of every tes3mp code file 8 years ago
David Cernat 63c8a98083 [General] Stop using virtual functions in BasePlayer 8 years ago
David Cernat 1d9c6ddd81 [General] Add placeholders for the new packet ID_PLAYER_CELL_LOAD 8 years ago
David Cernat 35e453dec3 [General] Sketch out most of functionality for journal saving/loading 8 years ago
David Cernat d308897f95 Rename PacketItems, PacketSpells into InventoryChanges, SpellbookChanges 8 years ago
David Cernat e2c595fc5d Add preliminary structure for journal changes 8 years ago
David Cernat e9b22814b9 Create placeholder for ID_GAME_JOURNAL 8 years ago
David Cernat a69f294ef0 Rename ID_GAME_CELL into ID_PLAYER_CELL_CHANGE 8 years ago
David Cernat 83277a1512 Send spellbook in LocalPlayer CharGen & change UPDATE action name to SET 8 years ago
David Cernat 0f7748d9d2 When clearing LocalPlayer's spells, keep race and birthsign abilities 8 years ago
David Cernat 33e85c54de Rename BasePlayer Inventory & Spellbook into PacketItems & PacketSpells
This avoids confusion when either of those is used to store and send a single item, and no longer requires coming up with confusing variable names like realSpellbook or realInventory for actual full spellbooks and inventories.
8 years ago
David Cernat 78c6ab2a99 Clean up client Networking by putting item & spell logic in LocalPlayer 8 years ago
David Cernat b8a6020af1 Check for update to inventory when closing a container 8 years ago
Koncord b9c3849cc7 Change keycode to scancode 8 years ago
Koncord 7595b33461 Implement spellbook 8 years ago
Koncord 6e6237541a Fix "comparison between signed and unsigned integer expressions" 8 years ago
Koncord 804259b2c9 Change some printf to LOG_MESSAGE_SIMPLE
printf is not streamed to files
8 years ago
Koncord 2eda48acca Fix issue #111 8 years ago
Koncord 3ee82a761b Remove redundant include 8 years ago
Koncord 4371a65fc6 fix spaces 8 years ago
Koncord 9ca206dda9 Add hooks for containers 8 years ago
Koncord 536715cf46 Cleanup tes3mp headers 8 years ago
Koncord 753dc50131 Fix crash if connection has failed 8 years ago
David Cernat 9e290ad799 Fix spacing irregularities 8 years ago
David Cernat 95efb77e53 Implement sending of ID_GAME_SPELLBOOK from client 8 years ago
David Cernat 6ea5f08e9c Create placeholder for ID_GAME_SPELLBOOK 8 years ago
David Cernat ae39daf76a Add and implement ID_MUSIC_PLAY 8 years ago
David Cernat 456aee65d9 Add and implement ClearInventory() script function 8 years ago
David Cernat 80b40bfb70 Prevent inventory requests from making LocalPlayer send inventory twice 8 years ago
David Cernat 843e84ba26 Once again use RakNetGUID as index for player map everywhere
Because of frequent server crashes, I tried to simplify the player map indexes with commit c91e240664, but it had no noticeable effect and was later partially reverted by Koncord in commit 902e968fd9, apparently for reasons of readability.

For the sake of consistency, this commit completes his reversion.
8 years ago
David Cernat 7f25abb9c8 Implement UnequipItem() script function 8 years ago
David Cernat c1bd4f1ce3 Use correct item count in LocalPlayer::setEquipment() for new items 8 years ago
David Cernat fcd24ebb7e Rename methods to show they deal with Equipment instead of Inventory 8 years ago
David Cernat 3a733eb122 Make tes3mp includes consistent 8 years ago
David Cernat faea5221d3 Use LocalPlayer's updateInventory() every cell change, not every frame 8 years ago
Koncord e2522fa366 Simplify LOG macros 8 years ago
David Cernat eedd40328a Add and use SendInventory() method in LocalPlayer, and clarify some code 8 years ago
David Cernat c5c72a3b17 Use consistent names for booleans in LocalPlayer 8 years ago
David Cernat 6cd959fac8 Rename BasePlayer's GetCell() into getCell() 8 years ago
David Cernat fa9d6e810e Use lowerCamelCase in tes3mp client function names like OpenMW does 8 years ago
David Cernat 527024a026 Stop WorldPackets about invalid cells from causing framelistener errors 8 years ago
David Cernat a430ee011a Use WorldController to fetch CellStore for WorldPackets received 8 years ago
David Cernat 3dcb8738c1 Create placeholder WorldController class 8 years ago
David Cernat f7b5e5e638 Ignore packets from server that try to move LocalPlayer to invalid cells 8 years ago
Koncord c85e6a5f91 Fix sucess chance 8 years ago
Koncord 56959ebfda Implement magic 8 years ago
David Cernat 729da2c0ba Improve logic and clarity of LocalPlayer's charGenThread()
Until now, the fact that charGenThread() returned false whenever the player had a menu open was preventing Main::UpdateWorld() from running at all with a menu open.

The result was that no player packets from LocalPlayer::Update() were being sent by a player in a menu.
8 years ago
David Cernat 817b63922c Put DedicatedPlayer in ToddTest if his cell doesn't exist on our client 8 years ago
David Cernat 25afa47e08 Only declare ptrCellStore for WorldPackets that need it 8 years ago
Koncord 37e9cafbf7 Add new API function: SetConsoleAllow
example:
tes3mp.SetConsoleAllow(pid, 0) -- disallow console to the player

The console is allowed by default
8 years ago
Koncord 3759127627 Woops 8 years ago
Koncord adb49b7c7d Add New GUI dialog: ListBox
Example:

local GUI_LISTBOX = 42

function OnPlayerSendMessage(pid, message)
    if message == "/lb" then
        local items = "consectetur adipiscing elit\nsed do eiusmod tempor incididunt ut labore\net dolore magna aliqua." -- items can be separated through newline
        local label = "Lorem ipsum dolor sit amet"
        tes3mp.ListBox(pid, GUI_LISTBOX, label, items)
    end
end

function OnGUIAction(pid, idGui, data)
    if idGui == GUI_LISTBOX then
        print("ID: " .. idGui .. " data: " .. tostring(data)) -- if value higher than last item id
    end
end
8 years ago
David Cernat 107dacac6d Add OnPlayerChangeInventory server script callback 8 years ago
David Cernat 66e697953c Add missing break statement in Networking to prevent default nighttime 8 years ago
David Cernat 31d02e8bf1 Move Networking code for ID_GAME_INVENTORY next to ID_GAME_EQUIPMENT 8 years ago
David Cernat 4621363b65 Make capitalization reflect name of filename, and remove unused check 8 years ago
David Cernat 05cfc918f5 Temporarily use a whitelist for scripts instead of a blacklist 8 years ago
David Cernat 3c4b74cd14 Fix frame listener errors for player markers 8 years ago
David Cernat 9c12aa2141 Fix formatting 8 years ago
David Cernat 41504bd02a Use more accurate position for ID_OBJECT_PLACE 8 years ago
David Cernat a4647de048 Break away from OpenMW by giving RefNum indexes to new created objects 8 years ago
David Cernat 937bf97883 Send gold values correctly with ID_OBJECT_PLACE 8 years ago
David Cernat 180aa3f2f3 Send item count ID_WORLD_OBJECT_PLACE 8 years ago
David Cernat 1f982e4dc7 Find objects from world packets using both ID and reference number 8 years ago
David Cernat d93e66207e Update player markers only when getting a position packet 8 years ago
David Cernat 46397a7dac Add and implement ID_OBJECT_ANIM_PLAY 8 years ago
David Cernat fff6833950 Send ID_SCRIPT_MEMBER_SHORT from MWScript::InterpreterContext 8 years ago
David Cernat c205e793cb Add and implement ID_SCRIPT_MEMBER_SHORT 8 years ago
David Cernat c91e240664 Simplify the type of map that player objects are stored in 8 years ago
David Cernat 65363b0dd1 Avoid sending packets for 9 more ingame scripts 8 years ago
David Cernat a9f6ea4d8d Use the name "guid" for RakNet IDs so as to not confuse with int IDs 8 years ago
David Cernat 47854d631b Avoid sending packets for 2 more ingame scripts 8 years ago
David Cernat c99c3b1486 Avoid sending packets for 3 additional spammy ingame scripts 8 years ago
David Cernat 97468980af Add and implement 3 new WorldPackets for ingame script variable values 8 years ago
David Cernat 75f6d82f08 Add a way of filtering out ingame scripts for upcoming script packets 8 years ago
David Cernat 385b5f39e3 Add and implement ID_OBJECT_ROTATE 8 years ago
David Cernat 54ed9a7ab4 Implement ID_OBJECT_MOVE and send it from ingame scripts 8 years ago
David Cernat c25ebc34b3 Shorten WorldPacket IDs by removing WORLD from them 8 years ago
David Cernat bdb53e1cb4 Implement ID_WORLD_DOOR_ACTIVATE and send it from MWBase::World 8 years ago
David Cernat 7264f13b8e Implement ID_WORLD_OBJECT_SCALE and send it from ingame scripts 8 years ago
David Cernat b2688777c1 Create marker once a player has been initialized properly and fix debug 8 years ago
David Cernat b6111d16cc Add and implement ID_WORLD_VIDEO_PLAY 8 years ago
David Cernat c54af2b02b Make DedicatedPlayer's setMarkerState method actually enable markers 8 years ago
David Cernat 1e4d625c99 Make player markers show up in exterior cells 8 years ago
David Cernat 04eb051df6 Make markers get removed when their players quit, rename marker methods 8 years ago
David Cernat 3fd93896f2 Add and implement ID_WORLD_OBJECT_LOCK 8 years ago
David Cernat 08ea5163c4 Add and implement ID_WORLD_OBJECT_UNLOCK 8 years ago
David Cernat e7567020bb Fix debug for ID_WORLD_OBJECT_DELETE in client's Networking 8 years ago
David Cernat d85a1ee1a9 Fix errors remaining from merge with tes3mp-packetexpansion 8 years ago
David Cernat c639337842 Merge with tes3mp-packetexpansion by fixing conflicts
# Conflicts:
#	apps/openmw-mp/Networking.cpp
#	apps/openmw/mwmp/Networking.cpp
#	components/CMakeLists.txt
#	components/openmw-mp/NetworkMessages.hpp
#	components/openmw-mp/PacketsController.cpp
8 years ago
David Cernat 0a44bea91d Send cell coordinates in tes3mp using mData instead of mCellId.mIndex 8 years ago
David Cernat cbc132612a Use mRefNum.mIndex instead of just mRefNum and add extra debug 8 years ago
David Cernat 17f66e4e90 Implement ID_WORLD_OBJECT_PLACE 8 years ago
Koncord df3886168f Word wrapping in chat 8 years ago
Koncord c27351c19e Implement inventory functions
AddItem, RemoveItem, GetItemName, GetItemCount, GetItemHealth, GetInventorySize SendInventory
Example:
```lua
tes3mp.AddItem(pid, "glass dagger", 1, 50)
tes3mp.AddItem(pid, "glass dagger", 1, -1)
tes3mp.SendInventory(pid)
tes3mp.RemoveItem(pid, "glass dagger", 1)
tes3mp.SendInventory(pid)
local invSize = tes3mp.GetInventorySize(pid) - 1
for i = 0, invSize do
    print(("%s %d %d"):format(tes3mp.GetItemName(pid, i), tes3mp.GetItemCount(pid, i), tes3mp.GetItemHealth(pid, i)))
end
```
8 years ago
David Cernat 6e43baf73e Send Cell instead of CellId because of problems with the latter 8 years ago
David Cernat 103b1e3f72 Send CellId in ID_WORLD_OBJECT_DELETE 8 years ago
David Cernat 2e57e25675 Only delete object from ID_WORLD_OBJECT_DELETE if it actually exists 8 years ago