Skip to content

Commit bee79c4

Browse files
committed
Extra Error handling, + permabans
1 parent 18c3ebe commit bee79c4

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

plugins/GlobalBan.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ public function isTriggered()
4545
$fields = [
4646
'key' => $this->CONFIG['key'],
4747
'uid' => $client['client_unique_identifier']->toString(),
48-
'ip' => $client['connection_client_ip'],
49-
'banned_by' => $this->info['invokername'],
50-
'banned_by_uid' => $this->info['invokeruid'],
51-
'reason' => $reason,
48+
'ip' => $client['connection_client_ip']->toString(),
49+
'banned_by' => $this->info['invokername']->toString(),
50+
'banned_by_uid' => $this->info['invokeruid']->toString(),
51+
'reason' => $reason->toString(),
5252
'server_name' => $this->server->toString(),
53-
'server_uid' => $this->server['virtualserver_unique_identifier'],
54-
'h' => hash_pbkdf2('sha1', sprintf("%s-%s-%s", $this->CONFIG['key'], $client['client_unique_identifier']->toString(),$this->info['invokeruid']),$this->server['virtualserver_unique_identifier'], 1, 8),
53+
'server_uid' => $this->server['virtualserver_unique_identifier']->toString(),
54+
'h' => hash_pbkdf2('sha1', sprintf("%s-%s-%s", $this->CONFIG['key'], $client['client_unique_identifier']->toString(),$this->info['invokeruid']),$this->server['virtualserver_unique_identifier']->toString(), 1, 8),
5555

5656
];
5757

@@ -73,14 +73,16 @@ public function isTriggered()
7373
try {
7474
$client->poke("[b][color=red]You are global banned by Nimda ID: #{$response->ban_id}");
7575
$client->poke("[b][color=red]Visit [url=#]Global Ban Support[/url].");
76-
$client->ban(1, "Global Ban ID #{$response->ban_id} ({$reason})");
76+
$client->ban(0, "Global Ban ID #{$response->ban_id} ({$reason})");
7777
}catch(Ts3Exception $e){
7878
return;
7979
}
8080

8181
$this->sendOutput(sprintf("[b][color=green] Client %s successfully global banned ID #%s", $client, $response->ban_id));
8282
} elseif ($response->success === false && $response->err === 0x02) {
8383
$this->sendOutput("[COLOR=red][b]This server is not authorized to global ban, email support@mxgaming.com");
84+
} else {
85+
$this->sendOutput("[COLOR=orange][b]Unexpected error");
8486
}
8587
}
8688

plugins/GlobalBanList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ public function isTriggered()
6565

6666
if($this->CONFIG['ban'] === true && $response->uid === $this->info['client_unique_identifier']->toString()) {
6767
try {
68-
$client->poke("[b][color=red]You are globally banned by Nimda ID: #{$response->id}");
68+
$client->poke("[b][color=red]You are globally banned by Nimda ID: #{$response->ban_id}");
6969
$client->poke("[b][color=red]Visit [url=#]Global Ban Support[/url].");
70-
$client->ban(1, "Global Ban ID #{$response->id} ({$response->reason})");
70+
$client->ban(0, "Global Ban ID #{$response->ban_id} ({$response->reason})");
7171
}catch(Ts3Exception $e){
7272
return;
7373
}
7474
}
7575

7676
if($this->CONFIG['alert'] === true) {
77-
$message = sprintf("[ALERT] Client %s is global banned ID #%s reason: %s\n", $client, $response->ban_id, $response->reason);
77+
$message = sprintf("[ALERT] Client %s is global banned ID #%s reason: %s issued Global Ban from: %s\n", $client, $response->ban_id, $response->reason, $response->server_name);
7878
array_walk(array_map([$this->server, 'serverGroupGetById'], $this->CONFIG['alert_groups']), function($admin) use ($message) {
7979
$admin->message($message);
8080
});

0 commit comments

Comments
 (0)