open.mp forum
[Web] Open.mp / SAMP Query - Printable Version

+- open.mp forum (https://forum.open.mp)
+-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
+--- Forum: Releases (https://forum.open.mp/forumdisplay.php?fid=13)
+--- Thread: [Web] Open.mp / SAMP Query (/showthread.php?tid=3215)



Open.mp / SAMP Query - laex - 2025-07-09

GTA SA-MP / Open.MP Server Monitor
Modern Web-Based Real-Time Server Monitoring Tool


[Image: samp-query.png]

About The Project

Hello SA-MP / Open.MP Community!

I'm presenting you a modern and useful SA-MP/Open.MP server monitoring project. This tool provides a responsive web interface that allows you to track servers in real-time.



Features
  • Real-Time Data: Direct UDP SA-MP/Open.MP query protocol implementation
  • Modern Interface: Responsive design with TailwindCSS and Alpine.js
  • Fast Performance: Optimized UDP socket connections
  • Smart Search: Filter by server name, IP, gamemode, or server type
  • Mobile Compatible: Perfect display on all devices
  • Auto Refresh: Automatic updates every 30 seconds
  • Detailed Information: Player count, ping, gamemode, language and more
  • No External APIs: Direct protocol implementation for reliability
  • Open.MP Support: Full compatibility with both SA-MP and Open.MP servers



Live Demo

You can see the demo here: https://samp.laex.com.tr (demo site updates automatically once per hour)



Technical Details
  • Backend: PHP 8.0+
  • Frontend: HTML5, TailwindCSS, Alpine.js
  • Protocol: SA-MP/Open.MP UDP Query Protocol
  • Icons: Font Awesome 6
  • License: MIT (Open Source)



Installation

Requirements:
- PHP 8.0 or higher
- Socket extension (php-sockets)
- JSON extension (php-json)
- Web server (Apache/Nginx)

Quick Installation:

Code:
git clone https://github.com/thislaex/samp-query.git cd samp-query # Copy files to your web server

Server Configuration:
Edit the $servers array in index.php:

Code:
private $servers = [     ['ip' => 'your-server-ip', 'port' => 7777, 'type' => 'samp'],     ['ip' => 'openmp-server-ip', 'port' => 7777, 'type' => 'openmp'], ];

Server Types:
- 'type' => 'samp' - For SA-MP servers
- 'type' => 'openmp' - For Open.MP servers



API Usage
The project also provides a JSON API:

Code:
GET /path/to/samp/?api=servers

Example Response:
Code:
{     "success": true,     "servers": [         {             "hostname": "[0.3.7/DL] Your SAMP Server",             "players": 42,             "maxplayers": 100,             "gamemode": "Roleplay/Freeroam",             "language": "English",             "password": false,             "ping": 85,             "ip": "192.168.1.100",             "port": 7777,             "server_type": "samp",             "is_openmp": false         },         {             "hostname": "Open.MP Test Server",             "players": 25,             "maxplayers": 100,             "gamemode": "Freeroam/DM",             "language": "English",             "password": false,             "ping": 65,             "ip": "192.168.1.101",             "port": 7777,             "server_type": "openmp",             "is_openmp": true         }     ],     "count": 2,     "timestamp": "2025-07-09 15:30:45" }

You can use this in your own projects as well!



Customization
Timeout Settings:
Code:
// Change timeout from 2 seconds to 5 seconds @socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 5, 'usec' => 0));

Auto Refresh Interval:
Code:
// Change from 30 seconds to 60 seconds setInterval(() => {     if (!this.loading) {         this.refreshServers();     } }, 60000);



Contributing
This project is open source! You can fork it on GitHub and contribute to development.

Steps:
1. Fork the repository
2. Create a development branch
3. Make your changes
4. Send a Pull Request

Code Standards:
- Follow PSR-12 coding standards
- Use Conventional Commits format
- Test with different SA-MP and Open.MP servers
- Check mobile compatibility



Troubleshooting
Servers not showing: Check if PHP sockets extension is installed

UDP connection failed: Make sure firewall allows UDP connections

Slow queries: Adjust timeout values or check network

API returns empty: Make sure servers are online and accessible

Open.MP server not showing: Make sure server type is set to 'openmp'

Windows Firewall Configuration:
Code:
New-NetFirewallRule -DisplayName "SAMP/OpenMP UDP" -Direction Outbound -Protocol UDP -LocalPort 7777

Contact and Links

GitHub Repository: thislaex/samp-query
GitHub Profile: @thislaex
Discord: thislaex
Bug Report: Issues



If this project helped you, don't forget to star it on GitHub!

Language Note: Currently, the interface is in Turkish. If you'd like to contribute an English translation or other languages, feel free to submit a Pull Request!

Made with <3 for SA-MP & Open.MP Community



RE: Open.mp / SAMP Query - iAmir - 2025-07-09

Very nice. It's going to be useful for many people. Thanks for sharing this!


RE: Open.mp / SAMP Query - laex - 2025-07-09

(2025-07-09, 03:22 AM)iAmir Wrote: Very nice. It's going to be useful for many people. Thanks for sharing this!
Thank you for your valuable comment :)