{ "info": { "author": "Richard Neumann", "author_email": "mail@richard-neumann.de", "bugtrack_url": null, "classifiers": [], "description": "# mcipc\n\nA Minecraft inter-process communication API implementing the [RCON](http://wiki.vg/RCON) and [Query](http://wiki.vg/Query) protocols.\n\n## Usage\n\n### Query protocol\nThe `Query` protcol is used to query a Minecraft server for server information. \nThe Minecraft query protocol has two query modes: *basic stats* and *full stats*.\n\n#### Basic stats\nTo get *basic stats* from a Minecraft server, it must enable the `Query` protocol. \nYou can enable the query protocol on a Minecraft server by setting `enable-query = true` in the server's `server.properties` file.\nTo specify a deviating port, you can set `query.port = ` in the same file. \nThe following example assumes a server running on `127.0.0.1` and on the default query port `25565`:\n\n from mcipc.query import Client\n\n with Client('127.0.0.1', 25565) as client:\n basic_stats = client.basic_stats\n\n print(basic_stats)\n\nThe type of `basic_stats` is a named tuple with the following properties:\n\n* `type`: The packet type (`Type`, protocol information).\n* `session_id`: The query's session ID (`int`, protocol information).\n* `motd`: The server's message of the day (`str`).\n* `game_type`: The game type (`str`).\n* `map`: The current map (`str`).\n* `num_players`: The amount of online players (`int`).\n* `max_players`: The amount of maximally allowed players (`int`).\n* `host_port`: The server's port (`int`).\n* `host_ip`: The server's IP address (`ipaddress.IPv4Address`).\n\n#### Full stats\nFor retrieving full stats of a server, the same premises apply.\n\n from mcipc.query import Client\n\n with Client('127.0.0.1', 25565) as client:\n full_stats = client.full_stats\n\n print(full_stats)\n\nThe type of `full_stats` is a named tuple with the following properties:\n\n* `type`: The packet type (`Type`, protocol information).\n* `session_id`: The query's session ID (`int`, protocol information).\n* `host_name`: The server's message of the day (`str`, same as BasicStats.motd).\n* `game_type`: The game type (`str`).\n* `game_id`: The game ID (`str`).\n* `version`: The game version (`str`).\n* `plugins`: The used plugins (`dict`).\n* `map`: The current map (`str`).\n* `num_players`: The amount of online players (`int`).\n* `max_players`: The amount of maximally allowed players (`int`).\n* `host_port`: The server's port (`int`).\n* `host_ip`: The server's IP address (`ipaddress.IPv4Address`).\n* `players`: The names of online players (`tuple` of `str`).\n\n### RCON protocol\nThe `RCON` protocol is used to remotely control a Minecraft server, i.e. execute\ncommands on a Minecraft server and receive the respective results. \nTo enable `RCON` on a Minecraft server, you must set `enable-rcon = true` in the\nserver's `server.properties` file.\nFurthermore, you need to specify a port for the RCON server by setting `rcon.port = `\nand a password by setting `rcon.password = ` in the same file. \nThe following example assumes a server running on `127.0.0.1` and on the RCON port `5000` with password `'mysecretpassword'`:\n\n from mcipc.rcon import Client\n\n with Client('127.0.0.1', 5000) as client:\n client.login('mysecretpassword') # Perform initial login.\n seed = client.seed # Get the server's seed.\n players = client.players # Get the server's players info.\n mansion = client.locate('Mansion') # Get the next mansion's location.\n\n print(seed)\n print(players)\n print(mansion)\n\n\nThe type of `seed` is `Seed` which is derived from `int` and can be used just like the latter. \nThe type of `players` is `Players`, a named tuple:\n\n* `online`: The amount of online players (`int`).\n* `max`: The amount of maximally allowed players (`int`).\n* `names`: The names of online players (`tuple` of `str`).\n\nThe type of `mansion` is `Location` which describes the x-y-z location of the next located object.\n\n* `x`: x-coordinate (`int`).\n* `y`: y-coordinate (`int` or `None`).\n* `z`: z-coordinate (`int`).\n\n*HINT:* The y-component of a location may be `None`, which represents the special Minectaft vector component `'~'`.\n\n## Scripts\nThis library also ships a couple of scripts intended as a proof-of-concept.\n\n* `rconclt`: An `RCON` client.\n* `rconshell`: An interactive `RCON` shell.\n\n### `rconclt`\nThe script `rconclt` is an RCON client script to communicate with minecraft servers using the shell. \nTo invoke a pre-defined server configuration (see below):\n\n rconclt my_server [...] [options]\n\n## Configuration\n`rconclt` can be configured in `/etc/mcipc.d/rcon.conf`:\n\n [my_server]\n host = 127.0.0.1\n port = 5000\n passwd = mysecretpassword\n\nThe `passwd` entry is optional.\n\n## License\nCopyright (C) 2018 Richard Neumann \n\nmcipc is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nmcipc is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with mcipc. If not, see .\n\n\n## Legal\nMinecraft content and materials are trademarks and copyrights of\nMojang and its licensors. All rights reserved.\nThis program is free software and is not affiliated with Mojang.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/conqp/mcipc", "keywords": "minecraft python server rcon query", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "mcipc", "package_url": "https://pypi.org/project/mcipc/", "platform": "", "project_url": "https://pypi.org/project/mcipc/", "project_urls": { "Homepage": "https://github.com/conqp/mcipc" }, "release_url": "https://pypi.org/project/mcipc/1.1.1/", "requires_dist": null, "requires_python": ">=3.6", "summary": "A Minecraft server inter-process communication library.", "version": "1.1.1" }, "last_serial": 5388132, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "5626f390dec6456dcba363bc021f1760", "sha256": "04e85897cb1f579abab541ceaf303aec284d499779ef5b628cfc6824eaf8e07e" }, "downloads": -1, "filename": "mcipc-1.0.2.tar.gz", "has_sig": false, "md5_digest": "5626f390dec6456dcba363bc021f1760", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14723, "upload_time": "2019-05-30T09:11:47", "url": "https://files.pythonhosted.org/packages/a6/73/a8dea7bc36c7fcd0ab59512b480535b3eea22fc0f263600b809ef3d89178/mcipc-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "cbb91c9434a075f208f9104b044875f9", "sha256": "f33976d5771eda3e8a01b259582eb3a0765773925349d397172d28f7b6dbddec" }, "downloads": -1, "filename": "mcipc-1.0.3.tar.gz", "has_sig": false, "md5_digest": "cbb91c9434a075f208f9104b044875f9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14710, "upload_time": "2019-05-30T13:34:59", "url": "https://files.pythonhosted.org/packages/78/db/ae891f2b2683c98244f4928b34c4094786fbf374277e5796e38b60753352/mcipc-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "0cc920944e7bf131d7493fdb84d8cb1f", "sha256": "b9b998639123c634e2212eab7b5e41979902e43c42c387e01df6414c2229f0ce" }, "downloads": -1, "filename": "mcipc-1.0.4.tar.gz", "has_sig": false, "md5_digest": "0cc920944e7bf131d7493fdb84d8cb1f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14676, "upload_time": "2019-05-30T13:41:11", "url": "https://files.pythonhosted.org/packages/0a/a8/279a48346deb83399c23b99629dfc3f7abaef05bc82ee66f4b54fefbd7e4/mcipc-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "1d5acc6edb0c4e9c27782e48390db3ee", "sha256": "32788ee281281025267c5b8061725738ea0cfe0aa76ad89cbf2989bf2d2ae060" }, "downloads": -1, "filename": "mcipc-1.0.5.tar.gz", "has_sig": false, "md5_digest": "1d5acc6edb0c4e9c27782e48390db3ee", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14677, "upload_time": "2019-05-30T13:47:55", "url": "https://files.pythonhosted.org/packages/db/d0/feb45d798cd2edb2a1018ec282f7563c870a7a5ca62cb3452157910446ef/mcipc-1.0.5.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "5c2e8a743f944391d28e81fbe6e27fe3", "sha256": "7ead8561e404f3d669ffde21eb2d1b9863932ce020a17a17f69dbf74682bb121" }, "downloads": -1, "filename": "mcipc-1.1.1.tar.gz", "has_sig": false, "md5_digest": "5c2e8a743f944391d28e81fbe6e27fe3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 17100, "upload_time": "2019-06-11T20:03:26", "url": "https://files.pythonhosted.org/packages/3c/53/33a5c3a8ad372ba3a5f3d84165ff889910345041655495f05905079c6ab5/mcipc-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5c2e8a743f944391d28e81fbe6e27fe3", "sha256": "7ead8561e404f3d669ffde21eb2d1b9863932ce020a17a17f69dbf74682bb121" }, "downloads": -1, "filename": "mcipc-1.1.1.tar.gz", "has_sig": false, "md5_digest": "5c2e8a743f944391d28e81fbe6e27fe3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 17100, "upload_time": "2019-06-11T20:03:26", "url": "https://files.pythonhosted.org/packages/3c/53/33a5c3a8ad372ba3a5f3d84165ff889910345041655495f05905079c6ab5/mcipc-1.1.1.tar.gz" } ] }