Provides data for Player.JoiningWorld event. Cancellable. Allows overriding the text that is shown on connection screen.
Inheritance: System.EventArgs, IPlayerEvent, ICancelableEvent
示例#1
0
 static bool RaisePlayerJoiningWorldEvent( [NotNull] Player player, [NotNull] World newWorld, WorldChangeReason reason,
                                           string textLine1, string textLine2 ) {
     if( player == null ) throw new ArgumentNullException( "player" );
     if( newWorld == null ) throw new ArgumentNullException( "newWorld" );
     var h = JoiningWorld;
     if( h == null ) return false;
     var e = new PlayerJoiningWorldEventArgs( player, player.World, newWorld, reason, textLine1, textLine2 );
     h( null, e );
     return e.Cancel;
 }
示例#2
0
 static bool RaisePlayerJoiningWorldEvent( [NotNull] Player player, [NotNull] World newWorld, WorldChangeContext context,
                                           string textLine1, string textLine2 ) {
     if( player == null ) throw new ArgumentNullException( "player" );
     if( newWorld == null ) throw new ArgumentNullException( "newWorld" );
     var handler = JoiningWorld;
     if( handler == null ) return true;
     var e = new PlayerJoiningWorldEventArgs( player, player.World, newWorld, context, textLine1, textLine2 );
     handler( null, e );
     return !e.Cancel;
 }