furic/game-essentials
Composer 安装命令:
composer require furic/game-essentials
包简介
The essentials and basic data for a gaming backend server.
README 文档
README
Game Essentials for Laravel 5.*. This package is required and used by few packages in Sweaty Chair Studio creating the basic data and essential functions for a gaming server backend. This provides functions such as registering players and assign the players to a game. After that the data can be used for analytics purpose.
If you are using other packages that requires this package, this will be added automatically and you do not need to install it manually. However, you can still use this package alone without using other packages.
Table of Contents
Installation
Install this package via Composer:
$ composer require furic/game-essentials
If you are using Laravel 5.5 or later, then installation is done. Otherwise follow the next steps.
Open config/app.php and follow steps below:
Find the providers array and add our service provider.
'providers' => [ // ... Furic\GameEssentials\GameEssentialsServiceProvider::class ],
Configuration
To create table for game essentials in database run:
$ php artisan migrate
Usage
Games Table
| Name | Type | Not Null |
|-----------------|----------|----------|
| id | integer | ✓ |
| name | varchar | ✓ |
| version_ios | integer | ✓ |
| version_android | integer | ✓ |
| version_tvos | integer | ✓ |
| created_at | datetime | |
| updated_at | datetime | |
- Name: The name of the game/app.
- iOS Version: The latest version number in iOS, used for force update in client.
- Android Version: The latest version number in Android, used for force update in client.
- tvOS Version: The latest version number in tvOS, used for force update in client.
Players Table
| Name | Type | Not Null |
|---------------|----------|----------|
| id | integer | ✓ |
| facebook_id | varchar | |
| gamecenter_id | varchar | |
| playgames_id | varchar | |
| udid | varchar | |
| name | varchar | |
| ip | varchar | ✓ |
| created_at | datetime | |
| updated_at | datetime | |
- Facebook ID: The Facebook ID of a player. (Optional)
- Game Center ID: The Game Center ID of a player in iOS. (Optional)
- Google Play Games ID: The Google Play Games ID of a player in Android. (Optional)
- UDID: The unique device UDID of a player. If the player is using multiple devices, only the first device UDID is used here.
- Name: The name of the player input in game/app. (Optional)
- IP: The IP of the player when being first seen.
GamePlayer Privot Table
| Name | Type | Not Null |
|------------|----------|----------|
| id | integer | ✓ |
| game_id | integer | ✓ |
| player_id | integer | ✓ |
| channel | integer | ✓ |
| version | integer | ✓ |
| is_hack | tinyint | ✓ |
| created_at | datetime | |
| updated_at | datetime | |
- Game ID: The ID of a the game that player launched.
- Player ID: The ID of a player.
- Channel: The channel of the player getting into the game. Mostly used for Android players, e.g. Sumsung Store, Huawei App Gallery, etc. (Optional)
- Version: The current game version that the player device is running.
- Is Hacked: A boolean to mark if the player ever performed any hack in game, for analytics and limiting functions in client.
API URLs
GET <server url>/api/games/{id}
Returns a JSON data from a given game ID, for debug usage only.
GET <server url>/api/games/{id}/versions
Returns a JSON data containing the versions from a given game ID, for client checking the latest game version and perform force-update.
GET <server url>/api/games/{id}/players
Returns a JSON array of all players from a given game ID, for debug usage only.
GET <server url>/api/players/{id}
Returns a JSON data from a given player ID, for debug usage only.
GET <server url>/api/players/name/{name}
Returns a JSON data from a given player name, for debug usage only.
POST <server url>/api/players
Creates a JSON data of a player with given POST data. If the player is already exists with the given UDID, Facebook ID, or game servies IDs, it update the player data instead.
PUT <server url>/api/players/{id}
Updates a JSON data of a player with a given player id.
GET <server url>/api/players/{id}/games
Returns a JSON array of all players from a given game ID, for debug usage only.
API Document can be found here.
TODO
- Create the web console to add/edit games.
- Add admin login for web console.
- Add tests and factories.
License
laravel-game-essentials is licensed under a MIT License.
furic/game-essentials 适用场景与选型建议
furic/game-essentials 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 74 次下载、GitHub Stars 达 5, 最近一次更新时间为 2020 年 11 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「laravel」 「game」 「player」 「gaming server」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 furic/game-essentials 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 furic/game-essentials 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 furic/game-essentials 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
腾讯小游戏ThinkPHP5.0.*版
the first PHP project
Simple CLI game
hexlet project - brain games
Wrapper for API https://www.freetogame.com
统计信息
- 总下载量: 74
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 13
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-02