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

C# Network.CityInfo类代码示例

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

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



CityInfo类属于Server.Network命名空间,在下文中一共展示了CityInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Initialize

		public static void Initialize()
		{
			EventSink.DeleteRequest += new DeleteRequestEventHandler( EventSink_DeleteRequest );
			EventSink.AccountLogin += new AccountLoginEventHandler( EventSink_AccountLogin );
			EventSink.GameLogin += new GameLoginEventHandler( EventSink_GameLogin );

			if ( PasswordCommandEnabled )
				CommandSystem.Register( "Password", AccessLevel.Player, new CommandEventHandler( Password_OnCommand ) );

			if ( Core.AOS )
			{
				CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3618, 2591, 0 );
				StartingCities[StartingCities.Length - 1] = haven;
			}
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:15,代码来源:AccountHandler.cs


示例2: OnResponse

		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;

			switch( info.ButtonID )
			{
				case 1:
					CityInfo city = new CityInfo( "Britain", "Town Center", 1475, 1645, 20 );

					from.MoveToWorld( city.Location, Map.Felucca );
					break;
				case 2:
					CityInfo city1 = new CityInfo( "Britain", "Town Center", 1475, 1645, 20 );

					from.MoveToWorld( city1.Location, Map.Trammel );
					break;
				case 3:
					CityInfo city2 = new CityInfo( "Lakeshire", "Town Center", 1203, 1124, -25 );

					from.MoveToWorld( city2.Location, Map.Ilshenar );
					break;
				case 4:
					CityInfo city3 = new CityInfo( "Luna", "Town Center", 989, 519, -50 );

					from.MoveToWorld( city3.Location, Map.Malas );
					break;

				case 5: 
					CityInfo city4 = new CityInfo( "Zento", "Town Center", 735, 1257, 30 );

					from.MoveToWorld( city4.Location, Map.Tokuno );
					break;

				case 6:
					CityInfo city5 = new CityInfo( "Test", "Test", 852, 3526, -43 );

					from.MoveToWorld( city5.Location, Map.TerMur );
					break;

			}
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:41,代码来源:FacetGump.cs


示例3: EventSink_CharacterCreated

		private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args )
		{
			if ( !VerifyProfession( args.Profession ) )
				args.Profession = 0;

			NetState state = args.State;

			if ( state == null )
				return;

			Mobile newChar = CreateMobile( args.Account as Account );

			if ( newChar == null )
			{
				Console.WriteLine( "Login: {0}: Character creation failed, account full", state );///////////////////////
				return;
			}

			args.Mobile = newChar;
			m_Mobile = newChar;

			newChar.Player = true;
			newChar.AccessLevel = args.Account.AccessLevel;
			newChar.Female = args.Female;
			//newChar.Body = newChar.Female ? 0x191 : 0x190;

			if( Core.Expansion >= args.Race.RequiredExpansion )
				newChar.Race = args.Race;	//Sets body
			else
				newChar.Race = Race.DefaultRace;

			//newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
			newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;

			newChar.Hunger = 20;
            newChar.Skills.Cap = (10000);
            newChar.StatCap = 300;
			bool young = false;

			if ( newChar is PlayerMobile )
			{
				PlayerMobile pm = (PlayerMobile) newChar;         

				pm.Profession = args.Profession;

                #region NeoLevelSystem              // Neo's Level SYstem

                pm.Exp = -1000;
                pm.Level = 0;

                #endregion                          // End of Neo's Level System

				if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young )
					young = pm.Young = true;
			}

			SetName( newChar, args.Name );

			AddBackpack( newChar );

			SetStats( newChar, state, args.Str, args.Dex, args.Int );
            //SetStats( newChar,  args.Str, args.Dex, args.Int );
			SetSkills( newChar, args.Skills, args.Profession );

			Race race = newChar.Race;

			if( race.ValidateHair( newChar, args.HairID ) )
			{
				newChar.HairItemID = args.HairID;
				newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF );
			}

			if( race.ValidateFacialHair( newChar, args.BeardID ) )
			{
				newChar.FacialHairItemID = args.BeardID;
				newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF );
			}

			if ( args.Profession <= 3 )
			{
				AddShirt( newChar, args.ShirtHue );
				AddPants( newChar, args.PantsHue );
				AddShoes( newChar );
			}

			//if( TestCenter.Enabled )
				FillBankbox( newChar );

		    /*if ( young )
			{
				NewPlayerTicket ticket = new NewPlayerTicket();
				ticket.Owner = newChar;
				newChar.BankBox.DropItem( ticket );
			}*/

		   // CityInfo city = GetStartLocation( args, young );
		    CityInfo city = new CityInfo( "New Player Castle", "New Player Castle", 885, 1408,-84, Map.Malas );

			newChar.MoveToWorld( city.Location, city.Map );

//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:101,代码来源:CharacterCreation.cs


示例4: EventSink_CharacterCreated

		private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
		{
			NetState state = args.State;
			var acct = args.Account as Account;

			Mobile newChar = CreateMobile(acct);

			if (newChar == null)
			{
				Console.WriteLine("Login: {0}: Character creation failed, account full", args.State);
				return;
			}

			args.Mobile = newChar;
			m_Mobile = newChar;

			newChar.Player = true;
			newChar.AccessLevel = args.Account.AccessLevel;

			bool young = false;

			if (newChar is PlayerMobile)
			{
				var pm = (PlayerMobile)newChar;

				if (pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young)
				{
					young = pm.Young = true;
				}
			}

			//CityInfo city = GetStartLocation(args, young);
			var city = new CityInfo("Britain", "Forever", 1495, 1628, 10, Map.Felucca);

			if (!VerifyProfession(args.Profession, city.Map.Expansion))
			{
				args.Profession = 0;
			}

			if (newChar is PlayerMobile)
			{
				((PlayerMobile)newChar).Profession = args.Profession;
			}

			newChar.Female = args.Female;
			//newChar.Body = newChar.Female ? 0x191 : 0x190;

			newChar.Race = city.Map.Expansion >= args.Race.RequiredExpansion ? args.Race : Race.DefaultRace;

			//newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
			newChar.Hue = newChar.Race.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000;

			newChar.Hunger = 20;
			newChar.Thirst = 20;

			//NameResultMessage result = SetName(newChar, args.Name);
			SetName(newChar, args.Name);
			AddBackpack(newChar, city.Map.Expansion);

			SetStats(newChar, state, args.Str, args.Dex, args.Int);
			SetSkills(newChar, city.Map.Expansion, args.Skills, args.Profession);

			Race race = newChar.Race;

			if (race.ValidateHair(newChar, args.HairID))
			{
				newChar.HairItemID = args.HairID;
				newChar.HairHue = race.ClipHairHue(args.HairHue & 0x3FFF);
			}

			if (race.ValidateFacialHair(newChar, args.BeardID))
			{
				newChar.FacialHairItemID = args.BeardID;
				newChar.FacialHairHue = race.ClipHairHue(args.BeardHue & 0x3FFF);
			}

			if (args.Profession <= 3)
			{
				AddShirt(newChar, args.ShirtHue, city.Map.Expansion);
				AddPants(newChar, args.PantsHue, city.Map.Expansion);
				AddShoes(newChar, city.Map.Expansion);
			}

			BankBox bank = newChar.BankBox;

			bool needstartpack = acct != null && String.IsNullOrEmpty(acct.GetTag("startpack"));

			if (needstartpack /*|| TestCenter.Enabled*/)
			{
				Container startpack = new StarterPack();
				bank.DropItem(startpack);
				/*
				Item housedeed = new SmallBrickHouseDeed();
				housedeed.Name = "a beta tester's small brick house deed";
				startpack.DropItem(housedeed);
				housedeed.X = 23;
				housedeed.Y = 53;

				Item startercheck = new BankCheck(10000);
				startpack.DropItem(startercheck);
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:101,代码来源:CharacterCreation.cs


示例5: CharacterCreatedEventArgs

 public CharacterCreatedEventArgs( NetState state, IAccount a, string name, bool female, int hue, int str, int dex, int intel, CityInfo city, SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue, int beardID, int beardHue, int profession, Race race)
     : this(state, a, name, female, hue, str, dex, intel, city, skills, shirtHue, pantsHue, hairID, hairHue, beardID, beardHue, profession, race, 0, 0)
 {
 }
开发者ID:greeduomacro,项目名称:liberdade-uo-server,代码行数:4,代码来源:EventSink.cs


示例6: CharacterList

		public CharacterList(IAccount a, CityInfo[] info)
			: base(0xA9)
		{
			EnsureCapacity(11 + (a.Length * 60) + (info.Length * 89));

			int highSlot = -1;

			for (int i = 0; i < a.Length; ++i)
			{
				if (a[i] != null)
				{
					highSlot = i;
				}
			}

			int count = Math.Max(Math.Max(highSlot + 1, a.Limit), 5);

			m_Stream.Write((byte)count);

			for (int i = 0; i < count; ++i)
			{
				if (a[i] != null)
				{
					m_Stream.WriteAsciiFixed(a[i].Name, 30);
					m_Stream.Fill(30); // password
				}
				else
				{
					m_Stream.Fill(60);
				}
			}

			m_Stream.Write((byte)info.Length);

			for (int i = 0; i < info.Length; ++i)
			{
				CityInfo ci = info[i];

				m_Stream.Write((byte)i);
				m_Stream.WriteAsciiFixed(ci.City, 32);
				m_Stream.WriteAsciiFixed(ci.Building, 32);
				m_Stream.Write(ci.X);
				m_Stream.Write(ci.Y);
				m_Stream.Write(ci.Z);
				m_Stream.Write(ci.Map.MapID);
				m_Stream.Write(ci.Description);
				m_Stream.Write(0);
			}

			CharacterListFlags flags = ExpansionInfo.CurrentExpansion.CharacterListFlags;

			if (count > 6)
			{
				flags |= (CharacterListFlags.SeventhCharacterSlot | CharacterListFlags.SixthCharacterSlot);
			}
			else if (count == 6)
			{
				flags |= CharacterListFlags.SixthCharacterSlot; // 6th Character Slot
			}
			else if (a.Limit == 1)
			{
				flags |= (CharacterListFlags.SlotLimit & CharacterListFlags.OneCharacterSlot); // Limit Characters & One Character
			}

			m_Stream.Write((int)(flags | m_AdditionalFlags)); // Additional Flags

			m_Stream.Write((short)-1);

			ThirdPartyFeature disabled = FeatureProtection.DisabledFeatures;

			if (disabled != 0)
			{
				if (m_MD5Provider == null)
				{
					m_MD5Provider = new MD5CryptoServiceProvider();
				}

				m_Stream.UnderlyingStream.Flush();

				byte[] hashCode = m_MD5Provider.ComputeHash(
					m_Stream.UnderlyingStream.GetBuffer(), 0, (int)m_Stream.UnderlyingStream.Length);
				var buffer = new byte[28];

				for (int i = 0; i < count; ++i)
				{
					Utility.RandomBytes(buffer);

					m_Stream.Seek(35 + (i * 60), SeekOrigin.Begin);
					m_Stream.Write(buffer, 0, buffer.Length);
				}

				m_Stream.Seek(35, SeekOrigin.Begin);
				m_Stream.Write((int)((long)disabled >> 32));
				m_Stream.Write((int)disabled);

				m_Stream.Seek(95, SeekOrigin.Begin);
				m_Stream.Write(hashCode, 0, hashCode.Length);
			}
		}
开发者ID:zerodowned,项目名称:justuo-with-ec-support,代码行数:99,代码来源:Packets.cs


示例7: CharacterList

        // Genova: suporte ao UO:KR.
        public CharacterList(IAccount a, CityInfo[] info, bool IsKrClient)
            : base(0xA9)
        {
            this.EnsureCapacity(9 + (a.Length * 60) + (info.Length * 63));

            int highSlot = -1;

            for (int i = 0; i < a.Length; ++i)
            {
                if (a[i] != null)
                    highSlot = i;
            }

            int count = Math.Max(Math.Max(highSlot + 1, a.Limit), 5);

            m_Stream.Write((byte)count);

            for (int i = 0; i < count; ++i)
            {
                if (a[i] != null)
                {
                    m_Stream.WriteAsciiFixed(a[i].Name, 30);
                    m_Stream.Fill(30); // password
                }
                else
                {
                    m_Stream.Fill(60);
                }
            }

            m_Stream.Write((byte)info.Length);

            for (int i = 0; i < info.Length; ++i)
            {
                CityInfo ci = info[i];

                m_Stream.Write((byte)i);
                m_Stream.WriteAsciiFixed(ci.City, 31);
                m_Stream.WriteAsciiFixed(ci.Building, 31);
            }
            /*
                        int flags = 0x08; //Context Menus

                        if ( Core.SE )
                            flags |= 0xA0; //SE & AOS
                        else if ( Core.AOS )
                            flags |= 0x20; //AOS
             * */

            int flags = ExpansionInfo.CurrentExpansion.CharacterListFlags;

            if (count >= 6)
                flags |= 0x40; // 6th character slot
            else if (a.Limit == 1)
                flags |= 0x14; // Limit characters & one character

            // Genova: suporte ao UO:KR.			
            // Is KR Client
            if (IsKrClient)
                flags |= 0x600;	// Still dont know. KR Flags.	

            m_Stream.Write((int)(flags | m_AdditionalFlags)); // flags
        }
开发者ID:brodock,项目名称:genova-project,代码行数:64,代码来源:Packets.cs


示例8: CharacterListOld

        public CharacterListOld( IAccount a, CityInfo[] info )
            : base(0xA9)
        {
            this.EnsureCapacity( 9 + (a.Length * 60) + (info.Length * 63) );

            int highSlot = -1;

            for ( int i = 0; i < a.Length; ++i )
            {
                if ( a[i] != null )
                    highSlot = i;
            }

            int count = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 );

            m_Stream.Write( (byte) count );

            for ( int i = 0; i < count; ++i )
            {
                if ( a[i] != null )
                {
                    m_Stream.WriteAsciiFixed( a[i].Name, 30 );
                    m_Stream.Fill( 30 ); // password
                }
                else
                {
                    m_Stream.Fill( 60 );
                }
            }

            m_Stream.Write( (byte) info.Length );

            for ( int i = 0; i < info.Length; ++i )
            {
                CityInfo ci = info[i];

                m_Stream.Write( (byte) i );
                m_Stream.WriteAsciiFixed( ci.City, 31 );
                m_Stream.WriteAsciiFixed( ci.Building, 31 );
            }

            CharacterListFlags flags = ExpansionInfo.CurrentExpansion.CharacterListFlags;

            if ( count > 6 )
                flags |= (CharacterListFlags.SeventhCharacterSlot | CharacterListFlags.SixthCharacterSlot); // 7th Character Slot - TODO: Is SixthCharacterSlot Required?
            else if ( count == 6 )
                flags |= CharacterListFlags.SixthCharacterSlot; // 6th Character Slot
            else if ( a.Limit == 1 )
                flags |= (CharacterListFlags.SlotLimit & CharacterListFlags.OneCharacterSlot); // Limit Characters & One Character

            m_Stream.Write( (int)(flags | CharacterList.AdditionalFlags) ); // Additional Flags

            ThirdPartyFeature disabled = FeatureProtection.DisabledFeatures;

            if ( disabled != 0 )
            {
                if ( m_MD5Provider == null )
                    m_MD5Provider = new System.Security.Cryptography.MD5CryptoServiceProvider();

                m_Stream.UnderlyingStream.Flush();

                byte[] hashCode = m_MD5Provider.ComputeHash( m_Stream.UnderlyingStream.GetBuffer(), 0, (int) m_Stream.UnderlyingStream.Length );
                byte[] buffer = new byte[28];

                for ( int i = 0; i < count; ++i )
                {
                    Utility.RandomBytes( buffer );

                    m_Stream.Seek( 35 + ( i * 60 ), SeekOrigin.Begin );
                    m_Stream.Write( buffer, 0, buffer.Length );
                }

                m_Stream.Seek( 35, SeekOrigin.Begin );
                m_Stream.Write( (int) ((long)disabled>>32) );
                m_Stream.Write( (int) disabled );

                m_Stream.Seek( 95, SeekOrigin.Begin );
                m_Stream.Write( hashCode, 0, hashCode.Length );
            }
        }
开发者ID:Leorgrium,项目名称:runuo,代码行数:80,代码来源:Packets.cs


示例9: CharacterList

        // UOSA: suporte ao UO:KR.
        public CharacterList(IAccount a, CityInfo[] info, bool IsKrClient)
            : base(0xA9)
        {
            this.EnsureCapacity( 11 + (a.Length * 60) + (info.Length * 89) );

            int highSlot = -1;

            for ( int i = 0; i < a.Length; ++i )
            {
                if ( a[i] != null )
                    highSlot = i;
            }

            int count = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 );

            m_Stream.Write( (byte) count );

            for ( int i = 0; i < count; ++i )
            {
                if ( a[i] != null )
                {
                    m_Stream.WriteAsciiFixed( a[i].Name, 30 );
                    m_Stream.Fill( 30 ); // password
                }
                else
                {
                    m_Stream.Fill( 60 );
                }
            }

            m_Stream.Write( (byte) info.Length );

            for ( int i = 0; i < info.Length; ++i )
            {
                CityInfo ci = info[i];

                m_Stream.Write( (byte) i );
                m_Stream.WriteAsciiFixed( ci.City, 32 );
                m_Stream.WriteAsciiFixed( ci.Building, 32 );
                m_Stream.Write( (int) ci.X );
                m_Stream.Write( (int) ci.Y );
                m_Stream.Write( (int) ci.Z );
                m_Stream.Write( (int) ci.Map.MapID );
                m_Stream.Write( (int) ci.Description );
                m_Stream.Write( (int) 0 );
            }

            CharacterListFlags flags = ExpansionInfo.CurrentExpansion.CharacterListFlags;

            if ( count > 6 )
                flags |= (CharacterListFlags.SeventhCharacterSlot | CharacterListFlags.SixthCharacterSlot); // 7th Character Slot - TODO: Is SixthCharacterSlot Required?
            else if ( count == 6 )
                flags |= CharacterListFlags.SixthCharacterSlot; // 6th Character Slot
            else if ( a.Limit == 1 )
                flags |= (CharacterListFlags.SlotLimit & CharacterListFlags.OneCharacterSlot); // Limit Characters & One Character

            // Genova: suporte ao UO:KR.
            // Is KR Client
            if (IsKrClient)
                flags |= CharacterListFlags.KR;	// Still dont know. KR Flags.

            m_Stream.Write( (int)(flags | m_AdditionalFlags) ); // Additional Flags
        }
开发者ID:greeduomacro,项目名称:liberdade-uo-server,代码行数:64,代码来源:Packets.cs


示例10: CharacterList

        public CharacterList( IAccount a, CityInfo[] info )
            : base(0xA9)
        {
            this.EnsureCapacity( 9 + (a.Length * 60) + (info.Length * 63) );

            int highSlot = -1;

            for ( int i = 0; i < a.Length; ++i )
            {
                if ( a[i] != null )
                    highSlot = i;
            }

            int count = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 );

            m_Stream.Write( (byte) count );

            for ( int i = 0; i < count; ++i )
            {
                if ( a[i] != null )
                {
                    m_Stream.WriteAsciiFixed( a[i].Name, 30 );
                    m_Stream.Fill( 30 ); // password
                }
                else
                {
                    m_Stream.Fill( 60 );
                }
            }

            m_Stream.Write( (byte) info.Length );

            for ( int i = 0; i < info.Length; ++i )
            {
                CityInfo ci = info[i];

                m_Stream.Write( (byte) i );
                m_Stream.WriteAsciiFixed( ci.City, 31 );
                m_Stream.WriteAsciiFixed( ci.Building, 31 );
            }
            /*
            int flags = 0x08; //Context Menus

            if ( Core.SE )
                flags |= 0xA0; //SE & AOS
            else if ( Core.AOS )
                flags |= 0x20; //AOS
             * */

            int flags = ExpansionInfo.CurrentExpansion.CharacterListFlags;

            if ( count >= 6 )
                flags |= 0x40; // 6th character slot
            else if ( a.Limit == 1 )
                flags |= 0x14; // Limit characters & one character

            m_Stream.Write( (int)(flags | m_AdditionalFlags) ); // flags

            ThirdPartyFeature disabled = FeatureProtection.DisabledFeatures;

            if ( disabled != 0 )
            {
                if ( m_MD5Provider == null )
                    m_MD5Provider = new System.Security.Cryptography.MD5CryptoServiceProvider();

                m_Stream.UnderlyingStream.Flush();

                byte[] hashCode = m_MD5Provider.ComputeHash( m_Stream.UnderlyingStream.GetBuffer(), 0, (int) m_Stream.UnderlyingStream.Length );

                Random rnd = new Random();
                byte[] buffer = new byte[29];

                for ( int i = 0; i < count; ++i )
                {
                    rnd.NextBytes( buffer );

                    m_Stream.Seek( 34 + ( i * 60 ), SeekOrigin.Begin );
                    m_Stream.Write( buffer, 0, buffer.Length );
                }

                m_Stream.Seek( 35, SeekOrigin.Begin );
                m_Stream.Write( (int) ((long)disabled>>32) );
                m_Stream.Write( (int) disabled );

                m_Stream.Seek( 95, SeekOrigin.Begin );
                m_Stream.Write( hashCode, 0, hashCode.Length );
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:88,代码来源:Packets.cs


示例11: EventSink_CharacterCreated

        private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args )
        {
            if ( !VerifyProfession( args.Profession ) )
                args.Profession = 0;

            Mobile newChar = CreateMobile( args.Account as Account );

            if ( newChar == null )
            {
                Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State );
                return;
            }

            args.Mobile = newChar;
            m_Mobile = newChar;

            newChar.Player = true;
            newChar.AccessLevel = args.Account.AccessLevel;
            newChar.Female = args.Female;
            //newChar.Body = newChar.Female ? 0x191 : 0x190;

            if( Core.Expansion >= args.Race.RequiredExpansion )
                newChar.Race = args.Race;	//Sets body
            else
                newChar.Race = Race.DefaultRace;

            //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
            newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;

            newChar.Hunger = 20;

            bool young = false;

            if ( newChar is PlayerMobile )
            {
                PlayerMobile pm = (PlayerMobile) newChar;

                pm.Profession = args.Profession;

                if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young )
                    young = pm.Young = true;
            }

            SetName( newChar, args.Name );

            AddBackpack( newChar );

            SetStats( newChar, args.Str, args.Dex, args.Int );
            SetSkills( newChar, args.Skills, args.Profession );

            Race race = newChar.Race;

            if( race.ValidateHair( newChar, args.HairID ) )
            {
                newChar.HairItemID = args.HairID;
                newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF );
            }

            if( race.ValidateFacialHair( newChar, args.BeardID ) )
            {
                newChar.FacialHairItemID = args.BeardID;
                newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF );
            }

            if ( args.Profession <= 3 )
            {
                AddShirt( newChar, args.ShirtHue );
                AddPants( newChar, args.PantsHue );
                AddShoes( newChar );
            }

            if( TestCenter.Enabled )
                FillBankbox( newChar );

            if ( young )
            {
                NewPlayerTicket ticket = new NewPlayerTicket();
                ticket.Owner = newChar;
                newChar.BankBox.DropItem( ticket );
            }

            //Because Malas is the only real map :D
            CityInfo city = new CityInfo("Luna", "Starting Point", 883, 532, -90, Map.Malas);

            //CityInfo city = GetStartLocation( args, young );
            //CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );

            newChar.MoveToWorld( city.Location, city.Map );

            Console.WriteLine( "Login: {0}: New character being created (account={1})", args.State, args.Account.Username );
            Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial );
            Console.WriteLine( " - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString() );

            new WelcomeTimer( newChar ).Start();
        }
开发者ID:FreeReign,项目名称:runuo-extended,代码行数:95,代码来源:CharacterCreation.cs


示例12: Initialize

        public static void Initialize()
        {
            //#warning This should be get rid off when the shard goes live
            //LockdownLevel = AccessLevel.GameMaster;

            EventSink.DeleteRequest += new DeleteRequestEventHandler( EventSink_DeleteRequest );
            EventSink.AccountLogin += new AccountLoginEventHandler( EventSink_AccountLogin );
            EventSink.GameLogin += new GameLoginEventHandler( EventSink_GameLogin );

            if ( PasswordCommandEnabled )
                Server.Commands.CommandSystem.Register( "Password", AccessLevel.Player, new Server.Commands.CommandEventHandler( Password_OnCommand ) );

            if ( Core.AOS )
            {
                CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3618, 2591, 0 );
                StartingCities[StartingCities.Length - 1] = haven;
            }
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:18,代码来源:AccountHandler.cs


示例13: Initialize

        public static void Initialize()
        {
            EventSink.DeleteRequest += new DeleteRequestEventHandler( EventSink_DeleteRequest );
            EventSink.AccountLogin += new AccountLoginEventHandler( EventSink_AccountLogin );
            EventSink.GameLogin += new GameLoginEventHandler( EventSink_GameLogin );

            if ( PasswordCommandEnabled )
                CommandSystem.Register( "Password", AccessLevel.Player, new CommandEventHandler( Password_OnCommand ) );

            if ( Core.AOS )
            {
                //CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3618, 2591, 0 );
                CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3503, 2574, 14 );
                StartingCities[StartingCities.Length - 1] = haven;
            }
            // added for login server to let players in heh.
            PacketHandlers.ClientVerification = false;
            // end ------
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:19,代码来源:AccountHandler.cs


示例14: CharacterListHS

        public CharacterListHS( IAccount a, CityInfo[] info )
            : base(0xA9)
        {
            this.EnsureCapacity( 311 + ( info.Length * 89 ) );

            int highSlot = -1;

            for ( int i = 0; i < a.Length; ++i )
            {
                if ( a[i] != null )
                    highSlot = i;
            }

            int slotCount = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 );

            m_Stream.Write( (byte) slotCount );

            for ( int i = 0; i < slotCount; ++i )
            {
                if ( a[i] != null )
                {
                    m_Stream.WriteAsciiFixed( a[i].Name, 30 );
                    m_Stream.Fill( 30 ); // password
                }
                else
                {
                    m_Stream.Fill( 60 );
                }
            }

            m_Stream.Write( (byte) info.Length );

            for ( int i = 0; i < info.Length; ++i )
            {
                CityInfo ci = info[i];

                m_Stream.Write( (byte) i );

                m_Stream.WriteAsciiFixed( ci.City, 32 );
                m_Stream.WriteAsciiFixed( ci.Building, 32 );

                m_Stream.Write( (int) ci.X );
                m_Stream.Write( (int) ci.Y );
                m_Stream.Write( (int) ci.Z );
                m_Stream.Write( (int) ci.Map.MapID );
                m_Stream.Write( (int) ci.Cliloc );
                m_Stream.Write( (int) 0 );
            }

            m_Stream.Write( (int) ( CharacterList.GetFlags( slotCount ) ) ); // flags
            m_Stream.Write( (short) -1 );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:52,代码来源:Packets.cs


示例15: EventSink_CharacterCreated


//.........这里部分代码省略.........
				PlayerMobile pm = (PlayerMobile) newChar;

				pm.Profession = args.Profession;

				if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young )
					young = pm.Young = true;
			}

			SetName( newChar, args.Name );

			AddBackpack( newChar );

			SetStats( newChar, args.Str, args.Dex, args.Int );
			SetSkills( newChar, args.Skills, args.Profession );

			AddHair( newChar, args.HairID, Utility.ClipHairHue( args.HairHue & 0x3FFF ) );
			AddBeard( newChar, args.BeardID, Utility.ClipHairHue( args.BeardHue & 0x3FFF ) );

			if ( args.Profession <= 3 )
			{
				AddShirt( newChar, args.ShirtHue );
				AddPants( newChar, args.PantsHue );
				AddShoes( newChar );
			}

			if( TestCenter.Enabled )
				FillBankbox( newChar );

			if ( young )
			{
				PackItem( new NewPlayerBook() );
			}

			if ( young && newChar.BankBox != null )
			{


				NewerPlayerTicket ticket = new NewerPlayerTicket();
				ticket.Owner = newChar;
				newChar.BankBox.DropItem( new Spellbook( UInt64.MaxValue ) );//Al: Fix for unblessed spellbook
				newChar.BankBox.DropItem( ticket );
				newChar.BankBox.DropItem( MakeNewbie( new BlackPearl( 30 ) ) );
				newChar.BankBox.DropItem( MakeNewbie( new Bloodmoss( 30 ) ) );
				newChar.BankBox.DropItem( MakeNewbie( new Garlic( 30 ) ) );
				newChar.BankBox.DropItem( MakeNewbie( new Ginseng( 30 ) ) );
				newChar.BankBox.DropItem( MakeNewbie( new MandrakeRoot( 30 ) ) );
				newChar.BankBox.DropItem( MakeNewbie( new Nightshade( 30 ) ) );
				newChar.BankBox.DropItem( MakeNewbie( new SulfurousAsh( 30 ) ) );
				newChar.BankBox.DropItem( MakeNewbie( new SpidersSilk( 30 ) ) );
			}

            //Al: personalized skill/statsball for wiped veteran accounts
            if
                (
                    newChar.Account is Account &&
                    ((Account)newChar.Account).CharacterCount == 1 &&
                    (DateTime.Now - ((Account)newChar.Account).Created) >= TimeSpan.FromDays(10000)
                )
            {
                int skillballsReceived;
                try
                {
                    skillballsReceived = Int32.Parse(((Account)newChar.Account).GetTag("WelcomeBackSkillballsReceived"));
                }
                catch
                {
                    skillballsReceived = 0;
                }
                if (skillballsReceived < MAXIMUM_WELCOME_BACK_SKILLBALLS)
                {
                    ((Account)newChar.Account).SetTag("WelcomeBackSkillballsReceived", (++skillballsReceived).ToString());
                    newChar.AddToBackpack(new WelcomeBackSkillball(newChar));
                    newChar.AddToBackpack(new NewPlayerStatsBall(newChar));
                }
            }

			//CityInfo city = GetStartLocation( args, young );
			� CityInfo city = new CityInfo( "Young Town", "Young Town Entrance", 1243, 1193, -29, Map.Ilshenar ); // Added 2011-Feb-06
			//CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );

			//**** ADDED FOR 1ST MARCH SPECIAL
			//if (newChar.Account.Count <= 1 /*|| (GetSharedAccounts((newChar.Account as Account).LoginIPs)).Count <= 1*/)
			//{
			//	city = new CityInfo("Newbie City", "Start room", 5738, 797, 0, Map.Felucca);
			//}
			//**** END 1ST MARCH SPECIAL

			newChar.MoveToWorld( city.Location, city.Map );

			Console.WriteLine( "Login: {0}: New character being created (account={1})", args.State, ((Account)args.Account).Username );
			Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial );
			Console.WriteLine( " - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString() );

			//new WelcomeTimer( newChar ).Start();

			//This has to be done here and not in a separate CharacterCreated-Event to get a reference to the new PlayerMobile
			//Player can set the email address till exactly 24 hours after account creation.
			if ( newChar.Account is Account && (DateTime.Now - ((Account)newChar.Account).Created <= TimeSpan.FromHours(24)))
				Timer.DelayCall(TimeSpan.FromSeconds(5), new TimerStateCallback(EmailSystem.SendEmailGump), newChar as PlayerMobile);
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:101,代码来源:CharacterCreation.cs


示例16: getLocalizacao

        private CityInfo getLocalizacao(string nomeLocal)
        {
            CityInfo local;
            if (nomeLocal == "padrao")
            {
                local = new CityInfo("Ouro Branco", "Barco", 1385, 579, 32, Map.Malas);
            }
            else if (nomeLocal == "ouroBranco")
            {
                local = new CityInfo("Ouro Branco", "Igreja", 1652, 591, 6, Map.Malas);
            }
            else if (nomeLocal == "loboLeite")
            {
                local = new CityInfo("Lobo leite", "Barco", 1385, 579, 32, Map.Malas);
            }
            else
            {
                local = new CityInfo("Ouro Branco", "Barco", 1385, 579, 32, Map.Malas);
            }

            return local;
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:22,代码来源:SistemaMorte.cs


示例17: CharacterCreatedEventArgs

 public CharacterCreatedEventArgs( NetState state, IAccount a, string name, bool female, int hue, int str, int dex, int intel, CityInfo city, SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue, int beardID, int beardHue, int profession, Race race )
 {
     m_State = state;
     m_Account = a;
     m_Name = name;
     m_Female = female;
     m_Hue = hue;
     m_Str = str;
     m_Dex = dex;
     m_Int = intel;
     m_City = city;
     m_Skills = skills;
     m_ShirtHue = shirtHue;
     m_PantsHue = pantsHue;
     m_HairID = hairID;
     m_HairHue = hairHue;
     m_BeardID = beardID;
     m_BeardHue = beardHue;
     m_Profession = profession;
     m_Race = race;
 }
开发者ID:Godkong,项目名称:Origins,代码行数:21,代码来源:EventSink.cs


示例18: EventSink_CharacterCreated

		private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args )
		{
			Mobile newChar = CreateMobile( args.Account as Account );

			if ( newChar == null )
			{
				Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State );
				return;
			}

			args.Mobile = newChar;
			m_Mobile = newChar;

			newChar.Player = true;
			newChar.AccessLevel = ((Account)args.Account).AccessLevel;
			newChar.Female = args.Female;
			newChar.Body = newChar.Female ? 0x191 : 0x190;
			newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;
			newChar.Hunger = 20;

			if ( newChar is PlayerMobile )
				((PlayerMobile)newChar).Profession = args.Profession;

			//Pix: default to warrior if chosen is paladin, necro, etc.
			if( ((PlayerMobile)newChar).Profession > 3 )
				((PlayerMobile)newChar).Profession = 1;

			SetName( newChar, args.Name );

			AddBackpack( newChar );

			SetStats( newChar, args.Str, args.Dex, args.Int );
			SetSkills( newChar, args.Skills, args.Profession );

			AddHair( newChar, args.HairID, Utility.ClipHairHue( args.HairHue & 0x3FFF ) );
			AddBeard( newChar, args.BeardID, Utility.ClipHairHue( args.BeardHue & 0x3FFF ) );

			if ( !Core.AOS || (args.Profession != 4 && args.Profession != 5) )
			{
				AddShirt( newChar, args.ShirtHue );
				AddPants( newChar, args.PantsHue );
				AddShoes( newChar );
			}

			if (TestCenter.Enabled)
				FillBankbox( newChar );

			/*
			 * Our numbers have been so low lately (< 50), it's once again important
			 * to concentrate playerss so that they do not log into what seems to be an empty shard.
			 * We can stem the griefing by:
			 * 1. Changing the look of starting players (remove noob look)
			 * 2. Have a wider entry area
			 * 3. Have them 'Recall in' so they look like they've been here for a while
			 * 4. Give them a 1 minute 'young' status?
			 */

            //Comment out the following line to let the player choose where to start.
            CityInfo city; // = args.City;
			Map spawnMap = Map.Felucca;

            //Comment out the following line to have them always start at Brit Inn
            //CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10 );

			// this NewPlayerStartingArea probably needs to be based on IP address and account age etc.
			if (CoreAI.IsDynamicFeatureSet(CoreAI.FeatureBits.NewPlayerStartingArea))
            {
                city = new CityInfo("New Player Starting Area", "Starting Area", 5731, 953, 0);
				spawnMap = Map.Trammel;
            }
            else
            {	
                //if( city.City == "Britain" )
                {
                	Point3D p = NewCharacterSpawnLocation();
                	city = new CityInfo("Britain", "West Brit Bank", p.X, p.Y, p.Z );
                }
            }

			newChar.MoveToWorld(city.Location, spawnMap);

			Console.WriteLine( "Login: {0}: New character being created (account={1})", args.State, ((Account)args.Account).Username );
			Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial );
			Console.WriteLine( " - Started: {0} {1}", city.City, city.Location );

			new WelcomeTimer( newChar ).Start();
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:87,代码来源:CharacterCreation.cs


示例19: CharacterListOld

        public CharacterListOld( IAccount a, CityInfo[] info )
            : base(0xA9)
        {
            this.EnsureCapacity( 9 + (a.Length * 60) + (info.Length * 63) );

            int highSlot = -1;

            for ( int i = 0; i < a.Length; ++i )
            {
                if ( a[i] != null )
                    highSlot = i;
            }

            int count = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 );

            m_Stream.Write( (byte) count );

            for ( int i = 0; i < count; ++i )
            {
                if ( a[i] != null )
                {
                    m_Stream.WriteAsciiFixed( a[i].Name, 30 );
                    m_Stream.Fill( 30 ); // password
                }
                else
                {
                    m_Stream.Fill( 60 );
                }
            }

            m_Stream.Write( (byte) info.Length );

            for ( int i = 0; i < info.Length; ++i )
            {
                CityInfo ci = info[i];

                m_Stream.Write( (by 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Network.Client类代码示例发布时间:2022-05-26
下一篇:
C# Multis.HouseSign类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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