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

C# GameClients.GameClient类代码示例

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

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



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

示例1: DoTrigger

          protected override void DoTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
          {
              ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniActionEvent);
              message.AddBoolean(false);
              message.AddInt32(0);
              message.AddInt32(0);
              message.AddInt32(Item.GetBaseItem().SpriteId);
              message.AddUInt32(Item.Id);

              if (Item.wiredHandler != null)
              {
                  Kick handler = (Kick)Item.wiredHandler;
                  message.AddString(handler.message);
              }
              else
              {
                  message.AddString(string.Empty);
              }

              message.AddInt32(0);
              message.AddInt32(0);
              message.AddInt32(7);
              message.AddInt32(0);
              message.AddInt32(0);
              message.AddString(string.Empty);

              Session.SendMessage(message);
          }
开发者ID:BjkGkh,项目名称:R106,代码行数:28,代码来源:ActionKickUserWired.cs


示例2:

        void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            RoomUser User = null;
            if (Session != null)
                User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
                return;

            if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
            {
                if (Item.ExtraData != "-1")
                {
                    if (Request == -1)
                    {
                        Item.ExtraData = "0";
                        Item.UpdateState();
                    }
                    else
                    {
                        Item.ExtraData = "-1";
                        Item.UpdateState(false, true);
                        Item.ReqUpdate(4, true);
                    }
                }
            }
            else
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:30,代码来源:DiceTrigger.cs


示例3: SellItem

        internal static void SellItem(GameClient Session, uint ItemId, int SellingPrice)
        {
            UserItem item = Session.GetHabboDataContainer().GetInventoryComponent().GetItem(ItemId);

            if (item == null || SellingPrice > 10000 || !CanSellItem(item))
            {
                ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.MarketplaceMakeOfferResult);
                message.AddInt32(0);
                Session.SendMessage(message);
            }
            else
            {
                int comissionPrice = CalculateComissionPrice(SellingPrice);
                int totalPrice = SellingPrice + comissionPrice;
                int itemType = (item.GetBaseItem().Type == 'i') ? 2 : 1;

                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.setQuery("INSERT INTO catalog_marketplace_offers (item_id,user_id,asking_price,total_price,public_name,sprite_id,item_type,timestamp,extra_data) VALUES (" + item.BaseItemID + "," + Session.GetHabbo().Id + "," + SellingPrice + "," + totalPrice + ",@public_name," + item.GetBaseItem().SpriteId + "," + itemType + "," + ButterflyEnvironment.GetUnixTimestamp() + ",@extra_data)");
                    dbClient.addParameter("public_name", item.GetBaseItem().PublicName);
                    dbClient.addParameter("extra_data", item.extraData);
                    dbClient.runQuery();
                }

                Session.GetHabboDataContainer().GetInventoryComponent().RemoveItem(ItemId, true);
                Session.GetHabboDataContainer().GetInventoryComponent().RunDBUpdate();

                ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.MarketplaceMakeOfferResult);
                message.AddInt32(1);
                Session.SendMessage(message);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:32,代码来源:Marketplace.cs


示例4: if

        void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            // Is this user valid?
            if (Item == null || Item.GetRoom() == null || Session == null || Session.GetHabbo() == null)
                return;
            RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null)
            {
                return;
            }

            // Alright. But is this user in the right position?
            if (User.Coordinate == Item.Coordinate || User.Coordinate == Item.SquareInFront)
            {
                // Fine. But is this tele even free?
                if (Item.InteractingUser != 0)
                {
                    return;
                }

                //User.TeleDelay = -1;
                Item.InteractingUser = User.GetClient().GetHabbo().Id;
            }
            else if (User.CanWalk)
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:29,代码来源:TeleportTrigger.cs


示例5: AlertUser

        internal static void AlertUser(GameClient ModSession, uint UserId, String Message, Boolean Caution)
        {
            GameClient Client = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUserID(UserId);

            if (Client == null || Client.GetHabbo().Id == ModSession.GetHabbo().Id)
            {
                return;
            }

            if (Caution && Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
            {
                ModSession.SendNotif(LanguageLocale.GetValue("moderation.caution.missingrank"));
                Caution = false;
            }

            Client.SendNotif(Message, Caution);

            if (Caution)
            {
                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.runFastQuery("UPDATE user_info SET cautions = cautions + 1 WHERE user_id = " + UserId + "");
                }
            }
        }
开发者ID:habb0,项目名称:Bfly,代码行数:25,代码来源:ModerationTool.cs


示例6:

        void IFurniTrigger.OnRemove(GameClient Session, RoomItem Item)
        {
            Item.ExtraData = "0";

            if (Item.InteractingUser != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);

                if (User != null)
                {
                    User.UnlockWalking();
                }

                Item.InteractingUser = 0;
            }

            if (Item.InteractingUser2 != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser2);

                if (User != null)
                {
                    User.UnlockWalking();
                }

                Item.InteractingUser2 = 0;
            }

            //Item.GetRoom().RegenerateUserMatrix();
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:30,代码来源:TeleportTrigger.cs


示例7:

        void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            if (Item.ExtraData != "1" && Item.GetBaseItem().VendingIds.Count >= 1 && Item.InteractingUser == 0 && Session != null)
            {
                RoomUser user = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
                if (user == null)
                    return;

                if (!Gamemap.TilesTouching(user.X, user.Y, Item.GetX, Item.GetY))
                {
                    user.MoveTo(Item.SquareInFront);
                    return;
                }

                Item.InteractingUser = Session.GetHabbo().Id;

                //user.ClearMovement(true);
                user.SetRot(Rotation.Calculate(user.X, user.Y, Item.GetX, Item.GetY), false);

                Item.ReqUpdate(2, true);

                Item.ExtraData = "1";
                Item.UpdateState(false, true);
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:25,代码来源:VendingTrigger.cs


示例8: if

        void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            RoomUser User = null;
            if (Session != null)
                User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
                return;

            if (!Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
            {
                return;
            }

            int Modes = (Item.GetBaseItem().Modes - 1);

            if (Modes < 0)
            {
                Modes = 0;
            }

            if (Session != null)
                ButterflyEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.FURNI_SWITCH);
            if (!UserHasRights)
            {
                return;
            }

            if (Modes == 0)
            {
                return;
            }

            int currentMode = 0;
            int newMode = 0;

            try
            {
                currentMode = int.Parse(Item.ExtraData);
            }
            catch // (Exception e)
            {
                //Logging.HandleException(e, "InteractorGenericSwitch.OnTrigger");
            }

            if (currentMode <= 0)
            {
                newMode = 1;
            }
            else if (currentMode >= Modes)
            {
                newMode = 0;
            }
            else
            {
                newMode = currentMode + 1;
            }

            Item.ExtraData = newMode.ToString();
            Item.UpdateState();
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:60,代码来源:GenericStandNextToTriggerWithModes.cs


示例9: GamePacketParser

        public GamePacketParser(GameClient Client)
		{
            this.CurrentClient = Client;
			this.bufferPos = 0;
			this.currentPacketLength = -1;
			this.bufferedData = memoryContainer.TakeBuffer();
		}
开发者ID:BjkGkh,项目名称:R106,代码行数:7,代码来源:GamePacketParser.cs


示例10: SerializeQuest

        internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
        {
            int AmountInCat = ButterflyEnvironment.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Category);
            int Number = Quest == null ? AmountInCat : Quest.Number - 1;
            int UserProgress = Quest == null ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);

            if (Quest != null && Quest.IsCompleted(UserProgress))
            {
                Number++;
            }

            Message.AddString(Category);
            Message.AddInt32(Number); // Quest progress in this cat
            Message.AddInt32(AmountInCat); // Total quests in this cat
            Message.AddInt32((int)QuestRewardType.Pixels); // Reward type (1 = Snowflakes, 2 = Love hearts, 3 = Pixels, 4 = Seashells, everything else is pixels
            Message.AddUInt32(Quest == null ? 0 : Quest.Id); // Quest id
            Message.AddBoolean(Quest == null ? false : Session.GetHabbo().CurrentQuestId == Quest.Id); // Quest started
            Message.AddString(Quest == null ? string.Empty : Quest.ActionName);
            Message.AddString(Quest == null ? string.Empty : Quest.DataBit);
            Message.AddInt32(Quest == null ? 0 : Quest.Reward);
            Message.AddString(Quest == null ? string.Empty : Quest.Name);
            Message.AddInt32(UserProgress); // Current progress
            Message.AddUInt32(Quest == null ? 0 : Quest.GoalData); // Target progress
            Message.AddInt32(0); // "Next quest available countdown" in seconds
            Message.AddString(string.Empty); //set_kuurna
            Message.AddString(string.Empty); // MAIN_CHAIN
            Message.AddBoolean(true); // Euh?
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:28,代码来源:QuestListComposer.cs


示例11: AddToPlaylist

        private static void AddToPlaylist(GameClient Session, ClientMessage Message)
        {
            Room Instance = Session.GetHabbo().CurrentRoom;

            if (Instance == null || !Instance.CheckRights(Session, true) || !Instance.GotMusicController() ||
                Instance.GetRoomMusicController().PlaylistSize >= Instance.GetRoomMusicController().PlaylistCapacity)
            {
                return;
            }

            UserItem DiskUserItem = Session.GetHabbo().GetInventoryComponent().GetItem(Message.PopWiredUInt());

            if (DiskUserItem == null || DiskUserItem.GetBaseItem().InteractionType != InteractionType.musicdisc)
            {
                return;
            }

            SongItem item = new SongItem(DiskUserItem);

            int NewOrder = Instance.GetRoomMusicController().AddDisk(item);

            if (NewOrder < 0)
            {
                return;
            }

            Session.GetHabbo().GetInventoryComponent().RemoveItem(item.itemID, true);

            Session.SendMessage(JukeboxComposer.Compose(Instance.GetRoomMusicController().PlaylistCapacity,
                Instance.GetRoomMusicController().Playlist.Values.ToList()));
        }
开发者ID:habb0,项目名称:Bfly,代码行数:31,代码来源:SongManager.cs


示例12: AvatarEffectsInventoryComponent

        internal AvatarEffectsInventoryComponent(uint UserId, GameClient pClient, UserData data)
        {
            this.mClient = pClient;
            this.Effects = new ArrayList();
            this.UserId = UserId;
            this.CurrentEffect = -1;
            this.Effects.Clear();

            StringBuilder QueryBuilder = new StringBuilder();
            foreach (AvatarEffect effect in data.effects)
            {
                if (!effect.HasExpired)
                {
                    Effects.Add(effect);
                    EffectCount++;
                }
                else
                    QueryBuilder.Append("DELETE FROM user_effects WHERE user_id = " + UserId + " AND effect_id = " + effect.EffectId + "; ");
            }

            if (QueryBuilder.Length > 0)
            {
                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                    dbClient.runFastQuery(QueryBuilder.ToString());
            }
        }
开发者ID:habb0,项目名称:Bfly,代码行数:26,代码来源:AvatarEffectsInventoryComponent.cs


示例13: if

        void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            if (!UserHasRights)
            {
                return;
            }

            int oldValue = 0;

            if (!string.IsNullOrEmpty(Item.ExtraData))
            {
                try
                {
                    oldValue = int.Parse(Item.ExtraData);
                }
                catch { }
            }


            if (Request == 1)
            {
                oldValue++;
            }
            else if (Request == 2)
            {
                oldValue--;
            }
            else if (Request == 3)
            {
                oldValue = 0;
            }

            Item.ExtraData = oldValue.ToString();
            Item.UpdateState(false, true);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:35,代码来源:ScoreCounterTrigger.cs


示例14: UserGotAuthorization

        internal bool UserGotAuthorization(GameClient session)
        {
            foreach (string subsciption in this.clubsAllowed)
            {
                if (!session.GetHabboDataContainer().GetSubscriptionManager().HasSubscription(subsciption) && subsciption != string.Empty)
                    return false;
            }

            if (minrank == 0)
                return true;
            else if (minrank > 0)
            {
                if (minrank <= session.GetHabbo().Rank)
                    return true;
            }
            else if (minrank < 0)
            {
                if (minrank == -1)
                {
                    if (session.GetHabbo().CurrentRoom.CheckRights(session, false))
                        return true;
                }
                else if (minrank == -2)
                {
                    if (session.GetHabbo().CurrentRoom.CheckRights(session, true))
                        return true;
                }
            }

            return false;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:31,代码来源:ChatCommand.cs


示例15: Compose

 internal static ServerMessage Compose(GameClient Session, Quest Quest)
 {
     ServerMessage Message = PacketHandelingManager.GetRecycledItem(OutputCode.QuestCompletedMessageComposer);
     QuestListComposer.SerializeQuest(Message, Session, Quest, Quest.Category);
     Message.AddBoolean(true);
     return Message;
 }
开发者ID:BjkGkh,项目名称:R106,代码行数:7,代码来源:QuestCompletedComposer.cs


示例16: Compose

        internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
        {
            ServerMessage Message = new ServerMessage(436); //436
            Message.AppendInt32(Achievements.Count);

            foreach (Achievement Achievement in Achievements)
            {
                UserAchievement UserData = Session.GetHabbo().GetAchievementData(Achievement.GroupName);
                int TargetLevel = (UserData != null ? UserData.Level + 1 : 1);
                int TotalLevels = Achievement.Levels.Count;

                if (TargetLevel > TotalLevels)
                {
                    TargetLevel = TotalLevels;
                }

                AchievementLevel TargetLevelData = Achievement.Levels[TargetLevel];

                Message.AppendUInt(Achievement.Id);                                                           // Unknown (ID?)
                Message.AppendInt32(TargetLevel);                                                   // Target level
                Message.AppendStringWithBreak(Achievement.GroupName + TargetLevel);                 // Target name/desc/badge
                Message.AppendInt32(TargetLevelData.Requirement);                                   // Progress req/target
                Message.AppendInt32(TargetLevelData.RewardPixels);                                   // Pixel reward
                Message.AppendInt32(TargetLevelData.RewardPoints);                                  // Unknown(??)
                Message.AppendInt32(UserData != null ? UserData.Progress : 0);                      // Current progress
                Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false);  // Set 100% completed(??)
                Message.AppendStringWithBreak(Achievement.Category);                                // Category
                Message.AppendInt32(TotalLevels);                                                   // Total amount of levels
            }

            return Message;
        }
开发者ID:habb0,项目名称:Bfly,代码行数:32,代码来源:AchievementListComposer.cs


示例17: GivePixels

        internal static void GivePixels(GameClient Client, int amount)
        {
            Double Timestamp = ButterflyEnvironment.GetUnixTimestamp();

            Client.GetHabbo().LastActivityPointsUpdate = Timestamp;
            Client.GetHabbo().ActivityPoints += amount;
            Client.GetHabboDataContainer().UpdateActivityPointsBalance();
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:8,代码来源:PixelManager.cs


示例18: GivePixels

        internal static void GivePixels(GameClient Client)
        {
            Double Timestamp = ButterflyEnvironment.GetUnixTimestamp();

            Client.GetHabbo().LastActivityPointsUpdate = Timestamp;
            Client.GetHabbo().ActivityPoints += RCV_AMOUNT;
            Client.GetHabbo().UpdateActivityPointsBalance(0);
        }
开发者ID:habb0,项目名称:Bfly,代码行数:8,代码来源:PixelManager.cs


示例19: CanBeTriggered

        public bool CanBeTriggered(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            string[] extraData = Item.ExtraData.Split(':');
            uint groupID = TextHandling.ParseUInt32(extraData[0]);
            GroupData group = ButterflyEnvironment.GetGame().GetGroupManager().GetGroup(groupID);

            return (group != null && group.IsMember(Session.GetHabbo().Id));
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:8,代码来源:GroupGate.cs


示例20:

        void IFurniTrigger.OnPlace(GameClient Session, RoomItem Item)
        {
            if (Item.team == Team.none)
                return;

            Item.ExtraData = Item.GetRoom().GetGameManager().Points[(int)Item.team].ToString();
            Item.UpdateState(false, true);
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:8,代码来源:BanzaiScoreCounterTrigger.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CBinding.CProjectConfiguration类代码示例发布时间:2022-05-24
下一篇:
C# BussinessLogic.ReceptionTaskBO类代码示例发布时间: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