GS2-Stamina¶
Create Client
stamina_client = client('stamina')
目次
Method¶
change_stamina¶
response = stamina_client:change_stamina(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
スタミナを増減します
- 消費クオータ: 5
Request¶
{
staminaPoolName=string,
overflow=boolean,
maxValue=number,
variation=number,
accessToken=string
}
- staminaPoolName
- [string] スタミナプールの名前を指定します。
- overflow
- [boolean] スタミナを回復する際に最大値を超えて回復するか
- maxValue
- [number] スタミナの最大値
- variation
- [number] スタミナの増減量
- accessToken
- [string] GS2-Auth で発行を受けたアクセストークン
consume_stamina¶
response = stamina_client:consume_stamina(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
スタミナを消費します。 このエンドポイントは回復に使用できません。 ポリシーで消費と回復を分けて管理したい場合に使用してください。
- 消費クオータ: 5
Request¶
{
staminaPoolName=string,
maxValue=number,
variation=number,
accessToken=string
}
- staminaPoolName
- [string] スタミナプールの名前を指定します。
- maxValue
- [number] スタミナの最大値
- variation
- [number] スタミナの消費量
- accessToken
- [string] GS2-Auth で発行を受けたアクセストークン
create_stamina_pool¶
response = stamina_client:create_stamina_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
スタミナプールを新規作成します
Request¶
{
increaseInterval=number,
name=string,
serviceClass=string,
description=string,
}
- increaseInterval
- [number] スタミナの回復速度(秒)
- name
- [string] スタミナプールの名前
- serviceClass
- [string] スタミナプールのサービスクラス
- description
- [string] スタミナプールの説明
delete_stamina_pool¶
response = stamina_client:delete_stamina_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
スタミナプールを削除します
Response¶
None
describe_service_class¶
response = stamina_client:describe_service_class(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
サービスクラスの一覧を取得します
Request¶
{
}
describe_stamina_pool¶
response = stamina_client:describe_stamina_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
スタミナプールの一覧を取得します
Request¶
{
pageToken=string,
limit=number,
}
- pageToken
- [string] データの取得を開始する位置を指定するトークン
- limit
- [number] データの取得件数
get_stamina¶
response = stamina_client:get_stamina(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
現在のスタミナ値を取得します
- 消費クオータ: 3
Request¶
{
staminaPoolName=string,
maxValue=number,
accessToken=string
}
- staminaPoolName
- [string] スタミナプールの名前を指定します。
- maxValue
- [number] スタミナの最大値を指定します
- accessToken
- [string] GS2-Auth で発行を受けたアクセストークン
get_stamina_pool¶
response = stamina_client:get_stamina_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
スタミナプールを取得します
get_stamina_pool_status¶
response = stamina_client:get_stamina_pool_status(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
スタミナプールの状態を取得します
update_stamina_pool¶
response = stamina_client:update_stamina_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
スタミナプールを更新します
Request¶
{
staminaPoolName=string,
serviceClass=string,
description=string,
increaseInterval=number,
}
- staminaPoolName
- [string] スタミナプールの名前を指定します。
- serviceClass
- [string] スタミナプールのサービスクラス
- description
- [string] スタミナプールの説明
- increaseInterval
- [number] スタミナの回復速度(秒)
Model¶
Stamina¶
- lastUpdateAt
- [number] 最終更新日時(エポック秒)
- overflow
- [number] 最大値を超えて保持しているスタミナ値
- userId
- [string] ユーザID
- value
- [number] スタミナ値
StaminaPool¶
- description
- [string] 説明文
- staminaPoolId
- [string] スタミナプールGRN
- serviceClass
- [string] サービスクラス
- createAt
- [number] 作成日時(エポック秒)
- ownerId
- [string] オーナーID
- increaseInterval
- [number] スタミナの回復速度(秒)
- updateAt
- [number] 最終更新日時(エポック秒)
- name
- [string] スタミナプール名