Skip to content

Commit

Permalink
Internal renaming, Release v2.0.3
Browse files Browse the repository at this point in the history
- Note look at renames in v3, I'll keep my promise of strict semver.
  • Loading branch information
JaxkDev committed Sep 4, 2021
1 parent ae30867 commit 4e39bee
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/JaxkDev/DiscordBot/Plugin/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Main extends PluginBase{
private $tickTask;

/** @var BotCommunicationHandler */
private $botCommsHandler;
private $communicationHandler;

/** @var Api */
private $api;
Expand Down Expand Up @@ -99,7 +99,7 @@ public function onEnable(){
}

$this->api = new Api($this);
$this->botCommsHandler = new BotCommunicationHandler($this);
$this->communicationHandler = new BotCommunicationHandler($this);

$this->getLogger()->debug("Starting DiscordBot Thread...");
$this->discordBot = new BotThread($this->getServer()->getLogger(), $this->config, $this->outboundData, $this->inboundData);
Expand Down Expand Up @@ -168,7 +168,7 @@ public function onCommand(CommandSender $sender, Command $command, string $label
$z->addFromString("storage.serialized", Storage::serializeStorage());
}

//Some metadata, instead of users having no clue of anything I ask, generate this information beforehand.
//Some metadata, instead of users having no clue of anything I ask, therefore generate this information beforehand.
$time = date('d-m-Y H:i:s');
$ver = $this->getDescription()->getVersion();
/** @phpstan-ignore-next-line Constant default means ternary condition is always false on analysis. */
Expand Down Expand Up @@ -251,14 +251,14 @@ private function tick(int $currentTick): void{

/** @var Packet $d */
foreach($data as $d){
$this->botCommsHandler->handle($d);
$this->communicationHandler->handle($d);
}

if(($currentTick % 20) === 0){
//Run every second. [Faster/More accurate over bots tick]
if($this->discordBot->getStatus() === BotThread::STATUS_READY){
$this->botCommsHandler->checkHeartbeat();
$this->botCommsHandler->sendHeartbeat();
$this->communicationHandler->checkHeartbeat();
$this->communicationHandler->sendHeartbeat();
}
if($this->discordBot->getStatus() === BotThread::STATUS_CLOSED){
$this->getServer()->getPluginManager()->disablePlugin($this);
Expand Down Expand Up @@ -295,7 +295,7 @@ public function writeOutboundData(Packet $packet): void{
}

public function getBotCommunicationHandler(): BotCommunicationHandler{
return $this->botCommsHandler;
return $this->communicationHandler;
}

public function getApi(): Api{
Expand Down

0 comments on commit 4e39bee

Please sign in to comment.