public override void OnResponse( Mobile from, string text )
{
int page = m_Page;
BaseHouse house = m_House;
BasePlayerBB board = m_Board;
if ( house == null || !house.IsLockedDown( board ) )
{
from.SendLocalizedMessage( 1062396 ); // This bulletin board must be locked down in a house to be usable.
return;
}
else if ( !from.InRange( board.GetWorldLocation(), 2 ) || !from.InLOS( board ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
return;
}
else if ( !CheckAccess( house, from ) )
{
from.SendLocalizedMessage( 1062398 ); // You are not allowed to post to this bulletin board.
return;
}
else if ( m_Greeting && !house.IsOwner( from ) )
{
return;
}
text = text.Trim();
if ( text.Length > 255 )
text = text.Substring( 0, 255 );
if ( text.Length > 0 )
{
PlayerBBMessage message = new PlayerBBMessage( DateTime.Now, from, text );
if ( m_Greeting )
{
board.Greeting = message;
}
else
{
board.Messages.Add( message );
if ( board.Messages.Count > 50 )
{
board.Messages.RemoveAt( 0 );
if ( page > 0 )
--page;
}
}
}
from.SendGump( new PlayerBBGump( from, house, board, page ) );
}
}