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


C# Client.GetStage方法代码示例

本文整理汇总了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);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:StageHandler.cs

示例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);
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:9,代码来源:StageHandler.cs

示例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);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:57,代码来源:Battle.cs

示例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);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:19,代码来源:Agent.cs

示例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");
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:24,代码来源:StageHandler.cs

示例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);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:9,代码来源:StageHandler.cs

示例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);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:26,代码来源:StageHandler.cs

示例8: ProcessStageSettings

 public static void ProcessStageSettings(Client client, PacketReader packet)
 {
     if (client.GetStage() != null)
         client.GetStage().Settings(client, true);
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:5,代码来源:StageHandler.cs

示例9: ProcessStageStart

        public static void ProcessStageStart(Client client, PacketReader packetReader)
        {
            if (client.GetStage() == null || client.GetStage().GetTraits().Master != client)
                return;

            client.GetStage().Start(client);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:7,代码来源:StageHandler.cs

示例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);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:12,代码来源:StagePackets.cs

示例11: ProcessEnterBattle

 public static void ProcessEnterBattle(Client client, PacketReader packetReader)
 {
     if (client.GetStage() == null) return;
     client.GetStage().GetTraits().Ruleset.GameEnterCallback(client);
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:5,代码来源:StageHandler.cs

示例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);
                }
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:39,代码来源:StageHandler.cs

示例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);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:StageHandler.cs

示例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);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:23,代码来源:StageHandler.cs

示例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);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:15,代码来源:StageHandler.cs


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