1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 22:19:54 +00:00
Commit graph

23 commits

Author SHA1 Message Date
David Cernat
bbf9f20053 [Client] Stop sending WorldKillCount packets or incrementing local kills
This means the server scripts are now required to send a WorldKillCount packet as a reply to ActorDeath packets sent by clients. This gives the server full control over which kills are counted, while also solving the previous problem of kills being counted only for actors that had finished their death animations.
2019-11-27 11:21:29 +02:00
David Cernat
afb9bd7eb5 [General] Implement script records for RecordDynamic packets 2019-11-09 21:34:09 +02:00
David Cernat
520cedb553 [Client] Use overrideRecord name for related functions in RecordHelper 2019-10-16 18:05:52 +03:00
David Cernat
d163f1b6da [General] Turn WorldKillCount into a Worldstate packet
Rename the old WorldKillCount that was a Player packet into PlayerPlaceholder. Rename the unused CellCreate that was a Worldstate packet into WorldKillCount. On the server, move kill count-related script functions from QuestFunctions to WorldstateFunctions.
2019-10-08 11:09:08 +03:00
David Cernat
031acffcbe [General] Implement cell records for RecordDynamic packets, part 1
New interior cells can be now be created that are either blank or based on existing interior cells.
2019-09-28 13:12:48 +03:00
David Cernat
0339958e21 [General] Rename Log class into TimedLog 2019-08-19 21:39:33 +03:00
David Cernat
ae5200cbb2 [General] Implement light records for RecordDynamic packets 2019-08-14 21:10:53 +03:00
David Cernat
18e2a14645 [General] Implement tool-related records for RecordDynamic packets 2019-08-04 17:53:18 +03:00
David Cernat
4100d93dea [General] Implement ingredient records for RecordDynamic packets 2019-08-03 06:19:22 +03:00
David Cernat
247d2fad30 [General] Implement activator & static records for RecordDynamic packets 2019-08-01 09:48:57 +03:00
David Cernat
e9336e53fc [General] Implement container and door records for RecordDynamic packets 2019-07-27 03:45:50 +03:00
David Cernat
b39e3f518b [Client] Use correct log levels for inventory and dynamic record packets 2018-11-30 23:38:16 +02:00
David Cernat
aed4ca2fd2 [Client] Allow use of baseId for more record types
Additionally, don't allow new enchantment records to be created if they have no effects, to avoid a crash.
2018-08-20 15:24:20 +03:00
David Cernat
b57807407a [General] Implement RecordDynamic packet, part 1
Spell, potion, enchantment, creature, NPC, armor, book, clothing, miscellaneous and weapon record data can now be sent in a RecordDynamic packet. Additionally, the packets include data related to associated magical effects (for spells, potions and enchantments), data related to default inventory contents (for creatures and NPCs) and data related to body parts affected (for armor and clothing).

The server now has associated script functions for setting most of the details of the above, with the main exception being individual creature and NPC stats.

Records can either be created entirely from scratch or can use an existing record (set via the baseId variable) as a starting point for their values. In the latter case, only the values that are specifically set override the starting values. Creature and NPC records also have an inventoryBaseId that can be used on top of the baseId to base their inventories on another existing record.

The client's RecordHelper class has been heavily expanded to allow for the above mentioned functionality.

When players create spells, potions and enchantments as part of regular gameplay, they send RecordDynamic packets that provide the server with the complete details of the records that should be created. When they create enchantments, they also provide the server with armor, book, clothing and weapon records corresponding to the items they've enchanted.

This functionality added by this packet was originally supposed to be exclusive to the rewrite, but I've gone ahead and tried to provide it for the pre-rewrite in a way that can mostly be reused for the rewrite.
2018-07-30 10:56:26 +03:00
David Cernat
0f0e8b7c08 [Client] Adjust log levels used for weather and global map 2018-07-21 12:08:31 +03:00
David Cernat
421d0e7a99 [Client] Make forceWeather false by default for client-sent weather 2018-07-21 05:21:26 +03:00
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.
2018-07-21 05:20:26 +03:00
David Cernat
bdf2f03c4f [General] Remove unnecessary MapChanges struct from BaseWorldstate 2018-07-12 05:06:31 +03:00
David Cernat
c23fc3446f [Client] Avoid sending map tiles for Wilderness cells 2018-07-06 03:54:34 +03:00
David Cernat
deda6ec071 [Client] Don't send WorldMap packets for already explored map tiles 2018-06-25 02:34:11 +03:00
David Cernat
72862dc255 [General] Turn PlayerMap into WorldMap, now a Worldstate packet 2018-06-07 12:51:45 +03:00
David Cernat
3efe05a88e [General] Implement WorldCollisionOverride packet 2018-05-27 16:05:40 +03:00
David Cernat
e8ec031a81 [Client] Create Worldstate class that inherits BaseWorldstate 2018-05-27 15:57:47 +03:00