Commit Graph

30 Commits (ffi-server-rewrite)

Author SHA1 Message Date
David Cernat 892d71ce71 [General] Reimplement weather synchronization to allow soft transitions
Although weather sync was added by Koncord to the rewrite in fd721143e2 in a way that used surprisingly few lines of code, it relied on the server requesting weather states every second from authority players and sending them to non-authority players, while also allowing only very sudden weather transitions across regions, i.e. if there was one player in the Ascadian Isles who had stormy weather, and another player with clear weather in the Bitter Coast Region walked across to the Ascadian Isles, that player was instantly made to have stormy weather with no kind of transition at all.

My approach solves both of those problems. It solves the packet spam by only sending weather updates to the server when weather changes happen or when there are new arrivals to a weather authority's region, and it allows for both sudden weather transitions when players teleport to a region and for soft, gradual transitions when players walk across to a region. It is inspired by my previous actor sync, and uses a WorldRegionAuthority packet to set players as region authorities in a similar way to how ActorAuthority sets players as cell AI authorities. Weather changes are created only by the region authority for a given region, and weather packets are also only sent by that authority.

However, it should be noted that gradual weather transitions are used by default in this implementation. To use sudden weather transitions, the serverside Lua scripts need to forward WorldWeather packets with the forceWeather boolean set to true. That is, however, already handled by our default Lua scripts in situations where it makes sense.
7 years ago
David Cernat 50fe54af5d [Client] Update DedicatedPlayer creature if displayCreatureName changes 7 years ago
David Cernat a01fc577f1 [Client] Add setAttributes() and setSkills() methods to DedicatedPlayer 7 years ago
David Cernat 68ee64902d [Client] Track & use previous race & creatureRefId for DedicatedPlayers 7 years ago
David Cernat 70f9cb535e [General] Use RecordHelper methods to create and update DedicatedPlayers 7 years ago
David Cernat c132dc70d2 [Client] Make PlayerShapeshift turn DedicatedPlayers into creatures 7 years ago
David Cernat 141eb8b7c2 [Client] Streamline creation of references for DedicatedPlayers
Additionally, delete DedicatedPlayers who disconnect.

Previously, all disconnected DedicatedPlayers were still kept in memory, but never used again. There was code that suggested they were meant to be reused upon reconnecting, but that reuse had never actually been implemented, and would probably not be that useful anyway.
7 years ago
David Cernat 14f90e773d [Client] Split up creation of DedicatedPlayers into multiple methods
Additionally, print player guids using their string representations for consistency.

The creation and updating of DedicatedPlayer references remains very inelegant, but this commit is the first step towards fixing that.
7 years ago
David Cernat be25decee2 [General] Implement PlayerSpeech packet 7 years ago
David Cernat 413893aa51 [General] Implement PlayerAnimPlay packet 7 years ago
David Cernat 43a3daf0aa [General] Add & implement PlayerShapeshift packet for werewolf states 8 years ago
David Cernat 8f5e6531db [Client] Avoid updating positions and anim flags when framerate is low
Also rename DedicatedPlayer methods so they are consistent with those from DedicatedActor
8 years ago
David Cernat 809b4d78ba [Client] Split off DedicatedPlayer and PlayerList into different files 8 years ago
David Cernat 44476248b7 [Client] Add and use DedicatedPlayer::update() 8 years ago
David Cernat 4e86d8781f [Client] Clean up & simplify logic for DedicatedPlayer cell transitions 8 years ago
David Cernat 2e8714afaa [Client] Rethink and restructure tes3mp combat code so it works for NPCs 8 years ago
David Cernat 07c2d4251e [Client] Add and use mwmp::PlayerList::isDedicatedPlayer() 8 years ago
David Cernat 7c45888f05 [Client] Reorder methods in DedicatedPlayer 8 years ago
David Cernat 0aaf68c994 [Client] Rename mwmp::Players into mwmp::PlayerList for clarity 8 years ago
David Cernat c05c456b11 [Client] Clean up parts of LocalPlayer and DedicatedPlayer 8 years ago
David Cernat e7960eee76 [General] Rename DrawState packets into AnimFlags ones for clarity 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 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 fa9d6e810e Use lowerCamelCase in tes3mp client function names like OpenMW does 8 years ago
Koncord 56959ebfda Implement magic 8 years ago
David Cernat c91e240664 Simplify the type of map that player objects are stored in 8 years ago
David Cernat 04eb051df6 Make markers get removed when their players quit, rename marker methods 8 years ago
Koncord b704519078 Show dedicated players on minimap 8 years ago
Koncord 1b259e2d33 Syncing inventory, animations, position, 8 key attributes
Created Package system
9 years ago