├── .gitattributes ├── .gitignore ├── LICENSE ├── MumblePing.php └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /MumblePing.php: -------------------------------------------------------------------------------- 1 | '', 55 | 'Users' => unpack( 'N', substr( $Data, 12, 4 ) )[ 1 ], 56 | 'MaxUsers' => unpack( 'N', substr( $Data, 16, 4 ) )[ 1 ], 57 | 'Bandwidth' => unpack( 'N', substr( $Data, 20, 4 ) )[ 1 ], 58 | ]; 59 | 60 | for( $i = 0; $i < 4; $i++ ) 61 | { 62 | if( $Data[ $i ] !== "\x00" ) 63 | { 64 | $Info[ 'Version' ] .= ord( $Data[ $i ] ); 65 | 66 | if( $Data[ $i + 1 ] !== "\x00" ) 67 | { 68 | $Info[ 'Version' ] .= '.'; 69 | } 70 | } 71 | } 72 | 73 | return $Info; 74 | } 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP Mumble Ping 2 | 3 | Mumble supports querying server information by sending a ping 4 | packet to the target server. This includes: server version, 5 | currently connected users, max users allowed, allowed bandwidth. 6 | This implementation doesn't require anything on the server side, 7 | and will work on any server. 8 | 9 | Read more about it [here](http://wiki.mumble.info/wiki/Protocol#UDP_Ping_packet). 10 | 11 | ### How to use it 12 | 13 | ```php 14 | '; 30 | echo 'Version: ' . $Info[ 'Version' ] . '
'; 31 | echo 'Bandwidth: ' . $Info[ 'Bandwidth' ] . ' (bytes)
'; 32 | } 33 | ``` 34 | --------------------------------------------------------------------------------