Commit Graph

86 Commits (sol2-server-rewrite)

Author SHA1 Message Date
David Cernat 176aa62b15 Merge pull request #446 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/Script/Functions/Cells.cpp
	apps/openmw-mp/Script/Functions/Cells.hpp
	apps/openmw-mp/Script/Functions/Worldstate.cpp
	apps/openmw-mp/Script/Functions/Worldstate.hpp
	apps/openmw-mp/Script/ScriptFunctions.hpp
	apps/openmw-mp/processors/player/ProcessorPlayerMap.hpp
	apps/openmw/mwmp/processors/player/ProcessorPlayerMap.hpp
	components/openmw-mp/Base/BasePlayer.hpp
	components/openmw-mp/Packets/Player/PacketPlayerMap.hpp
	components/openmw-mp/Packets/Worldstate/PacketWorldMap.cpp
7 years ago
David Cernat c5f33e451f Merge pull request #418 from TES3MP/0.6.3 while resolving conflicts 7 years ago
David Cernat 4846497078 Merge pull request #415 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/Script/Functions/Positions.cpp
	apps/openmw-mp/Script/Functions/Positions.hpp
	apps/openmw-mp/Script/Functions/World.cpp
	apps/openmw-mp/Script/Functions/World.hpp
	apps/openmw-mp/Script/Script.hpp
	apps/openmw-mp/Script/ScriptFunctions.cpp
	components/openmw-mp/Base/BasePlayer.hpp
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 34893ff631 [Server] Split up handshake handling into multiple functions for debug
Unfortunately, the handshake attempt limit implemented in 4ebfcc4a21 for 0.7 and then ported over to 0.6 in a3a341fee6 does not appear to work properly, which is why gathering more information on it is important.
7 years ago
David Cernat a3a341fee6 [Server] Reimplement 4ebfcc4a21 for 0.6 7 years ago
Koncord f2a88e6a37 [Server] Use multiple parameters instead functions for Mark functions 7 years ago
David Cernat 3b865244d0 [Server] Fix typo related to player deletion 7 years ago
David Cernat 4e9cac96c7 [Server] Add scale and selected spell functions to Player in Sol 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 029dfc56ba [General] Implement player scale as part of PlayerShapeshift 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 cb86557aca [Server] Init Player::inUpdateQueue 7 years ago
Koncord c4949ac5d9 [General] Change regular enums to enum class 7 years ago
Koncord 8f5d31cb03 [Server] Iterate only through updated players on each frame 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 f2eca2566f [Server] Add storedData table for Player to increase clarity
This way, customData is meant to hold module-specific and temporary data while storedData is meant to hold persistent core data.
7 years ago
Koncord 077a3d06b3 [General] Change type of BasePlayer::resurrectType to ResurrectType 7 years ago
Koncord 44dc153ebe [Server] Add Weather API 7 years ago
Koncord dd352f0a91 [Server] Improve Player::sendToLoaded() 7 years ago
Koncord 585c24cee8 [Server] Optimize CellController 7 years ago
Koncord ff8b5061b4 [Server] Modernize CellController singleton 7 years ago
David Cernat ad61d88cb1 [General] Fix typos and use consistent style for recent additions 7 years ago
Koncord 392e645fe5 [Server] Add isMarkedForDeleteion function 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 bd9e8bd10f [General] Simplify storing of attribute and skill index changes 7 years ago
David Cernat 901fe72471 [Server] Fix variable shadowing in Player 7 years ago
David Cernat a796f81444 [General] Add and use utility function for int value checks in vectors 7 years ago
Koncord 4ebfcc4a21 [Server] Limit handshake attempts 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 07d75abdf8 [Server] Use consistent order for includes 7 years ago
David Cernat 010a80ceca [Server] Place getters and setters in consistent order 7 years ago
David Cernat 947b3f76be [Server] Replace Player's isMale() and setIsMale() with gender property
For simplicity and clarity.
7 years ago
David Cernat a3e2ab4d4e [Server] Send correct packet for inventory changes 7 years ago
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.
7 years ago
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.
7 years ago
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.
7 years ago
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.
7 years ago
David Cernat 1272b03f25 [Server] Fix typo in player script function 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 dffd3bfa7d [Server] Add customData to Player
example:
counter = 0

Event.register(Events.ON_PLAYER_CONNECT, function(player)
    player.customData.counter = counter
    counter = counter + 1
    return true
end)

CommandController.registerCommand("test", function(player, args)
    player:message(player.customData.counter, false)
    return true
end, "")
7 years ago
David Cernat bbac26294f [Server] Fix typos and make all files end with newlines 7 years ago
Koncord 2d0840cb3a [General] Modernize Script API
This commit changes the style of tes3mp serverside scripting mods. Short list of changes:
* Break compatibility with old server mods
* OOP style lua API
* Basic dependency checker, allowing the installation of multiple server mods without changing configs
* Remove support for C++ plugins
* Change outdated LuaBridge to [sol2](https://github.com/ThePhD/sol2);
* Support GCC, Clang and MSVC compilers
* New environment variables: "TES3MP_SERVER_DIR" and "TES3MP_SERVER_USERDIR";
* New entity "Command controller" for registering new chat commands;
* New Event system
* Simplified Timer API
* All Lua mods now run in their own environments
* Add global namespace - Data that can be used for communicating between mods
* Player and Actor inherit base class NetActor
7 years ago
David Cernat d543edbd9a [Server] Make sure players are initialized as non-werewolves 8 years ago
David Cernat 3c30801eac [Server] Try to fix server crash from iterations through invalid players 8 years ago
David Cernat 4d81455020 [General] Rework and simplify death reasons so they work with NPCs 8 years ago
David Cernat c6c0e4acc9 [Server] Fix Cell::sendToLoaded() part 2, and fix Player::sendToLoaded() 8 years ago
Koncord 690211ad99 [General] Extract BaseEvent & BasePlayer from packets to functions
Move Send and Read functions to BasePacket
8 years ago