cego/player-account-client

该软件包已被废弃,不再维护。未建议替代软件包。

用于与玩家账户服务交互的库。

0.3.3 2021-09-22 08:54 UTC

README

该软件包用作与玩家账户服务通信的标准化方式。客户端实现了一个流畅的接口。

客户端设置

// Getting a client instance
$playerAccount = PlayerAccount::create($playerAccountBaseURL);

// Setting basic auth credentials
$playerAccount->auth($username, $password);

// Telling the client to use Request Insurance
$playerAccount->useRequestInsurance();

使用方法

// Updating attributes of a user
$playerAccount->update($userId, [
    'admin_user_id'    => 123,
    'user_attribute_1' => 'Becomes this',
    'user_attribute_2' => 'Becomes that'
]);

// Adding a flag to a user
$playerAccount->addFlag($userId, [
    'type'          => 'TheFlagType',
    'admin_user_id' => 123,
    'reason'        => 'The player needs the flag'
]);

// Removing a flag from a user
$playerAccount->removeFlag($userId, [
    'type'          => 'TheFlagType',
    'admin_user_id' => 123,
    'reason'        => 'The player must have the flag removed'
]);

// Triggering a user incident
$playerAccount->incident($userId, [
    'type'          => 'TheIncidentType',
    'admin_user_id' => 123,
    'reason'        => 'Something happened that triggered the incident'
]);

该项目最初由

  • Thomas Wogelius (THWO)