Interface IWukongSynchronizationApi
Namespace: WukongMp.Sdk.Api
Assembly: WukongMp.Sdk.dll
Provides methods related to synchronizing game state between players in a multiplayer session.
public interface IWukongSynchronizationApi
Propertiesâ
AllMainCharactersâ
Gets a list of all main characters.
EntityList<ReadyMainCharacter> AllMainCharacters { get; }
Property Valueâ
EntityList<ReadyMainCharacter>
AllPlayersâ
Gets a list of all players on the server.
IReadOnlyList<PlayerId> AllPlayers { get; }
Property Valueâ
AllTamersâ
Gets a list of all tamers (monsters).
EntityList<ReadyTamer> AllTamers { get; }
Property Valueâ
AreaMainCharactersâ
Gets a list of main characters in the current area.
EntityList<ReadyMainCharacter> AreaMainCharacters { get; }
Property Valueâ
EntityList<ReadyMainCharacter>
AreaPlayersâ
Gets a list of players in the current area.
IReadOnlyList<PlayerId> AreaPlayers { get; }
Property Valueâ
AreaTamersâ
Gets a list of tamers (monsters) in the current area.
EntityList<ReadyTamer> AreaTamers { get; }
Property Valueâ
CurrentAreaIdâ
Gets the current area ID.
AreaId? CurrentAreaId { get; }
Property Valueâ
InAreaâ
Gets a value indicating whether the player is in an area.
bool InArea { get; }
Property Valueâ
IsConnectedâ
Gets a value indicating whether the player is connected to the server.
bool IsConnected { get; }
Property Valueâ
IsMasterClientâ
Gets a value indicating whether the player is the master client in an area.
bool IsMasterClient { get; }
Property Valueâ
LocalMainCharacterâ
Gets the local main character.
ReadyMainCharacter? LocalMainCharacter { get; }
Property Valueâ
LocalPlayerIdâ
Gets the local player's ID.
PlayerId? LocalPlayerId { get; }
Property Valueâ
Methodsâ
DisableSpectatorMode(ReadyMainCharacter)â
Disables spectator mode for the specified character.
void DisableSpectatorMode(ReadyMainCharacter character)
Parametersâ
character ReadyMainCharacter
The character to disable spectator mode for.
EnableSpectatorMode(ReadyMainCharacter, SpectatorReason)â
Enables spectator mode for the specified character.
void EnableSpectatorMode(ReadyMainCharacter character, SpectatorReason reason)
Parametersâ
character ReadyMainCharacter
The character to enable spectator mode for.
reason SpectatorReason
The reason for enabling spectator mode.
GetDisconnectReasonAndInvoke(Action<DisconnectReason>)â
Retrieves the disconnect reason and invokes the provided callback with it.
void GetDisconnectReasonAndInvoke(Action<DisconnectReason> callback)
Parametersâ
callback Action<DisconnectReason>
The callback to invoke with the disconnect reason.
GetMainCharacterByPlayerId(PlayerId)â
Gets the main character associated with the specified player ID.
ReadyMainCharacter? GetMainCharacterByPlayerId(PlayerId playerId)
Parametersâ
playerId PlayerId
The player ID.
Returnsâ
The main character, or null if not found.
GetPlayerEntityByActor(AActor?)â
Gets the player entity associated with the specified actor.
ReadyMainCharacter? GetPlayerEntityByActor(AActor? actor)
Parametersâ
actor AActor?
The actor to find the player entity for.
Returnsâ
The player entity, or null if not found.
GetPlayerEntityByLastTransformation(BGUCharacterCS?)â
Gets the player entity associated with the last transformation of the specified character.
ReadyMainCharacter? GetPlayerEntityByLastTransformation(BGUCharacterCS? targetCharacter)
Parametersâ
targetCharacter BGUCharacterCS?
The character to find the player entity for.
Returnsâ
The player entity, or null if not found.
SpawnEnemy(TamerKind, Vector3, int, int)â
Spawns an enemy of the specified kind at the given position.
void SpawnEnemy(TamerKind kind, Vector3 position, int count = 1, int teamId = 2)
Parametersâ
kind TamerKind
The kind of enemy to spawn.
position Vector3
The position to spawn the enemy at.
count int
The number of enemies to spawn. Defaults to 1.
teamId int
The team ID for the spawned enemies. Defaults to the default monster team ID (2).
SyncMonstersInArea()â
Register all monsters in the current area to be synchronized over the network. This should be called whenever the first player enters a new area.
void SyncMonstersInArea()
TryGetPlayerInfoById(PlayerId, out string?, out int?)â
Tries to get player information by ID.
bool TryGetPlayerInfoById(PlayerId player, out string? nickname, out int? team)
Parametersâ
player PlayerId
The player ID.
nickname string?
The player's nickname, if found.
team int?
The player's team ID, if found.
Returnsâ
true if the player information was found; otherwise, false.