Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

Commit 812ac2d

Browse files
committed
Update Config
1 parent ed971c5 commit 812ac2d

4 files changed

Lines changed: 23 additions & 3 deletions

File tree

resources/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Discord: https://discord.gg/EF2G5dh
66

77
# Config version
8-
version: 7
8+
version: 8
99
# You can set whether to enable developer mode.
1010
# Note: Do not forget to disable developer mode when publishing server.
1111
dev-mode: true
@@ -18,6 +18,9 @@ event-time: 30
1818
timezone: Asia/Tokyo
1919
# Please enter the block ID which can participate in the game when touching the block.
2020
join-block-id: 247
21+
# Please configure server address and port.
22+
ip: play.vector-network.tk
23+
port: 19132
2124

2225
red:
2326
spawn1:

src/VectorNetworkProject/TheMix/TheMix.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
class TheMix extends PluginBase
3838
{
39-
public const VERSION = 7;
39+
public const VERSION = 8;
4040

4141
/* @var TheMix $instance */
4242
private static $instance = null;

src/VectorNetworkProject/TheMix/game/DefaultConfig.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,22 @@ public static function getBlockId(): int
8484
return TheMix::getInstance()->getConfig()->get(self::BLOCK_ID);
8585
}
8686

87+
/**
88+
* @return string
89+
*/
90+
public static function getIp(): string
91+
{
92+
return TheMix::getInstance()->getConfig()->get('ip');
93+
}
94+
95+
/**
96+
* @return int
97+
*/
98+
public static function getPort(): int
99+
{
100+
return TheMix::getInstance()->getConfig()->get('port');
101+
}
102+
87103
/**
88104
* @return array
89105
*/

src/VectorNetworkProject/TheMix/task/ResetGameTask.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use pocketmine\scheduler\Task;
1212
use pocketmine\Server;
13+
use VectorNetworkProject\TheMix\game\DefaultConfig;
1314

1415
class ResetGameTask extends Task
1516
{
@@ -19,7 +20,7 @@ class ResetGameTask extends Task
1920
public function onRun(int $currentTick)
2021
{
2122
foreach (Server::getInstance()->getOnlinePlayers() as $player) {
22-
$player->transfer('play.vector-network.tk', 19132, '再接続');
23+
$player->transfer(DefaultConfig::getIp(), DefaultConfig::getPort(), '再接続');
2324
}
2425
Server::getInstance()->shutdown();
2526
}

0 commit comments

Comments
 (0)