Skip to content

Commit 143f07a

Browse files
committed
limit commands to admin players
1 parent 97f7725 commit 143f07a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/net/inbound-packets/command-packet.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { inputCommandAction } from '../../world/actor/player/action/input-command-action';
2+
import {Rights} from "../../world/actor/player/player";
23

34
const commandPacket = (player, packet) => {
45
const input = packet.buffer.getString();
@@ -13,8 +14,11 @@ const commandPacket = (player, packet) => {
1314
const command = args[0];
1415

1516
args.splice(0, 1);
16-
17-
inputCommandAction(player, command, isConsole, args);
17+
if(player.rights !== Rights.ADMIN) {
18+
player.sendLogMessage("You need to be an administrator to use commands.", isConsole);
19+
} else {
20+
inputCommandAction(player, command, isConsole, args);
21+
}
1822
};
1923

2024
export default [{

0 commit comments

Comments
 (0)