Skip to content

Multiplayer

mika edited this page Apr 26, 2018 · 4 revisions

Multiplayer

  • void ShowOtherPlayers()
    • draw other players (their avatars), if any are connected
    • note: in photosphere, all players are in 0,0,0 position, so they wont be visible unless moving
  • void HideOtherPlayers()
    • hide other players (their avatars)
  • float GetMultiplayerUpdateSpeed()
    • Default update value is 15 secs
  • void SetMultiplayerUpdateSpeed(float delay)
    • Set update speed (clamped to 0.16f - 9999f)
    • Note: low values might cause heavy traffic on the server with many players online (and there is no automatic way to restart server if it crashes)
  • string[] GetPlayerNames()
    • Returns array of player names (this current client is listed as a first name)
    • Note: Requires ShowOtherPlayers() to be enabled, so that other players are created in the world
    • Note: Player names are not yet sent to clients, so youll see their ip+port instead as an unique id
  • float[] GetPlayerPosition(string id)
    • returns multiplayers world position, using id from GetPlayerNames()
    • returns float array
  • int GetAmountOfConnectedPlayers()
    • returns how many players are connected
    • Note: also returns 0 if no other player has spawned yet (there is small delay before players spawn after joining)
Clone this wiki locally