定制 opengsq/opengsq-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

opengsq/opengsq-php

最新稳定版本:v0.0.3

Composer 安装命令:

composer require opengsq/opengsq-php

包简介

PHP library designed for querying game servers.

README 文档

README

PHP Composer GitHub license Packagist Version Packagist Downloads

The OpenGSQ PHP library provides a convenient way to query servers from applications written in the PHP language.

Documentation

Detailed documentation is available at https://php.opengsq.com.

System Requirements

Installation

The recommended way to install the OpenGSQ PHP library is through Composer, a tool for dependency management in PHP. You can install it by running the following command in your terminal:

composer require opengsq/opengsq-php

Basic Usage

Here’s a quick example of how you can use the OpenGSQ library to query a server using the VCMP protocol:

<?php

// Include the Composer autoloader
require_once '../vendor/autoload.php';

// Import the Vcmp class from the OpenGSQ\Protocols namespace
use OpenGSQ\Protocols\Vcmp;

// Create a new Vcmp object with the specified host and port
$vcmp = new Vcmp('123.123.123.123', 8114);

// Get the status of the server
$status = $vcmp->getStatus();

// Output the status information
var_dump($status);

// Get the players on the server
$players = $vcmp->getPlayers();

// Output the player information
var_dump($players);

In this example, we first include the Composer autoloader and import the Vcmp class. We then create a new Vcmp object, specifying the host and port of the server we want to query. Finally, we call the getStatus and getPlayers methods to retrieve and output information about the server and its players.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Stargazers over time

Stargazers over time

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-28