1<?php
2/**
3 * BlackTek (https://github.com/Black-Tek/BlackTek-Server): a TFS fork whose
4 * schema.sql - checked against its `master` branch - matches TFS_10 in every
5 * way that matters here: `accounts` has `name` and a `secret` char(16) column,
6 * `players_online` exists, `houses` uses the TFS column names (not Canary's
7 * renamed internal_bid/bid_end_date/...), and both `guild_membership` and
8 * `guild_ranks` exist. So it is normalised to TFS_10 for querying (see
9 * engine/init.php) and the legacy accounts.secret 2FA flow works unmodified.
10 */
11final class BlackTekAdapter implements ServerAdapterInterface
12{
13 public function key(): string {
14 return 'BLACKTEK';
15 }
16
17 public function login(string $username, string $password): int|false {
18 return user_login($username, $password);
19 }
20
21 public function accountIdentityColumn(): string {
22 return 'name';
23 }
24
25 public function accountDisplayColumn(): string {
26 return '`a`.`name`';
27 }
28
29 public function supportsLegacyTwoFactor(): bool {
30 return true;
31 }
32
33 public function onlineCount(): int {
34 return znote_sql_count("SELECT COUNT(*) AS `c` FROM `players_online`;");
35 }
36
37 public function normalizedEngine(): string {
38 return 'TFS_10';
39 }
40}
41