tryChangeClientName, LidgrenHandleConnection, handlePendingClient hooks and some other things

This commit is contained in:
Evil Factory
2021-12-28 12:37:51 -03:00
parent 71e39f1422
commit e6d170329a
7 changed files with 57 additions and 5 deletions
@@ -2701,6 +2701,15 @@ namespace Barotrauma.Networking
c.NameID = nameId;
newName = Client.SanitizeName(newName);
if (newName == c.Name && newJob == c.PreferredJob && newTeam == c.PreferredTeam) { return false; }
var result = new LuaResult(GameMain.Lua.hook.Call("tryChangeClientName", c, newName, newJob, newTeam));
if (!result.IsNull())
{
LastClientListUpdateID++;
return result.Bool();
}
c.PreferredJob = newJob;
c.PreferredTeam = newTeam;