public void SetAuthentication(string auth, string by) { #if Full_API var ctx = new Plugin.HookContext() { Player = this as Terraria.Player, Connection = this.Connection.Socket }; var changing = new Plugin.HookArgs.PlayerAuthenticationChanging() { AuthenticatedAs = auth, AuthenticatedBy = by }; Plugin.HookPoints.PlayerAuthenticationChanging.Invoke(ref ctx, ref changing); if (ctx.Result != Plugin.HookResult.DEFAULT) { return; } this.AuthenticatedAs = auth; this.AuthenticatedBy = by; ctx = new Plugin.HookContext() { Player = this as Terraria.Player, Connection = this.Connection.Socket }; var changed = new Plugin.HookArgs.PlayerAuthenticationChanged() { AuthenticatedAs = this.AuthenticatedAs, AuthenticatedBy = this.AuthenticatedBy }; Plugin.HookPoints.PlayerAuthenticationChanged.Invoke(ref ctx, ref changed); #endif }
public void SetAuthentication(string auth, string by) { #if Full_API var ctx = new Plugin.HookContext() { Player = this as Terraria.Player, Connection = this.Connection.Socket }; var changing = new Plugin.HookArgs.PlayerAuthenticationChanging() { AuthenticatedAs = auth, AuthenticatedBy = by }; Plugin.HookPoints.PlayerAuthenticationChanging.Invoke(ref ctx, ref changing); if (ctx.Result != Plugin.HookResult.DEFAULT) return; this.AuthenticatedAs = auth; this.AuthenticatedBy = by; ctx = new Plugin.HookContext() { Player = this as Terraria.Player, Connection = this.Connection.Socket }; var changed = new Plugin.HookArgs.PlayerAuthenticationChanged() { AuthenticatedAs = this.AuthenticatedAs, AuthenticatedBy = this.AuthenticatedBy }; Plugin.HookPoints.PlayerAuthenticationChanged.Invoke(ref ctx, ref changed); #endif }