Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

MasterServer.dedicatedServer

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public static var dedicatedServer: bool;
public static bool dedicatedServer;

Descripción

Report this machine as a dedicated server.

If running as a server the connection count defines the player count and this is reported when registering on the master server. By default the master server assumes this instance is not a dedicated server and thus the player count is incremented by one (to account for the \"client\" running on the server). If this is not desired this variable can be set to false and then only the connection count is reported in the host data as the player count.

	function StartServer() {
		Network.InitializeServer(32, 25002);
		// Not running a client locally
		MasterServer.dedicatedServer = true;
		MasterServer.RegisterHost("MyUniqueGameType", 
			"JohnDoes game", "l33t game for all");
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void StartServer() { Network.InitializeServer(32, 25002); MasterServer.dedicatedServer = true; MasterServer.RegisterHost("MyUniqueGameType", "JohnDoes game", "l33t game for all"); } }