OpenTTDLib
[ class tree: OpenTTDLib ] [ index: OpenTTDLib ] [ all elements ]
Prev Next

getDetail()

detailed structure example

OpenTTDLib::getDetail()

NOTE: PHP is not able to nativly handle 64 bit integers, therefore OpenTTDLib makes use of the BCMath functions. Please use these functions when doing any calculations with ['company_value'] , ['money'] or ['income']

after a successlful OpenTTDLib::queryServer() the return value of OpenTTDLib::getDetail() is structured the following way:

Output using print_r() (with all options left at the default values):

stdClass Object
(
    [detail_version] => 4
    [active_players] => 8
    [player] => Array
        (
            [0] => stdClass Object
                (
                    [current] => 1
                    [company_name] => Penknight Transport
                    [inaugurated] => 1978
                    [company_value] => 124027008
                    [money] => 91747042
                    [income] => 6979474
                    [performance] => 632
                    [password] => 1
                    [vehicles] => Array
                        (
                            [0] => 87
                            [1] => 0
                            [2] => 0
                            [3] => 5
                            [4] => 0
                        )

                    [stations] => Array
                        (
                            [0] => 21
                            [1] => 0
                            [2] => 0
                            [3] => 2
                            [4] => 0
                        )

                    [client] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [client_name] => Penknight
                                    [unique_id] => 50eccc6e2b0d307d5e8a40fb296f6171
                                    [join_date] => 1978-05-13
                                )

                        )

                )

            [1] => stdClass Object
                (
                    [current] => 2
                    [company_name] => Corocoro Transport
                    [inaugurated] => 1953
                    [company_value] => 14563090
                    [money] => 14725648
                    [income] => 570300
                    [performance] => 363
                    [password] => 1
                    [vehicles] => Array
                        (
                            [0] => 4
                            [1] => 0
                            [2] => 0
                            [3] => 0
                            [4] => 0
                        )

                    [stations] => Array
                        (
                            [0] => 7
                            [1] => 0
                            [2] => 0
                            [3] => 0
                            [4] => 0
                        )

                    [client] => Array
                        (
                        )

                )

            [2] => stdClass Object
                (
                    [current] => 3
                    [company_name] => Tocopilla Transport
                    [inaugurated] => 1979
                    [company_value] => 38584236
                    [money] => 30928470
                    [income] => 5708732
                    [performance] => 638
                    [password] => 1
                    [vehicles] => Array
                        (
                            [0] => 19
                            [1] => 4
                            [2] => 3
                            [3] => 5
                            [4] => 0
                        )

                    [stations] => Array
                        (
                            [0] => 26
                            [1] => 2
                            [2] => 2
                            [3] => 5
                            [4] => 0
                        )

                    [client] => Array
                        (
                        )

                )

            [3] => stdClass Object
                (
                    [current] => 4
                    [company_name] => Szega Transport
                    [inaugurated] => 1949
                    [company_value] => 88115656
                    [money] => 70296836
                    [income] => 3333110
                    [performance] => 530
                    [password] => 1
                    [vehicles] => Array
                        (
                            [0] => 21
                            [1] => 0
                            [2] => 0
                            [3] => 0
                            [4] => 0
                        )

                    [stations] => Array
                        (
                            [0] => 25
                            [1] => 0
                            [2] => 0
                            [3] => 1
                            [4] => 0
                        )

                    [client] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [client_name] => Szega
                                    [unique_id] => acbd18db4cc2f85cedef654fccc4a4d8
                                    [join_date] => 2006-04-05
                                )

                        )

                )

            [4] => stdClass Object
                (
                    [current] => 5
                    [company_name] => I Pwnz Noobz Transport
                    [inaugurated] => 1949
                    [company_value] => 23564254
                    [money] => 23372264
                    [income] => 993634
                    [performance] => 452
                    [password] => 1
                    [vehicles] => Array
                        (
                            [0] => 9
                            [1] => 2
                            [2] => 0
                            [3] => 0
                            [4] => 0
                        )

                    [stations] => Array
                        (
                            [0] => 13
                            [1] => 2
                            [2] => 3
                            [3] => 0
                            [4] => 0
                        )

                    [client] => Array
                        (
                        )

                )

            [5] => stdClass Object
                (
                    [current] => 6
                    [company_name] => Mega Corp.
                    [inaugurated] => 1949
                    [company_value] => 95421456
                    [money] => 94618178
                    [income] => 3586896
                    [performance] => 581
                    [password] => 1
                    [vehicles] => Array
                        (
                            [0] => 24
                            [1] => 0
                            [2] => 9
                            [3] => 0
                            [4] => 0
                        )

                    [stations] => Array
                        (
                            [0] => 36
                            [1] => 0
                            [2] => 9
                            [3] => 0
                            [4] => 0
                        )

                    [client] => Array
                        (
                        )

                )

            [6] => stdClass Object
                (
                    [current] => 7
                    [company_name] => Kai Transport
                    [inaugurated] => 1993
                    [company_value] => 40783712
                    [money] => 38428690
                    [income] => 9158682
                    [performance] => 461
                    [password] => 1
                    [vehicles] => Array
                        (
                            [0] => 1
                            [1] => 0
                            [2] => 1
                            [3] => 6
                            [4] => 0
                        )

                    [stations] => Array
                        (
                            [0] => 2
                            [1] => 0
                            [2] => 3
                            [3] => 3
                            [4] => 0
                        )

                    [client] => Array
                        (
                        )

                )

            [7] => stdClass Object
                (
                    [current] => 8
                    [company_name] => Klaymen Transport
                    [inaugurated] => 1953
                    [company_value] => 65488740
                    [money] => 51486722
                    [income] => 7183178
                    [performance] => 602
                    [password] => 1
                    [vehicles] => Array
                        (
                            [0] => 43
                            [1] => 0
                            [2] => 0
                            [3] => 0
                            [4] => 0
                        )

                    [stations] => Array
                        (
                            [0] => 17
                            [1] => 0
                            [2] => 0
                            [3] => 0
                            [4] => 0
                        )

                    [client] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [client_name] => Klaymen #1
                                    [unique_id] => 37b51d194a7513e45b56f6524f2d51f2
                                    [join_date] => 2006-04-20
                                )

                        )

                )

        )

    [spectator] => Array
        (
            [0] => stdClass Object
                (
                    [client_name] => Mr_Console|2
                    [unique_id] => 5bf72c0c39d4bd3fe679fbedd508e65c
                    [join_date] => 0
                )

        )

    [allclients] => Array
        (
            [0] => stdClass Object
                (
                    [client_name] => Penknight
                    [unique_id] => 50eccc6e2b0d307d5e8a40fb296f6171
                    [join_date] => 1978-05-13
                )

            [1] => stdClass Object
                (
                    [client_name] => Szega
                    [unique_id] => acbd18db4cc2f85cedef654fccc4a4d8
                    [join_date] => 2006-04-05
                )

            [2] => stdClass Object
                (
                    [client_name] => Klaymen #1
                    [unique_id] => 37b51d194a7513e45b56f6524f2d51f2
                    [join_date] => 2006-04-20
                )

            [3] => stdClass Object
                (
                    [client_name] => Mr_Console|2
                    [unique_id] => 5bf72c0c39d4bd3fe679fbedd508e65c
                    [join_date] => 0
                )

        )

)
				
unique_id's have been replaced with random md5sums!


Prev Up Next
getInfo() Return Value Structures getNewGrf()

Documentation generated on Wed, 29 Apr 2009 23:33:49 +0200 by phpDocumentor 1.4.2