• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Assistant.Serial类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Assistant.Serial的典型用法代码示例。如果您正苦于以下问题:C# Serial类的具体用法?C# Serial怎么用?C# Serial使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Serial类属于Assistant命名空间,在下文中一共展示了Serial类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:herculesjr,项目名称:razor,代码行数:7,代码来源:Mobile.cs


示例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 );
        }
开发者ID:herculesjr,项目名称:razor,代码行数:9,代码来源:Packets.cs


示例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;
        }
开发者ID:herculesjr,项目名称:razor,代码行数:9,代码来源:ObjectPropertyList.cs


示例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 );
        }
开发者ID:WildGenie,项目名称:Razor,代码行数:9,代码来源:Mobile.cs


示例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;
 }
开发者ID:jaryn-kubik,项目名称:RazorEx,代码行数:11,代码来源:NPCAbilities.cs


示例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 );
        }
开发者ID:herculesjr,项目名称:razor,代码行数:19,代码来源:Packets.cs


示例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 );
         }
     }
 }
开发者ID:herculesjr,项目名称:razor,代码行数:20,代码来源:ActionQueue.cs


示例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;
        }
开发者ID:jaryn-kubik,项目名称:RazorEx,代码行数:40,代码来源:StatusBar.cs


示例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;
            }
        }
开发者ID:WildGenie,项目名称:Razor,代码行数:22,代码来源:MsgQueue.cs


示例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;
        }
开发者ID:herculesjr,项目名称:razor,代码行数:12,代码来源:ActionQueue.cs


示例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;
        }
开发者ID:herculesjr,项目名称:razor,代码行数:10,代码来源:ActionQueue.cs


示例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;
        }
开发者ID:herculesjr,项目名称:razor,代码行数:13,代码来源:ActionQueue.cs


示例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;
                }
            }
        }
开发者ID:herculesjr,项目名称:razor,代码行数:41,代码来源:ActionQueue.cs


示例14: HuePicker

 public HuePicker( Serial serial, ItemID itemid )
     : base(0x95, 9)
 {
     Write( (uint)serial );
     Write( (ushort)0 );
     Write( (ushort)itemid );
 }
开发者ID:herculesjr,项目名称:razor,代码行数:7,代码来源:Packets.cs


示例15: DropReq

 public DropReq( Serial s, Layer layer )
 {
     Serial = s; Layer = layer;
 }
开发者ID:herculesjr,项目名称:razor,代码行数:4,代码来源:ActionQueue.cs


示例16: DequeueDropFor

 private static DropReq DequeueDropFor( Serial s )
 {
     DropReq dr = null;
     Queue q = (Queue)m_DropReqs[s];
     if ( q != null )
     {
         if ( q.Count > 0 )
             dr = q.Dequeue() as DropReq;
         if ( q.Count <= 0 )
             m_DropReqs.Remove( s );
     }
     return dr;
 }
开发者ID:herculesjr,项目名称:razor,代码行数:13,代码来源:ActionQueue.cs


示例17: CancelDragFor

        public static bool CancelDragFor( Serial s )
        {
            if ( Empty )
                return false;

            int skip = 0;
            for(byte j=m_Front;j!=m_Back;j++)
            {
                if ( skip == 0 && m_LiftReqs[j] != null && m_LiftReqs[j].Serial == s )
                {
                    m_LiftReqs[j] = null;
                    skip++;
                    if ( j == m_Front )
                    {
                        m_Front++;
                        break;
                    }
                    else
                    {
                        m_Back--;
                    }
                }

                if ( skip > 0 )
                    m_LiftReqs[j] = m_LiftReqs[(byte)(j+skip)];
            }

            if ( skip > 0 )
            {
                m_LiftReqs[m_Back] = null;
                return true;
            }
            else
            {
                return false;
            }
        }
开发者ID:herculesjr,项目名称:razor,代码行数:37,代码来源:ActionQueue.cs


示例18: OnCommand

 private static void OnCommand(bool location, Serial serial, Point3D p, ushort gfxid)
 {
     new StatusBar(serial == World.Player.Serial || !serial.IsValid || !serial.IsMobile ? Serial.MinusOne : serial).Show();
 }
开发者ID:jaryn-kubik,项目名称:RazorEx,代码行数:4,代码来源:StatusBar.cs


示例19: WorldEx_MobileUpdated

 private void WorldEx_MobileUpdated(Serial mobileSerial)
 {
     if (serial == mobileSerial || (serial == Serial.MinusOne && mobileSerial == World.Player.Serial))
         UpdateStats();
 }
开发者ID:jaryn-kubik,项目名称:RazorEx,代码行数:5,代码来源:StatusBar.cs


示例20: HandleSpeech

        public static void HandleSpeech( Packet p, PacketHandlerEventArgs args, Serial ser, ushort body, MessageType type, ushort hue, ushort font, string lang, string name, string text )
        {
            if ( World.Player == null )
                return;

            if ( !ser.IsValid || ser == World.Player.Serial || ser.IsItem )
            {
                SysMessages.Add( text.ToLower() );

                if ( SysMessages.Count >= 25 )
                    SysMessages.RemoveRange( 0, 10 );
            }

            if ( type == MessageType.Spell )
            {
                Spell s = Spell.Get( text.Trim() );
                bool replaced = false;
                if ( s != null )
                {
                    System.Text.StringBuilder sb = new System.Text.StringBuilder( Config.GetString( "SpellFormat" ) );
                    sb.Replace( @"{power}", s.WordsOfPower );
                    string spell = Language.GetString( s.Name );
                    sb.Replace( @"{spell}", spell );
                    sb.Replace( @"{name}", spell );

                    string newText = sb.ToString();

                    if ( newText != null && newText != "" && newText != text )
                    {
                        ClientCommunication.SendToClient( new AsciiMessage( ser, body, MessageType.Spell, s.GetHue( hue ), font, name, newText ) );
                        //ClientCommunication.SendToClient( new UnicodeMessage( ser, body, MessageType.Spell, s.GetHue( hue ), font, Language.CliLocName, name, newText ) );
                        replaced = true;
                        args.Block = true;
                    }
                }

                if ( !replaced && Config.GetBool( "ForceSpellHue" ) )
                {
                    p.Seek( 10, SeekOrigin.Begin );
                    if ( s != null )
                        p.Write( (ushort)s.GetHue( hue ) );
                    else
                        p.Write( (ushort)Config.GetInt( "NeutralSpellHue" ) );
                }
            }
            else if ( ser.IsMobile && type == MessageType.Label )
            {
                Mobile m = World.FindMobile( ser );
                if ( m != null /*&& ( m.Name == null || m.Name == "" || m.Name == "(Not Seen)" )*/&& m.Name.IndexOf( text ) != 5 && m != World.Player && !( text.StartsWith( "(" )  && text.EndsWith( ")" ) ) )
                    m.Name = text;
            }
            /*else if ( Spell.Get( text.Trim() ) != null )
            { // send fake spells to bottom left
                p.Seek( 3, SeekOrigin.Begin );
                p.Write( (uint)0xFFFFFFFF );
            }*/
            else
            {
                if ( ser == Serial.MinusOne && name == "System" )
                {
                    if ( Config.GetBool( "FilterSnoopMsg" ) && text.IndexOf( World.Player.Name ) == -1 && text.StartsWith( "You notice" ) && text.IndexOf( "attempting to peek into" ) != -1 && text.IndexOf( "belongings" ) != -1 )
                    {
                        args.Block = true;
                        return;
                    }
                    else if ( text.StartsWith( "You've committed a criminal act" ) || text.StartsWith( "You are now a criminal" ) )
                    {
                        World.Player.ResetCriminalTimer();
                    }
                }

                if ( ( type == MessageType.Emote || type == MessageType.Regular || type == MessageType.Whisper || type == MessageType.Yell ) && ser.IsMobile && ser != World.Player.Serial )
                {
                    if ( Config.GetBool( "ForceSpeechHue" ) )
                    {
                        p.Seek( 10, SeekOrigin.Begin );
                        p.Write( (ushort)Config.GetInt( "SpeechHue" ) );
                    }
                }

                if ( Config.GetBool( "FilterSpam" ) && ( ser == Serial.MinusOne || ser == Serial.Zero ) )
                {
                    if ( !MessageQueue.Enqueue( ser, body, type, hue, font, lang, name, text ) )
                    {
                        args.Block = true;
                        return;
                    }
                }
            }
        }
开发者ID:herculesjr,项目名称:razor,代码行数:90,代码来源:Handlers.cs



注:本文中的Assistant.Serial类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BAL.Report类代码示例发布时间:2022-05-24
下一篇:
C# Assistant.PacketHandlerEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap