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

455 commits

Author SHA1 Message Date
David Cernat
b46767de6e [Server] Clean up recent additions to ServerFunctions 2019-03-19 03:57:16 +02:00
David Cernat
a0ec9dfd2e [Server] Rename OnRequestPluginList into OnRequestDataFileList 2019-03-12 03:18:57 +02:00
David Cernat
986528c67d [Server] Add error message as argument to OnServerScriptCrash 2019-03-12 02:15:20 +02:00
David Cernat
552a94a0ca [Server] Add OnServerScriptCrash script event 2019-03-10 00:46:40 +02:00
David Cernat
a508a0faf8 [Server] Turn GetArguments() from ScriptFunctions into Utils function 2019-02-24 01:43:04 +02:00
Koncord
0df32accca [Server] Fix ARM build 2019-01-21 12:02:02 +08:00
David Cernat
6e1504f0a1 [Server] Use clearer variable & function names in TimerAPI 2018-12-30 04:15:53 +02:00
David Cernat
42b5a8054f [Server] Remove unusable position functions for players 2018-12-30 03:17:37 +02:00
Koncord
4ce0331f1b [Server] Fix GCC build 2018-12-29 15:54:08 +08:00
Koncord
55cea491ca [Server] Introduce MS VC++ 2017 support 2018-12-29 11:57:26 +08:00
Koncord
6af2400752 [Server] Remove usages of get/set env. Add GetModDir function 2018-12-29 11:40:31 +08:00
David Cernat
5e38e8abdb [Server] Add GetArchitectureType() script function
Additionally, bring GetOperatingSystem() up-to-date by making it use the renamed function in Utils.
2018-12-17 11:55:50 +02:00
David Cernat
fa1700e2ab [Server] Add GetOperatingSystemType() script function 2018-12-17 11:32:31 +02:00
David Cernat
b7090b2550 [Server] Add experimental option for not crashing from Lua script errors
Additionally, fix return type of GetPluginEnforcementState()
2018-12-01 03:03:39 +02:00
David Cernat
d8ca268067 [Server] Move plugin enforcement functions to ServerFunctions 2018-11-30 22:43:10 +02:00
David Cernat
2933526995 [Server] Include errors related to Lua calls in server logs 2018-11-30 22:01:02 +02:00
Koncord
e162af0003 [Server] Disallow non void callbacks 2018-10-30 15:32:52 +08:00
Koncord
07a5f5296c [Server] Rework OnRequestPluginList callback. Add AddPluginHash function 2018-10-30 14:56:54 +08:00
Koncord
20a7619a4a [Server] Remove result from the OnPlayerConnect callback
Now it's recommended to use tes3mp.Kick() function
2018-10-30 13:18:32 +08:00
Koncord
f1e8569291 [Server] Remove result from the OnPlayerSendMessage callback 2018-10-30 13:13:07 +08:00
Koncord
efa362031e [Server] Remove unused Main callback 2018-10-30 13:03:37 +08:00
Koncord
b83e4056a8 [Server] Remove CallFF dependency as it not fully supported by Windows and MacOS 2018-10-30 12:59:47 +08:00
Koncord
585557ad8a [Server] Remove argument cast in the Call with va_args 2018-10-30 12:58:15 +08:00
Koncord
3101de5f02 [Server] Add kicked load status 2018-10-30 12:56:50 +08:00
David Cernat
99f8ef88a5 [Server] Add SetObjectActivatingPid() script function 2018-10-22 16:25:50 +03:00
David Cernat
bb834748c5 [Server] Log player kicks 2018-10-13 09:34:29 +03:00
David Cernat
292536439e [Server] Rename script functions for clearing packet vectors for players 2018-10-03 02:26:47 +03:00
David Cernat
c79660f721 [Server] Make inventory script functions consistent with others
Functions that add elements to a vector should not change the action. This fixes the last remaining oddity in Koncord's original implementation of inventory sync.
2018-10-01 18:29:50 +03:00
Koncord
48f4792bc1 [Server] Add GetMaxPlayers, GetPort and HasPassword functions to API 2018-09-05 18:19:34 +08:00
David Cernat
75a64a69c7 [Server] Add GetInventoryChangesAction() script function
Additionally, fix a typo in the description of GetSpellBookChangesAction()
2018-08-21 10:06:40 +03:00
David Cernat
5fd4113978 [General] Implement sending of ActorSpeech packets from server scripts 2018-08-13 20:39:03 +03:00
David Cernat
aec0c5bd49 [Server] Make capitalization consistent for AI-related script functions 2018-08-11 18:57:36 +03:00
David Cernat
8df08c7d10 [General] Implement PlayerItemUse packet
Players can no longer unilaterally use items on themselves in their inventory. When they try to use an item, they send a PlayerItemUse packet to the server with the item's details. A serverside script can then check the item and either send the packet back to make the item use go through or drop it.
2018-08-09 18:25:20 +03:00
David Cernat
888e1dfff8 [General] Allow setting of AI fight & dynamic stats in record packets
Additionally, allow the setting of the Autocalc flag for an NPC record based on an existing record.
2018-08-05 11:00:25 +03:00
David Cernat
6498bcb22b [Server] Add script functions for getting player draw & sneak states 2018-08-03 18:26:44 +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
d93b67ef21 [General] Sync soul refIds for items and add related script functions 2018-07-26 22:37:04 +03:00
David Cernat
d778bc3b8a [Server] Turn readWorldstate and writeWorldstate into static variables 2018-07-26 20:03:42 +03:00
David Cernat
b4802e4201 [General] Use Time struct for time in BaseWorldstate 2018-07-26 19:01:27 +03:00
David Cernat
a4b588d1b5 [General] Add optional timestamps to journal entries in PlayerJournal 2018-07-26 04:36:12 +03:00
David Cernat
b79221efcc [Server] Rename variable i into index in ActorFunctions 2018-07-24 21:29:40 +03:00
David Cernat
8fbed1f808 [General] Remove custom data from PlayerSpellbook packet
It has never made sense to have custom spell data in PlayerSpellbook packets, so it has been removed.
2018-07-24 20:58:55 +03:00
David Cernat
2e0b6e4e3e [Server] Rename variable i into index in script function arguments
Additionally, rename i into index in LangLua.
2018-07-24 20:14:51 +03:00
David Cernat
d4a84ac34a [Server] Update script function descriptions for ObjectList origin 2018-07-22 23:08:32 +03:00
David Cernat
3dc2d1b214 [General] Add packetOrigin and originClientScript to ObjectList packets
Additionally, add script functions for getting the packetOrigin and originClientScript of received ObjectList packets.
2018-07-22 18:38:05 +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
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
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