当前位置: 首页>>代码示例>>C#>>正文


C# D3类代码示例

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


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

示例1: ToonHandleHelper

 public ToonHandleHelper(D3.OnlineService.EntityId entityID)
 {
     var stream = CodedInputStream.CreateInstance(entityID.ToByteArray());
     this.ID = stream.ReadUInt64();
     //this.Program = stream.ReadUInt32();
     //this.Region = stream.ReadRawVarint32();
     //this.Realm = stream.ReadRawVarint32();
 }
开发者ID:orior,项目名称:d3sharp,代码行数:8,代码来源:ToonHandleHelper.cs

示例2: ToonHandleHelper

 public ToonHandleHelper(D3.OnlineService.EntityId entityID)
 {
     var stream = CodedInputStream.CreateInstance(entityID.ToByteArray());
     ulong tmp=0;
     // I believe this actually calls ReadRawVarint64(), but just to be sure..
     stream.ReadUInt64(ref tmp);
     this.ID = tmp;
     //this.Program = stream.ReadRawVarint32();
     //this.Region = stream.ReadRawVarint32();
     //this.Realm = stream.ReadRawVarint32();
 }
开发者ID:rotacioskapa,项目名称:mooege,代码行数:11,代码来源:ToonHandleHelper.cs

示例3: GetChannelByEntityId

 public static Channel GetChannelByEntityId(D3.OnlineService.EntityId entityId)
 {
     if (entityId.IdHigh == (ulong)EntityIdHelper.HighIdType.ChannelId)
     {
         if (Channels.ContainsKey(entityId.IdLow))
             return Channels[entityId.IdLow];
     }
     else
         Logger.Warn("Given entity ID doesn't look like a channel ID!");
     return null;
 }
开发者ID:alvarotg,项目名称:mooege,代码行数:11,代码来源:ChannelManager.cs

示例4: StartGame

        public void StartGame(List<MooNetClient> clients, ulong objectId, D3.OnlineService.GameCreateParams gameCreateParams, string version)
        {
            this.GameCreateParams = gameCreateParams;
            this.Version = version;
            this.InGame = GS.Game.GameManager.CreateGame((int) this.DynamicId); // create the ingame.

            clients.First().MapLocalObjectID(this.DynamicId, objectId); // map remote object-id for party leader.

            foreach(var client in clients) // get all clients in game.
            {
                this.SendConnectionInfo(client);
            }
        }
开发者ID:Thundernick,项目名称:mooege,代码行数:13,代码来源:GameCreator.cs

示例5: AttackUnit

        public static bool AttackUnit(D3.Unit _unit, TimeSpan _timeout)
        {
            if (Sherpa.GetBool(() => _unit.Life <= 0))
            {
                return false;
            }

            TimeSpan startTime = TimeSpan.FromTicks(System.Environment.TickCount);

            while (Sherpa.GetBool(() => _unit.Life > 0))
            {
                if (Me.MaxLife - Me.Life > 10000)
                {
                    breathOfHeaven.Use();
                }

                blindingFlash.Use();
                if (sevenSidedStrike.Use(_unit))
                    Thread.Sleep(900);
                else
                {
                    var buff = Sherpa.GetData(() => UIElement.Get(0x42A41DDB1E96841A));
                    if (buff == default(UIElement) || !buff.Visible)
                        sweepingWind.Use();

                    wayOfTheHundredFists.Use(_unit);

                }
                Thread.Sleep(100);

                if (TimeSpan.FromTicks(System.Environment.TickCount).Subtract(startTime) > _timeout)
                {
                    return false;
                }
            }

            return true;
        }
开发者ID:murrain,项目名称:Snowshoes,代码行数:38,代码来源:Monk.cs

示例6: GetGameAccountSettings

        private ByteString GetGameAccountSettings(D3.GameMessage.GetGameAccountSettings settings)
        {
            Logger.Trace("GetGameAccountSettings()");

            var gameAccount = this.Client.Account.CurrentGameAccount;
            return gameAccount.Settings.ToByteString();
            //var pref = D3.Client.Preferences.CreateBuilder().SetVersion(105).Build(); //hack since client is expecting this atm -Egris
            //return pref.ToByteString();
        }
开发者ID:ElCorpseMaker,项目名称:mooege,代码行数:9,代码来源:GameUtilitiesService.cs

示例7: SetGameAccountSettings

        private ByteString SetGameAccountSettings(D3.GameMessage.SetGameAccountSettings settings)
        {
            Logger.Trace("SetGameAccountSettings()");

            this.Client.Account.CurrentGameAccount.Settings = settings.Settings;
            return ByteString.Empty;
        }
开发者ID:ElCorpseMaker,项目名称:mooege,代码行数:7,代码来源:GameUtilitiesService.cs

示例8: SelectHero

        private ByteString SelectHero(D3.OnlineService.EntityId hero)
        {
            this.Client.Account.CurrentGameAccount.CurrentToon = ToonManager.GetToonByLowID(hero.IdLow);

            Logger.Trace("SelectToon() {0}", this.Client.Account.CurrentGameAccount.CurrentToon);

            if (this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID != this.Client.Account.CurrentGameAccount.lastPlayedHeroId)
            {
                this.Client.Account.CurrentGameAccount.NotifyUpdate();
                this.Client.Account.CurrentGameAccount.lastPlayedHeroId = this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID;
            }
            return this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID.ToByteString();
        }
开发者ID:ElCorpseMaker,项目名称:mooege,代码行数:13,代码来源:GameUtilitiesService.cs

示例9: SaveBanner

        private bool SaveBanner(D3.GameMessage.SaveBannerConfiguration bannerConfig)
        {
            Logger.Trace("SaveBannerConifuration()");

            if (this.Client.Account.CurrentGameAccount.BannerConfigurationField.Value == bannerConfig.Banner)
                return false;
            else
            {
                this.Client.Account.CurrentGameAccount.BannerConfiguration = bannerConfig.Banner;
                this.Client.Account.CurrentGameAccount.NotifyUpdate();
            }
            return true;
        }
开发者ID:ElCorpseMaker,项目名称:mooege,代码行数:13,代码来源:GameUtilitiesService.cs

示例10: allTests


//.........这里部分代码省略.........
        Console.Out.Flush();
        {
            try
            {
                B p1;
                B p2;
                B ret = testPrx.returnTest2(out p1, out p2);
                test(ret == p1);
            }
            catch(Exception)
            {
                test(false);
            }
        }
        Console.Out.WriteLine("ok");

        Console.Out.Write("return value identity with unknown first (AMI)... ");
        Console.Out.Flush();
        {
            AsyncCallback cb = new AsyncCallback();
            testPrx.begin_returnTest2().whenCompleted(cb.response_returnTest2, cb.exception);
            cb.check();
        }
        Console.Out.WriteLine("ok");

        Console.Out.Write("return value identity for input params known first... ");
        Console.Out.Flush();
        {
            try
            {
                D1 d1 = new D1();
                d1.sb = "D1.sb";
                d1.sd1 = "D1.sd1";
                D3 d3 = new D3();
                d3.pb = d1;
                d3.sb = "D3.sb";
                d3.sd3 = "D3.sd3";
                d3.pd3 = d1;
                d1.pb = d3;
                d1.pd1 = d3;

                B b1 = testPrx.returnTest3(d1, d3);

                test(b1 != null);
                test(b1.sb.Equals("D1.sb"));
                test(b1.ice_id().Equals("::Test::D1"));
                D1 p1 = (D1) b1;
                test(p1 != null);
                test(p1.sd1.Equals("D1.sd1"));
                test(p1.pd1 == b1.pb);

                B b2 = b1.pb;
                test(b2 != null);
                test(b2.sb.Equals("D3.sb"));
                test(b2.ice_id().Equals("::Test::B")); // Sliced by server
                test(b2.pb == b1);
                try
                {
                    D3 p3 = (D3) b2;
                    test(false);
                    D3 tmp = p3; p3 = tmp; // Stop compiler warning about unused variable.
                }
                catch(InvalidCastException)
                {
                }
开发者ID:bholl,项目名称:zeroc-ice,代码行数:66,代码来源:AllTests.cs

示例11: DeleteHero

        private ByteString DeleteHero(D3.OnlineService.EntityId hero)
        {
            var deleteToon = ToonManager.GetToonByLowID(hero.IdLow);
            ToonManager.DeleteToon(deleteToon);

            Logger.Trace("DeleteHero() {0}", deleteToon);
            return ByteString.Empty;
        }
开发者ID:ElCorpseMaker,项目名称:mooege,代码行数:8,代码来源:GameUtilitiesService.cs

示例12: GetHeroProfiles

        private ByteString GetHeroProfiles(D3.GameMessage.GetHeroProfiles profiles)
        {
            Logger.Trace("GetHeroProfiles()");

            var profileList = D3.Profile.HeroProfileList.CreateBuilder();
            if (profiles.HeroIdsCount > 0)
            {
                foreach (var hero in profiles.HeroIdsList)
                {
                    var toon = ToonManager.GetToonByLowID(hero.IdLow);
                    profileList.AddHeros(toon.Profile);
                }
            }
            else
            {
                var heroList = GameAccountManager.GetAccountByPersistentID(profiles.AccountId.IdLow).Toons;
                foreach (var hero in heroList.Values)
                {
                    profileList.AddHeros(hero.Profile);
                }
            }

            return profileList.Build().ToByteString();
        }
开发者ID:ElCorpseMaker,项目名称:mooege,代码行数:24,代码来源:GameUtilitiesService.cs

示例13: GetAccountItems

        private ByteString GetAccountItems(D3.GameMessage.GetAccountItems request)
        {
            Logger.Trace("GetAccountItems()");

            var itemList = D3.Items.ItemList.CreateBuilder();
            return itemList.Build().ToByteString();
        }
开发者ID:ElCorpseMaker,项目名称:mooege,代码行数:7,代码来源:GameUtilitiesService.cs

示例14: UndeleteHero

 private ByteString UndeleteHero(D3.GameMessage.UndeleteHero heroId)
 {
     var toon = ToonManager.GetToonByLowID(heroId.UndeleteHeroId.IdLow);
     if (toon != null && toon.Deleted)
     {
         toon.Deleted = false;
         ToonManager.SaveToDB(toon);
         return toon.Digest.ToByteString();
     }
     else
         return ByteString.Empty;
 }
开发者ID:hfenigma,项目名称:mooege,代码行数:12,代码来源:GameUtilitiesService.cs

示例15: GetGameAccountSettings

        private ByteString GetGameAccountSettings(D3.GameMessage.GetGameAccountSettings settings)
        {
            Logger.Trace("GetGameAccountSettings()");

            //var gameAccount = GameAccountManager.GetAccountByPersistentID(settings.AccountId.IdLow);
            //return gameAccount.Settings.ToByteString();
            var pref = D3.Client.Preferences.CreateBuilder().SetVersion(102).Build(); //hack since client is expecting this atm -Egris
            return pref.ToByteString();
        }
开发者ID:jujuman,项目名称:mooege,代码行数:9,代码来源:GameUtilitiesService.cs


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