本文整理汇总了C#中Server.Items.BulletinMessage类的典型用法代码示例。如果您正苦于以下问题:C# BulletinMessage类的具体用法?C# BulletinMessage怎么用?C# BulletinMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BulletinMessage类属于Server.Items命名空间,在下文中一共展示了BulletinMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BBMessageHeader
public BBMessageHeader( BaseBulletinBoard board, BulletinMessage msg )
: base(0x71)
{
string poster = SafeString( msg.PostedName );
string subject = SafeString( msg.Subject );
string time = SafeString( msg.GetTimeAsString() );
EnsureCapacity( 22 + poster.Length + subject.Length + time.Length );
m_Stream.Write( (byte) 0x01 ); // PacketID
m_Stream.Write( (int) board.Serial ); // Bulletin board serial
m_Stream.Write( (int) msg.Serial ); // Message serial
BulletinMessage thread = msg.Thread;
if ( thread == null )
m_Stream.Write( (int) 0 ); // Thread serial--root
else
m_Stream.Write( (int) thread.Serial ); // Thread serial--parent
WriteString( poster );
WriteString( subject );
WriteString( time );
}
示例2: RecurseDelete
private void RecurseDelete( BulletinMessage msg )
{
List<Item> found = new List<Item>();
List<Item> items = this.Items;
for ( int i = items.Count - 1; i >= 0; --i )
{
if ( i >= items.Count )
continue;
BulletinMessage check = items[i] as BulletinMessage;
if ( check == null )
continue;
if ( check.Thread == msg )
{
check.Delete();
found.Add( check );
}
}
for ( int i = 0; i < found.Count; ++i )
RecurseDelete( (BulletinMessage)found[i] );
}
示例3: BBMessageContent
public BBMessageContent( BaseBulletinBoard board, BulletinMessage msg )
: base(0x71)
{
string poster = SafeString( msg.PostedName );
string subject = SafeString( msg.Subject );
string time = SafeString( msg.GetTimeAsString() );
EnsureCapacity( 22 + poster.Length + subject.Length + time.Length );
m_Stream.Write( (byte) 0x02 ); // PacketID
m_Stream.Write( (int) board.Serial ); // Bulletin board serial
m_Stream.Write( (int) msg.Serial ); // Message serial
WriteString( poster );
WriteString( subject );
WriteString( time );
m_Stream.Write( (short) msg.PostedBody );
m_Stream.Write( (short) msg.PostedHue );
int len = msg.PostedEquip.Length;
if ( len > 255 )
len = 255;
m_Stream.Write( (byte) len );
for ( int i = 0; i < len; ++i )
{
BulletinEquip eq = msg.PostedEquip[i];
m_Stream.Write( (short) eq.itemID );
m_Stream.Write( (short) eq.hue );
}
len = msg.Lines.Length;
if ( len > 255 )
len = 255;
m_Stream.Write( (byte) len );
for ( int i = 0; i < len; ++i )
WriteString( msg.Lines[i] );
}
示例4: BulletinMessage
public BulletinMessage(Mobile poster, BulletinMessage thread, string subject, string[] lines)
: base(0xEB0)
{
this.Movable = false;
this.m_Poster = poster;
this.m_Subject = subject;
this.m_Time = DateTime.UtcNow;
this.m_LastPostTime = this.m_Time;
this.m_Thread = thread;
this.m_PostedName = this.m_Poster.Name;
this.m_PostedBody = this.m_Poster.Body;
this.m_PostedHue = this.m_Poster.Hue;
this.m_Lines = lines;
List<BulletinEquip> list = new List<BulletinEquip>();
for (int i = 0; i < poster.Items.Count; ++i)
{
Item item = poster.Items[i];
if (item.Layer >= Layer.OneHanded && item.Layer <= Layer.Mount)
list.Add(new BulletinEquip(item.ItemID, item.Hue));
}
this.m_PostedEquip = list.ToArray();
}
示例5: PostMessage
public void PostMessage( Mobile from, BulletinMessage thread, string subject, string[] lines )
{
if ( thread != null )
thread.LastPostTime = DateTime.Now;
AddItem( new BulletinMessage( from, thread, subject, lines ) );
}
示例6: MessageOK
public virtual bool MessageOK( BulletinMessage msg )
{
return msg.Parent == this;
}
示例7: BulletinMessage
public BulletinMessage( Mobile poster, BulletinMessage thread, string subject, string[] lines )
: base( 0xEB0 )
{
Movable = false;
m_Poster = poster;
m_Subject = subject;
m_Time = DateTime.Now;
m_LastPostTime = m_Time;
m_Thread = thread;
m_PostedName = m_Poster.Name;
m_PostedBody = m_Poster.Body;
m_PostedHue = m_Poster.Hue;
m_Lines = lines;
List<BulletinEquip> list = new List<BulletinEquip>();
for (int i = 0; i < poster.Items.Count; ++i)
{
Item item = poster.Items[i];
if (item.Layer >= Layer.OneHanded && item.Layer <= Layer.Mount)
list.Add(new BulletinEquip(item.ItemID, item.Hue));
}
/*
var postedEquip =
from item in poster.item()
where item.Layer >= Layer.OneHanded && item.Layer <= Layer.Mount
select new BulletinEquip( item.ItemID, item.Hue );
*/
m_PostedEquip = list.ToArray();
}
示例8: BulletinMessage
public BulletinMessage( Mobile poster, BulletinMessage thread, string subject, string[] lines )
: base(0xEB0)
{
Movable = false;
m_Poster = poster;
m_Subject = subject;
m_Time = DateTime.Now;
m_Thread = thread;
m_Lines = lines;
if ( m_Poster == null )
{
m_PostedName = "";
m_PostedBody = 0x0190;
m_PostedHue = 0x83EA;
m_PostedEquip = new BulletinEquip[0];
}
else
{
m_PostedName = m_Poster.Name;
m_PostedBody = m_Poster.Body;
m_PostedHue = m_Poster.Hue;
ArrayList list = new ArrayList( poster.Items.Count );
for ( int i = 0; i < poster.Items.Count; ++i )
{
Item item = (Item)poster.Items[i];
if ( item.Layer >= Layer.FirstValid && item.Layer <= Layer.LastValid )
list.Add( new BulletinEquip( item.ItemID, item.Hue ) );
}
m_PostedEquip = (BulletinEquip[])list.ToArray( typeof( BulletinEquip ) );
}
}
示例9: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
if ( reader.ReadBool() )
m_DestinationString = reader.ReadString(); // NOTE: We cannot EDI.Find here, regions have not yet been loaded :-(
if ( reader.ReadBool() )
{
m_DeleteTime = reader.ReadDeltaTime();
m_DeleteTimer = new DeleteTimer( this, m_DeleteTime - DateTime.Now );
m_DeleteTimer.Start();
}
m_Message = reader.ReadItem() as BulletinMessage;
}
示例10: PostMessage
public override void PostMessage( Mobile from, BulletinMessage thread, string subject, string[] lines )
{
from.SendAsciiMessage( "This board is for automated bounty postings only. For communications you should use the forums at http://www.uorebirth.com" );
return;
}
示例11: GetLastPostTime
public override DateTime GetLastPostTime( BulletinMessage check )
{
return check.Time;
}
示例12: RecurseDelete
private void RecurseDelete( BulletinMessage msg )
{
ArrayList found = null;
List<Item> items = this.Items;
for ( int i = items.Count - 1; i >= 0; --i )
{
BulletinMessage check = items[i] as BulletinMessage;
if ( check != null && check.Thread == msg )
{
if ( found == null ) found = new ArrayList( 1 );
found.Add( check );
}
}
if ( found != null )
{
for ( int i = 0; i < found.Count; ++i )
RecurseDelete( (BulletinMessage)found[i] );
}
msg.Delete();
}
示例13: BulletinMessage
public BulletinMessage( Mobile poster, BulletinMessage thread, string subject, string[] lines )
: base(0xEB0)
{
Movable = false;
m_Poster = poster;
m_Subject = subject;
m_Time = DateTime.Now;
m_LastPostTime = m_Time;
m_Thread = thread;
m_PostedName = m_Poster.Name;
m_PostedBody = m_Poster.Body;
m_PostedHue = m_Poster.Hue;
m_Lines = lines;
ArrayList list = new ArrayList();
for ( int i = 0; i < poster.Items.Count; ++i )
{
Item item = poster.Items[i];
if ( item.Layer >= Layer.OneHanded && item.Layer <= Layer.Mount )
list.Add( new BulletinEquip( item.ItemID, item.Hue ) );
}
m_PostedEquip = (BulletinEquip[])list.ToArray( typeof( BulletinEquip ) );
}
示例14: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_Poster = reader.ReadMobile();
m_Subject = reader.ReadString();
m_Time = reader.ReadDateTime();
m_LastPostTime = reader.ReadDateTime();
bool hasThread = reader.ReadBool();
m_Thread = reader.ReadItem() as BulletinMessage;
m_PostedName = reader.ReadString();
m_PostedBody = reader.ReadInt();
m_PostedHue = reader.ReadInt();
m_PostedEquip = new BulletinEquip[reader.ReadInt()];
for ( int i = 0; i < m_PostedEquip.Length; ++i )
{
m_PostedEquip[i].itemID = reader.ReadInt();
m_PostedEquip[i].hue = reader.ReadInt();
}
m_Lines = new string[reader.ReadInt()];
for ( int i = 0; i < m_Lines.Length; ++i )
m_Lines[i] = reader.ReadString();
if ( hasThread && m_Thread == null )
Delete();
break;
}
}
}
示例15: OnLocationChange
protected override void OnLocationChange(Point3D oldLocation)
{
base.OnLocationChange(oldLocation);
if (oldLocation == Point3D.Zero)
{
EDI dest = GetDestination();
if (dest != null && m_Message == null)
{
if (m_Camp != null)
m_Message = new PrisonerMessage(m_Camp, this);
else
m_Message = new EscortMessage(this);
}
}
}