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


C# Entities.SendNobility方法代码示例

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


在下文中一共展示了Entities.SendNobility方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Donate

        public static void Donate(Entities.GameClient client, long Amount)
        {
            if (client.Money < Amount)
                return;
            if (Amount < 3000000)
                return;
            if (Amount > 999999999)
                return;

            if (Donations.ContainsKey(client.DatabaseUID))
            {
                NobilityDonation donation;
                if (Donations.TryGetValue(client.DatabaseUID, out donation))
                {
                    if (donation.Donation >= Core.NumericConst.MaxNobilityDonation)
                        return;

                    client.Money -= (uint)Amount;
                    donation.Donation = Math.Min(Core.NumericConst.MaxNobilityDonation, (long)(donation.Donation + Amount));
                    GetTop50();

                    client.SendNobility();

                    donation.UpdateDonation();
                }
            }
            else
            {
                NobilityDonation donation = new NobilityDonation();
                donation.Rank = Enums.NobilityRank.Serf;
                donation.Donation = Amount;
                if (Donations.TryAdd(client.DatabaseUID, donation))
                {
                    client.Money -= (uint)Amount;
                    donation.DatabaseID = client.DatabaseUID;
                    donation.Name = client.Name;
                    donation.Client = client;
                    client.Nobility = donation;
                    GetTop50();

                    client.SendNobility();

                    donation.CreateDatabase();
                    donation.UpdateDonation();
                }
            }
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:47,代码来源:NobilityBoard.cs

示例2: Handle

        public static void Handle(Entities.GameClient client)
        {
            // Send vip, merchant, quiz points and heavenbless etc.

            client.BaseEntity.SetBaseStats();
            client.BaseEntity.CalculateBaseStats();

            client.Stamina = 50;
            client.PKPoints = client.PKPoints; // update status effect
            client.BoundCPs = client.BoundCPs; // for some reason this has to be done here ...

            using (ProjectX_V3_Lib.Sql.SqlHandler sql = Database.CharacterDatabase.OpenRead(client, "DB_Players"))
                client.StatusFlag2 = sql.ReadUInt64("PlayerStatusFlag");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine(Core.MessageConst.LOGIN_MSG, client.Name, client.Account, client.EntityUID, client.DatabaseUID);
            Console.ResetColor();

            MessagePacket bc = Threads.BroadcastThread.GetLastBroadcast();
            if (bc != null)
            {
                client.Send(bc);
                bc.Dispose();
            }
            Database.CharacterDatabase.LoadMessageQuery(client);

            Data.NobilityBoard.SetNobility(client);
            client.SendNobility();

            client.SendSubClasses2();

            Packets.UpdatePacket update = Packets.UpdatePacket.Create(client.EntityUID);
            update.AddUpdate(Enums.UpdateType.VIPLevel, 6);
            update.AddUpdate(Enums.UpdateType.Merchant, 255);
            client.Send(update);

            Data.ArenaQualifier.SetArenaInfo(client);
            if (client.Arena == null)
            {
                client.Arena = new ProjectX_V3_Game.Data.ArenaInfo(client);
                client.Arena.ArenaHonorPoints = 1000;
                client.Arena.Level = (uint)client.Level;
                client.Arena.Class = (uint)client.Class;
                Database.ArenaDatabase.AddNewArenaInfo(client.Arena);
                if (!Data.ArenaQualifier.AddArenaInfo(client.Arena))
                {
                    client.NetworkClient.Disconnect("FAILED_TO_MAKE_ARENA_INFO");
                    return;
                }
            }

            client.CanSave = true;
            using (var motd = Packets.Message.MessageCore.CreateTalk(
                Core.SystemVariables.Variables["ServerName"], client.Name,
                Core.SystemVariables.ReplaceVariables(Program.Config.ReadString("MOTD"))))
                client.Send(motd);
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:56,代码来源:LoginHandler.cs


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