本文整理汇总了C#中Assistant.Serial类的典型用法代码示例。如果您正苦于以下问题:C# Serial类的具体用法?C# Serial怎么用?C# Serial使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Serial类属于Assistant命名空间,在下文中一共展示了Serial类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Mobile
public Mobile( Serial serial )
: base(serial)
{
m_Items = new ArrayList();
m_Map = World.Player == null ? (byte)0 : World.Player.Map;
m_Visible = true;
}
示例2: AcceptParty
public AcceptParty( Serial leader )
: base(0xBF)
{
EnsureCapacity( 1 + 2 + 2 + 1 + 4 );
Write( (ushort)0x06 ); // party command
Write( (byte)0x08 ); // accept
Write( (uint)leader );
}
示例3: ObjectPropertyList
public ObjectPropertyList( Serial ser, int hash, ArrayList props )
{
m_Serial = ser;
m_ServerHash = hash;
m_ServerProps = props;
m_MyHash = 0;
m_MyProps = null;
}
示例4: Mobile
public Mobile( Serial serial )
: base(serial)
{
m_Items = new ArrayList();
m_Map = World.Player == null ? (byte)0 : World.Player.Map;
m_Visible = true;
Agent.InvokeMobileCreated( this );
}
示例5: Event_ASCIIMessage
private static bool? Event_ASCIIMessage(Serial serial, ItemID graphic, byte type, ushort hue, ushort font, string lang, string name, string msg)
{
if (msg == "Banish!" || msg == "Decimate!" || msg == "Pool of Poison!")
{
msg = string.Format("!!!{0}!!", msg);
WorldEx.OverHeadMessage(msg, 0x0017);
if (msg == "!!!Banish!!!")
timer.Start();
}
return null;
}
示例6: AsciiMessage
public AsciiMessage( Serial serial, int graphic, MessageType type, int hue, int font, string name, string text )
: base(0x1C)
{
if ( name == null ) name = "";
if ( text == null ) text = "";
if ( hue == 0 )
hue = 0x3B2;
this.EnsureCapacity( 45 + text.Length );
Write( (uint) serial );
Write( (short) graphic );
Write( (byte) type );
Write( (short) hue );
Write( (short) font );
WriteAsciiFixed( name, 30 );
WriteAsciiNull( text );
}
示例7: DoubleClick
public static void DoubleClick( bool silent, Serial s )
{
if ( s != Serial.Zero )
{
if ( m_Last != s )
{
m_Queue.Enqueue( s );
m_Last = s;
m_Total++;
if ( m_Queue.Count == 1 && !m_Timer.Running )
m_Timer.StartMe();
else if ( !silent && m_Total > 1 )
World.Player.SendMessage( LocString.ActQueued, m_Queue.Count, TimeLeft );
}
else if ( !silent )
{
World.Player.SendMessage( LocString.QueueIgnore );
}
}
}
示例8: StatusBar
private StatusBar(Serial serial)
{
this.serial = serial;
table.Padding = new Padding(3);
table.Controls.Add(barHP = new Bar(Color.Red));
if (serial == Serial.MinusOne || PacketHandlers.Party.Contains(serial))
{
table.Controls.Add(barMana = new Bar(Color.Blue));
table.Controls.Add(barStamina = new Bar(Color.DarkGoldenrod));
if (PacketHandlers.Party.Contains(serial))
barMana.Text = barStamina.Text = "-";
}
if (serial == Serial.MinusOne)
{
if (ConfigEx.GetAttribute(false, "ex", "Status"))
{
table.ColumnCount = 2;
table.Controls.Add(labelFoll = new LabelEx("-", margin: 0) { ForeColor = Color.White });
table.Controls.Add(labelWeight = new LabelEx("-", margin: 0) { ForeColor = Color.White });
table.Controls.Add(labelBands = new LabelEx("-", margin: 0) { ForeColor = Color.White });
table.Controls.SetChildIndex(labelFoll, 1);
table.Controls.SetChildIndex(labelWeight, 3);
table.Controls.SetChildIndex(labelBands, 5);
Bandages.Changed += Bandages_Changed;
}
ConfigEx.SetAttribute(true, "enabled", "Status");
BackColor = Color.Purple;
Location = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Status"),
ConfigEx.GetAttribute(Location.Y, "locY", "Status"));
UpdateStats();
}
else
{
Mobile mobile = World.FindMobile(serial);
if (mobile != null)
WorldEx.SendToServer(new StatusQuery(mobile));
}
Event.MobileUpdated += WorldEx_MobileUpdated;
}
示例9: Enqueue
public static bool Enqueue( Serial ser, ushort body, MessageType type, ushort hue, ushort font, string lang, string name, string text )
{
MsgInfo m = m_Table[text] as MsgInfo;
if ( m == null )
{
m_Table[text] = m = new MsgInfo( ser, body, type, hue, font, lang, name );
m.Count = 0;
m.Delay = TimeSpan.FromSeconds( (((int)(text.Length / 50))+1) * 3.5 );
m.NextSend = DateTime.Now + m.Delay;
return true;
}
else
{
m.Count++;
return false;
}
}
示例10: LiftReject
public static bool LiftReject()
{
Log( "Server rejected lift for item {0}", m_Holding );
if ( m_Holding == Serial.Zero )
return true;
m_Holding = m_Pending = Serial.Zero;
m_HoldingItem = null;
m_Lifted = DateTime.MinValue;
return m_ClientLiftReq;
}
示例11: HasDragFor
public static bool HasDragFor( Serial s )
{
for(byte j=m_Front;j!=m_Back;j++)
{
if ( m_LiftReqs[j] != null && m_LiftReqs[j].Serial == s )
return true;
}
return false;
}
示例12: EndHolding
public static bool EndHolding( Serial s )
{
//if ( m_Pending == s )
// return false;
if ( m_Holding == s )
{
m_Holding = Serial.Zero;
m_HoldingItem = null;
}
return true;
}
示例13: Drop
public static bool Drop( Item i, Serial dest, Point3D pt )
{
if ( m_Pending == i.Serial )
{
Log( "Dropping {0} to {1} (@{2})", i, dest, pt );
ClientCommunication.SendToServer( new DropRequest( i.Serial, pt, dest ) );
m_Pending = Serial.Zero;
m_Lifted = DateTime.MinValue;
return true;
}
else
{
bool add = false;
for(byte j=m_Front;j!=m_Back && !add;j++)
{
if ( m_LiftReqs[j] != null && m_LiftReqs[j].Serial == i.Serial )
{
add = true;
break;
}
}
if ( add )
{
Log( "Queuing Drop {0} (to {1} (@{2}))", i, dest, pt );
Queue q = m_DropReqs[i.Serial] as Queue;
if ( q == null )
m_DropReqs[i.Serial] = q = new Queue();
q.Enqueue( new DropReq( dest, pt ) );
return true;
}
else
{
Log( "Drop for {0} (to {1} (@{2})) not found, skipped", i, dest, pt );
return false;
}
}
}
示例14: HuePicker
public HuePicker( Serial serial, ItemID itemid )
: base(0x95, 9)
{
Write( (uint)serial );
Write( (ushort)0 );
Write( (ushort)itemid );
}
示例15: DropReq
public DropReq( Serial s, Layer layer )
{
Serial = s; Layer = layer;
}