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


C# GameClient.SendNotif方法代码示例

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


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

示例1: AlertUser

        internal static void AlertUser(GameClient ModSession, uint UserId, String Message, Boolean Caution)
        {
            GameClient Client = FirewindEnvironment.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 = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.runFastQuery("UPDATE user_info SET cautions = cautions + 1 WHERE user_id = " + UserId + "");
                }
            }
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:25,代码来源:ModerationTool.cs

示例2: BanUser

        internal static void BanUser(GameClient ModSession, uint UserId, int Length, String Message)
        {
            GameClient Client = FirewindEnvironment.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;

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

示例3: HandlePurchase


//.........这里部分代码省略.........
            Boolean CreditsError = false;
            Boolean PixelError = false;
            Boolean CrystalError = false;

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

            if (Session.GetHabbo().VipPoints < (Item.CrystalCost * finalAmount))
            {
                CrystalError = true;
            }

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

            if (CreditsError || PixelError)
            {
                ServerMessage message = new ServerMessage(Outgoing.NotEnoughBalance);
                message.AppendBoolean(CreditsError);
                message.AppendBoolean(PixelError);
                Session.SendMessage(message);
                return;
            }

            if (Item.CrystalCost > 0)
            {
                int cost = Item.CrystalCost * finalAmount;
                if (Session.GetHabbo().VipPoints < cost)
                {
                    Session.SendNotif("You can't afford that item!");
                    Session.SendMessage(new ServerMessage(Outgoing.PurchaseError));
                    return;
                }

                Session.GetHabbo().VipPoints -= cost;
                Session.GetHabbo().UpdateActivityPointsBalance(true);

                using (IQueryAdapter adapter = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    adapter.runFastQuery("UPDATE users SET vip_points = " + Session.GetHabbo().VipPoints + " WHERE id = " + Session.GetHabbo().Id);
                }

            }

            if (Item.CreditsCost > 0 && !IsGift)
            {
                Session.GetHabbo().Credits -= (Item.CreditsCost * finalAmount);
                Session.GetHabbo().UpdateCreditsBalance();
            }

            if (Item.PixelsCost > 0 && !IsGift)
            {
                Session.GetHabbo().ActivityPoints -= (Item.PixelsCost * finalAmount);
                Session.GetHabbo().UpdateActivityPointsBalance(true);
            }

            // Item is purchased, now do post-proccessing
            if (Item.IsLimited)
            {
                Item.LimitedSelled++;
                using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
                {
开发者ID:TheNaked,项目名称:Firewind,代码行数:67,代码来源:Catalog.cs

示例4: DeliverItems


//.........这里部分代码省略.........
                    for (int i = 0; i < Amount; i++)
                    {
                        //uint GeneratedId = GenerateItemId();
                        switch (Item.InteractionType)
                        {
                            case InteractionType.pet:

                                //int petType = int.Parse(Item.InteractionType.ToString().Replace("pet", ""));
                                int petType = int.Parse(Item.Name.Substring(Item.Name.IndexOf(' ') + 4));
                                string[] PetData = ExtraData.Split('\n');

                                Pet GeneratedPet = CreatePet(Session.GetHabbo().Id, PetData[0], petType, PetData[1], PetData[2]);

                                Session.GetHabbo().GetInventoryComponent().AddPet(GeneratedPet);
                                result.Add(Session.GetHabbo().GetInventoryComponent().AddNewItem(0, 320, new StringData("0"), 0, true, false, 0));

                                break;

                            case InteractionType.teleport:

                                UserItem one = Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, new StringData("0"), 0, true, false, 0);
                                uint idOne = one.Id;
                                UserItem two = Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, new StringData("0"), 0, true, false, 0);
                                uint idTwo = two.Id;
                                result.Add(one);
                                result.Add(two);

                                using (IQueryAdapter dbClient = FirewindEnvironment.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:

                                UserItem it = Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, new StringData(ExtraData), 0, true, false, 0);
                                uint id = it.Id;
                                result.Add(it);
                                using (IQueryAdapter dbClient = FirewindEnvironment.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:
                                {
                                    result.Add(Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, new StringData(songID.ToString()), 0, true, false, songID));
                                    break;
                                }
                            case InteractionType.mannequin:
                                MapStuffData data = new MapStuffData();
                                data.Data.Add("OUTFIT_NAME", "");
                                data.Data.Add("FIGURE", "hr-515-33.hd-600-1.ch-635-70.lg-716-66-62.sh-735-68");
                                data.Data.Add("GENDER", "M");

                                result.Add(Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, data, 0, true, false, songID));
                                break;

                            case InteractionType.guildgeneric:
                            case InteractionType.guilddoor:
                                StringArrayStuffData stringData = new StringArrayStuffData();
                                stringData.Data.Add(""); // furniture state
                                stringData.Data.Add("1"); // guild id
                                stringData.Data.Add(""); // badge string
                                stringData.Data.Add("FFFFFF"); // COLOR_1_STUFFDATA
                                stringData.Data.Add("FFFFFF"); // COLOR_2_STUFFDATA

                                result.Add(Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, stringData, 0, true, false, songID));
                                break;

                            default:

                                result.Add(Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, new StringData(ExtraData), 0, true, false, songID));
                                break;
                        }
                    }
                    return result;

                case "e":

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

                    return result;

                case "r": // Rentable bot

                    return result;

                default:

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

示例5: CreateRoom

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

            if (!roomModels.ContainsKey(Model))
            {
                Session.SendNotif(LanguageLocale.GetValue("room.modelmissing"));
                return null;
            }

            if (((RoomModel)roomModels[Model]).ClubOnly && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip"))
            {
                Session.SendNotif(LanguageLocale.GetValue("room.missingclub"));
                return null;
            }

            if (Name.Length < 3)
            {
                Session.SendNotif(LanguageLocale.GetValue("room.namelengthshort"));
                return null;
            }

            UInt32 RoomId = 0;

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("INSERT INTO rooms (caption,owner,model_name) VALUES (@caption,@username,@model)");
                dbClient.addParameter("caption", Name);
                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:Kristopher-RZ,项目名称:Firewind,代码行数:40,代码来源:RoomManager.cs

示例6: KickUser

        internal static void KickUser(GameClient ModSession, uint UserId, String Message, Boolean Soft)
        {
            GameClient Client = FirewindEnvironment.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 = FirewindEnvironment.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 = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.runFastQuery("UPDATE user_info SET cautions = cautions + 1 WHERE user_id = " + UserId + "");
                }
            }
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:35,代码来源:ModerationTool.cs

示例7: 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);
                    ((StringData)Item.data).Data = room.MoodlightData.GenerateExtraData();
                }
            }

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

            ServerMessage Message = new ServerMessage(Outgoing.AddWallItemToRoom);
            Item.Serialize(Message, room.OwnerId);
            Message.AppendString(room.Owner); // TODO
            room.SendMessage(Message);

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

示例8: 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;
                }
                /*else if (mFloorItems.ContainsKey(Item.Id) && Item.MagicRemove)
                {
                    RemoveFurniture(Session, Item.Id);
                    if (mFloorItems.ContainsKey(Item.Id))
                    {
                        Logging.WriteLine("lul?");
                        mFloorItems.Remove(Item.Id);
                    }
                }*/

                //using (DatabaseClient dbClient = FirewindEnvironment.GetDatabase().GetClient())
                //{
                //    dbClient.addParameter("extra_data", ((StringData)Item.data).Data);
                //    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);
开发者ID:TheNaked,项目名称:Firewind,代码行数:67,代码来源:RoomItemHandling.cs


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