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


C# GameClient.SendNotif方法代码示例

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


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

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

示例2: BanUser

        internal static void BanUser(GameClient ModSession, uint UserId, int Length, String Message)
        {
            GameClient Client = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUserID(UserId);

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

            if (Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
            {
                ModSession.SendNotif(LanguageLocale.GetValue("moderation.ban.missingrank"));
                return;
            }

            Double dLength = Length;

            ButterflyEnvironment.GetGame().GetBanManager().BanUser(Client, ModSession.GetHabbo().Username, dLength, Message, false);
        }
开发者ID:habb0,项目名称:Bfly,代码行数:19,代码来源:ModerationTool.cs

示例3: SetWallItem

        internal bool SetWallItem(GameClient Session, RoomItem Item)
        {
            if (!Item.IsWallItem || mWallItems.ContainsKey(Item.Id))
                return false;
            if (mFloorItems.ContainsKey(Item.Id))
            {
                Session.SendNotif("Oeps! Er is iets mis gegaan, probeer het opnieuw!\r\r<b>Beschrijving:</b>\rJe hebt dit Meubi al eerder in je kamer geplaatst.");
                return true;
            }
            Item.Interactor.OnPlace(Session, Item);

            if (Item.GetBaseItem().InteractionType == InteractionType.dimmer)
            {
                if (room.MoodlightData == null)
                {
                    room.MoodlightData = new MoodlightData(Item.Id);
                    Item.ExtraData = room.MoodlightData.GenerateExtraData();
                }
            }

            mWallItems.Add(Item.Id, Item);
            AddItem(Item);

            ServerMessage Message = PacketHandelingManager.GetRecycledItem(OutputCode.ItemWallAddMessageEvent);
            Item.Serialize(Message);
            Message.AddString(room.Owner);
            room.SendMessage(Message);

            return true;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:30,代码来源:RoomItemHandling.cs

示例4: SetFloorItem


//.........这里部分代码省略.........
                    {
                        StacktitleZ = I.TotalHeight;
                    }
                }

                if (StacktitleZ != 99998)
                    newZ = StacktitleZ;
            }

            // Verify the rotation is valid
            if (Item.GetBaseItem().InteractionType == InteractionType.mannequin)
            {
                if (newRot < 0 || newRot > 12) 
                    newRot = 0;
            }
            else
            {
                if (newRot < 0 || newRot > 12 || newRot % 2 != 0)
                    newRot = 0;
            }

            //Item.GetX = newX;
            //Item.GetY = newY;
            //Item.GetZ = newZ;


            Item.Rot = newRot;
            int oldX = Item.GetX;
            int oldY = Item.GetY;
            Item.SetState(newX, newY, newZ, AffectedTiles);

            if (!OnRoller && Session != null)
                Item.Interactor.OnPlace(Session, Item);


            if (newItem)
            {
                if (mFloorItems.ContainsKey(Item.Id))
                {
                    if (Session != null)
                        Session.SendNotif("Oeps! Er is iets mis gegaan, probeer het opnieuw!\r\r<b>Beschrijving:</b>\rJe hebt dit Meubi al eerder in je kamer geplaatst.");

                    return true;
                }

                if (Item.IsFloorItem && !mFloorItems.ContainsKey(Item.Id))
                    mFloorItems.Add(Item.Id, Item);
                else if (Item.IsWallItem && !mWallItems.ContainsKey(Item.Id))
                    mWallItems.Add(Item.Id, Item);

                AddItem(Item);

                if (sendMessage)
                {
                    ServerMessage Message = PacketHandelingManager.GetRecycledItem(OutputCode.ObjectAddMessageEvent);
                    Item.Serialize(Message);
                    Message.AddString(room.Owner);
                    room.SendMessage(Message);
                }
            }
            else
            {
                UpdateItem(Item);

                if (!OnRoller && sendMessage)
                {
                    ServerMessage Message = PacketHandelingManager.GetRecycledItem(OutputCode.ObjectUpdateMessageEvent);
                    Item.Serialize(Message);
                    room.SendMessage(Message);
                }
            }
            if (Item.wiredCondition != null)
            {
                room.GetWiredHandler().conditionHandler.AddOrIgnoreRefferance(Item);
            }
            if (!newItem)
            {
                room.GetWiredHandler().RemoveWiredItem(new Point(oldX, oldY));

                if (WiredHandler.TypeIsWire(Item.GetBaseItem().InteractionType))
                {
                    room.GetWiredHandler().AddWire(Item, new Point(newX, newY), newRot, Item.GetBaseItem().InteractionType);
                }
            }
            else
            {
                if (WiredHandler.TypeIsWire(Item.GetBaseItem().InteractionType))
                {
                    room.GetWiredHandler().AddWire(Item, Item.Coordinate, newRot, Item.GetBaseItem().InteractionType);
                }
            }

            //GenerateMaps(false);
            room.GetGameMap().AddToMap(Item);

            if (updateRoomUserStatuses)
                room.GetRoomUserManager().UpdateUserStatusses();

            return true;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:101,代码来源:RoomItemHandling.cs

示例5: CreateRoom

        internal RoomData CreateRoom(GameClient Session, string Name, string Desc, string Model)
        {
            Name = ButterflyEnvironment.FilterInjectionChars(Name);

            if (!roomModels.ContainsKey(Model))
            {
                Session.SendNotif("Oeps! Er is iets misgegaan, probeer het opnieuw.\r\r<b>Beschrijving:</b>\rDoor een fout in ons systeem kun je deze kamervorm tijdelijk niet gebruiken.");
                return null;
            }

            if (((RoomModel)roomModels[Model]).ClubOnly && !Session.GetHabboDataContainer().GetSubscriptionManager().HasSubscription())
            {
                Session.SendNotif("Only for Habbo Club.");

                return null;
            }

            if (Name.Length < 3)
            {
                Session.SendNotif("Name to short!");
                return null;
            }

            UInt32 RoomId = 0;

            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("INSERT INTO rooms (roomtype,caption,description,owner,model_name) VALUES ('private',@caption,@desc,@username,@model)");
                dbClient.addParameter("caption", Name);
                dbClient.addParameter("desc", Desc);
                dbClient.addParameter("model", Model);
                dbClient.addParameter("username", Session.GetHabbo().Username);

                RoomId = (UInt32)dbClient.insertQuery();
            }

            RoomData newRoomData = GenerateRoomData(RoomId);
            Session.GetHabbo().UsersRooms.Add(newRoomData);

            return newRoomData;
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:41,代码来源:RoomManager.cs

示例6: HandlePurchase

        internal void HandlePurchase(GameClient Session, int PageId, uint ItemId, string ExtraData, Boolean IsGift, string GiftUser, string GiftMessage)
        {
            CatalogPage Page;
            if (!Pages.TryGetValue(PageId, out Page))
                return;

            if (Page == null || Page.ComingSoon || !Page.Enabled || !Page.Visible || Session == null || Session.GetHabbo() == null)
            {
                return;
            }

            if (Page.ClubOnly && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
            {
                return;
            }
            if (Session.GetHabbo().Rank != Page.MinRank) // Workaround
            {
                if (Session.GetHabbo().Rank < Page.MinRank)
                {
                    return;
                }
            }
            CatalogItem Item = Page.GetItem(ItemId);

            if (Item == null)
            {
                return;
            }

            uint GiftUserId = 0;

            if (IsGift)
            {
                if (!Item.GetBaseItem().AllowGift)
                {
                    return;
                }

                DataRow dRow;
                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.setQuery("SELECT id FROM users WHERE username = @gift_user");
                    dbClient.addParameter("gift_user", GiftUser);

                    dRow = dbClient.getRow();
                }

                if (dRow == null)
                {
                    Session.GetMessageHandler().GetResponse().Init(76);
                    Session.GetMessageHandler().GetResponse().AppendBoolean(true);
                    Session.GetMessageHandler().GetResponse().AppendStringWithBreak(GiftUser);
                    Session.GetMessageHandler().SendResponse();

                    return;
                }

                GiftUserId = Convert.ToUInt32(dRow[0]);

                if (GiftUserId == 0)
                {
                    Session.GetMessageHandler().GetResponse().Init(76);
                    Session.GetMessageHandler().GetResponse().AppendBoolean(true);
                    Session.GetMessageHandler().GetResponse().AppendStringWithBreak(GiftUser);
                    Session.GetMessageHandler().SendResponse();

                    return;
                }
            }

            Boolean CreditsError = false;
            Boolean PixelError = false;

            if (Session.GetHabbo().Credits < Item.CreditsCost)
            {
                CreditsError = true;
            }

            if (Session.GetHabbo().ActivityPoints < Item.PixelsCost)
            {
                PixelError = true;
            }

            if (CreditsError || PixelError)
            {
                Session.GetMessageHandler().GetResponse().Init(68);
                Session.GetMessageHandler().GetResponse().AppendBoolean(CreditsError);
                Session.GetMessageHandler().GetResponse().AppendBoolean(PixelError);
                Session.GetMessageHandler().SendResponse();

                return;
            }

            if (IsGift && Item.GetBaseItem().Type == 'e')
            {
                Session.SendNotif(LanguageLocale.GetValue("catalog.gift.send.error"));
                return;
            }

            if (Item.CrystalCost > 0)
//.........这里部分代码省略.........
开发者ID:habb0,项目名称:Bfly,代码行数:101,代码来源:Catalog.cs

示例7: DeliverItems


//.........这里部分代码省略.........
                                {
                                    dbClient.runFastQuery("INSERT INTO items_tele_links (tele_one_id,tele_two_id) VALUES (" + idOne + "," + idTwo + ")");
                                    dbClient.runFastQuery("INSERT INTO items_tele_links (tele_one_id,tele_two_id) VALUES (" + idTwo + "," + idOne + ")");
                                }

                                break;

                            case InteractionType.dimmer:

                                uint id = Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, ExtraData, true, false, 0).Id;
                                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                                {
                                    dbClient.runFastQuery("INSERT INTO items_moodlight (item_id,enabled,current_preset,preset_one,preset_two,preset_three) VALUES (" + id + ",0,1,'#000000,255,0','#000000,255,0','#000000,255,0')");
                                }

                                break;

                            case InteractionType.musicdisc:
                                {
                                    Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, songID.ToString(), true, false, songID);
                                    break;
                                }

                            default:

                                Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, ExtraData, true, false, songID);
                                break;
                        }
                    }

                    Session.GetHabbo().GetInventoryComponent().UpdateItems(false);
                    break;

                case "e":

                    for (int i = 0; i < Amount; i++)
                    {
                        Session.GetHabbo().GetAvatarEffectsInventoryComponent().AddEffect(Item.SpriteId, 3600);
                    }

                    break;

                case "h":

                    for (int i = 0; i < Amount; i++)
                    {
                        Session.GetHabbo().GetSubscriptionManager().AddOrExtendSubscription("habbo_club", 2678400);
                    }

                    if (!Session.GetHabbo().GetBadgeComponent().HasBadge("HC1"))
                    {
                        Session.GetHabbo().GetBadgeComponent().GiveBadge("HC1", true);
                    }

                    Session.GetMessageHandler().GetResponse().Init(7);
                    Session.GetMessageHandler().GetResponse().AppendStringWithBreak("habbo_club");

                    if (Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
                    {
                        Double Expire = Session.GetHabbo().GetSubscriptionManager().GetSubscription("habbo_club").ExpireTime;
                        Double TimeLeft = Expire - ButterflyEnvironment.GetUnixTimestamp();
                        int TotalDaysLeft = (int)Math.Ceiling(TimeLeft / 86400);
                        int MonthsLeft = TotalDaysLeft / 31;

                        if (MonthsLeft >= 1) MonthsLeft--;

                        Session.GetMessageHandler().GetResponse().AppendInt32(TotalDaysLeft - (MonthsLeft * 31));
                        Session.GetMessageHandler().GetResponse().AppendBoolean(true);
                        Session.GetMessageHandler().GetResponse().AppendInt32(MonthsLeft);
                    }
                    else
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            Session.GetMessageHandler().GetResponse().AppendInt32(0);
                        }
                    }

                    Session.GetMessageHandler().SendResponse();

                    List<string> Rights = ButterflyEnvironment.GetGame().GetRoleManager().GetRightsForHabbo(Session.GetHabbo());

                    Session.GetMessageHandler().GetResponse().Init(2);
                    Session.GetMessageHandler().GetResponse().AppendInt32(Rights.Count);

                    foreach (string Right in Rights)
                    {
                        Session.GetMessageHandler().GetResponse().AppendStringWithBreak(Right);
                    }

                    Session.GetMessageHandler().SendResponse();
                    ButterflyEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_BasicClub", 1); //ACH_VipClub
                    break;

                default:

                    Session.SendNotif(LanguageLocale.GetValue("catalog.buyerror"));
                    break;
            }
        }
开发者ID:habb0,项目名称:Bfly,代码行数:101,代码来源:Catalog.cs

示例8: KickUser

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

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

            if (Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
            {
                ModSession.SendNotif(LanguageLocale.GetValue("moderation.kick.missingrank"));
                return;
            }

            Room Room = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(Client.GetHabbo().CurrentRoomId);

            if (Room == null)
            {
                return;
            }

            Room.GetRoomUserManager().RemoveUserFromRoom(Client, true, false);
            Client.CurrentRoomUserID = -1;

            if (!Soft)
            {
                Client.SendNotif(Message);

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

示例9: SetWallItem

        internal bool SetWallItem(GameClient Session, RoomItem Item)
        {
            if (!Item.IsWallItem || mWallItems.ContainsKey(Item.Id))
                return false;
            if (mFloorItems.ContainsKey(Item.Id))
            {
                Session.SendNotif(LanguageLocale.GetValue("room.itemplaced"));
                return true;
            }
            Item.Interactor.OnPlace(Session, Item);

            if (Item.GetBaseItem().InteractionType == InteractionType.dimmer)
            {
                if (room.MoodlightData == null)
                {
                    room.MoodlightData = new MoodlightData(Item.Id);
                    Item.ExtraData = room.MoodlightData.GenerateExtraData();
                }
            }

            mWallItems.Add(Item.Id, Item);
            AddItem(Item);

            ServerMessage Message = new ServerMessage(83);
            Item.Serialize(Message);
            room.SendMessage(Message);

            return true;
        }
开发者ID:habb0,项目名称:Bfly,代码行数:29,代码来源:RoomItemHandling.cs

示例10: SetFloorItem


//.........这里部分代码省略.........
                        continue; // cannot stack on self
                    }

                    if (I.TotalHeight > newZ)
                    {
                        newZ = I.TotalHeight;
                    }
                }
            }

            // Verify the rotation is correct
            if (newRot != 0 && newRot != 2 && newRot != 4 && newRot != 6 && newRot != 8)
            {
                newRot = 0;
            }

            //Item.GetX = newX;
            //Item.GetY = newY;
            //Item.GetZ = newZ;

            Item.Rot = newRot;
            int oldX = Item.GetX;
            int oldY = Item.GetY;
            Item.SetState(newX, newY, newZ, AffectedTiles);

            if (!OnRoller && Session != null)
                Item.Interactor.OnPlace(Session, Item);

            if (newItem)
            {
                if (mFloorItems.ContainsKey(Item.Id))
                {
                    if (Session != null)
                        Session.SendNotif(LanguageLocale.GetValue("room.itemplaced"));

                    //Remove from map!!!
                    return true;
                }

                //using (DatabaseClient dbClient = ButterflyEnvironment.GetDatabase().GetClient())
                //{
                //    dbClient.addParameter("extra_data", Item.ExtraData);
                //    dbClient.runFastQuery("INSERT INTO room_items (id,room_id,base_item,extra_data,x,y,z,rot,wall_pos) VALUES ('" + Item.Id + "','" + RoomId + "','" + Item.BaseItem + "',@extra_data,'" + Item.GetX + "','" + Item.GetY + "','" + Item.GetZ + "','" + Item.Rot + "','')");
                //}
                //if (mRemovedItems.ContainsKey(Item.Id))
                //    mRemovedItems.Remove(Item.Id);
                //if (mAddedItems.ContainsKey(Item.Id))
                //    return false;

                //mAddedItems.Add(Item.Id, Item);

                if (Item.IsFloorItem && !mFloorItems.ContainsKey(Item.Id))
                    mFloorItems.Add(Item.Id, Item);
                else if (Item.IsWallItem && !mWallItems.ContainsKey(Item.Id))
                    mWallItems.Add(Item.Id, Item);

                AddItem(Item);

                if (sendMessage)
                {
                    ServerMessage Message = new ServerMessage(93);
                    Item.Serialize(Message);
                    room.SendMessage(Message);
                }
            }
            else
开发者ID:habb0,项目名称:Bfly,代码行数:67,代码来源:RoomItemHandling.cs

示例11: DeliverItems


//.........这里部分代码省略.........

                                Session.GetHabboDataContainer().GetInventoryComponent().AddPet(GeneratedPet12);
                                Session.GetHabboDataContainer().GetInventoryComponent().AddNewItem(0, 320, "0", true, false, 0);

                                break;
                            case InteractionType.pet14:
                                string[] PetData14 = ExtraData.Split('\n');

                                Pet GeneratedPet14 = CreatePet(Session.GetHabbo().Id, PetData14[0], 14, PetData14[1], PetData14[2]);

                                Session.GetHabboDataContainer().GetInventoryComponent().AddPet(GeneratedPet14);
                                Session.GetHabboDataContainer().GetInventoryComponent().AddNewItem(0, 320, "0", true, false, 0);

                                break;
                            case InteractionType.pet15:
                                string[] PetData15 = ExtraData.Split('\n');

                                Pet GeneratedPet15 = CreatePet(Session.GetHabbo().Id, PetData15[0], 15, PetData15[1], PetData15[2]);

                                Session.GetHabboDataContainer().GetInventoryComponent().AddPet(GeneratedPet15);
                                Session.GetHabboDataContainer().GetInventoryComponent().AddNewItem(0, 320, "0", true, false, 0);

                                break;
                            case InteractionType.teleport:

                                uint idOne = Session.GetHabboDataContainer().GetInventoryComponent().AddNewItem(0, Item.ItemId, "0", true, false, 0).itemID;
                                uint idTwo = Session.GetHabboDataContainer().GetInventoryComponent().AddNewItem(0, Item.ItemId, "0", true, false, 0).itemID;

                                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                                {
                                    dbClient.runFastQuery("INSERT INTO items_tele_links (tele_one_id,tele_two_id) VALUES (" + idOne + "," + idTwo + ")");
                                    dbClient.runFastQuery("INSERT INTO items_tele_links (tele_one_id,tele_two_id) VALUES (" + idTwo + "," + idOne + ")");
                                }

                                break;

                            case InteractionType.dimmer:

                                uint id = Session.GetHabboDataContainer().GetInventoryComponent().AddNewItem(0, Item.ItemId, ExtraData, true, false, 0).itemID;
                                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                                {
                                    dbClient.runFastQuery("INSERT INTO items_moodlight (item_id,enabled,current_preset,preset_one,preset_two,preset_three) VALUES (" + id + ",0,1,'#000000,255,0','#000000,255,0','#000000,255,0')");
                                }

                                break;

                            case InteractionType.roombg:

                                uint it = Session.GetHabboDataContainer().GetInventoryComponent().AddNewItem(0, Item.ItemId, ExtraData, true, false, 0).itemID;

                                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                                {
                                    dbClient.runFastQuery("INSERT INTO items_roombg VALUES (" + it + ",'0',0,0,0)");
                                }

                                break;
                                
                            case InteractionType.musicdisc:
                                {
                                    Session.GetHabboDataContainer().GetInventoryComponent().AddNewItem(0, Item.ItemId, songID.ToString(), true, false, songID);
                                    break;
                                }

                            default:

                                uint ItemId = Session.GetHabboDataContainer().GetInventoryComponent().AddNewItem(0, Item.ItemId, ExtraData, true, false, songID).itemID;
                                UnseenItem(Session, ItemId, Amount, false, false);
                                break;
                        }
                    }

                    Session.GetHabboDataContainer().GetInventoryComponent().UpdateItems(false);
                    break;
                case "r":
                    {
                        switch (Item.InteractionType)
                        {
                            case InteractionType.bot:
                                {
                                    CreateBotForUser(Session, Item, ExtraData);
                                }
                                break;
                        }
                    }
                    break;
                case "e":

                    for (int i = 0; i < Amount; i++)
                    {
                        Session.GetHabboDataContainer().GetAvatarEffectsInventoryComponent().AddEffect(Item.SpriteId, 3600);
                    }

                    break;

                default:

                    Session.SendNotif("Er is iets fout gegaan, probeer het opnieuw!");
                    break;
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:101,代码来源:Catalog.cs

示例12: HandlePurchase


//.........这里部分代码省略.........
                {
                    dbClient.setQuery("SELECT id FROM users WHERE username = @gift_user");
                    dbClient.addParameter("gift_user", giftData.sendingUser);
                    dRow = dbClient.getRow();
                }

                if (dRow == null)
                {
                    ServerMessage response = PacketHandelingManager.GetRecycledItem(OutputCode.GiftReceiverNotFoundEvent);
                    response.AddBoolean(true);
                    response.AddString(giftData.sendingUser);
                    Session.SendMessage(response);

                    return;
                }

                GiftUserId = Convert.ToUInt32(dRow[0]);

                if (GiftUserId == 0)
                {
                    ServerMessage response = PacketHandelingManager.GetRecycledItem(OutputCode.GiftReceiverNotFoundEvent);
                    response.AddBoolean(true);
                    response.AddString(giftData.sendingUser);
                    Session.SendMessage(response);
                    return;
                }
            }

            if (Session.GetHabbo().ActivityPoints < total_cost_pixels || Session.GetHabbo().Credits < total_cost_credits || Session.GetHabbo().Diamonds < total_cost_diamonds)
                return;

            if (IsGift && Item.GetBaseItem().Type == 'e')
            {
                Session.SendNotif("Oeps! Er is iets mis gegaan, probeer het opnieuw!\r\r<b>Beschrijving:</b>\rJe kunt dit item niet versturen als cadeau.");
                return;
            }

            if (Item.catalogName.Contains("HABBO_CLUB_VIP") || Item.catalogName.Equals("deal_vip_1_year_and_badge") || Item.catalogName.ToUpper().Contains("DEAL_HC"))
            {
                if (Item.creditCost > Session.GetHabbo().Credits)
                    return;

                int Days = 0;

                //DEAL_HC_3

                if (Item.catalogName.ToUpper().Contains("DEAL_HC_"))
                {
                    int k = int.Parse(Item.catalogName.Split('_')[2]);
                    switch (k)
                    {
                        case 1:
                            Days = 1 * 31;
                            break;
                        case 2:
                            Days = 3 * 31;
                            break;
                        case 3:
                            Days = 6 * 31;
                            break;
                    }
                }
                else if (Item.catalogName.Contains("HABBO_CLUB_VIP_"))
                {
                    if (Item.catalogName.Contains("_DAY"))
                    {
开发者ID:BjkGkh,项目名称:R106,代码行数:67,代码来源:Catalog.cs


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