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


C# GameClient.GetLocalWorld方法代码示例

本文整理汇总了C#中GameClient.GetLocalWorld方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.GetLocalWorld方法的具体用法?C# GameClient.GetLocalWorld怎么用?C# GameClient.GetLocalWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameClient的用法示例。


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

示例1: Handle

        public override void Handle(GameClient client)
        {
            
            if (this.Field1 == 0x77F20036)
            {
                client.EnterInn();
                return;
            }
            for (int i = 0; i < client.GetLocalWorld().encounters.Count; i++)
            {
                Monster monster = client.GetLocalWorld().encounters[i].GetMonsterByID(this.Field1);
                if (monster != null)
                {
                    if (monster.IsDead())
                    {
                        monster.Die();
                        client.GetLocalWorld().encounters[i].RemoveMonster(monster);
                    }
                    else
                    {
                        monster.Pain(18 + RandomHelper.Next(8));

                        if (monster.IsDead())
                        {
                            
                            monster.Die();
                            client.GetLocalWorld().encounters[i].RemoveMonster(monster);
                        }
                    }

                    break;
                }
            }
        }
开发者ID:yabizz,项目名称:d3sharp,代码行数:34,代码来源:TargetMessage.cs

示例2: Handle

        public override void Handle(GameClient client)
        {
            if (this.Id != 0x000A)
                throw new NotImplementedException();

            // a hackish way to get client.BnetClient in context -- pretends games has only one client in. when we're done with implementing bnet completely, will get this sorted out. /raist
            client.BnetClient = Core.Games.GameManager.AvailableGames[(ulong)this.Field2].Clients.FirstOrDefault();
            if (client.BnetClient != null)
            {
                client.Toon = client.BnetClient.CurrentToon;
                client.BnetClient.InGameClient = client;
            }

            client.SendMessageNow(new VersionsMessage()
            {
                Id = 0x000D,
                SNOPackHash = this.SNOPackHash,
                ProtocolHash = GameMessage.ImplementedProtocolHash,
                Version = "0.3.0.7333",
            });

            client.SendMessage(new ConnectionEstablishedMessage()
            {
                Id = 0x002E,
                Field0 = 0x00000000,
                Field1 = 0x4BB91A16,
                Field2 = this.SNOPackHash,
            });

            client.SendMessage(new GameSetupMessage()
            {
                Id = 0x002F,
                Field0 = 0x00000077,
            });

            client.SendMessage(new SavePointInfoMessage()
            {
                Id = 0x0045,
                snoLevelArea = -1,
            });

            client.SendMessage(new HearthPortalInfoMessage()
            {
                Id = 0x0046,
                snoLevelArea = -1,
                Field1 = -1,
            });

            client.SendMessage(new ActTransitionMessage()
            {
                Id = 0x00A8,
                Field0 = 0x00000000,
                Field1 = true,
            });

            client.GameUniverse.EnterPlayer(client);

            client.FlushOutgoingBuffer();

            client.GetLocalWorld().SendEncounters(client);

            client.FlushOutgoingBuffer();
        }
开发者ID:yabizz,项目名称:d3sharp,代码行数:63,代码来源:JoinBNetGameMessage.cs


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