Пример #1
0
    public override void OnLobbyServerPlayerRemoved(NetworkConnection conn, short playerControllerId)
    {
        Debug.Log("On Lobby server remove lobby player");
        for (int i = 0; i < lobbySlots.Length; ++i)
        {
            PlayerLobby p = lobbySlots[i] as PlayerLobby;

            if (p != null)
            {
                p.RpcUpdatePlayerLobby();
            }
        }
        if (ServerLog.instance != null)
        {
            ServerLog.instance.Log("Player lobby : ID " + conn.connectionId + " removed");
        }
    }
Пример #2
0
    public override void OnLobbyServerDisconnect(NetworkConnection conn)
    {
        Debug.Log("On lobby disconnect");
        if (ServerLog.instance != null)
        {
            ServerLog.instance.Log("Player lobby:" + conn.address + " disconnected");
        }
        for (int i = 0; i < lobbySlots.Length; ++i)
        {
            PlayerLobby p = lobbySlots[i] as PlayerLobby;

            if (p != null)
            {
                p.RpcUpdatePlayerLobby();
            }
        }
    }
Пример #3
0
    // Server Callback
    public override GameObject OnLobbyServerCreateLobbyPlayer(NetworkConnection conn, short playerControllerId)
    {
        Debug.Log("On Lobby server create lobby player");
        GameObject obj = Instantiate(lobbyPlayerPrefab.gameObject) as GameObject;

        for (int i = 0; i < lobbySlots.Length; ++i)
        {
            PlayerLobby p = lobbySlots[i] as PlayerLobby;

            if (p != null)
            {
                p.RpcUpdatePlayerLobby();
            }
        }
        if (ServerLog.instance != null)
        {
            ServerLog.instance.Log("Player lobby:" + conn.address + " created");
        }
        return(obj);
    }