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

760 commits

Author SHA1 Message Date
David Cernat
b6324e3532 [Client] Clean up debug for spell usage 2018-07-21 09:41:36 +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
9823a77bf2 [General] Turn PlayerRegionAuthority into WorldRegionAuthority
WorldRegionAuthority is a Worldstate packet.
2018-07-17 09:21:13 +03:00
David Cernat
0b5cb15f71 [General] Turn GameWeather into WorldWeather, now a WorldstatePacket 2018-07-16 02:20:43 +03:00
David Cernat
3649cf553f [General] Rename PlayerKillCount into WorldKillCount
This should clarify the real meaning of the packet and its associated event.

The event itself has been renamed from OnPlayerKillCount to OnWorldKillCount.
2018-07-15 05:34:59 +03:00
David Cernat
f13705e8be [Client] Improve debug for ObjectActivate and ConsoleCommand 2018-07-15 04:09:19 +03:00
David Cernat
6ebe09375f [General] Implement ObjectActivate packet & associated script functions 2018-07-15 03:16:04 +03:00
David Cernat
81b160cae8 [General] Add placeholder for ObjectActivate packet 2018-07-15 01:08:31 +03:00
David Cernat
61da0d2475 [General] Turn PlayerInteraction into PlayerInput 2018-07-15 00:36:07 +03:00
David Cernat
32b6134fad [General] Add placeholder for CellReplace packet 2018-07-15 00:17:13 +03:00
David Cernat
a471f5e452 [General] Turn CellCreate into a Worldstate packet 2018-07-14 23:51:49 +03:00
David Cernat
743933134d [Client] Simplify sending of ActorAI packets for uninitialized actors 2018-07-14 01:00:27 +03:00
David Cernat
528bd26a3b [General] Allow followers to follow non-authority players through cells 2018-07-13 21:27:29 +03:00
David Cernat
6c1173d598 [Client] Rename searchPtrViaRefIndex into searchPtrViaUniqueIndex 2018-07-13 04:33:54 +03:00
David Cernat
09da24f1ea [General] Rename all instances of refNumIndex into refNum
This creates symmetry with mpNum and should cause less confusion in the future.
2018-07-13 04:12:03 +03:00
David Cernat
6316f1e590 [Client] Add ActorList methods for sending ActorAI packets
Additionally, use consistent capitalization for AI-related methods.
2018-07-12 20:48:47 +03:00
David Cernat
0fd8f7660b [Client] Replace LocalActor arg with BaseActor in ActorList functions 2018-07-12 20:15:04 +03:00
David Cernat
bdf2f03c4f [General] Remove unnecessary MapChanges struct from BaseWorldstate 2018-07-12 05:06:31 +03:00
David Cernat
59a56ca35e [Client] Disallow clients from scaling their associated players
Additionally, display messages when trying to scale players.
2018-07-12 03:29:38 +03:00
David Cernat
8ca29dbaac [Client] Fix remaining mistakes in debug for received ActorAI packets 2018-07-11 23:11:37 +03:00
David Cernat
25f7a55495 [Client] Improve debug for received ActorAI packets 2018-07-11 19:54:56 +03:00
David Cernat
bff6e9e235 [General] Implement ActorAI packet, part 5
Allow repetition for AiWander package to be turned on and off.
2018-07-10 23:18:32 +03:00
David Cernat
2e31c212c0 [Client] Make any ActorAI packet override an actor's desire to fight 2018-07-10 11:33:07 +03:00
David Cernat
79ee976c95 [Client] Implement ACTIVATE action in DedicatedActor::setAI()
Additionally, clean up usage of CreatureStats in DedicatedActor.
2018-07-10 11:31:51 +03:00
David Cernat
00c13ae96c [General] Implement ActorAI packet, part 4
The server can now make actors activate players and objects, at least in theory. In practice, OpenMW''s AiActivate package needs to be worked so it allows specific objects as targets instead of just refIds.
2018-07-10 07:07:37 +03:00
David Cernat
0e13207afe [General] Implement ActorAI packet, part 3
The server can now cancel actor AI, make actors travel to a location, make actors wander, and make actors get escorted by a player or another actor.
2018-07-10 05:07:58 +03:00
David Cernat
5baef09f79 [General] Implement ActorAI packet, part 2
The server can now make actors start combat with players or other actors.
2018-07-10 02:47:52 +03:00
David Cernat
5628f3b977 [Client] Fix debug for DedicatedActor::setAI() 2018-07-10 02:05:10 +03:00
David Cernat
b86155dc11 [Client] Allow AiFollow package to have infinite distance when desired 2018-07-10 01:40:57 +03:00
David Cernat
864c66d1d4 [Client] Make sure hasAiTarget is set correctly for DedicatedActors 2018-07-10 01:35:38 +03:00
David Cernat
3ed9d89280 [General] Use separate variables for video & music filenames in packets 2018-07-07 14:40:35 +03:00
David Cernat
509882b5f6 [Client] Rework MechanicsHelper::getTarget() to avoid crashes 2018-07-07 11:43:57 +03:00
David Cernat
4eb72eecb1 [Client] Fix crash for invalid CellRefs in MechanicsHelper::getTarget() 2018-07-06 18:39:14 +03:00
David Cernat
4b30a44816 [Client] Compare crimeTime and deathTime when NPCs forgive player crimes
Previously, all crime witnesses stopped being hostile to a respawning player for as long as the player's diedSinceArrestAttempt was true. That meant that, in an area with no guards to arrest the player, crime witnesses did not enage in combat with the player at all ever again until diedSinceArrestAttempt became false.

This commit makes it so the time of the last crime is recorded for each witness, and that is then compared with the time of the LocalPlayer's last death for a one-time crime forgiveness during that player's current life.

This is essentially a gameplay adjustment for "singleplayer with respawns," and will have to be reworked to make sense for every player in multiplayer, though that requires reworking the crime system as a whole and is thus on hold.
2018-07-06 14:17:54 +03:00
David Cernat
c23fc3446f [Client] Avoid sending map tiles for Wilderness cells 2018-07-06 03:54:34 +03:00
David Cernat
17c234d9ca [Client] Use initial values for LocalPlayer and LocalActor killers 2018-07-06 02:07:55 +03:00
David Cernat
97cd3effa7 [Client] Make actor debug consistent with object debug 2018-07-06 00:32:45 +03:00
David Cernat
c075496748 [General] Replace deathReason in death packets with a killer variable
Add serverside script functions for determining the killers of both players and actors.

Use unsigned ints for script functions returning an object or actor's refNumIndex or mpNum.

Remove updateDeadState() from LocalPlayer and make its code part of updateStatsDynamic() for simplicity.
2018-07-05 22:24:51 +03:00
David Cernat
f02492a593 [General] Temporarily include target names in mwmp::Target
These will be removed once the server can get the names matching refIds by reading content files.
2018-07-05 19:40:28 +03:00
David Cernat
691b332d03 [Client] Use MechanicsHelper::getTarget() for summoners in ObjectList 2018-07-05 16:38:03 +03:00
David Cernat
130a32ebb0 [Client] Add new methods for handling mwmp::Target in MechanicsHelper 2018-07-05 16:36:52 +03:00
David Cernat
c2411982d2 [Client] Log object refNumIndexes and mpNums in a consistent way 2018-07-04 21:54:11 +03:00
David Cernat
8a23a96da4 [Client] Update initialization of AiFollow packages in multiplayer code 2018-07-04 04:00:12 +03:00
Koncord
c5c1a160b2 [Client] Comment out an unused variable 2018-07-03 03:35:48 +08:00
David Cernat
bef53749ed [General] Replace BaseObject's hasMaster variable with isSummon
Additionally, add a GetObjectSummonState() script function to the server.
2018-07-02 02:25:06 +03:00
David Cernat
958b220835 [General] Send summon duration to server in ObjectSpawn packets 2018-07-01 00:43:29 +03:00
David Cernat
7ffdb18bf9 [General] Implement ActorDeath packet, part 1
ActorDeath packets are sent for dead actors before their StatsDynamic packets. They contain the actor's deathReason in a manner similar to that of PlayerDeath packets.

A future commit will replace the deathReason with a variable named killer which will be an mwmp::Target.
2018-06-27 21:47:55 +03:00
David Cernat
fec500c4b0 [Client] Reduce container debug spam by requiring VERBOSE logging for it 2018-06-26 23:40:19 +03:00
David Cernat
914b79fcc9 [General] Make it possible to check which placed objects have containers 2018-06-26 16:56:08 +03:00