using UnityEngine;
using BossRoom;
namespace BossRoomClient
namespace BossRoom.Client
{
/// <summary>
/// Client specialization of the Characterc Select game state.
/// Client specialization of the Character Select game state.
[RequireComponent(typeof(CharSelectData))]
public class ClientCharSelectState : GameStateBehaviour
public override GameState ActiveState { get { return GameState.CHARSELECT; } }
/// Game Logic that runs when sitting at the MainMenu. This is likely to be "nothing", as no game has been started. But it is
/// Client logic for the GameNetHub. Contains implementations for all of GameNetHub's S2C RPCs.
using System.Collections.Generic;
namespace BossRoomViz
namespace BossRoom.Viz
/// Provides backing logic for all of the UI that runs in the MainMenu stage.
namespace BossRoomServer
namespace BossRoom.Server
/// Server specialization of core BossRoom game logic.
/// Server specialization of Character Select game state.
/// </summary>
public class ServerCharSelectState : GameStateBehaviour
/// Server logic plugin for the GameNetHub. Contains implementations for all GameNetHub's C2S RPCs.
public GameObject NetworkingManagerGO;
private BossRoomClient.ClientGNHLogic m_ClientLogic;
private BossRoomServer.ServerGNHLogic m_ServerLogic;
private BossRoom.Client.ClientGNHLogic m_ClientLogic;
private BossRoom.Server.ServerGNHLogic m_ServerLogic;
public MLAPI.NetworkingManager NetManager { get; private set; }
if (NetManager.IsClient)
m_ClientLogic = new BossRoomClient.ClientGNHLogic(this);
m_ClientLogic = new BossRoom.Client.ClientGNHLogic(this);
m_ServerLogic = new BossRoomServer.ServerGNHLogic(this);
m_ServerLogic = new BossRoom.Server.ServerGNHLogic(this);
RegisterServerMessageHandlers();
}
if( NetManager.IsHost )
/// <param name="port">The port of the host to connect to. </param>
public void StartClient(string ipaddress, int port)
BossRoomClient.ClientGNHLogic.StartClient(this, ipaddress, port);
BossRoom.Client.ClientGNHLogic.StartClient(this, ipaddress, port);
/// <param name="port">The port we should listen on. </param>
public void StartHost(string ipaddress, int port )
BossRoomServer.ServerGNHLogic.StartHost(this, ipaddress, port);
BossRoom.Server.ServerGNHLogic.StartHost(this, ipaddress, port);
//Server->Client RPCs