本文整理汇总了C#中Bunny.Core.Client.GetStage方法的典型用法代码示例。如果您正苦于以下问题:C# Client.GetStage方法的具体用法?C# Client.GetStage怎么用?C# Client.GetStage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bunny.Core.Client
的用法示例。
在下文中一共展示了Client.GetStage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProccessLateJoin
public static void ProccessLateJoin(Client client, PacketReader packet)
{
if (client.GetStage() == null)
return;
Battle.ResponseLateJoin(client);
client.GetStage().GetTraits().Ruleset.GameLateJoinCallback(client);
}
示例2: ProcessBattleInfo
public static void ProcessBattleInfo(Client client, PacketReader packetReader)
{
if (client.GetStage() == null)
{
Log.Write("NULL Stage?");
return;
}
client.GetStage().GetTraits().Ruleset.GameInfoCallback(client);
}
示例3: BattleResponseInfo
public static void BattleResponseInfo(Client client, int red, int blue, List<Client> players)
{
using (var packet = new PacketWriter(Operation.BattleResponseInfo, CryptFlags.Encrypt))
{
var traits = client.GetStage().GetTraits();
packet.Write(traits.StageId);
packet.Write(1, 6);
packet.Write((byte)red);
packet.Write((byte)blue);
packet.Write(0);
//TODO: Add rulesets here.
if (!traits.Ruleset.IsBerserker() || !traits.Ruleset.IsAssassination() || ((Berserker)traits.Ruleset).CurrentBerserker == null)
{
packet.Write(0, 0);
}
else if (traits.Ruleset.IsBerserker())
{
var berserker = traits.Ruleset as Berserker;
if (berserker != null && berserker.CurrentBerserker != null)
{
packet.Write(1, 9);
packet.Write((byte)8);
packet.Write(berserker.CurrentBerserker.GetMuid());
}
}
else if (traits.Ruleset.IsAssassination())
{
var rule = traits.Ruleset as Assassination;
if (rule.RedVip != null && rule.BlueVip != null)
{
packet.Write(1, 17);
packet.Write((byte) ObjectStageGameType.Assassination);
packet.Write(rule.RedVip.GetMuid());
packet.Write(rule.BlueVip.GetMuid());
}
else
{
packet.Write(0,0);
}
}
packet.Write(players.Count, 17);
foreach (var c in players)
{
packet.Write(c.GetMuid());
packet.Write(c.ClientPlayer.PlayerStats.Spawned);
packet.Write(c.ClientPlayer.PlayerStats.Kills);
packet.Write(c.ClientPlayer.PlayerStats.Deaths);
}
client.Send(packet);
}
}
示例4: ProcessPeerRelay
public static void ProcessPeerRelay(Client client, PacketReader packetReader)
{
if (client.GetStage() == null)
return;
var charId = packetReader.ReadMuid();
var peerId = packetReader.ReadMuid();
//Now attempt to bind them!
if (Globals.NatAgent != null)
{
AgentPackets.RelayPeer(Globals.NatAgent, new Tuple<Muid, Muid, Muid>(charId, peerId, client.GetStage().GetTraits().StageId));
Log.Write("Binding player to NAT");
}
else
{
AgentPackets.AgentError(client, 10001);
}
}
示例5: ProcessGameKill
public static void ProcessGameKill(Client client, PacketReader packet)
{
if (client.GetStage() == null)
{
Log.Write("Client doesn't have a stage...?");
return;
}
var uidKiller = packet.ReadMuid();
Client killer;
lock (client.GetStage().ObjectLock)
{
killer =
client.GetStage().GetTraits().Players.Find(c => c.GetMuid() == uidKiller);
}
if (killer != null)
client.GetStage().GetTraits().Ruleset.GameKillCallback(killer, client);
else
{
Log.Write("Invalid killer");
}
}
示例6: ResponseStageChat
public static void ResponseStageChat(Client client, PacketReader packetReader)
{
var uidChar = packetReader.ReadUInt64();
var uidStage = packetReader.ReadUInt64();
var message = packetReader.ReadString();
if (client.GetStage() != null)
client.GetStage().Chat(client, message);
}
示例7: ResponseSpawnWorldItem
public static void ResponseSpawnWorldItem(Client client, PacketReader packet)
{
var charId = packet.ReadMuid();
var itemId = packet.ReadInt32();
var X = packet.ReadSingle();
var Y = packet.ReadSingle();
var Z = packet.ReadSingle();
var spawn = new ItemSpawn();
spawn.Position.X = X;
spawn.Position.Y = Y;
spawn.Position.Z = Z;
spawn.ItemId = (ushort)itemId;
spawn.Taken = false;
spawn.ItemUid = client.GetStage().GetTraits().WorldItemUid;
spawn.NextSpawn = DateTime.Now.AddMilliseconds(WorldItemManager.GetTime(itemId));
Interlocked.Increment(ref client.GetStage().GetTraits().WorldItemUid);
lock (client.GetStage().GetTraits().WorldItems)
client.GetStage().GetTraits().WorldItems.Add(spawn);
lock (client.GetStage().ObjectLock)
Battle.SpawnWorldItem(client.GetStage().GetTraits().Players,
spawn);
}
示例8: ProcessStageSettings
public static void ProcessStageSettings(Client client, PacketReader packet)
{
if (client.GetStage() != null)
client.GetStage().Settings(client, true);
}
示例9: ProcessStageStart
public static void ProcessStageStart(Client client, PacketReader packetReader)
{
if (client.GetStage() == null || client.GetStage().GetTraits().Master != client)
return;
client.GetStage().Start(client);
}
示例10: ResponseStageJoin
public static void ResponseStageJoin(Client client, Results result)
{
using (var packet = new PacketWriter(Operation.StageJoin, CryptFlags.Encrypt))
{
packet.Write(client.GetMuid());
packet.Write(client.GetStage().GetTraits().StageId);
packet.Write(client.GetStage().GetTraits().StageIndex);
packet.Write(client.GetStage().GetTraits().Name);
client.Send(packet);
}
}
示例11: ProcessEnterBattle
public static void ProcessEnterBattle(Client client, PacketReader packetReader)
{
if (client.GetStage() == null) return;
client.GetStage().GetTraits().Ruleset.GameEnterCallback(client);
}
示例12: ProcessGameSpawn
public static void ProcessGameSpawn(Client client, PacketReader packetReader)
{
var uid = packetReader.ReadUInt64();
var xpos = packetReader.ReadSingle();
var ypos = packetReader.ReadSingle();
var zpos = packetReader.ReadSingle();
var xdir = packetReader.ReadSingle();
var ydir = packetReader.ReadSingle();
var zdir = packetReader.ReadSingle();
if (client.GetStage() != null)
{
var traits = client.GetStage().GetTraits();
if (traits.Ruleset.IsDuel())
{
if (traits.DuelQueue.Challenger != client && traits.DuelQueue.Champion != client)
return;
}
if (traits.Ruleset.IsTeam())
return;
var position = new Position();
var direction = new Direction();
position.X = xpos;
position.Y = ypos;
position.Z = zpos;
direction.X = xdir;
direction.Y = ydir;
direction.Z = zdir;
lock (client.GetStage().ObjectLock)
{
Battle.GameSpawn(client.GetStage().GetTraits().Players, client.GetMuid(),
position, direction);
}
}
}
示例13: ProcessLeaveBattle
public static void ProcessLeaveBattle(Client client, PacketReader packet)
{
if (client.GetStage() != null)
{
client.ClientPlayer.PlayerLocation = Place.Stage;
client.GetStage().GetTraits().Ruleset.GameLeaveBattle(client);
}
}
示例14: ProcessStageCreate
public static void ProcessStageCreate(Client client, PacketReader packetReader)
{
var uid = packetReader.ReadMuid();
var name = packetReader.ReadString();
var locked = packetReader.ReadBoolean();
var password = packetReader.ReadString();
if (uid != client.GetMuid())
{
client.Disconnect();
return;
}
var traits = new StageTraits();
traits.StageId = Globals.StageCounter.GetNext();
traits.Name = name;
traits.Locked = locked;
traits.Password = password;
traits.Master = client;
client.ClientPlayer.PlayerStage = client.GetChannel().Add(traits);
client.GetStage().Join(client);
}
示例15: ResponseStageState
public static void ResponseStageState(Client client, PacketReader packetReader)
{
var charId = packetReader.ReadMuid();
var stageId = packetReader.ReadMuid();
var state = packetReader.ReadInt32();
if (!Enum.IsDefined(typeof(ObjectStageState), state) || client.GetStage() == null)
{
client.Disconnect();
return;
}
client.ClientPlayer.PlayerState = (ObjectStageState)state;
client.GetStage().PlayerState(client);
}