Skip to content

Commit

Permalink
fix: hasView tblMultiServerInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Javdu10 committed Oct 21, 2021
1 parent cb844b6 commit 24f4857
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 4 deletions.
Binary file modified assets/img/jobs/32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/jobs/33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/jobs/34.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/jobs/35.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/jobs/36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/jobs/37.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/jobs/38.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/jobs/39.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "flyff",
"name": "flyff",
"description": "Plugin for Azuriom",
"version": "0.2.7",
"version": "0.2.8",
"url": "https:\/\/azuriom.com",
"authors": [
"Javdu10"
Expand Down
12 changes: 9 additions & 3 deletions src/Games/FlyffServerBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Azuriom\Models\User;
use Azuriom\Games\ServerBridge;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Azuriom\Plugin\Shop\Models\User as ShopUser;

/**
Expand All @@ -25,7 +24,7 @@ public function getServerData()
{
if (@fsockopen($this->server->address, $this->server->port, $errorno, $errorstr, 0.1)) {
$connected = 0;
if (Schema::connection('sqlsrv')->hasTable('CHARACTER_01_DBF.dbo.tblMultiServerInfo')) {
if ($this->hasTblMultiServerInfoView()) {
$connected = DB::connection('sqlsrv')->table('CHARACTER_01_DBF.dbo.tblMultiServerInfo')->where('MultiServer', '1')->count();
} else {
$connected = DB::connection('sqlsrv')->table('CHARACTER_01_DBF.dbo.CHARACTER_TBL')->where('MultiServer', '1')->count();
Expand Down Expand Up @@ -113,7 +112,7 @@ private function getPlayerFallback($user, &$idPlayer, &$idServer)

private function playerIsConnected($idPlayer, $idServer)
{
if (Schema::connection('sqlsrv')->hasTable('CHARACTER_01_DBF.dbo.tblMultiServerInfo')) {
if ($this->hasTblMultiServerInfoView()) {
return DB::connection('sqlsrv')->table('CHARACTER_01_DBF.dbo.tblMultiServerInfo')
->where([
['m_idPlayer', $idPlayer],
Expand Down Expand Up @@ -163,4 +162,11 @@ private function sendItemsWithSocket($idPlayer, $idServer, $commands)
fclose($fp);
}
}

private function hasTblMultiServerInfoView()
{
return DB::connection('sqlsrv')->table('CHARACTER_01_DBF.INFORMATION_SCHEMA.TABLES')
->where('TABLE_NAME', 'tblMultiServerInfo')
->exists();
}
}

0 comments on commit 24f4857

Please sign in to comment.