Skip to content

Commit 4ee90d8

Browse files
author
Flavius12
committed
v2.10
1 parent 25a3fd8 commit 4ee90d8

15 files changed

Lines changed: 34 additions & 24 deletions

ServerAuth/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: ServerAuth
22
main: ServerAuth\ServerAuth
3-
version: "2.00"
3+
version: "2.10"
44
api: [1.11.0]
55
load: STARTUP
66
author: EvolSoft

ServerAuth/src/ServerAuth/Commands/ChangePassword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* ServerAuth (v2.00) by EvolSoft
4+
* ServerAuth (v2.10) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
77
* Date: 31/08/2015 10:27 AM (UTC)

ServerAuth/src/ServerAuth/Commands/Commands.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* ServerAuth (v2.00) by EvolSoft
4+
* ServerAuth (v2.10) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
77
* Date: 31/08/2015 10:31 AM (UTC)

ServerAuth/src/ServerAuth/Commands/Logout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* ServerAuth (v2.00) by EvolSoft
4+
* ServerAuth (v2.10) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
77
* Date: 31/08/2015 10:56 AM (UTC)

ServerAuth/src/ServerAuth/Commands/Register.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* ServerAuth (v2.00) by EvolSoft
4+
* ServerAuth (v2.10) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
77
* Date: 31/08/2015 11:03 AM (UTC)

ServerAuth/src/ServerAuth/Commands/Unregister.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* ServerAuth (v2.00) by EvolSoft
4+
* ServerAuth (v2.10) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
77
* Date: 31/08/2015 11:09 AM (UTC)

ServerAuth/src/ServerAuth/EventListener.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* ServerAuth (v2.00) by EvolSoft
4+
* ServerAuth (v2.10) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
7-
* Date: 31/08/2015 01:25 PM (UTC)
7+
* Date: 31/08/2015 05:39 PM (UTC)
88
* Copyright & License: (C) 2015 EvolSoft
99
* Licensed under MIT (https://github.com/EvolSoft/ServerAuth/blob/master/LICENSE)
1010
*/
@@ -33,6 +33,7 @@
3333
use pocketmine\Server;
3434

3535
use ServerAuth\ServerAuth;
36+
use pocketmine\event\entity\EntityDamageByEntityEvent;
3637

3738
class EventListener implements Listener {
3839

@@ -54,10 +55,8 @@ public function onPreLogin(PlayerPreLoginEvent $event){
5455
}
5556
}
5657
if($count > 1){
57-
if(ServerAuth::getAPI()->isPlayerAuthenticated($player)){
58-
$player->close($this->plugin->translateColors("&", ServerAuth::getAPI()->getConfigLanguage()->getAll()["single-auth"]), $this->plugin->translateColors("&", ServerAuth::getAPI()->getConfigLanguage()->getAll()["single-auth"]), false);
59-
$event->setCancelled(true);
60-
}
58+
$player->close("", $this->plugin->translateColors("&", ServerAuth::getAPI()->getConfigLanguage()->getAll()["single-auth"]), $this->plugin->translateColors("&", ServerAuth::getAPI()->getConfigLanguage()->getAll()["single-auth"]), false);
59+
$event->setCancelled(true);
6160
}
6261
}
6362
}
@@ -169,8 +168,19 @@ public function onBucketEmpty(PlayerBucketEmptyEvent $event){
169168
}
170169
171170
public function onEntityDamage(EntityDamageEvent $event){
172-
if(!ServerAuth::getAPI()->isPlayerRegistered($event->getPlayer()->getName()) || !ServerAuth::getAPI()->isPlayerAuthenticated($event->getPlayer())){
173-
$event->setCancelled(true);
171+
$player = $event->getEntity();
172+
if($player instanceof Player){
173+
if(!ServerAuth::getAPI()->isPlayerRegistered($player->getName()) || !ServerAuth::getAPI()->isPlayerAuthenticated($player)){
174+
$event->setCancelled(true);
175+
}
176+
}
177+
if($event instanceof EntityDamageByEntityEvent){
178+
$damager = $event->getDamager();
179+
if($damager instanceof Player){
180+
if(!ServerAuth::getAPI()->isPlayerRegistered($damager->getName()) || !ServerAuth::getAPI()->isPlayerAuthenticated($damager)){
181+
$event->setCancelled(true);
182+
}
183+
}
174184
}
175185
}
176186

ServerAuth/src/ServerAuth/Events/ServerAuthAuthenticateEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* ServerAuth (v2.00) by EvolSoft
4+
* ServerAuth (v2.10) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
77
* Date: 10/05/2015 02:17 PM (UTC)

ServerAuth/src/ServerAuth/Events/ServerAuthDeauthenticateEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* ServerAuth (v2.00) by EvolSoft
4+
* ServerAuth (v2.10) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
77
* Date: 10/05/2015 02:19 PM (UTC)

ServerAuth/src/ServerAuth/Events/ServerAuthPasswordChangeEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* ServerAuth (v2.00) by EvolSoft
4+
* ServerAuth (v2.10) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
77
* Date: 10/05/2015 02:22 PM (UTC)

0 commit comments

Comments
 (0)