• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Core.Client类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ProcessDeleteChar

        public static void ProcessDeleteChar(Client client, PacketReader packetReader)
        {
            var uid = packetReader.ReadMuid();
            var index = packetReader.ReadInt32();
            var name = packetReader.ReadString();
            var result = Results.Accepted;

            if (uid != client.GetMuid() || !Globals.AcceptedString.IsMatch(name) || index < 0 || index > 4)
            {
                client.Disconnect();
                return;
            }

            var cid = Globals.GunzDatabase.GetCid(client.ClientPlayer.PlayerAccount.AccountId, index);
            if (cid == 0)
            {
                result = Results.CharacterDeleteDisabled;
            }
            else
            {
                Globals.GunzDatabase.DeleteCharacter(client.ClientPlayer.PlayerAccount.AccountId, cid);
            }

            Match.ResponseDeleteCharacter(client, result);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:25,代码来源:Login.cs


示例2: ProcessCreateChar

        public static void ProcessCreateChar(Client client, PacketReader packetReader)
        {
            var uid = packetReader.ReadMuid();
            var index = packetReader.ReadInt32();
            var name = packetReader.ReadString();
            var sex = packetReader.ReadInt32();
            var hair = packetReader.ReadInt32();
            var face = packetReader.ReadInt32();
            var costume = packetReader.ReadInt32();
            var result = Results.Accepted;

            if (uid != client.GetMuid() || index < 0 || index > 4 || sex < 0 || sex > 1)
            {
                client.Disconnect();
                return;
            }

            if (!Globals.AcceptedString.IsMatch(name))
                result = Results.CharacterEnterName;
            else if (Globals.GunzDatabase.GetCharacterCount(client.ClientPlayer.PlayerAccount.AccountId) >= 4)
                result = Results.CharacterNameNonExistant;
            else if (Globals.GunzDatabase.CharacterExists(name))
                result = Results.CharacterNameInUse;
            else if (!Globals.GunzDatabase.CreateCharacter(client.ClientPlayer.PlayerAccount.AccountId, (byte)index, name, sex, hair, face, costume))
                result = Results.CharacterInvalidName;

            Match.ResponseCreateChar(client, result, name);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:28,代码来源:Login.cs


示例3: ProcessAccountCharList

        public static void ProcessAccountCharList(Client client, PacketReader packetReader)
        {
            client.Unload();

            var characters = Globals.GunzDatabase.GetCharacterList(client.ClientPlayer.PlayerAccount.AccountId);
            Match.ResponseCharList(client, characters);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:7,代码来源:Login.cs


示例4: AddToQueue

 public void AddToQueue(Client client)
 {
     lock (_objectLock)
     {
         WaitQueue.Enqueue(client);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:7,代码来源:DuelQueue.cs


示例5: ClanInfo

        public static void ClanInfo(Client client, string clanName)
        {
            var player = client.ClientPlayer;
            var info = new ClanInfo();
            var clanId = Globals.GunzDatabase.GetClanId(clanName);

            Globals.GunzDatabase.GetClanInfo(clanId, ref info);

            if (info == null)
                return;

            info.ConnectedMembers = Convert.ToInt16(TcpServer.GetClanMembers(clanId).Count);

            using (var packet = new PacketWriter(Operation.MatchClanResponseClanInfo, CryptFlags.Encrypt))
            {
                packet.Write(1, 78);

                packet.Write(info.Name, 16);
                packet.Write(info.Level);
                packet.Write(info.Points);
                packet.Write(info.TotalPoints);
                packet.Write(info.Ranking);
                packet.Write(info.Master, 32);
                packet.Write(info.Wins);
                packet.Write(info.Losses);
                packet.Write(info.MemberCount);
                packet.Write(info.ConnectedMembers);
                packet.Write(info.ClanId);
                packet.Write(info.EmblemChecksum);

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:33,代码来源:ClanPackets.cs


示例6: Remove

 public static void Remove(Client client)
 {
     lock (_objectLock)
     {
         Clients.Remove(client);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:7,代码来源:TcpServer.cs


示例7: Chat

        public void Chat(Client client, string message)
        {
            if (message.StartsWith("/dtrank "))
            {
                var args = message.Substring(message.IndexOf(" ") + 1);
                var dtrank = Int32.Parse(args);

                client.GetCharacter().DuelRank = dtrank;
                Refresh();
            }
            if (message.StartsWith("/cw "))
            {
                var args = message.Substring(message.IndexOf(" ") + 1);
                var c = Network.TcpServer.GetClientFromName(args);

                List<Client> red = new List<Client>();
                List<Client> blue = new List<Client>();

                red.Add(c);
                blue.Add(client);

                _stages.CreateClanwar(red, blue);
            }
            lock (_objectLock)
                ChannelPackets.ResponseChat(_traits.Playerlist, _traits.ChannelId, client.GetCharacter().Name, message, client.ClientPlayer.PlayerAccount.Access);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:26,代码来源:Channel.cs


示例8: GameLeaveBattle

        public override void GameLeaveBattle(Client client)
        {
            if (CurrentBerserker == client)
                CurrentBerserker = null;

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


示例9: GameInfoCallback

        public virtual void GameInfoCallback(Client client)
        {
            var traits = _stage.GetTraits();
            lock (_stage.ObjectLock)
            {
                Battle.BattleResponseInfo(client, _teamScores[0], _teamScores[1], traits.Players);
            }

            client.ClientPlayer.PlayerStats.Spawned = true;
            client.ClientPlayer.PlayerStats.RequestedInfo = true;
            client.ClientPlayer.PlayerStats.Loaded = true;
            ProcessRoundState();

            if ((!IsTeam() && !IsQuestDerived() && !IsDuel()) || IsExtreme())
            {

                Battle.StageRoundUpdate(client, traits.StageId, traits.CurrentRound, traits.Round);
                Spawn(client);
            }
            else if (IsTeam())
            {
                if (_roundState != RoundState.Play)
                {
                    client.ClientPlayer.PlayerStats.Entered = true;
                }
                else
                {
                    client.ClientPlayer.PlayerStats.Entered = false;
                    client.ClientPlayer.PlayerStats.Spawned = false;
                    Battle.StageRoundUpdate(client, traits.StageId, traits.CurrentRound, traits.Round);
                }
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:33,代码来源:Callbacks.cs


示例10: OnGameKill

        public override void OnGameKill(Client killer, Client victim)
        {
            if (killer == CurrentBerserker && CurrentStage.GetTraits().Name.ToLower().Contains("[sb]"))
            {
                lock (CurrentStage.ObjectLock)
                {
                    Battle.AssignBerserker(CurrentStage.GetTraits().Players, CurrentBerserker.GetMuid());
                }
            }

            if (victim == CurrentBerserker || CurrentBerserker == null)
            {
                lock (CurrentStage.ObjectLock)
                {
                    CurrentBerserker = killer;
                    Battle.AssignBerserker(CurrentStage.GetTraits().Players, CurrentBerserker.GetMuid());
                }
            }

            if (killer.ClientPlayer.PlayerStats.Kills == CurrentStage.GetTraits().RoundCount)
            {
                GameInProgress = false;
                ItemSpawns.Abort();
                GameOver();
            }
            else
            {
                Spawn(victim, 5);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:30,代码来源:Berserker.cs


示例11: ResponseChannelList

        public static void ResponseChannelList(Client client, List<Channel> channels)
        {
            using (var packet = new PacketWriter(Operation.ChannelList, CryptFlags.Decrypt))
            {
                packet.Write(channels.Count, 88);

                Int16 index = 0;
                foreach (var c in channels)
                {
                    var traits = c.GetTraits();
                    packet.Write(traits.ChannelId);
                    packet.Write(++index);
                    packet.Write((Int16)traits.Playerlist.Count);
                    packet.Write((Int16)traits.MaxUsers);
                    packet.Write((Int16)traits.MinLevel);
                    packet.Write((Int16)traits.MaxLevel);
                    packet.Write((byte)traits.Type);
                    packet.Write(traits.ChannelName, 64);
                    packet.Write(false);
                    packet.Write(0);
                }

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:25,代码来源:ChannelPackets.cs


示例12: ResponseAllPlayerList

        public static void ResponseAllPlayerList(Client client, List<Client> clients, Muid channelId)
        {
            using (var packet = new PacketWriter(Operation.ChannelResponseAllPlayerList, CryptFlags.Encrypt))
            {
                packet.Write(channelId);
                packet.Write(clients.Count, 73);

                foreach (var c in clients)
                {
                    packet.Write(c.GetMuid());
                    packet.Write(c.GetCharacter().Name, 32);
                    packet.Write(c.GetCharacter().ClanName, 16);
                    packet.Write((byte)c.GetCharacter().Level);
                    packet.Write((byte)c.GetCharacter().DuelRank);//dagger for duel tourney.
                    packet.Write((Int32)c.ClientPlayer.PlayerLocation);
                    packet.Write((byte)c.ClientPlayer.PlayerAccount.Access);
                    packet.Write((byte)2);
                    packet.Write(c.GetCharacter().ClanId);
                    packet.Write(0);//unknown.
                    packet.Write((byte)3);//unknown
                }

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:25,代码来源:ChannelPackets.cs


示例13: ResponseCharacterItemList

        public static void ResponseCharacterItemList(Client client)
        {
            using (var packet = new PacketWriter(Operation.MatchResponseCharacterItemList, CryptFlags.Decrypt))
            {
                packet.Write(client.GetCharacter().Bp);

                packet.Write(17, 8);
                for (var i = 0; i < 17; ++i)
                {
                    packet.Write(0);
                    packet.Write(client.GetCharacter().EquippedItems[i].ItemCid);
                }

                packet.Write(client.GetCharacter().Items.Count, 24);
                foreach (var i in client.GetCharacter().Items)
                {
                    packet.Write(0);
                    packet.Write(i.ItemCid);
                    packet.Write(i.ItemId);
                    packet.Write(i.RentHour);
                    packet.Write(0);
                    packet.Write(i.Quantity);
                }
                packet.Write(0, 12);

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:28,代码来源:Match.cs


示例14: GameKillCallback

        public virtual void GameKillCallback(Client killer, Client victim)
        {
            victim.ClientPlayer.PlayerStats.Spawned = false;
            if (_gameType == ObjectStageGameType.Training)
            {
                var uids = new Pair<Muid, Muid>(killer.GetMuid(), victim.GetMuid());
                var args = new Pair<UInt32, UInt32>(0, 0);
                lock (CurrentStage.ObjectLock)
                {
                    Battle.GameDie(CurrentStage.GetTraits().Players, uids, args);
                }
            }
            else
            {
                if (killer != victim)
                {
                    var exp = ExpManager.GetExpFromKill(killer.GetCharacter().Level,
                                                        victim.GetCharacter().Level);

                    killer.GetCharacter().Xp += exp;

                    var uids = new Pair<Muid, Muid>(killer.GetMuid(), victim.GetMuid());
                    var args = new Pair<UInt32, UInt32>((exp << 16), 0);
                    lock (CurrentStage.ObjectLock)
                    {
                        Battle.GameDie(CurrentStage.GetTraits().Players, uids, args);

                        //killer.GetCharacter().Level =
                          //  (Int16) ExpManager.GetLevel((Int32) killer.GetCharacter().Xp);
                        Log.Write("Exp Gained: {0} | Exp To Next Level: {1} | Current Exp: {2}", exp, ExpManager.GetExp(killer.GetCharacter().Level + 1), killer.GetCharacter().Xp);
                        if (ExpManager.Level(killer.GetCharacter().Level,
                                             killer.GetCharacter().Xp))
                        {
                            killer.GetCharacter().Level++;
                            Battle.GameLevelUp(CurrentStage.GetTraits().Players, killer.GetMuid(),
                                               killer.GetCharacter().Level);
                            EventManager.AddCallback(
                                () =>
                                Globals.GunzDatabase.UpdateLevel(killer.GetCharacter().CharacterId,
                                                     killer.GetCharacter().Xp,
                                                     killer.GetCharacter().Level));
                        }
                    }

                    killer.ClientPlayer.PlayerStats.Kills++;
                    victim.ClientPlayer.PlayerStats.Deaths++;

                    if (killer.ClientPlayer.PlayerStats.Kills%20 == 0)
                    {
                        EventManager.AddCallback(
                            () =>
                            Globals.GunzDatabase.UpdateLevel(killer.GetCharacter().CharacterId,
                                                 killer.GetCharacter().Xp,
                                                 killer.GetCharacter().Level));
                    }
                }
            }
            OnGameKill(killer, victim);
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:59,代码来源:Callbacks.cs


示例15: Notify

 public static void Notify(Client client, Int32 error)
 {
     using (var packet = new PacketWriter(Operation.MatchNotify, CryptFlags.Encrypt))
     {
         packet.Write(error);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:Match.cs


示例16: AgentError

 public static void AgentError(Client client, Int32 error)
 {
     using (var packet = new PacketWriter(Operation.AgentError, CryptFlags.Encrypt))
     {
         packet.Write(error);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:AgentPackets.cs


示例17: ResponseBuyItem

 public static void ResponseBuyItem(Client client, Results results)
 {
     using (var packet = new PacketWriter(Operation.MatchResponseBuyItem, CryptFlags.Decrypt))
     {
         packet.Write((Int32)results);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:Match.cs


示例18: 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


示例19: ExpelMemberNotAllowed

 public static void ExpelMemberNotAllowed(Client client)
 {
     using (var expelMember = new PacketWriter(Operation.MatchClanAdminResponseLeaveMember, CryptFlags.Encrypt))
     {
         expelMember.Write((Int32)Results.ClanNotAuthorized);
         client.Send(expelMember);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:ClanPackets.cs


示例20: ResponsePeerRelay

 public static void ResponsePeerRelay(Client client, Muid playerId)
 {
     using (var packet = new PacketWriter(Operation.MatchResponsePeerRelay, CryptFlags.Encrypt))
     {
         packet.Write(playerId);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:AgentPackets.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BusinessObjects.MasterDataBLL类代码示例发布时间:2022-05-24
下一篇:
C# LinearMath.IndexedVector3类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap