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


C# Client.GetMuid方法代码示例

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


在下文中一共展示了Client.GetMuid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

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

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

示例5: LadderPrepare

        public static void LadderPrepare(Client client, int teamNumber)
        {
            using (var packet = new PacketWriter(Operation.LadderPrepare, CryptFlags.Encrypt))
            {
                packet.Write(client.GetMuid());
                packet.Write(teamNumber);

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

示例6: ResponseBridgePeer

        public static void ResponseBridgePeer(Client client)
        {
            using (var packet = new PacketWriter(Operation.BridgeResponse, CryptFlags.Decrypt))
            {
                packet.Write(client.GetMuid());
                packet.Write((Int32)Results.Accepted);

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

示例7: Announce

        public static void Announce(Client client, string message)
        {
            using (var packet = new PacketWriter(Operation.AdminAnnounce, CryptFlags.Decrypt))
            {
                packet.Write(client.GetMuid());
                packet.Write(message);
                packet.Write(0);

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

示例8: OnInitialStart

        public override void OnInitialStart()
        {
            var traits = CurrentStage.GetTraits();
            var rand = new Random();
            var red = traits.Players.FindAll(c => c.ClientPlayer.PlayerTeam == Team.Red);
            var blue = traits.Players.FindAll(c => c.ClientPlayer.PlayerTeam == Team.Blue);

            RedVip = red[rand.Next(red.Count)];
            BlueVip = blue[rand.Next(blue.Count)];

            Battle.AssignVips(traits.Players, RedVip.GetMuid(), BlueVip.GetMuid());

            new Thread(ItemThread).Start();
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:14,代码来源:Assassination.cs

示例9: AskAgreement

        public static void AskAgreement(List<Client> clients, Client proposer, int mode, int request)
        {
            using (var packet = new PacketWriter(Operation.MatchAskAgreement, CryptFlags.Encrypt))
            {
                packet.Write(proposer.GetMuid());

                packet.Write(clients.Count+1, 32);
                clients.ForEach(c => packet.Write(c.GetCharacter().Name, 32));
                packet.Write(proposer.GetCharacter().Name, 32);
                packet.Write(mode);
                packet.Write(request);

                clients.ForEach(c => c.Send(packet));
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:15,代码来源:ClanPackets.cs

示例10: GameInfoCallback

        public override void GameInfoCallback(Client client)
        {
            var traits = CurrentStage.GetTraits();

            lock (CurrentStage.ObjectLock)
            {
                Battle.BattleResponseInfo(client, Scores[0], Scores[1], traits.Players);
            }

            client.ClientPlayer.PlayerStats.Spawned = true;
            client.ClientPlayer.PlayerStats.RequestedInfo = true;

            if (client.ClientPlayer.PlayerStats.LateJoined)
            {
                lock (CurrentStage.ObjectLock)
                {
                    if (traits.DuelQueue.Challenger != null)
                    {
                        traits.DuelQueue.AddToQueue(client);
                        var players = traits.DuelQueue.Clone();
                        Battle.DuelQueue(client, players, (byte)traits.DuelQueue.WaitQueue.Count,
                            traits.DuelQueue.Victories, true);
                        Battle.SetObserver(traits.Players, client.GetMuid());
                    }
                    else
                    {

                        var players = traits.DuelQueue.Clone();
                        players.Add(client);
                        Battle.DuelQueue(client, players, (byte)(traits.DuelQueue.WaitQueue.Count+1), traits.DuelQueue.Victories);

                        traits.DuelQueue.Challenger = client;
                        players = traits.DuelQueue.Clone();
                        Battle.DuelQueue(traits.Players, players, traits.DuelQueue.QueueLength,
                            traits.DuelQueue.Victories, true);
                        ThreadPool.QueueUserWorkItem(StartNextRound);
                    }
                }
            }
            ProcessRoundState();
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:41,代码来源:Duel.cs

示例11: ProcessRound

        private void ProcessRound(object o)
        {
            var traits = CurrentStage.GetTraits();

            Log.Write("Starting new round.");
            lock (CurrentStage.ObjectLock)
            {

                GameInProgress = true;
                if (traits.Time > 0)
                {
                    GameTimer = new Timer();
                    GameTimer.Interval = TimeSpan.FromMinutes(traits.Time).TotalMilliseconds;
                    GameTimer.Elapsed += (s, a) => OnRoundEnd();
                    GameTimer.Enabled = true;
                }

                traits.Players.ForEach(delegate(Client c)
                                           {
                                               c.ClientPlayer.PlayerStats.Spawned = false;
                                               c.ClientPlayer.PlayerStats.Entered = false;
                                               c.ClientPlayer.PlayerStats.RequestedInfo = false;
                                           });

                traits.Round = RoundState.Countdown;
                Battle.StageRoundUpdate(traits.Players, traits.StageId, traits.CurrentRound, traits.Round);

                Thread.Sleep(TimeSpan.FromSeconds(3));

                traits.Round = RoundState.Play;
                Battle.StageRoundUpdate(traits.Players, traits.StageId, traits.CurrentRound, traits.Round);
                traits.Players.ForEach(delegate(Client c)
                                           {
                                               c.ClientPlayer.PlayerStats.Spawned = true;
                                               c.ClientPlayer.PlayerStats.InGame = true;
                                           });

                var rand = new Random();
                var red = traits.Players.FindAll(c => c.ClientPlayer.PlayerTeam == Team.Red);
                var blue = traits.Players.FindAll(c => c.ClientPlayer.PlayerTeam == Team.Blue);

                RedVip = red[rand.Next(red.Count)];
                BlueVip = blue[rand.Next(blue.Count)];

                Battle.AssignVips(traits.Players, RedVip.GetMuid(), BlueVip.GetMuid());

                if (!_killThread)
                {
                    _killThread = true;
                    while (_killThread)
                    {
                        Thread.Sleep(1);
                    }
                }

                _killThread = false;
                new Thread(ItemThread).Start();
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:59,代码来源:Assassination.cs

示例12: ResponseLeave

        public static void ResponseLeave(Client client, Muid channel)
        {
            using (var packet = new PacketWriter(Operation.ChannelLeave, CryptFlags.Encrypt))
            {
                packet.Write(client.GetMuid());
                packet.Write(channel);

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

示例13: GameLoadedCallback

        public virtual void GameLoadedCallback(Client client)
        {
            lock (_stage.ObjectLock)
            {
                Battle.LoadingComplete(CurrentStage.GetTraits().Players, client.GetMuid());
            }

            if (_stage.GetTraits().Master != client)
                client.ClientPlayer.PlayerState = ObjectStageState.NonReady;

            client.ClientPlayer.PlayerStats.InGame = true;
            client.ClientPlayer.PlayerStats.Loaded = true;
            client.ClientPlayer.PlayerLocation = Place.Battle;
            ProcessRoundState();
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:15,代码来源:Callbacks.cs

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

示例15: ProcessLoginRequest

        public static void ProcessLoginRequest(Client client, PacketReader packetReader)
        {
            var user = packetReader.ReadString();
            var pass = packetReader.ReadString();
            var version = packetReader.ReadInt32();
            var checksum = packetReader.ReadInt32();
            var totalSize = packetReader.ReadInt32();
            var blobSize = packetReader.ReadInt32();
            var blobCount = packetReader.ReadInt32();
            var md5 = new byte[blobSize*blobCount];

            packetReader.Read(md5, 0, blobSize);

            if (blobSize > 32)
            {
                client.Disconnect();
                return;
            }

            if (!Globals.AcceptedString.IsMatch(user) || !Globals.AcceptedString.IsMatch(pass))
            {
                Match.ResponseLogin(client, Results.LoginAuthenticationFailed, user, UGradeId.Guest, PGradeId.Free, new Muid(0,0));
                client.Disconnect();
                return;
            }

            if (Globals.Config.Server.AutoRegistration)
            {
                if (user.StartsWith("!r"))
                {
                    user = user.Substring(2);
                    if (!Globals.GunzDatabase.AccountExists(user))
                        Globals.GunzDatabase.CreateAccount(user, pass, ref client.ClientPlayer.PlayerAccount);
                    else
                    {
                        Match.ResponseNotify(client, "That account is already in use!", 1);
                        client.Disconnect();
                        return;
                    }
                }
                else
                    Globals.GunzDatabase.GetAccount(user, pass, ref client.ClientPlayer.PlayerAccount);
            }
            else
                Globals.GunzDatabase.GetAccount(user, pass, ref client.ClientPlayer.PlayerAccount);

            if (client.ClientPlayer.PlayerAccount.AccountId == 0)
            {
                Match.ResponseLogin(client, Results.LoginIncorrectPassword, user, UGradeId.Guest, PGradeId.Free, new Muid(0, 0));
                client.Disconnect();
                return;
            }

            if (client.ClientPlayer.PlayerAccount.Access == UGradeId.Banned || client.ClientPlayer.PlayerAccount.Access == UGradeId.Criminal)
            {
                Match.ResponseLogin(client, Results.LoginBannedId, user, UGradeId.Guest, PGradeId.Free, new Muid(0, 0));
                client.Disconnect();
                return;
            }

            if (version != Globals.Config.Client.Version)
            {
                Match.ResponseLogin(client, Results.LoginInvalidVersion, user, UGradeId.Guest, PGradeId.Free, new Muid(0, 0));
                return;
            }

            if (Globals.Config.Client.UseCrc)
            {
                if ((checksum^0) != Globals.Config.Client.FileList)
                {
                    Match.ResponseLogin(client, Results.LoginInvalidVersion, user, UGradeId.Guest, PGradeId.Free, new Muid(0, 0));
                    client.Disconnect();
                    return;
                }
            }

            var inuse = TcpServer.GetClientFromAid(client.ClientPlayer.PlayerAccount.AccountId);

            if (inuse != null && inuse != client)
            {
                inuse.Disconnect();
            }

            client.ClientFlags = PacketFlags.Login;
            Match.ResponseLogin(client, Results.Accepted, user, client.ClientPlayer.PlayerAccount.Access, PGradeId.Free, client.GetMuid());
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:86,代码来源:Login.cs


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