mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-12-11 20:15:10 +01:00
API: GetIsHost
This commit is contained in:
parent
ef6061664f
commit
37a0d4c853
@ -14,6 +14,11 @@ public interface IQSBAPI
|
||||
/// </summary>
|
||||
uint GetLocalPlayerID();
|
||||
|
||||
/// <summary>
|
||||
/// Returns if the current player is the host.
|
||||
/// </summary>
|
||||
bool GetIsHost();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of a given player.
|
||||
/// </summary>
|
||||
|
||||
@ -14,6 +14,11 @@ public interface IQSBAPI
|
||||
/// </summary>
|
||||
uint GetLocalPlayerID();
|
||||
|
||||
/// <summary>
|
||||
/// Returns if the current player is the host.
|
||||
/// </summary>
|
||||
bool GetIsHost();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of a given player.
|
||||
/// </summary>
|
||||
@ -52,7 +57,7 @@ public interface IQSBAPI
|
||||
/// <param name="key">The unique key of the data you want to access.</param>
|
||||
/// <returns>The data requested. If key is not valid, returns default.</returns>
|
||||
T GetCustomData<T>(uint playerId, string key);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sends a message containing arbitrary data to every player.
|
||||
/// </summary>
|
||||
|
||||
@ -17,6 +17,7 @@ public class QSBAPI : IQSBAPI
|
||||
}
|
||||
|
||||
public uint GetLocalPlayerID() => QSBPlayerManager.LocalPlayerId;
|
||||
public bool GetIsHost() => QSBCore.IsHost;
|
||||
public string GetPlayerName(uint playerId) => QSBPlayerManager.GetPlayer(playerId).Name;
|
||||
public uint[] GetPlayerIDs() => QSBPlayerManager.PlayerList.Select(x => x.PlayerId).ToArray();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user