File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
4
4
core .register_on_sending_chat_messages (function (message )
5
+ if message :sub (1 ,2 ) == " .." then
6
+ return false
7
+ end
8
+
5
9
local first_char = message :sub (1 ,1 )
6
10
if first_char == " /" or first_char == " ." then
7
11
core .display_chat_message (core .gettext (" issued command: " ) .. message )
@@ -12,9 +16,7 @@ core.register_on_sending_chat_messages(function(message)
12
16
end
13
17
14
18
local cmd , param = string.match (message , " ^%.([^ ]+) *(.*)" )
15
- if not param then
16
- param = " "
17
- end
19
+ param = param or " "
18
20
19
21
if not cmd then
20
22
core .display_chat_message (core .gettext (" -!- Empty command" ))
@@ -36,15 +38,15 @@ core.register_on_sending_chat_messages(function(message)
36
38
end )
37
39
38
40
core .register_chatcommand (" list_players" , {
39
- description = " List online players" ,
41
+ description = core . gettext ( " List online players" ) ,
40
42
func = function (param )
41
43
local players = table.concat (core .get_player_names (), " , " )
42
- core .display_chat_message (" Online players: " .. players )
44
+ core .display_chat_message (core . gettext ( " Online players: " ) .. players )
43
45
end
44
46
})
45
47
46
48
core .register_chatcommand (" disconnect" , {
47
- description = " Exit to main menu" ,
49
+ description = core . gettext ( " Exit to main menu" ) ,
48
50
func = function (param )
49
51
core .disconnect ()
50
52
end ,
You can’t perform that action at this time.
0 commit comments