{"id":37060795,"url":"https://github.com/justmavi/sampquery","last_synced_at":"2026-01-14T06:53:01.328Z","repository":{"id":43069085,"uuid":"313778620","full_name":"justmavi/sampquery","owner":"justmavi","description":"Library for sending queries to SAMP servers","archived":false,"fork":false,"pushed_at":"2025-11-22T19:32:53.000Z","size":450,"stargazers_count":9,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T21:07:57.768Z","etag":null,"topics":["csharp","samp","sampapi","sampquery"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/SAMPQuery/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justmavi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-11-18T00:28:26.000Z","updated_at":"2025-11-22T19:32:57.000Z","dependencies_parsed_at":"2022-09-10T23:11:37.499Z","dependency_job_id":null,"html_url":"https://github.com/justmavi/sampquery","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/justmavi/sampquery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmavi%2Fsampquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmavi%2Fsampquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmavi%2Fsampquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmavi%2Fsampquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justmavi","download_url":"https://codeload.github.com/justmavi/sampquery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmavi%2Fsampquery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csharp","samp","sampapi","sampquery"],"created_at":"2026-01-14T06:53:00.703Z","updated_at":"2026-01-14T06:53:01.314Z","avatar_url":"https://github.com/justmavi.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NuGet version (SAMPQuery)](https://img.shields.io/badge/nuget-1.1.1-blue)](https://www.nuget.org/packages/SAMPQuery/)\n\n# SAMPQuery\n\nSAMPQuery is a library that allows you to query SAMP servers for information about it and execute RCON commands. It includes encoding correction, hostname resolution, asynchronous calls and much more.\n\n## Table of Contents\n\n- [SAMPQuery](#sampquery)\n  - [Table of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [Documentation](#documentation)\n    - [Constructor](#constructor)\n    - [GetServerInfoAsync](#getserverinfoasync)\n    - [GetServerRulesAsync](#getserverrulesasync)\n    - [GetServerPlayersAsync](#getserverplayersasync)\n    - [SendRconCommandAsync](#sendrconcommandasync)\n    - [ServerInfo](#serverinfo)\n    - [ServerRules](#serverrules)\n    - [ServerPlayer](#serverplayer)\n  - [Gratitude](#gratitude)\n  - [Stay in touch](#stay-in-touch)\n\n## Installation\n\nPackage manager\n\n```nuget\nInstall-Package SAMPQuery -Version 1.1.1\n```\n\nTerminal\n\n```shell\n$ dotnet add package SAMPQuery --version 1.1.1\n```\n\nPackage Reference\n\n```xml\n\u003cPackageReference Include=\"SAMPQuery\" Version=\"1.1.1\" /\u003e\n```\n\nClone repository\n\n```shell\n$ git clone https://github.com/justmavi/sampquery.git\n```\n\n## Usage\n\n```csharp\nvar server = new SampQuery(\"localhost\", 7777);\n\nServerInfo serverInfo = await server.GetServerInfoAsync();\nServerRules serverRules = await server.GetServerRulesAsync();\nIEnumerable\u003cServerPlayer\u003e serverPlayers = await server.GetServerPlayersAsync();\n\nConsole.WriteLine($\"Welcome to ${serverInfo.HostName}! Mapname: ${serverRules.MapName}\");\nConsole.WriteLine(\"Players online:\");\nserverPlayers.ToList().ForEach(player =\u003e Console.WriteLine(player.PlayerName));\n```\n\n## Documentation\n\n### Constructor\n\n```csharp\nvar server = new SampQuery(\"127.0.0.1\", 7777);\n```\n\nThe constructor also has overloads\n\n```csharp\nSampQuery(IPAddress ip, ushort port)\nSampQuery(string ip, ushort port, string password)\nSampQuery(IPAddress ip, ushort port, string password)\nSampQuery(IPAddress ip) // will be used default 7777 port\nSampQuery(string ip) // will be used default 7777 port or you can use \"HOST:PORT\" string\n```\n\nHostname is also allowed\n\n```csharp\nvar server = new SampQuery(\"localhost\", 7777);\n```\n\n### GetServerInfoAsync\n\nAsynchronously requests basic information about the server\n\n```csharp\nvar server = new SampQuery(\"127.0.0.1\", 7777);\nServerInfo data = await server.GetServerInfoAsync();\n\nConsole.WriteLine($\"Server {data.HostName}. Online: {data.Players}/{data.MaxPlayers}\");\n```\n\n### GetServerRulesAsync\n\nAsynchronously requests the rules, set by the server\n\n```csharp\nvar server = new SampQuery(\"127.0.0.1\", 7777);\nServerInfo data = await server.GetServerRulesAsync();\n\nConsole.WriteLine($\"Lagcomp {(data.Lagcomp ? \"On\" : \"Off\")}. Map: {data.MapName}. SAMPCAC: {data.SAMPCAC_Version ?? \"Isn't required\"}\");\n```\n\n**The maximum value of the player ID is 255. Two-byte identifiers are not supported here (SA-MP limit).**\n\n### GetServerPlayersAsync\n\nAsynchronously requests players online with detailed information (works up to 100 online, SA-MP limit)\n\n```csharp\n var server = new SampQuery(\"127.0.0.1\", 7777);\n IEnumerable\u003cServerPlayer\u003e players = await server.GetServerPlayersAsync();\n\n Console.WriteLine(\"ID | Nick | Score | Ping\\n\");\n\n foreach(ServerPlayer player in players)\n {\n     Console.WriteLine($\"{player.PlayerId} | {player.PlayerName} | {player.PlayerScore} | {player.PlayerPing}\");\n }\n```\n\n**The maximum value of the player ID is 255. Two-byte identifiers are not supported here (SA-MP limit).**\n\n### SendRconCommandAsync\n\nAsynchronously executes RCON command\n\n```csharp\n var server = new SampQuery(\"127.0.0.1\", 7777, \"helloworld\");\n string answer = await sampQuery.SendRconCommandAsync(\"varlist\");\n\n Console.WriteLine($\"Server says: {answer}\");\n```\n\n### ServerInfo\n\nA class representing information about the server. Properties:\n\n- HostName\n- GameMode\n- Language\n- Players\n- MaxPlayers\n- Password\n- ServerPing\n\n### ServerRules\n\nA class representing server rules. Properties:\n\n- Lagcomp\n- MapName\n- Version\n- SAMPCAC_Version\n- Weather\n- Weburl\n- WorldTime\n- Gravity\n\n### ServerPlayer\n\nA class representing information about the player. Properties:\n\n- PlayerId\n- PlayerName\n- PlayerScore\n- PlayerPing\n\n## Gratitude\n\n- Separate gratitude to **@continue98** for fixing bugs\n\n## Stay in touch\n\n- Author - [Grish Poghosyan](https://www.linkedin.com/in/grishpoghosyan)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustmavi%2Fsampquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustmavi%2Fsampquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustmavi%2Fsampquery/lists"}