wbykos Posted June 18, 2015 Share Posted June 18, 2015 How can i parse messages on server side? Link to comment Share on other sites More sharing options...
wbykos Posted June 18, 2015 Author Share Posted June 18, 2015 Sorry, wrong Subforum, this topic must be in Dont Starve Together. Anyway i found solution by placing this code in modmain.luaGLOBAL.Networking_Say = function(guid, userid, name, prefab, message, colour, whisper, ...) print(message)endIs this right way to do this or not?This code does not overwrite main function, which resides in networking.lua? Link to comment Share on other sites More sharing options...
Blueberrys Posted June 18, 2015 Share Posted June 18, 2015 @wbykos That would in fact overwrite the original function. You can preserve the original by assigning it to another variable and calling it.local old_Networking_Say = GLOBAL.Networking_Say -- preserve old function-- OverwriteGLOBAL.Networking_Say = function(guid, userid, name, prefab, message, colour, whisper) local r = old_Networking_Say(guid, userid, name, prefab, message, colour, whisper) -- Call old function print(message) -- Do what you need return r -- Return value from old functionend Link to comment Share on other sites More sharing options...
wbykos Posted June 19, 2015 Author Share Posted June 19, 2015 Thanks, will keep it in mind Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.