Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 2ffd09e

Browse files
author
UramnOIL
committed
get()の追加
1 parent 926c7a5 commit 2ffd09e

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

resources/sqlite.sql

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ IN (
5151
WHERE accounts.name = :name
5252
);
5353
-- # }
54+
-- # { get
55+
-- # :name string
56+
SELECT *
57+
FROM dual
58+
INNER JOIN accounts
59+
ON dual.id = accounts.id
60+
WHERE accounts.name = :name;
61+
-- # }
5462
-- # { addcount
5563
-- # :name string
5664
-- # :kill int
@@ -72,7 +80,7 @@ WHERE id IN (
7280
-- # }
7381
-- # { getrankingbyExp
7482
-- # :limit int
75-
SELECT accounts.name, accounts.id, ffapvp.kill, ffapvp.death, ffapvp.exp
83+
SELECT *
7684
FROM ffapvp
7785
INNER JOIN accounts
7886
ON ffapvp.id = accounts.id
@@ -81,7 +89,7 @@ ORDER BY exp DESC;
8189
-- # }
8290
-- # { getrankingbykill
8391
-- # :limit int
84-
SELECT accounts.name, accounts.id, ffapvp.kill, ffapvp.death, ffapvp.exp
92+
SELECT *
8593
FROM ffapvp
8694
INNER JOIN accounts
8795
ON ffapvp.id = accounts.id
@@ -139,9 +147,9 @@ WHERE id IN (
139147
WHERE accounts.name = :name
140148
);
141149
-- # }
142-
-- # { getranking
150+
-- # { getrankingbywin
143151
-- # :limit int
144-
SELECT accounts.name, accounts.id, dual.kill
152+
SELECT *
145153
FROM dual
146154
INNER JOIN accounts
147155
ON dual.id = accounts.id

src/VectorNetworkProject/DataProvider/Tables/FFAPvP/FFAPvP.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313

1414
class FFAPvP extends TableBase
1515
{
16-
public const FFAPVP_INIT = 'userdataprovider.ffapvp.init';
17-
public const FFAPVP_REGISTER = 'userdataprovider.ffapvp.register';
18-
public const FFAPVP_UNREGISTER = 'userdataprovider.ffapvp.unregister';
19-
public const FFAPVP_ADD_COUNT = 'userdataprovider.ffapvp.addcount';
16+
public const FFAPVP_INIT = 'userdataprovider.ffapvp.init';
17+
public const FFAPVP_REGISTER = 'userdataprovider.ffapvp.register';
18+
public const FFAPVP_UNREGISTER = 'userdataprovider.ffapvp.unregister';
19+
public const FFAPVP_GET = 'userdataprovider.ffapvp.get';
20+
public const FFAPVP_ADD_COUNT = 'userdataprovider.ffapvp.addcount';
2021
public const FFAPVP_GET_RANKING_BY_KILL = 'userdataprovider.ffapvp.getrankingbykill';
21-
public const FFAPVP_GET_RANKING_BY_EXP = 'userdataprovider.ffapvp.getrankingbyexp';
22+
public const FFAPVP_GET_RANKING_BY_EXP = 'userdataprovider.ffapvp.getrankingbyexp';
2223

2324
public function init(): void
2425
{
@@ -50,6 +51,18 @@ public function unregister(IPLayer $player, ?callable $onSuccess = null, ?callab
5051
$this->connector->executeChange(self::FFAPVP_UNREGISTER, [$player->getName()], $onSuccess, $onError );
5152
}
5253

54+
/**
55+
* プレイヤーの情報を取得します
56+
*
57+
* @param IPlayer $player
58+
* @param callable|null $onSuccess
59+
* @param callable|null $onError
60+
*/
61+
public function get(IPlayer $player, callable $onSuccess = null, ?callable $onError = null): void
62+
{
63+
$this->connector->executeSelect(self::FFAPVP_GET, [$player->getName()], $onSuccess, $onError);
64+
}
65+
5366
/**
5467
* プレイヤーのそれぞれのカウントを増やします
5568
*

0 commit comments

Comments
 (0)