{"id":15143618,"url":"https://github.com/jasonw4331/libpmquery","last_synced_at":"2025-02-27T18:19:33.953Z","repository":{"id":23575907,"uuid":"99370791","full_name":"jasonw4331/libpmquery","owner":"jasonw4331","description":"A library which allows querying Minecraft Bedrock server information","archived":false,"fork":false,"pushed_at":"2024-08-28T13:17:21.000Z","size":164,"stargazers_count":43,"open_issues_count":4,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T21:58:54.697Z","etag":null,"topics":["php","pocketmine","pocketmine-mp","poggit-virion"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasonw4331.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["jasonwynn10"],"patreon":"jasonwynn10","custom":"https://www.buymeacoffee.com/jasonwynn10"}},"created_at":"2017-08-04T18:42:01.000Z","updated_at":"2024-05-23T12:16:39.000Z","dependencies_parsed_at":"2023-10-02T18:16:36.984Z","dependency_job_id":"48a394e7-0ee2-4704-989a-b0d3a5b8eec7","html_url":"https://github.com/jasonw4331/libpmquery","commit_stats":{"total_commits":100,"total_committers":7,"mean_commits":"14.285714285714286","dds":"0.31999999999999995","last_synced_commit":"b06a786937ff54dbc25c7bcce9e196b57b7e3749"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonw4331%2Flibpmquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonw4331%2Flibpmquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonw4331%2Flibpmquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonw4331%2Flibpmquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasonw4331","download_url":"https://codeload.github.com/jasonw4331/libpmquery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240907842,"owners_count":19876689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","pocketmine","pocketmine-mp","poggit-virion"],"created_at":"2024-09-26T10:02:16.190Z","updated_at":"2025-02-27T18:19:33.918Z","avatar_url":"https://github.com/jasonw4331.png","language":"PHP","funding_links":["https://github.com/sponsors/jasonwynn10","https://patreon.com/jasonwynn10","https://www.buymeacoffee.com/jasonwynn10"],"categories":[],"sub_categories":[],"readme":"# libPMQuery\n\n[![Poggit-Ci](https://poggit.pmmp.io/ci.shield/jasonw4331/libpmquery/libpmquery)](https://poggit.pmmp.io/ci/jasonw4331/libpmquery/libpmquery)\n\nA PocketMine Virion which allows plugins to query other servers for a selection of information\n\n## Basic Usage\nThis virion was made for developers to query Pocketmine-MP servers with ease. Here is some basic functionality:\n\n### Required imports\nThe following imports are necessary to use the virion library:\n```php\nuse jasonw4331\\libpmquery\\PMQuery;\nuse jasonw4331\\libpmquery\\PmQueryException;\n```\n\n### API\nThe querying API is a single function which grabs the data from whatever server you input. Usage is as follows:\n```php\n$query = PMQuery::query(\"my.server.net\", 19132);\n```\nThe values returned will follow these values/types:\n```php\n$query['GameName'];         // Returns the server software being used\n$query['HostName'];         // Returns the server host name\n$query['Protocol'];         // Returns the protocol version allowed to connect\n$query['Version'];          // Returns the client version allowed to connect\n$query['Players'];          // Returns the number of players on the server currently\n$query['MaxPlayers'];       // Returns the maximum player count of the server\n$query['ServerId'];         // Returns the raknet server id\n$query['Map'];              // Returns the default world name\n$query['GameMode'];         // Returns the default gamemode\n$query['NintendoLimited'];  // Returns the status of Nintendo's limitation to join\n$query['IPv4Port'];         // Returns the ipv4 port number\n$query['IPv6Port'];         // Returns the ipv6 port number\n$query['Extra'];            // I still don't know what this info is\n```\n\n### Offline Queries\nQueries sent to offline servers always throw a `PmQueryException`. Exceptions can be caught in a try/catch statement to log their offline status.\n```php\ntry{\n    $query = PMQuery::query(\"my.server.net\", 19133);\n    $players = (int) $query['Players'];\n    Server::getInstance()-\u003egetLogger()-\u003einfo(\"There are \".$players.\" on the queried server right now!\");\n}catch(PmQueryException $e){\n    //you can choose to log this if you want\n    Server::getInstance()-\u003egetLogger()-\u003einfo(\"The queried server is offline right now!\");\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonw4331%2Flibpmquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonw4331%2Flibpmquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonw4331%2Flibpmquery/lists"}