mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
Update FindPlayerUIDByName.php
This commit is contained in:
parent
8d257d05a9
commit
f2f289d723
@ -14,14 +14,15 @@ $redis = new Redis();
|
|||||||
$redis->pconnect(127.0.0.1, 6379, 2.5, "Server1");
|
$redis->pconnect(127.0.0.1, 6379, 2.5, "Server1");
|
||||||
$redis->auth("yourlongasspasswordhere");
|
$redis->auth("yourlongasspasswordhere");
|
||||||
|
|
||||||
|
// get all players names in database
|
||||||
$playerNames = $redis->keys('PlayerData:*');
|
$playerNames = $redis->keys('PlayerData:*');
|
||||||
|
|
||||||
// print all UID's matching player name
|
// print all UID's matching player name
|
||||||
foreach ($playerNames as $key => $value) {
|
foreach ($playerNames as $key => $value) {
|
||||||
$data = $redis->get($value);
|
$data = $redis->get($value);
|
||||||
if (stripos($data, $search) !== false) {
|
if (stripos($data, $search) !== false) {
|
||||||
$key = explode(":", $value);
|
$UID_raw = explode(":", $value);
|
||||||
echo "<p>" . $key[1] . "</p>" ;
|
echo "<p>" . $UID_raw[1] . "</p>" ;
|
||||||
break; // comment out this line if you want all matches and not just the first.
|
break; // comment out this line if you want all matches and not just the first.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user