diff options
author | cheapie <no-email-for-you@example.com> | 2021-03-13 02:09:59 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2021-03-13 02:09:59 -0600 |
commit | c1258412c43cd9f1657a96e44d2ad97baa069dda (patch) | |
tree | 36dcad31578145c46b37a1c3d4021400d1cb7ab7 | |
parent | e8b521162fc539d6ca23f9f7510043d900991e03 (diff) | |
download | chat6-c1258412c43cd9f1657a96e44d2ad97baa069dda.tar chat6-c1258412c43cd9f1657a96e44d2ad97baa069dda.tar.gz chat6-c1258412c43cd9f1657a96e44d2ad97baa069dda.tar.bz2 chat6-c1258412c43cd9f1657a96e44d2ad97baa069dda.tar.xz chat6-c1258412c43cd9f1657a96e44d2ad97baa069dda.zip |
Hopefully compatible with modern clients again
-rw-r--r-- | init.lua | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -1,10 +1,5 @@ chat6 = {} -local player_name = "UNKNOWN" -minetest.register_on_connect(function() - player_name = minetest.localplayer:get_name() -end) - local function default_settings() chat6.settings.fields.highlight_color = "#4E9A06" chat6.settings.fields.send_nick_color = "#A40000" @@ -60,7 +55,6 @@ minetest.register_on_formspec_input(function(formname,fields) chat6.settings.fields.send_message_color = validate_hex_color(fields.sendmsg,chat6.settings.fields.send_message_color) chat6.settings.fields.join_color = validate_hex_color(fields.join,chat6.settings.fields.join_color) chat6.settings.fields.part_color = validate_hex_color(fields.part,chat6.settings.fields.part_color) - --chat6.settings.fields.timestamps = (fields.timestamps and "true" or "false") chat6.storage:from_table(chat6.settings) end return true @@ -102,6 +96,7 @@ minetest.register_on_receiving_chat_message(function(message) timestamp = string.format("[%02d:%02d:%02d] ",date.hour,date.min,date.sec) end if string.sub(message,1,1) == "<" then + local player_name = minetest.localplayer:get_name() msgtype = "channel" user,text = string.match(message,"^<([^%c ]*)> (.*)$") if not user then @@ -118,6 +113,7 @@ minetest.register_on_receiving_chat_message(function(message) text = "(Client Quit)" end elseif string.sub(message,1,1) == "*" then + local player_name = minetest.localplayer:get_name() msgtype = "action" user,text = string.match(message,"^* ([^%c ]*) (.*)$") if not user then |