Exemplo n.º 1
0
    void Start()
    {
        common = RPC.NetworkingCommon.Instance;

        networkingInfo = GameController.Instance.networkingInfo;
        if (networkingInfo.port == -1)
        {
            networkingInfo.port = RPC.NetworkingInfo.defaultPort;
        }
        if (networkingInfo.address == "")
        {
            networkingInfo.address = RPC.NetworkingInfo.defaultAddress;
        }

        playerLog = GetComponent <PlayerLog>();
        common.RegisterOnConsole(playerLog.AddEvent);

        if (networkingInfo.isServer)
        {
            server = new RPC.Server(networkingInfo);
            server.RegisterOnClient(ClientAvailable);
        }
        client = new RPC.Client(networkingInfo);
        client.RegisterClientShutdown(ShutdownClient);
    }
Exemplo n.º 2
0
	void Start () {
		common = RPC.NetworkingCommon.Instance;

		networkingInfo = GameController.Instance.networkingInfo;
		if(networkingInfo.port == -1) networkingInfo.port = RPC.NetworkingInfo.defaultPort;
		if(networkingInfo.address == "") networkingInfo.address = RPC.NetworkingInfo.defaultAddress;

		playerLog = GetComponent<PlayerLog>();
		common.RegisterOnConsole(playerLog.AddEvent);

		if(networkingInfo.isServer) 
		{
			server = new RPC.Server(networkingInfo);
			server.RegisterOnClient(ClientAvailable);
		}
		client = new RPC.Client(networkingInfo);
		client.RegisterClientShutdown(ShutdownClient);
	}
Exemplo n.º 3
0
	// Various functions for callbacks etc

	void ShutdownClient()
	{
		client = null;
	}
Exemplo n.º 4
0
    // Various functions for callbacks etc

    void ShutdownClient()
    {
        client = null;
    }