Commit Graph

178 Commits (coverity_scan)

Author SHA1 Message Date
David Cernat 2f644e9b14 [Server] Add script functions for getting info about cell state changes 8 years ago
David Cernat 70823d011d [Server] Define CELLAPI 8 years ago
David Cernat 0cc20d26ce [Server] Move script functions for cells to a new CellFunctions class 8 years ago
David Cernat 62f359e250 [Server] Rename Translocations into Positions 8 years ago
David Cernat 96bd21a7ca [Server] Rename OnPlayerCellLoad to OnPlayerCellState, add action param 8 years ago
David Cernat 158d606477 [General] Leave one blank line at the end of every tes3mp code file 8 years ago
David Cernat 73d39c1a0a [General] Stop using virtual functions in BasePlayer, part 2 8 years ago
David Cernat 63c8a98083 [General] Stop using virtual functions in BasePlayer 8 years ago
David Cernat c62a575a9e [Server] Change order of words in the names of script callbacks 8 years ago
David Cernat 1d9c6ddd81 [General] Add placeholders for the new packet ID_PLAYER_CELL_LOAD 8 years ago
David Cernat f9feaf05f0 [Server] Add script callbacks for object placement and deletion 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 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 e7675d94d4 Make server script functions for spells consistent with those from items 8 years ago
David Cernat 6b14ca0775 Finish renaming of script functions for sending items and spells 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
Koncord e92df0c465 Implement SetModname, SetHostname functions 8 years ago
Koncord dbbdb1071c Use default FindLua51 instead homebrew 8 years ago
Koncord 7595b33461 Implement spellbook 8 years ago
Koncord 6e6237541a Fix "comparison between signed and unsigned integer expressions" 8 years ago
U-VirtualBox-PC\Admin 6229269506 Some patches for lua on windows 8 years ago
Koncord 804259b2c9 Change some printf to LOG_MESSAGE_SIMPLE
printf is not streamed to files
8 years ago
David Cernat 4e23fc0a5b Send action parameter to OnPlayerChangeSpellbook 8 years ago
David Cernat 9e290ad799 Fix spacing irregularities 8 years ago
David Cernat d4b5c826f8 Fix typo in spell script functions 8 years ago
David Cernat c81b58e1be Add spell script functions to tes3mp server 8 years ago
David Cernat 95efb77e53 Implement sending of ID_GAME_SPELLBOOK from client 8 years ago
David Cernat 456aee65d9 Add and implement ClearInventory() script function 8 years ago
David Cernat 7fae28ce91 Prevent RemoveItem() script function from clearing inventorySendBuffer
Up to this commit, the following commands in a Lua script led to the target player receiving all three items, as expected:

    tes3mp.AddItem(self.pid, "common_shirt_01", 1, -1)
    tes3mp.AddItem(self.pid, "common_pants_01", 1, -1)
    tes3mp.AddItem(self.pid, "common_shoes_01", 1, -1)
    tes3mp.SendInventory(self.pid)

This, on the other hand, only led to the removal of the last item specified (in this case, the shoes):

    tes3mp.RemoveItem(self.pid, "common_shirt_01", 1)
    tes3mp.RemoveItem(self.pid, "common_pants_01", 1)
    tes3mp.RemoveItem(self.pid, "common_shoes_01", 1)
    tes3mp.SendInventory(self.pid)

Inventory functions are bound to remain confusing, but they should at least be consistent in their behavior.
8 years ago
David Cernat 7f25abb9c8 Implement UnequipItem() script function 8 years ago
David Cernat 56928bdc4c Clean up inventory script functions so they are usable for equipment too 8 years ago
David Cernat 356143faed Rename GetEquipmentSlotCount() into GetEquipmentSize() 8 years ago
David Cernat 977e93288e Add GetEquipmentSlotCount() to item script functions 8 years ago
Koncord f5f1a29f31 Change printf to LOG_MESSAGE_SIMPLE 8 years ago
Koncord 18026d4a50 Fix include guard 8 years ago
Koncord e2522fa366 Simplify LOG macros 8 years ago
David Cernat 46b41b605a Revert "Use lowerCamelCase in tes3mp server script function names, part 1"
This reverts commit 0e2b589cdb.
8 years ago
David Cernat ad43cb5473 Revert "Use lowerCamelCase in tes3mp server script function names, part 2"
This reverts commit 80d16fe1fd.
8 years ago
David Cernat 6cd959fac8 Rename BasePlayer's GetCell() into getCell() 8 years ago
David Cernat 80d16fe1fd Use lowerCamelCase in tes3mp server script function names, part 2 8 years ago
David Cernat 0e2b589cdb Use lowerCamelCase in tes3mp server script function names, part 1 8 years ago
David Cernat 25dc2b19e7 Use lowerCamelCase in tes3mp server networking function names 8 years ago
David Cernat dc9b814ff6 Fix typo in server script translocations 8 years ago
David Cernat 841e93d5e0 Use new SendCell() method in server scripts to send cell packets 8 years ago
David Cernat 5b39916894 Use new SendPos() method in server scripts to send position packets 8 years ago
David Cernat e0c88150c3 Reorder functions for server script translocations 8 years ago
Koncord 82f202c891 Implement GetAvgPing(pid) function 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 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 3380c482c0 Fix errors remaining from merge with tes3mp-packetexpansion, part 2 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
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 bda1f867fd Rename server's GetController() method into GetPlayerController() 8 years ago
Koncord 79532cf797 Detecting reason of death 8 years ago
David Cernat 4b96080521 Make GetItemSlot work and add SendEquipment in server item functions 8 years ago
David Cernat 6650b74498 Add handling of skill increases 8 years ago
David Cernat 977b277cdd Add missing entries for level progress functions 8 years ago
David Cernat a0e9a672a5 Split updateClassStats in 3 and add handling of level progress 8 years ago
David Cernat 56a2c70911 Use double instead of int for skill progress functions 8 years ago
David Cernat ae4950ce49 Add server stat functions for getting and setting skill progress 8 years ago
David Cernat bc0aa86bcf Make variable names more consistent and easier to understand 8 years ago
David Cernat 7a1531c01b Fix script functions for setting dynamic stats, part 2 8 years ago
David Cernat 458bdf4dff Fix script functions for setting dynamic stats 8 years ago
David Cernat 433190d82e Rename OnPlayerUpdateEquiped into OnPlayerChangeEquipment 8 years ago
Koncord 94f6ab30f2 Fix GetProtocolVersion 8 years ago
David Cernat b6086ab015 Rename ID_GAME_DYNAMICSTATS_CURRENT into ID_GAME_DYNAMICSTATS 8 years ago
David Cernat 57f07813b0 Rename ID_GAME_UPDATE_POS into ID_GAME_POS 8 years ago
David Cernat 26487598a6 Rename ID_GAME_UPDATE_EQUIPED into ID_GAME_EQUIPMENT 8 years ago
David Cernat 9fd5ae981e Add missing backslash 8 years ago
David Cernat ce4b326b02 Rename ID_GAME_UPDATE_BASESTATS into ID_GAME_DYNAMICSTATS_CURRENT 8 years ago
David Cernat 295f486a97 Using less confusing names for server stat functions, part 2 8 years ago
David Cernat 69030579c1 Using less confusing names for server stat functions 8 years ago
David Cernat 7ae9ea7465 Add server stat functions for getting attribute and skill counts 8 years ago
David Cernat 57703482b2 Fetch attribute and skill counts in server stat functions 8 years ago
David Cernat 4d7130b12f Improve logic for script-induced cell changes 8 years ago
David Cernat 01af4f3bbc Update position before sending cell packet 8 years ago
David Cernat 1ee2458f6e Add packet for player levels, part 2 8 years ago
David Cernat 046a1ea899 Add packet for player levels 8 years ago
Koncord 61c5456373 Log callbacks 8 years ago
Koncord e661a35ac2 Fix checking strings in SetName & SetBirthsign 8 years ago
Koncord babc3230b7 Add new functions: GetServerVersion & GetProtocolVersion 8 years ago
David Cernat ff94b5f1ac Fix unsuitable variable name 8 years ago
David Cernat 970e9aff2f Remove old class methods and don't include class in ID_GAME_BASE_INFO 8 years ago
David Cernat a20e7890a2 Fix formatting 8 years ago
Koncord cf1a0113a1 Time API 8 years ago
David Cernat 5e6a374687 Add comment about MesssageBox to prevent future confusion 8 years ago
David Cernat 857defadbc Revert one unnecessary renaming of MessageBox 8 years ago
David Cernat 32ce7e97a8 Fix build for Windows server 8 years ago
Koncord 1186d09ec0 ScriptFunctions.hpp size reduction 8 years ago
Koncord 11eae277a9 Characters Class API
Added some new functions
8 years ago
David Cernat 00e7810428 Add script functions for saving and loading non-custom player classes 8 years ago
David Cernat 5385563972 Let players inform others about Lua script-induced cell & pos changes 8 years ago
Koncord fc4d8b82fb Stubs for minimap 8 years ago
David Cernat 7691bcc958 Add server script callbacks for attribute and skill changes 8 years ago