Beispiel #1
0
    /*
     * Function: OnRequestPlayerCount
     *
     *      Send number of players connected to the host
     *
     * Parameters:
     *
     * msg1
     *
     * Returns:
     *
     * void
     */

    void OnRequestPlayerCount(NetworkMessage msg1)
    {
        int             playerCount1 = NetworkServer.connections.Count;
        connectionCount msg          = new connectionCount();

        msg.newMessage(playerCount1);
        NetworkConnection localConn = NetworkServer.localConnections [0];

        NetworkServer.SendToClient(localConn.connectionId, Message.NUM_OF_PLAYERS, msg);
    }
Beispiel #2
0
	/*
        Function: OnRequestPlayerCount

		Send number of players connected to the host

        Parameters: 

           msg1

        Returns:

           void
     */

	void OnRequestPlayerCount(NetworkMessage msg1)
	{
		int playerCount1 = NetworkServer.connections.Count;
		connectionCount msg = new connectionCount ();
		msg.newMessage (playerCount1);
		NetworkConnection localConn = NetworkServer.localConnections [0];
		NetworkServer.SendToClient (localConn.connectionId, Message.NUM_OF_PLAYERS, msg);
	}