Commit graph

665 commits

Author SHA1 Message Date
David Cernat
fc5e883160 [General] Rework PlayerStatsDynamic packets so they are of minimal size 2017-12-02 18:29:30 +02:00
David Cernat
993cc3dfd6 [Server] Rename server "plugins"/"mods" into "modules" for clarity
The terms "plugins" and "mods" were used interchangeably to refer to collections of server scripts, which was bound to cause confusion later on, especially with client data files frequently being referred to as "plugins" and "mods" as well.

Moreover, the server configuration file now starts its manual ordering with "Module1" for consistency with the pluginlist.json (soon to be dataFileList.json) of the CoreScripts.
2017-12-02 15:39:08 +02:00
David Cernat
d1ad0c91f8 [General] Rework PlayerEquipment packets so they are of minimal size
Moreover, rename BaseNetCreature's equipedItems into equipmentItems.
2017-11-30 12:31:54 +02:00
David Cernat
bd9e8bd10f [General] Simplify storing of attribute and skill index changes 2017-11-29 16:55:51 +02:00
David Cernat
720ef5f6c5 [General] Use consistent code style 2017-11-29 13:00:22 +02:00
Koncord
e44fcdc0b3 [General] Cleanup Player packets 2017-11-28 21:38:45 +08:00
David Cernat
901fe72471 [Server] Fix variable shadowing in Player 2017-11-26 13:14:53 +02:00
David Cernat
a796f81444 [General] Add and use utility function for int value checks in vectors 2017-11-26 13:03:54 +02:00
Koncord
4ebfcc4a21 [Server] Limit handshake attempts 2017-11-26 00:18:19 +08:00
Koncord
729f6e745e [Server] Remove unused get() method from EventController 2017-11-26 00:00:31 +08:00
Koncord
e657934cef [Server] Add custom window API 2017-11-25 23:47:02 +08:00
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.
2017-11-24 14:28:05 +02:00
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.
2017-11-24 12:38:42 +02:00
David Cernat
64b57983f0 [General] Add TRACE log messages in player processors 2017-11-24 09:43:45 +02:00
David Cernat
07d75abdf8 [Server] Use consistent order for includes 2017-11-23 08:11:37 +02:00
David Cernat
d33254f287 [Server] Rename CharClass' isDefault() into isCustom()
It was already using the logic of isCustom() by mistake.
2017-11-19 12:35:11 +02:00
David Cernat
010a80ceca [Server] Place getters and setters in consistent order 2017-11-19 11:34:03 +02:00
David Cernat
947b3f76be [Server] Replace Player's isMale() and setIsMale() with gender property
For simplicity and clarity.
2017-11-19 11:06:35 +02:00
David Cernat
6f822f54aa [Server] Make chat commands case insensitive 2017-11-19 10:12:35 +02:00
David Cernat
a3e2ab4d4e [Server] Send correct packet for inventory changes 2017-11-19 04:24:54 +02:00
David Cernat
4cc0216e0a [Server] Send cell changes before position changes, and prioritize both
Previously, a script changing a player's cell and position at the same time would end up sending a position packet first and then a cell change packet that overrode the former, with the player ending up at the center of the destination cell instead of at the correct position.
2017-11-19 00:59:32 +02:00
David Cernat
80be664139 [Server] Fix skill-related script functions
Add getSkillIncrease() and setSkillIncrease() script functions to get and set the attribute bonuses received at the next level up as a result of skill increases.

Previously, getSkill() and setSkill() attempted to return and set the attribute bonuses, respectively. However, they mistakenly used a skill ID as a parameter for the attribute bonuses, when in fact npcStats.mSkillIncrease is an integer array of size 8 where the key stands for an attribute's ID. As a result, setSkill() had the unexpected side effect of messing up a player's major and minor skills because of the invalid values it was setting for npcStats.mSkillIncreases.
2017-11-18 10:02:52 +02:00
David Cernat
57a0415ba3 [Server] Send level packets in Player's update() at the appropriate time
Previously, trying to send a level packet after base info and character class packets in a script actually led to the level packet being sent first and then being overridden by the others, with the player ending up at level 1 on their client.
2017-11-18 03:55:17 +02:00
David Cernat
494b10b97e [Server] Send player packets in a more appropriate order
Previously, the fact that a character class packet got sent after a dynamic stats packet caused the dynamic stats to get overridden on the client by the class change.
2017-11-18 01:47:18 +02:00
David Cernat
ba161ddddd [Server] Make a few function names more consistent and fix typos 2017-11-17 04:12:25 +02:00
David Cernat
1272b03f25 [Server] Fix typo in player script function 2017-11-13 07:43:20 +02:00
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.
2017-11-13 05:33:27 +02:00
David Cernat
a8261bb385 [General] Fix printing of packet identifiers after changes to logger 2017-11-12 02:36:18 +02:00
Koncord
64b531aa3c [Server] Remove redundant argument 2017-11-07 06:37:09 +08:00
Koncord
d15c674584 [General] Move getFilenameTimestamp() to Utils 2017-11-07 05:33:10 +08:00
Koncord
0da44f69ad [Server] Isolate getModFolder() & getDataFolder() 2017-11-03 06:36:35 +08:00
Koncord
062d6a1824 [Server] Add sandboxed import() function 2017-11-03 06:36:35 +08:00
David Cernat
29cb51cdce [Server] Enable SOL_SAFE_USERTYPE for both Debug and RelWithDebInfo 2017-11-01 18:09:25 +02:00
Koncord
bd7082f57e [Server] Use custom Lua error handler not only on Windows
For some reason sol's default error handler does not wroking properly
2017-11-01 21:48:42 +08:00
David Cernat
71c921faa7 [Server] Rename property cell into description, initialize Cells type 2017-11-01 13:22:41 +02:00
David Cernat
5653d07c7b [Server] Fix build on Windows 2017-10-31 22:00:03 +02:00
Koncord
948090676a [Server] Impove Lua Error handler for Windows 2017-11-01 01:17:11 +08:00
David Cernat
b7e5e77166 [Server] Fix getCaseInsensitiveFilename, simplify Players.size() 2017-10-28 03:58:53 +03:00
David Cernat
378d30834b [Server] Add special error handler for Sol back in, but only for Windows 2017-10-28 01:44:02 +03:00
Koncord
14d47213ef [Server] Add Players.size() to Lua API 2017-10-28 02:34:45 +08:00
Koncord
e7a5919477 [Server] Fix path to native libs 2017-10-27 20:58:02 +08:00
Koncord
1aa630e4a9 [Server] Add StackWalker for Windows 2017-10-27 05:27:07 +08:00
Koncord
14fdec2478 [Server] Add forgotten stacktrace.cpp 2017-10-26 23:24:35 +08:00
David Cernat
878294e4fe Merge branch 'new-script-api' of https://github.com/TES3MP/openmw-tes3mp into new-script-api 2017-10-26 17:25:53 +03:00
Koncord
d44848ecbb [Server] Fix build 2017-10-25 16:05:45 +08:00
Koncord
05abb8ace3 [Server] Add Log level constants to lua 2017-10-25 15:22:07 +08:00
Koncord
04a844a9c0 [Server] Use sol's default_handler 2017-10-25 15:21:11 +08:00
Koncord
dad0b38f25 [Server] Add custom terminate handler with stacktrace 2017-10-25 14:45:36 +08:00
Koncord
a3d5fbbdcd [Server] Add stacktrace 2017-10-25 14:45:36 +08:00
Koncord
916ada108f [General] Modernize Log utility
* Reverse Log levels
* Add LOG_TRACE
* Spawn instance of Log in Get() function
2017-10-25 14:45:36 +08:00