Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #27

Merged
merged 62 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
c5b779d
Added configurable chat command prefix.
Dec 6, 2022
8bd3a16
Added configurable chat command prefix.
Dec 6, 2022
7a1107d
Added Rooki rank for apex
Dec 6, 2022
d255cd5
Invalidate client cache on client enter view
Dec 7, 2022
72221c7
A game will now considered as active it has assignments.
Dec 9, 2022
c3fa757
Change default log channel to daily
Dec 10, 2022
d693dde
Updated dependencies
Dec 11, 2022
8a1cc1a
Bugfix
Dec 11, 2022
a6119e6
Merge branch 'master' into development
Domenikus Dec 11, 2022
7fd883e
Improved Service provider for teamspeak listeners
Dec 12, 2022
f54e6f7
Refactored GameGateways
Dec 12, 2022
5a1c829
Merge remote-tracking branch 'origin/master' into development
Dec 12, 2022
4b9cdb9
Send message to client when registration process is in progress
Dec 12, 2022
dc6faf6
Added .editorconfig to enforce PSR1/2 codestyle
Dec 14, 2022
db97bb0
Drop id column from game-type
Dec 15, 2022
043cd62
Possibility to customise the server groups which will be shown in ts3…
Domenikus Dec 20, 2022
66d2f2a
Merge remote-tracking branch 'origin/master' into development
Dec 20, 2022
f6d9c0f
Solve merge conflict
Dec 20, 2022
c02e770
Added phpstan to ci pipeline
Dec 20, 2022
f6ba08c
Added phpstan to ci pipeline
Dec 20, 2022
92b6676
Added phpstan to ci pipeline
Dec 20, 2022
ead8a1b
Updated dependencies
Dec 20, 2022
2cbd81c
Updated dependencies
Dec 20, 2022
43ec993
Updated dependencies
Dec 20, 2022
0d9228e
Updated dependencies
Dec 20, 2022
097ae7c
Updated dependencies
Dec 20, 2022
b571078
Added migration which create game_user_types for existing users
Dec 20, 2022
a34c7ce
Adding composer cache to speed up builds
Dec 20, 2022
9df704b
Fix build
Dec 20, 2022
6fe593f
Fix build
Dec 20, 2022
2bf59d2
Fix build
Dec 20, 2022
3d1ba59
Fix build
Dec 20, 2022
042b54f
Fix build
Dec 20, 2022
e0403b7
Fix build
Dec 20, 2022
f6a2068
Fix build
Dec 20, 2022
136a505
Fix build
Dec 20, 2022
8c71ce4
Fix build
Dec 20, 2022
26a3678
Added static analysis on every pull request
Dec 20, 2022
efca367
Added missing example in help file
Dec 21, 2022
fdff09c
Change pipeline
Dec 21, 2022
768c53f
Remove todo
Dec 21, 2022
cb49ff5
Updated documentation
Dec 21, 2022
be8dc93
Added option to configure how many matches will be considered while c…
Dec 22, 2022
da16bad
Exclude game user in auto update which has updated their stats manual…
Dec 25, 2022
40fbc91
Updated pipeline
Dec 25, 2022
ec7a163
Merge remote-tracking branch 'origin/master' into development
Dec 25, 2022
e9c7ac6
Ignore default server groups while getting highest sort id
Dec 25, 2022
28b8d00
Bugfix
Jan 5, 2023
85a4ce6
Added bot default channel
Jan 11, 2023
efbcf49
Updated documentation
Jan 11, 2023
d2a3ba2
Merge remote-tracking branch 'origin/master' into development
Jan 12, 2023
e5cd87d
Merge remote-tracking branch 'origin/master' into development
Jan 12, 2023
c34b70b
Updated documentation
Jan 12, 2023
4395564
Updated documentation
Jan 12, 2023
1f139b5
Updated documentation
Jan 12, 2023
bef9f13
Updated dependecies
Mar 14, 2023
70fceee
Updated dependecies
Mar 14, 2023
af69f31
Adjust code style
Mar 14, 2023
a1d35a9
Added emerald rank
Jul 28, 2024
0a91254
Added emerald rank, switched to latest icons
Jul 28, 2024
873ca7e
Bugfix
Jul 28, 2024
fd1708d
Bugfix
Jul 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ php game-bot menu
## Setup for production

- Create a query user on the teamspeak server, see necessary permission down below
- Whitelist the ipaddress of the bot or turn of anti-flood-protection
- Whitelist the ipaddress of the bot or turn off anti-flood-protection
- Get Api keys
- Apex Legends: [Tracker.gg](https://tracker.gg/developers) (optional)
- League of Legends: [Riot developers](https://developer.riotgames.com/apis) (optional)
Expand Down Expand Up @@ -194,20 +194,23 @@ docker exec -it game-bot php game-bot
b_serverinstance_permission_list
b_virtualserver_servergroup_permission_list
b_virtualserver_client_list
b_serverquery_login
b_virtualserver_notify_register
b_virtualserver_notify_unregister
i_channel_subscribe_power
b_virtualserver_servergroup_list
b_virtualserver_channelgroup_list
b_virtualserver_servergroup_create
b_virtualserver_servergroup_delete
i_permission_modify_power
b_icon_manage
i_icon_id (Grant)
i_group_sort_id (Grant)
i_icon_id (grant)
i_group_sort_id (grant)
i_max_icon_filesize
b_client_ignore_antiflood
i_group_modify_power
i_group_member_add_power
i_client_max_channel_subscriptions
```

## Usage
Expand Down
1 change: 0 additions & 1 deletion app/Commands/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class Menu extends Command
/**
* Execute the console command.
*
* @return void
*
* @throws InvalidTerminalException
*/
Expand Down
4 changes: 0 additions & 4 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class AppServiceProvider extends ServiceProvider

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot(): void
{
Expand All @@ -45,8 +43,6 @@ public function boot(): void

/**
* Register any application services.
*
* @return void
*/
public function register(): void
{
Expand Down
7 changes: 0 additions & 7 deletions app/Services/GameServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@ interface GameServiceInterface
{
/**
* Get images in specific type for the given value
*
* @param Type $type
* @param string $value
* @return string|null
*/
public function grabImage(Type $type, string $value): ?string;

/**
* Get values for given type
*
* @param Type $type
* @return array|null
*/
public function grabValues(Type $type): ?array;

Expand Down
5 changes: 0 additions & 5 deletions app/Services/Gateways/ApexLegendsGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ public function mapStats(GameUser $gameUser, array $stats, Collection $assignmen
}

/**
* @param array $stats
* @param Collection<int, Assignment> $assignments
* @return Assignment|null
*/
protected function mapLegend(array $stats, Collection $assignments): ?Assignment
{
Expand All @@ -197,10 +195,7 @@ protected function mapLegend(array $stats, Collection $assignments): ?Assignment
}

/**
* @param array $stats
* @param Collection<int, Assignment> $assignments
* @param string $queueType
* @return Assignment|null
*/
protected function mapRank(array $stats, Collection $assignments, string $queueType): ?Assignment
{
Expand Down
3 changes: 0 additions & 3 deletions app/Services/Gateways/GameGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ public function grabRankImage(string $rankName): ?string;
public function grabRanks(): ?array;

/**
* @param GameUser $gameUser
* @param array $stats
* @param Collection<int, Assignment> $assignments
* @return array
*/
public function mapStats(
GameUser $gameUser,
Expand Down
3 changes: 0 additions & 3 deletions app/Services/Gateways/GameGatewayFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
class GameGatewayFactory implements GameGatewayFactoryInterface
{
/**
* @param string $gameName
* @return GameGateway
*
* @throws InvalidGatewayException
*/
public function create(string $gameName): GameGateway
Expand Down
30 changes: 4 additions & 26 deletions app/Services/Gateways/LeagueOfLegendsGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,11 @@ public function setLanguageCode(string $languageCode): LeagueOfLegendsGateway
return $this;
}

/**
* @return int
*/
public function getMatchCount(): int
{
return $this->matchCount;
}

/**
* @param int $matchCount
* @return LeagueOfLegendsGateway
*/
public function setMatchCount(int $matchCount): LeagueOfLegendsGateway
{
$this->matchCount = $matchCount;
Expand Down Expand Up @@ -328,7 +321,7 @@ public function grabRankImage(string $rankName): ?string
{
$rankImage = null;
if (! $this->getRankImageFolderPath()) {
if ($archiveFilePath = $this->downloadArchive('https://static.developer.riotgames.com/docs/lol/ranked-emblems.zip', 'rank-icons')) {
if ($archiveFilePath = $this->downloadArchive('https://static.developer.riotgames.com/docs/lol/ranked-emblems-latest.zip', 'rank-icons')) {
$rankImageFolderPath = getcwd().'/storage/rank-icons';
if ($this->extractArchive($archiveFilePath, $rankImageFolderPath)) {
$this->setRankImageFolderPath($rankImageFolderPath);
Expand All @@ -337,10 +330,10 @@ public function grabRankImage(string $rankName): ?string
}
}

$fileName = 'Emblem_'.substr($rankName, 0, strpos($rankName, ' ') ?: strlen($rankName)).'.png';
$fileName = 'Rank='.substr($rankName, 0, strpos($rankName, ' ') ?: strlen($rankName)).'.png';

if (File::exists($this->getRankImageFolderPath().'/'.$fileName)) {
$rankImage = File::get($this->getRankImageFolderPath().'/'.$fileName, true);
if (File::exists($this->getRankImageFolderPath().'/Ranked Emblems Latest/'.$fileName)) {
$rankImage = File::get($this->getRankImageFolderPath().'/Ranked Emblems Latest/'.$fileName, true);
} else {
Log::error('No rank image found', ['rankName' => $rankName, 'fileName' => $fileName]);
}
Expand All @@ -360,10 +353,7 @@ public function grabRanks(): ?array
}

/**
* @param GameUser $gameUser
* @param array $stats
* @param Collection<int, Assignment> $assignments
* @return array
*/
public function mapStats(GameUser $gameUser, array $stats, Collection $assignments): array
{
Expand Down Expand Up @@ -504,10 +494,7 @@ protected function grabMatches(GameUser $gameUser, int $offset, int $count, stri
}

/**
* @param GameUser $gameUser
* @param array $match
* @param Collection<int, Assignment> $assignments
* @return Assignment|null
*/
protected function mapChampion(GameUser $gameUser, array $match, Collection $assignments): ?Assignment
{
Expand All @@ -523,10 +510,7 @@ protected function mapChampion(GameUser $gameUser, array $match, Collection $ass
}

/**
* @param GameUser $gameUser
* @param array $match
* @param Collection<int, Assignment> $assignments
* @return Assignment|null
*/
protected function mapLane(GameUser $gameUser, array $match, Collection $assignments): ?Assignment
{
Expand All @@ -542,10 +526,7 @@ protected function mapLane(GameUser $gameUser, array $match, Collection $assignm
}

/**
* @param GameUser $gameUser
* @param array $matches
* @param Collection<int, Assignment> $assignments
* @return array
*/
protected function mapMatches(GameUser $gameUser, array $matches, Collection $assignments): array
{
Expand Down Expand Up @@ -589,10 +570,7 @@ protected function mapMatches(GameUser $gameUser, array $matches, Collection $as
}

/**
* @param array $leagues
* @param Collection<int, Assignment> $assignments
* @param string $queueType
* @return Assignment|null
*/
protected function mapRank(array $leagues, Collection $assignments, string $queueType): ?Assignment
{
Expand Down
6 changes: 0 additions & 6 deletions app/Services/Gateways/TeamfightTacticsGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ public function grabPositions(): ?array
}

/**
* @param GameUser $gameUser
* @param array $stats
* @param Collection<int, Assignment> $assignments
* @return array
*/
public function mapStats(GameUser $gameUser, array $stats, Collection $assignments): array
{
Expand All @@ -114,10 +111,7 @@ public function mapStats(GameUser $gameUser, array $stats, Collection $assignmen
}

/**
* @param array $leagues
* @param Collection<int, Assignment> $assignments
* @param string $queueType
* @return Assignment|null
*/
protected function mapRank(array $leagues, Collection $assignments, string $queueType): ?Assignment
{
Expand Down
1 change: 0 additions & 1 deletion app/Services/Gateways/TeamspeakGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ public static function getServerGroups(): array
}

/**
* @param TeamSpeak3_Node_Client $client
* @return array<string>
*/
public static function getServerGroupsAssignedToClient(TeamSpeak3_Node_Client $client): array
Expand Down
5 changes: 0 additions & 5 deletions app/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,7 @@ protected function registerUser(Game $game, string $identityId, array $params):
}

/**
* @param GameUser $gameUser
* @param Collection<int, Assignment> $assignments
* @return void
*/
protected function removeServerGroups(GameUser $gameUser, Collection $assignments): void
{
Expand All @@ -280,10 +278,7 @@ protected function removeServerGroups(GameUser $gameUser, Collection $assignment
}

/**
* @param GameUser $gameUser
* @param Collection<int, Assignment> $assignments
* @param GameGateway $interface
* @return void
*/
protected function updateServerGroups(GameUser $gameUser, Collection $assignments, GameGateway $interface): void
{
Expand Down
28 changes: 0 additions & 28 deletions app/Services/UserServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,69 +10,41 @@ public function handleAdmin(User $user, array $params = []): void;

/**
* Shows all available commands
*
* @param string $identityId
* @return void
*/
public function handleHelp(string $identityId): void;

/**
* Hide type
*
* @param User $user
* @param array $params
* @return void
*/
public function handleHide(User $user, array $params = []): void;

/**
* Handels invalid commands
*
* @param string $identityId
* @param array $params
* @return void
*/
public function handleInvalid(string $identityId, array $params = []): void;

/**
* Handels !register command in teamspeak chat
*
* @param string $identityId
* @param array $params
* @return void
*/
public function handleRegister(string $identityId, array $params = []): void;

/**
* Show type
*
* @param User $user
* @param array $params
* @return void
*/
public function handleShow(User $user, array $params = []): void;

/**
* Handels !unregister command in teamspeak chat
*
* @param User $user
* @param array $params
* @return void
*/
public function handleUnregister(User $user, array $params = []): void;

/**
* Handels !update command in teamspeak chat
*
* @param User $user
* @return void
*/
public function handleUpdate(User $user): void;

/**
* Updates all clients which are currently online
*
* @return void
*/
public function handleUpdateAll(): void;
}
Loading
Loading