本文整理汇总了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;
}
}
}
示例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();
}