// DNMPlayerListener ////////////////////////////////////////// public void Init(string username, int role, DualNetworkManager.GameState gameState, Mode mode, bool isHosted = true, bool isLocal = true) { this.isHosted = isHosted; this.isLocal = isLocal; nameDisplay.text = username; SetColor(GetColor(false)); roleDisplay.text = GetRoleText(role); roleButton.interactable = isHosted; // TODO do this here? readyToggle.isOn = mode == Mode.OfflineMode; }
public StatusMessage(bool accepted, string scene, DualNetworkManager.GameState gameState, MessageBase extraMessage) { this.accepted = accepted; this.scene = scene; this.gameState = gameState; if (extraMessage != null) { NetworkWriter w = new NetworkWriter(); extraMessage.Serialize(w); msgData = w.ToArray(); msgSize = w.Position; extraReader = new NetworkReader(msgData); } }
public override void Deserialize(NetworkReader reader) { accepted = reader.ReadBoolean(); scene = reader.ReadString(); gameState = (DualNetworkManager.GameState)reader.ReadInt32(); msgData = reader.ReadBytesAndSize(); if (msgData == null) { msgSize = 0; } else { msgSize = msgData.Length; } extraReader = new NetworkReader(msgData); }
public Client(NetworkConnection conn) { connection = conn; players = new List<DNMPlayer>(); stateInServer = DualNetworkManager.GameState.NoGame; }
public override void Deserialize(NetworkReader reader) { newState = (DualNetworkManager.GameState)reader.ReadInt32(); }
public GameStateMessage(DualNetworkManager.GameState newState) { this.newState = newState; }