Skip to content

Commit ed97495

Browse files
Update API for Patch 1.0.224
1 parent be656d9 commit ed97495

File tree

1 file changed

+109
-5
lines changed

1 file changed

+109
-5
lines changed

src/EmmyLua/core-games-api.def.lua

Lines changed: 109 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function AbilityTarget.New() end
186186
--- @class AnimatedMesh : CoreMesh @AnimatedMesh objects are skeletal CoreMeshes with parameterized animations baked into them. They also have sockets exposed to which any CoreObject can be attached.
187187
--- @field animationEvent Event @Some animations have events specified at important points of the animation (e.g. the impact point in a punch animation). This event is fired with the animated mesh that triggered it, the name of the event at those points, and the name of the animation itself.
188188
--- @field animationStance string @The stance the animated mesh plays.
189-
--- @field animationStancePlaybackRate number @The playback rate for the animation stance being played. Negative values will play the animation in reverse.
189+
--- @field animationStancePlaybackRate number @The playback rate for the animation stance being played.
190190
--- @field animationStanceShouldLoop boolean @If `true`, the animation stance will keep playing in a loop. If `false` the animation will stop playing once completed.
191191
--- @field playbackRateMultiplier number @Rate multiplier for all animations played on the animated mesh. Setting this to `0` will stop all animations on the mesh.
192192
--- @field type string
@@ -1513,6 +1513,27 @@ NetReference = {}
15131513
--- @class NetworkContext : CoreObject @NetworkContext is a CoreObject representing a special folder containing client-only, server-only, or static objects.. . They have no properties or functions of their own, but inherit everything from CoreObject.
15141514
--- @field type string
15151515
local NetworkContextInstance = {}
1516+
--- Spawns an instance of an asset into the world as a child of a networked Static Context, also spawning copies of the asset on clients without the overhead of additional networked objects. Any object spawned this way cannot be modified, as with other objects within a Static Context, but they may be destroyed by calling `DestroySharedAsset()` on the same `NetworkContext` instance. Raises an error if called on a non-networked Static Context or a Static Context which is a descendant of a Client Context or Server Context. Optional parameters can specify a transform for the spawned object.
1517+
---
1518+
--- Supported parameters include:
1519+
---
1520+
--- `position (Vector3)`: Position of the spawned object, relative to the parent NetworkContext.
1521+
---
1522+
--- `rotation (Rotation or Quaternion)`: Local rotation of the spawned object.
1523+
---
1524+
--- `scale (Vector3 or number)`: Scale of the spawned object, may be specified as a `Vector3` or as a `number` for uniform scale.
1525+
---
1526+
--- `transform (Transform)`: The full transform of the spawned object. If `transform` is specified, it is an error to also specify `position`, `rotation`, or `scale`.
1527+
--- @overload fun(assetId: string): CoreObject
1528+
--- @param assetId string
1529+
--- @param optionalParameters table
1530+
--- @return CoreObject
1531+
function NetworkContextInstance:SpawnSharedAsset(assetId, optionalParameters) end
1532+
1533+
--- Destroys an object that was spawned using `SpawnSharedAsset()`. Raises an error if `coreObject` was not created by this `NetworkContext`.
1534+
--- @param coreObject CoreObject
1535+
function NetworkContextInstance:DestroySharedAsset(coreObject) end
1536+
15161537
--- @param typeName string
15171538
--- @return boolean
15181539
function NetworkContextInstance:IsA(typeName) end
@@ -1971,6 +1992,10 @@ function PlayerInstance:GetPrivateNetworkedData(key) end
19711992
--- @return table
19721993
function PlayerInstance:GetPrivateNetworkedDataKeys() end
19731994

1995+
--- Returns the number of bytes used by private networked data on this player. Returns 0 if private networked data is not available.
1996+
--- @return number
1997+
function PlayerInstance:GetPrivateNetworkedDataSize() end
1998+
19741999
--- @param typeName string
19752000
--- @return boolean
19762001
function PlayerInstance:IsA(typeName) end
@@ -3234,6 +3259,7 @@ VoiceChatChannel = {}
32343259
--- @field spreadDecreaseSpeed number @Speed at which the spread contracts back from its current value to the minimum cone size.
32353260
--- @field spreadIncreasePerShot number @Amount the spread increases each time the Weapon attacks.
32363261
--- @field spreadPenaltyPerShot number @Cumulative penalty to the spread size for successive attacks. Penalty cools off based on `spreadDecreaseSpeed`.
3262+
--- @field attackSoundTemplateId string @Asset reference for a sound effect to be played each time the Weapon attacks.
32373263
--- @field type string
32383264
local WeaponInstance = {}
32393265
--- Informs whether the Weapon is able to attack or not.
@@ -3629,7 +3655,7 @@ function Game.IsAcceptingPlayers() end
36293655
--- @param gameCollectionEntry CoreGameCollectionEntry
36303656
function Game.TransferAllPlayersToGame(gameCollectionEntry) end
36313657

3632-
--- Similar to `Player:TransferToGame()`, transfers the specified list of players to the game specified by the passed in game ID. Note that if a party leader is included in the list of players to transfer, the "Play as Party" party setting is ignored, and other party members will only be transfered if also included in the list of players. Does not work in preview mode or in games played locally.
3658+
--- Similar to `Player:TransferToGame()`, transfers the specified list of players to the game specified by the passed in game ID. Note that if a party leader is included in the list of players to transfer, the "Play as Party" party setting is ignored, and other party members will only be transferred if also included in the list of players. Does not work in preview mode or in games played locally.
36333659
--- @overload fun(gameInfo: CoreGameInfo,players: table<number, Player>)
36343660
--- @overload fun(gameId: string,players: table<number, Player>)
36353661
--- @param gameCollectionEntry CoreGameCollectionEntry
@@ -3646,7 +3672,7 @@ function Game.TransferPlayersToGame(gameCollectionEntry, players) end
36463672
--- @param optionalParams table
36473673
function Game.TransferAllPlayersToScene(sceneName, optionalParams) end
36483674

3649-
--- Similar to `Player:TransferToScene()`, transfers the specified list of players to the scene specified by the passed in scene name. Note that if a party leader is included in the list of players to transfer, the "Play as Party" party setting is ignored, and other party members will only be transfered if also included in the list of players. Does not work in preview mode or in games played locally.
3675+
--- Similar to `Player:TransferToScene()`, transfers the specified list of players to the scene specified by the passed in scene name. Note that if a party leader is included in the list of players to transfer, the "Play as Party" party setting is ignored, and other party members will only be transferred if also included in the list of players. Does not work in preview mode or in games played locally.
36503676
---
36513677
--- The following optional parameters are supported:
36523678
---
@@ -3661,6 +3687,10 @@ function Game.TransferPlayersToScene(sceneName, players, optionalParams) end
36613687
--- @return string
36623688
function Game.GetCurrentSceneName() end
36633689

3690+
--- Returns the ID of the current game. When called in preview mode, returns `nil` if the game has not been published, otherwise returns the published game ID.
3691+
--- @return string
3692+
function Game.GetCurrentGameId() end
3693+
36643694
--- @class Input
36653695
local InputInstance = {}
36663696
--- @class GlobalInput
@@ -3744,6 +3774,76 @@ function Storage.GetPlayerData(player) end
37443774
--- @return StorageResultCode|string
37453775
function Storage.SetPlayerData(player, data) end
37463776

3777+
--- Requests the concurrent player data associated with the specified player. This function may yield until data is available. Returns the data (`nil` if not available), a result code, and an optional error message if an error occurred.
3778+
--- @param playerId string
3779+
--- @return table|StorageResultCode|string
3780+
function Storage.GetConcurrentPlayerData(playerId) end
3781+
3782+
--- Updates the concurrent player data associated with the specified player. This function retrieves the most recent copy of the player's data, then calls the creator-provided `callback` function with the data table as a parameter. `callback` is expected to return the player's updated data table, which will then be saved. This function yields until the entire process is complete, returning a copy of the player's updated data (`nil` if not available), a result code, and an optional error message if an error occurred.
3783+
--- @param playerId string
3784+
--- @param callback function
3785+
--- @return table|StorageResultCode|string
3786+
function Storage.SetConcurrentPlayerData(playerId, callback) end
3787+
3788+
--- Requests the concurrent player data associated with the specified player and storage key. The storage key must be of type `CONCURRENT_SHARED_PLAYER_STORAGE`. This function may yield until data is available. Returns the data (`nil` if not available), a result code, and an optional error message if an error occurred.
3789+
--- @param netReference NetReference
3790+
--- @param playerId string
3791+
--- @return table|StorageResultCode|string
3792+
function Storage.GetConcurrentSharedPlayerData(netReference, playerId) end
3793+
3794+
--- Updates the concurrent player data associated with the specified player and storage key. The storage key must be of type `CONCURRENT_SHARED_PLAYER_STORAGE`. This function retrieves the most recent copy of the player's data, then calls the creator-provided `callback` function with the data table as a parameter. `callback` is expected to return the player's updated data table, which will then be saved. This function yields until the entire process is complete, returning a copy of the player's updated data (`nil` if not available), a result code, and an optional error message if an error occurred.
3795+
--- @param netReference NetReference
3796+
--- @param playerId string
3797+
--- @param callback function
3798+
--- @return table|StorageResultCode|string
3799+
function Storage.SetConcurrentSharedPlayerData(netReference, playerId, callback) end
3800+
3801+
--- Requests the concurrent data associated with the given storage key. The storage key must be of type `CONCURRENT_CREATOR_STORAGE`. This data is player- and game-agnostic. This function may yield until data is available. Returns the data (`nil` if not available), a result code, and an optional error message if an error occurred.
3802+
--- @param netReference NetReference
3803+
--- @return table|StorageResultCode|string
3804+
function Storage.GetConcurrentCreatorData(netReference) end
3805+
3806+
--- Updates the concurrent data associated with the given storage key. The storage key must be of type `CONCURRENT_CREATOR_STORAGE`. This data is player- and game-agnostic. This function retrieves the most recent copy of the creator data, then calls the creator-provided `callback` function with the data table as a parameter. `callback` is expected to return the updated data table, which will then be saved. This function yields until the entire process is complete, returning a copy of the updated data (`nil` if not available), a result code, and an optional error message if an error occurred.
3807+
--- @param netReference NetReference
3808+
--- @param callback function
3809+
--- @return table|StorageResultCode|string
3810+
function Storage.SetConcurrentCreatorData(netReference, callback) end
3811+
3812+
--- Listens for any changes to the concurrent data associated with `playerId` for this game. Calls to `Storage.SetConcurrentPlayerData()` from this or other game servers will trigger this listener. The listener function parameters should be: `string` player ID, `table` player data. Accepts any number of additional arguments after the listener function, those arguments will be provided, in order, after the `table` argument. Returns an EventListener which can be used to disconnect from the event or check if the event is still connected.
3813+
--- @param playerId string
3814+
--- @param callback function
3815+
--- @return EventListener
3816+
function Storage.ConnectToConcurrentPlayerDataChanged(playerId, callback, ...) end
3817+
3818+
--- Listens for any changes to the concurrent shared data associated with `playerId` and `concurrentSharedStorageKey`. Calls to `Storage.SetConcurrentSharedPlayerData()` from this or other game servers will trigger this listener. The listener function parameters should be: `NetReference` storage key, `string` player ID, `table` shared player data. Accepts any number of additional arguments after the listener function, those arguments will be provided, in order, after the `table` argument. Returns an EventListener which can be used to disconnect from the event or check if the event is still connected.
3819+
--- @param netReference NetReference
3820+
--- @param playerId string
3821+
--- @param callback function
3822+
--- @return EventListener
3823+
function Storage.ConnectToConcurrentSharedPlayerDataChanged(netReference, playerId, callback, ...) end
3824+
3825+
--- Listens for any changes to the concurrent data associated with `concurrentCreatorStorageKey`. Calls to `Storage.SetConcurrentCreatorData()` from this or other game servers will trigger this listener. The listener function parameters should be: `NetReference` storage key, `table` creator data. Accepts any number of additional arguments after the listener function, those arguments will be provided, in order, after the `table` argument. Returns an EventListener which can be used to disconnect from the event or check if the event is still connected.
3826+
--- @param netReference NetReference
3827+
--- @param callback function
3828+
--- @return EventListener
3829+
function Storage.ConnectToConcurrentCreatorDataChanged(netReference, callback, ...) end
3830+
3831+
--- Returns `true` if this server has a pending call to `Storage.SetConcurrentPlayerData()` either waiting to be processed or actively running for the specified player ID.
3832+
--- @param playerId string
3833+
--- @return boolean
3834+
function Storage.HasPendingSetConcurrentPlayerData(playerId) end
3835+
3836+
--- Returns `true` if this server has a pending call to `Storage.SetConcurrentSharedPlayerData()` either waiting to be processed or actively running for the specified player ID and shared storage key.
3837+
--- @param netReference NetReference
3838+
--- @param playerId string
3839+
--- @return boolean
3840+
function Storage.HasPendingSetConcurrentSharedPlayerData(netReference, playerId) end
3841+
3842+
--- Returns `true` if this server has a pending call to `Storage.SetConcurrentCreatorData()` either waiting to be processed or actively running for the specified creator storage key.
3843+
--- @param netReference NetReference
3844+
--- @return boolean
3845+
function Storage.HasPendingSetConcurrentCreatorData(netReference) end
3846+
37473847
--- Returns the shared player data associated with `player` and `sharedStorageKey`. This returns a copy of the data that has already been retrieved for the player, so calling this function does not incur any additional network cost. Changes to the data in the returned table will not be persisted without calling `Storage.SetSharedPlayerData()`.
37483848
--- @param sharedStorageKey NetReference
37493849
--- @param player Player
@@ -3982,11 +4082,11 @@ function World.FindObjectsByType(typeName) end
39824082
---
39834083
--- `rotation (Rotation or Quaternion)`: Rotation of the spawned object.
39844084
---
3985-
--- `scale (Vector3)`: Scale of the spawned object.
4085+
--- `scale (Vector3 or number)`: Scale of the spawned object, may be specified as a `Vector3` or as a `number` for uniform scale.
39864086
---
39874087
--- `transform (Transform)`: The full transform of the spawned object. If `transform` is specified, it is an error to also specify `position`, `rotation`, or `scale`.
39884088
---
3989-
--- `networkContext (NetworkContext)`: Overrides the network context of the spawned object. This may be used, for example, to spawn networked or static objects from a server only context, or client-only objects from a client script running in a static context, but it cannot spawn client only objects from a server script or networked objects from a client script. If an invalid context is specified, an error will be raised.
4089+
--- `networkContext` ([NetworkContextType](../api/enums#networkcontexttype)): Overrides the network context of the spawned object. This may be used, for example, to spawn networked or static objects from a server only context, or client-only objects from a client script running in a static context, but it cannot spawn client only objects from a server script or networked objects from a client script. If an invalid context is specified, an error will be raised.
39904090
---
39914091
--- `name (string)`: Set the name of the spawned object.
39924092
---
@@ -4247,6 +4347,9 @@ MovementMode = {
42474347
NetReferenceType = {
42484348
LEADERBOARD = 1,
42494349
SHARED_STORAGE = 2,
4350+
SHARED_PLAYER_STORAGE = 2,
4351+
CONCURRENT_SHARED_PLAYER_STORAGE = 4,
4352+
CONCURRENT_CREATOR_STORAGE = 5,
42504353
CREATOR_PERK = 3,
42514354
UNKNOWN = 0,
42524355
}
@@ -4323,6 +4426,7 @@ StorageResultCode = {
43234426
FAILURE = 2,
43244427
STORAGE_DISABLED = 1,
43254428
EXCEEDED_SIZE_LIMIT = 3,
4429+
REQUEST_ALREADY_QUEUED = 4,
43264430
}
43274431
--- @class TaskStatus @Indicates the status of a script `Task`.
43284432
TaskStatus = {

0 commit comments

Comments
 (0)