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


C# ServerMessage.AppendStringWithBreak方法代码示例

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


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

示例1: hotelalert

        internal void hotelalert()
        {
            string Notice = GetInput(Params).Substring(4);
            ServerMessage HotelAlert = new ServerMessage(Outgoing.BroadcastMessage);
            HotelAlert.AppendStringWithBreak(LanguageLocale.GetValue("hotelallert.notice") + "\r\n" +
            Notice + "\r\n" + "- " + Session.GetHabbo().Username);
            FirewindEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(HotelAlert);
            FirewindEnvironment.GetGame().GetModerationTool().LogStaffEntry(Session.GetHabbo().Username, string.Empty, "HotelAlert", "Hotel alert [" + Notice + "]");

            //FirewindEnvironment.messagingBot.SendMassMessage(new PublicMessage(string.Format("[{0}] => [{1}]", Session.GetHabbo().Username, Notice)), true);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:11,代码来源:ChatCommandHandler.cs

示例2: linkAlert

        internal void linkAlert()
        {
            Room TargetRoom = Session.GetHabbo().CurrentRoom;
            // Hotel Alert pluss link :hal <link> <message>
            string Link = Params[1];

            string Message = MergeParams(Params, 2);

            ServerMessage nMessage = new ServerMessage(Outgoing.SendNotif);
            nMessage.AppendStringWithBreak(LanguageLocale.GetValue("hotelallert.notice") + "\r\n" + Message + "\r\n-" + Session.GetHabbo().Username);
            nMessage.AppendStringWithBreak(Link);
            FirewindEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(nMessage);

            //FirewindEnvironment.messagingBot.SendMassMessage(new PublicMessage(string.Format("[{0}] => [{1}] + [{2}]", Session.GetHabbo().Username, Link, Message)), true);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:15,代码来源:ChatCommandHandler.cs

示例3: copylook

        internal void copylook()
        {
            string copyTarget = Params[1];
            bool findResult = false;

            string gender = null;
            string figure = null;
            DataRow dRow;
            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("SELECT gender,look FROM users WHERE username = @username");
                dbClient.addParameter("username", copyTarget);
                dRow = dbClient.getRow();

                if (dRow != null)
                {
                    findResult = true;
                    gender = (string)dRow[0];
                    figure = (string)dRow[1];

                    dbClient.setQuery("UPDATE users SET gender = @gender, look = @look WHERE username = @username");
                    dbClient.addParameter("gender", gender);
                    dbClient.addParameter("look", figure);
                    dbClient.addParameter("username", Session.GetHabbo().Username);
                    dbClient.runQuery();
                }
            }

            if (findResult)
            {
                Session.GetHabbo().Gender = gender;
                Session.GetHabbo().Look = figure;
                Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateUserInformation);
                Session.GetMessageHandler().GetResponse().AppendInt32(-1);
                Session.GetMessageHandler().GetResponse().AppendStringWithBreak(Session.GetHabbo().Look);
                Session.GetMessageHandler().GetResponse().AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
                Session.GetMessageHandler().GetResponse().AppendStringWithBreak(Session.GetHabbo().Motto);
                Session.GetMessageHandler().GetResponse().AppendInt32(Session.GetHabbo().AchievementPoints);
                Session.GetMessageHandler().SendResponse();

                if (Session.GetHabbo().InRoom)
                {
                    Room Room = Session.GetHabbo().CurrentRoom;

                    if (Room == null)
                    {
                        return;
                    }

                    RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                    if (User == null)
                    {
                        return;
                    }

                    ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
                    RoomUpdate.AppendInt32(User.VirtualId);
                    RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
                    RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
                    RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
                    RoomUpdate.AppendInt32(Session.GetHabbo().AchievementPoints);
                    Room.SendMessage(RoomUpdate);
                }
            }
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:66,代码来源:ChatCommandHandler.cs

示例4: deleteMission

        internal void deleteMission()
        {
            string TargetUser = Params[1];
            GameClient TargetClient = null;
            Room TargetRoom = Session.GetHabbo().CurrentRoom;

            TargetClient = FirewindEnvironment.GetGame().GetClientManager().GetClientByUsername(TargetUser);

            if (TargetClient == null)
            {
                Session.SendNotif(LanguageLocale.GetValue("input.usernotfound"));
                return;
            }
            if (Session.GetHabbo().Rank <= TargetClient.GetHabbo().Rank)
            {
                Session.SendNotif(LanguageLocale.GetValue("user.notpermitted"));
                return;
            }
            TargetClient.GetHabbo().Motto = LanguageLocale.GetValue("user.unacceptable_motto");
            //TODO update motto

            FirewindEnvironment.GetGame().GetModerationTool().LogStaffEntry(Session.GetHabbo().Username, TargetClient.GetHabbo().Username, "mission removal", "removed mission");

            Room Room = TargetClient.GetHabbo().CurrentRoom;

            if (Room == null)
            {
                return;
            }
            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null)
            {
                return;
            }

            ServerMessage RoomUpdate = new ServerMessage(266);
            RoomUpdate.AppendInt32(User.VirtualId);
            RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
            RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
            RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
            Room.SendMessage(RoomUpdate);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:43,代码来源:ChatCommandHandler.cs

示例5: FlushSettings

        internal void FlushSettings()
        {
            List<ServerMessage> messages = new List<ServerMessage>();

            lock (GetRoomItemHandler().mFloorItems)
            {
                foreach (RoomItem Item in GetRoomItemHandler().mFloorItems.Values)
                {
                    ServerMessage Message = new ServerMessage(94);
                    Message.AppendRawUInt(Item.Id);
                    Message.AppendStringWithBreak("");
                    Message.AppendBoolean(false);
                    messages.Add(Message);
                }
            }

            lock (GetRoomItemHandler().mWallItems)
            {
                foreach (RoomItem Item in GetRoomItemHandler().mWallItems.Values)
                {
                    ServerMessage Message = new ServerMessage(84);
                    Message.AppendRawUInt(Item.Id);
                    Message.AppendStringWithBreak("");
                    Message.AppendBoolean(false);
                    messages.Add(Message);
                }
            }

            SendMessage(messages);

            mCycleEnded = true;
            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
                GetRoomItemHandler().SaveFurniture(dbClient);

            Tags.Clear();
            UsersWithRights.Clear();
            Bans.Clear();
            ActiveTrades.Clear();

            if (GotFreeze())
                freeze = new Freeze(this);
            if (GotBanzai())
                banzai = new BattleBanzai(this);
            if (GotSoccer())
                soccer = new Soccer(this);
            if (gameItemHandler != null)
                gameItemHandler = new GameItemHandler(this);
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:48,代码来源:Room.cs

示例6: massclothes

 internal void massclothes()
 {
     Room currentRoom = Session.GetHabbo().CurrentRoom;
     if (currentRoom != null)
     {
         if (currentRoom.Owner == Session.GetHabbo().Username && Session.GetHabbo().Rank >= 3)
         {
             List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers();
             foreach (RoomUser user in roomUsers)
             {
                 ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
                 RoomUpdate.AppendInt32(user.VirtualId);
                 RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
                 RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
                 RoomUpdate.AppendStringWithBreak(user.GetClient().GetHabbo().Motto);
                 RoomUpdate.AppendInt32(user.GetClient().GetHabbo().AchievementPoints);
                 currentRoom.SendMessage(RoomUpdate);
             }
         }
     }
 }
开发者ID:TheNaked,项目名称:Firewind,代码行数:21,代码来源:ChatCommandHandler.cs

示例7: OnTrigger

        internal override bool OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            Room Room = Session.GetHabbo().CurrentRoom;
            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            MapStuffData data = (MapStuffData)Item.data;

            string figure = data.Data["FIGURE"];
            string gender = data.Data["GENDER"];

            // We gotta keep our skin and headgear!
            string filteredLook = "";
            string[] sp = Session.GetHabbo().Look.Split('.');
            foreach (string s in sp)
            {
                if ((s.StartsWith("hd") || s.StartsWith("ha") || s.StartsWith("he") || s.StartsWith("fa") || s.StartsWith("ea") || s.StartsWith("hr")))
                {
                    filteredLook += s + ".";
                }
            }
            filteredLook += figure;

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {

                dbClient.setQuery("UPDATE users SET gender = @gender, look = @look WHERE id = @id");
                dbClient.addParameter("id", Session.GetHabbo().Id);
                dbClient.addParameter("gender", gender);
                dbClient.addParameter("look", filteredLook);
                dbClient.runQuery();
            }

            Session.GetHabbo().Look = filteredLook;
            Session.GetHabbo().Gender = gender;

            Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateUserInformation);
            Session.GetMessageHandler().GetResponse().AppendInt32(-1);
            Session.GetMessageHandler().GetResponse().AppendStringWithBreak(Session.GetHabbo().Look);
            Session.GetMessageHandler().GetResponse().AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
            Session.GetMessageHandler().GetResponse().AppendStringWithBreak(Session.GetHabbo().Motto);
            Session.GetMessageHandler().GetResponse().AppendInt32(Session.GetHabbo().AchievementPoints);
            Session.GetMessageHandler().SendResponse();

            ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
            RoomUpdate.AppendInt32(User.VirtualId);
            RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
            RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
            RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
            RoomUpdate.AppendInt32(Session.GetHabbo().AchievementPoints);
            Room.SendMessage(RoomUpdate);

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

示例8: InvokeCommand


//.........这里部分代码省略.........
                                                            Logging.WriteLine("Loaded room count: " + getGame().GetRoomManager().LoadedRoomsCount);
                                                            break;
                                        }

                                    //case "dbconnections":
                                    //    {
                                    //        Logging.WriteLine("Database connection: " + FirewindEnvironment.GetDatabaseManager().getOpenConnectionCount());
                                    //        break;
                                    //    }

                                    case "console":
                                        {
                                            Logging.WriteLine("Press ENTER for disabling console writing");
                                            Logging.DisabledState = false;
                                            break;
                                        }

                                    default:
                                        {
                                            unknownCommand(inputData);
                                            break;
                                        }
                                }

                            }
                            break;
                        }

                    case "alert":
                        {
                            string Notice = inputData.Substring(6);

                            ServerMessage HotelAlert = new ServerMessage(Outgoing.SendNotif);
                            HotelAlert.AppendStringWithBreak(LanguageLocale.GetValue("console.noticefromadmin") + "\n\n" +
                            Notice);
                            HotelAlert.AppendString("");
                            getGame().GetClientManager().QueueBroadcaseMessage(HotelAlert);
                            Logging.WriteLine("[" + Notice + "] sent");

                            //FirewindEnvironment.messagingBot.SendMassMessage(new PublicMessage(string.Format("[@CONSOLE] => [{0}]", Notice)), true);

                            break;
                        }

                    case "broadcastalert":
                        {
                            string Notice = inputData.Substring(15);

                            ServerMessage HotelAlert = new ServerMessage(Outgoing.BroadcastMessage);
                            HotelAlert.AppendStringWithBreak(LanguageLocale.GetValue("console.noticefromadmin") + "\n\n" +
                            Notice);
                            HotelAlert.AppendString("");
                            getGame().GetClientManager().QueueBroadcaseMessage(HotelAlert);
                            Logging.WriteLine("[" + Notice + "] sent");

                            //FirewindEnvironment.messagingBot.SendMassMessage(new PublicMessage(string.Format("[@CONSOLE] => [{0}]", Notice)), true);

                            break;
                        }

                    //case "ddos":
                    //case "setddosprotection":
                    //    {
                    //        if (parameters.Length < 2)
                    //            Logging.WriteLine("You need to specify a parameter within your command. Type help for more information");
                    //        else
开发者ID:TheNaked,项目名称:Firewind,代码行数:67,代码来源:ConsoleCommandHandling.cs

示例9: UpdateUserStatus


//.........这里部分代码省略.........
                            {
                                if (cyclegameitems)
                                {
                                    if (User.team != Item.team)
                                        User.team = Item.team;

                                    else if (User.team == Item.team)
                                        User.team = Team.none;

                                    if (!string.IsNullOrEmpty(Item.Figure))
                                    {
                                        //User = GetUserForSquare(Item.Coordinate.X, Item.Coordinate.Y);
                                        if (User != null && !User.IsBot)
                                        {
                                            if (User.Coordinate == Item.Coordinate)
                                            {
                                                if (User.GetClient().GetHabbo().Gender != Item.Gender && User.GetClient().GetHabbo().Look != Item.Figure)
                                                {

                                                    User.GetClient().GetHabbo().tempGender = User.GetClient().GetHabbo().Gender;
                                                    User.GetClient().GetHabbo().tempLook = User.GetClient().GetHabbo().Look;

                                                    User.GetClient().GetHabbo().Gender = Item.Gender;
                                                    User.GetClient().GetHabbo().Look = Item.Figure;
                                                }
                                                else
                                                {
                                                    User.GetClient().GetHabbo().Gender = User.GetClient().GetHabbo().tempGender;
                                                    User.GetClient().GetHabbo().Look = User.GetClient().GetHabbo().tempLook;
                                                }

                                                ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
                                                RoomUpdate.AppendInt32(User.VirtualId);
                                                RoomUpdate.AppendStringWithBreak(User.GetClient().GetHabbo().Look);
                                                RoomUpdate.AppendStringWithBreak(User.GetClient().GetHabbo().Gender.ToLower());
                                                RoomUpdate.AppendStringWithBreak(User.GetClient().GetHabbo().Motto);
                                                RoomUpdate.AppendInt32(User.GetClient().GetHabbo().AchievementPoints);
                                                room.SendMessage(RoomUpdate);
                                            }
                                        }
                                    }
                                }

                                break;
                            }

                        //33: Red
                        //34: Green
                        //35: Blue
                        //36: Yellow

                        case InteractionType.banzaigategreen:
                        case InteractionType.banzaigateblue:
                        case InteractionType.banzaigatered:
                        case InteractionType.banzaigateyellow:
                            {
                                if (cyclegameitems)
                                {
                                    int effectID = (int)Item.team + 32;
                                    TeamManager t = User.GetClient().GetHabbo().CurrentRoom.GetTeamManagerForBanzai();
                                    AvatarEffectsInventoryComponent efectmanager = User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent();

                                    if (User.team != Item.team)
                                    {
                                        if (t.CanEnterOnTeam(Item.team))
                                        {
开发者ID:TheNaked,项目名称:Firewind,代码行数:67,代码来源:RoomUserManager.cs

示例10: SerializePage

        internal static ServerMessage SerializePage(CatalogPage Page)
        {
            ServerMessage PageData = new ServerMessage(Outgoing.OpenShopPage);
            PageData.AppendInt32(Page.PageId);

            switch (Page.Layout)
            {
                case "frontpage":

                    PageData.AppendString("frontpage3");
                    PageData.AppendInt32(2);
                    //for (int i = 0; i < 3; i++)
                    //{
                    //    PageData.AppendString("catalog_club_headline1");
                    //}
                    //PageData.AppendInt32(7);
                    //for (int i = 0; i < 7; i++)
                    //{
                    //    PageData.AppendString("#FEFEFE");
                    //}
                    PageData.AppendString("Bundles_ts");
                    PageData.AppendString("");
                    PageData.AppendInt32(11);
                    PageData.AppendString("");
                    PageData.AppendString("");
                    PageData.AppendString("");
                    PageData.AppendString("How to get Habbo Credits");
                    PageData.AppendString("You can get Habbo Credits via Prepaid Cards, Home Phone, Credit Card, Mobile, completing offers and more! " + Convert.ToChar(13) + Convert.ToChar(10) + Convert.ToChar(13) + Convert.ToChar(10) + "To redeem your Habbo Credits, enter your voucher code below.");
                    PageData.AppendString(Page.TextDetails);
                    PageData.AppendString("");
                    PageData.AppendString("#FEFEFE");
                    PageData.AppendString("#FEFEFE");
                    PageData.AppendString(LanguageLocale.GetValue("catalog.waystogetcredits"));
                    PageData.AppendString("credits");
                    break;

                case "recycler_info":

                    PageData.AppendString(Page.Layout);
                    PageData.AppendInt32(2);
                    PageData.AppendString(Page.LayoutHeadline);
                    PageData.AppendString(Page.LayoutTeaser);
                    PageData.AppendInt32(3);
                    PageData.AppendString(Page.Text1);
                    PageData.AppendString(Page.Text2);
                    PageData.AppendString(Page.TextDetails);

                    break;

                case "recycler_prizes":

                    // A[email protected]_prizesIcatalog_recycler_headline3IDe Ecotron geeft altijd een van deze beloningen:H
                    PageData.AppendString("recycler_prizes");
                    PageData.AppendInt32(1);
                    PageData.AppendString("catalog_recycler_headline3");
                    PageData.AppendInt32(1);
                    PageData.AppendString(Page.Text1);

                    break;

                case "spaces_new":

                    PageData.AppendString(Page.Layout);
                    PageData.AppendInt32(1);
                    PageData.AppendString(Page.LayoutHeadline);
                    PageData.AppendInt32(1);
                    PageData.AppendString(Page.Text1);

                    break;

                case "recycler":

                    PageData.AppendString(Page.Layout);
                    PageData.AppendInt32(2);
                    PageData.AppendString(Page.LayoutHeadline);
                    PageData.AppendString(Page.LayoutTeaser);
                    PageData.AppendInt32(1);
                    PageData.AppendStringWithBreak(Page.Text1, 10);
                    PageData.AppendString(Page.Text2);
                    PageData.AppendString(Page.TextDetails);

                    break;

                case "trophies":

                    PageData.AppendString("trophies");
                    PageData.AppendInt32(1);
                    PageData.AppendString(Page.LayoutHeadline);
                    PageData.AppendInt32(2);
                    PageData.AppendString(Page.Text1);
                    PageData.AppendString(Page.TextDetails);

                    break;

                case "pets":

                    PageData.AppendString("pets");
                    PageData.AppendInt32(2);
                    PageData.AppendString(Page.LayoutHeadline);
                    PageData.AppendString(Page.LayoutTeaser);
//.........这里部分代码省略.........
开发者ID:TheNaked,项目名称:Firewind,代码行数:101,代码来源:Catalog.cs

示例11: RemoveUserFromRoom

        internal void RemoveUserFromRoom(GameClient Session, Boolean NotifyClient, Boolean NotifyKick)
        {
            try
            {
                if (Session == null)
                    return;

                if (Session.GetHabbo() == null)
                    return;

                Session.GetHabbo().GetAvatarEffectsInventoryComponent().OnRoomExit();

                if (NotifyClient)
                {
                    if (NotifyKick)
                    {
                        Session.GetMessageHandler().GetResponse().Init(Outgoing.GenericError);
                        Session.GetMessageHandler().GetResponse().AppendInt32(4008);
                        Session.GetMessageHandler().SendResponse();
                    }

                    Session.GetMessageHandler().GetResponse().Init(Outgoing.OutOfRoom);
                    Session.GetMessageHandler().SendResponse();
                }

                RoomUser User = GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (User != null)
                {
                    if (User.team != Team.none)
                    {
                        room.GetTeamManagerForBanzai().OnUserLeave(User);
                        room.GetTeamManagerForFreeze().OnUserLeave(User);
                    }
                    if (User.isMounted == true)
                    {
                        User.isMounted = false;
                        RoomUser usuarioVinculado = GetRoomUserByVirtualId((int)User.mountID);
                        if (usuarioVinculado != null)
                        {
                            usuarioVinculado.isMounted = false;
                            usuarioVinculado.mountID = 0;

                        }
                    }

                    if (User.sentadoBol == true || User.acostadoBol == true)
                    {
                        User.sentadoBol = false;
                        User.acostadoBol = false;
                    }

                    RemoveRoomUser(User);

                    if (Session.GetHabbo() != null)
                    {
                        if (!User.IsSpectator)
                        {
                            if (User.CurrentItemEffect != ItemEffectType.None)
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().CurrentEffect = -1;
                            }
                            //UserMatrix[User.X, User.Y] = false;

                            if (Session.GetHabbo() != null)
                            {
                                if (room.HasActiveTrade(Session.GetHabbo().Id))
                                    room.TryStopTrade(Session.GetHabbo().Id);

                                if (Session.GetHabbo().Username == room.Owner)
                                {
                                    if (room.HasOngoingEvent)
                                    {
                                        ServerMessage Message = new ServerMessage(Outgoing.RoomEvent);
                                        Message.AppendStringWithBreak("-1");
                                        room.SendMessage(Message);

                                        FirewindEnvironment.GetGame().GetRoomManager().GetEventManager().QueueRemoveEvent(room.RoomData, room.Event.Category);
                                        room.Event = null;
                                    }
                                }
                                Session.GetHabbo().CurrentRoomId = 0;

                                try
                                {
                                    if (Session.GetHabbo().GetMessenger() != null)
                                        Session.GetHabbo().GetMessenger().OnStatusChanged(true);
                                }
                                catch { }
                            }

                            //DateTime Start = DateTime.Now;
                            //using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
                            //{
                            //    //TimeSpan TimeUsed1 = DateTime.Now - Start;
                            //    //Logging.LogThreadException("Time used on sys part 2: " + TimeUsed1.Seconds + "s, " + TimeUsed1.Milliseconds + "ms", "");

                            //    //if (Session.GetHabbo() != null)
                            //    //    dbClient.runFastQuery("UPDATE user_roomvisits SET exit_timestamp = '" + FirewindEnvironment.GetUnixTimestamp() + "' WHERE room_id = '" + this.Id + "' AND user_id = '" + Id + "' ORDER BY exit_timestamp DESC LIMIT 1");
                            //    //dbClient.runFastQuery("UPDATE rooms SET users_now = " + UsersNow + " WHERE id = " + Id);
//.........这里部分代码省略.........
开发者ID:TheNaked,项目名称:Firewind,代码行数:101,代码来源:RoomUserManager.cs

示例12: ForwardToRoom

        internal void ForwardToRoom(int flatID)
        {
            if (FirewindEnvironment.ShutdownStarted)
            {
                Session.SendNotif(LanguageLocale.GetValue("shutdown.alert"));
                return;
            }

            if (Session.GetHabbo().IsTeleporting && Session.GetHabbo().TeleportingRoomID != flatID)
                return;

            Room room = FirewindEnvironment.GetGame().GetRoomManager().LoadRoom((uint)flatID);
            if (room == null)
            {
                // Don't actually think this message is used anymore
                Response.Init(Outgoing.NoSuchFlat);
                Response.AppendInt32(flatID); // flatId
                SendResponse();
                return;
            }

            ClearRoomLoading();
            if (Session.GetHabbo().InRoom)
            {
                Room oldRoom = FirewindEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                if (oldRoom != null)
                {
                    oldRoom.GetRoomUserManager().RemoveUserFromRoom(Session, false, false);
                    Session.CurrentRoomUserID = -1;
                }
            }
            //QueuedServerMessage response = new QueuedServerMessage(Session.GetConnection());

            if (room.UsersNow >= room.UsersMax && !Session.GetHabbo().HasFuse("fuse_enter_full_rooms"))
            {
                if (!FirewindEnvironment.GetGame().GetRoleManager().RankHasRight(Session.GetHabbo().Rank, "fuse_enter_full_rooms"))
                {
                    // This room is full!!!!
                    Response.Init(Outgoing.RoomErrorToEnter);
                    Response.AppendInt32(1);
                    SendResponse();
                    //response.appendResponse(GetResponse());

                    Response.Init(Outgoing.OutOfRoom);
                    SendResponse();
                    //response.appendResponse(GetResponse());

                    //response.sendResponse();
                    return;
                }
            }

            if (!Session.GetHabbo().HasFuse("fuse_enter_any_room") && room.UserIsBanned(Session.GetHabbo().Id))
            {
                if (room.HasBanExpired(Session.GetHabbo().Id))
                {
                    room.RemoveBan(Session.GetHabbo().Id);
                }
                else
                {
                    // You are banned of this room!
                    Response.Init(Outgoing.RoomErrorToEnter);
                    Response.AppendInt32(4);
                    SendResponse();
                    //response.appendResponse(GetResponse());

                    Response.Init(Outgoing.OutOfRoom);
                    SendResponse();
                    //response.appendResponse(GetResponse());

                    //response.sendResponse();
                    return;
                }
            }

            Session.GetHabbo().LoadingRoom = (uint)flatID;
            CurrentLoadingRoom = room;

            Response.Init(Outgoing.PrepareRoomForUsers);
            SendResponse();
            //response.appendResponse(GetResponse());

            if (!Session.GetHabbo().HasFuse("fuse_enter_any_room") && !room.CheckRights(Session, true) && !Session.GetHabbo().IsTeleporting)
            {
                switch (room.State)
                {
                    case 1:
                        if (room.UserCount == 0)
                        {
                            // Aww nobody in da room!
                            Response.Init(Outgoing.DoorBellNoPerson);
                            SendResponse();
                            //response.appendResponse(GetResponse());
                        }
                        else
                        {
                            // Waiting for answer!
                            Response.Init(Outgoing.Doorbell);
                            Response.AppendStringWithBreak("");
//.........这里部分代码省略.........
开发者ID:TheNaked,项目名称:Firewind,代码行数:101,代码来源:Rooms.cs

示例13: Whisper

        internal void Whisper()
        {
            if (FirewindEnvironment.SystemMute)
                return;

            if (Session == null || Session.GetHabbo() == null)
                return;

            Room Room = Session.GetHabbo().CurrentRoom;

            if (Room == null)
            {
                return;
            }

            if (Session.GetHabbo().Muted)
            {
                Session.SendNotif(LanguageLocale.GetValue("user.ismuted"));
                return;
            }

            if (Room.RoomMuted)
                return;

            TimeSpan SinceLastMessage = DateTime.Now - FloodTime;
            if (SinceLastMessage.Seconds > 4)
                FloodCount = 0;

            if (SinceLastMessage.Seconds < 4 && FloodCount > 5 && Session.GetHabbo().Rank < 5)
            {
                ServerMessage Packet = new ServerMessage(Outgoing.FloodFilter);
                Packet.AppendInt32(30); //Blocked for 30sec
                Session.SendMessage(Packet);
                return;
            }
            FloodTime = DateTime.Now;
            FloodCount++;

            string Params = Request.ReadString();
            string ToUser = Params.Split(' ')[0];
            string Message = Params.Substring(ToUser.Length + 1);

            Message = LanguageLocale.FilterSwearwords(Message);
            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            ServerMessage TellMsg = new ServerMessage();
            TellMsg.Init(Outgoing.Whisp);
            TellMsg.AppendInt32(User.VirtualId);
            TellMsg.AppendStringWithBreak(Message);
            TellMsg.AppendInt32(0);
            TellMsg.AppendInt32(0);
            TellMsg.AppendInt32(-1);

            Session.SendMessage(TellMsg);
            User.Unidle();

            RoomUser User2 = Room.GetRoomUserManager().GetRoomUserByHabbo(ToUser);
            if (ToUser == User.GetUsername() || User2 == null)
                return;

            if (!User2.IsBot)
            {
                if (!User2.GetClient().GetHabbo().MutedUsers.Contains(Session.GetHabbo().Id))
                    User2.GetClient().SendMessage(TellMsg);
            }

            List<RoomUser> ToNotify = Room.GetRoomUserManager().GetRoomUserByRank(6);
            if (ToNotify.Count > 0)
            {
                TellMsg = new ServerMessage();
                TellMsg.Init(Outgoing.Whisp);
                TellMsg.AppendInt32(User.VirtualId);
                TellMsg.AppendStringWithBreak(LanguageLocale.GetValue("moderation.whisper") + ToUser + ": " + Message);
                TellMsg.AppendInt32(0);
                TellMsg.AppendInt32(0);
                TellMsg.AppendInt32(-1);

                foreach (RoomUser user in ToNotify)
                    if (user.HabboId != User2.HabboId && user.HabboId != User.HabboId)
                        user.GetClient().SendMessage(TellMsg);

            }
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:83,代码来源:Rooms.cs

示例14: StopEvent

        internal void StopEvent()
        {
            Room Room = FirewindEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session, true) || Room.Event == null)
            {
                return;
            }

            //Room.Event = null;

            ServerMessage Message = new ServerMessage(Outgoing.RoomEvent);
            Message.AppendStringWithBreak("-1");
            Room.SendMessage(Message);

            FirewindEnvironment.GetGame().GetRoomManager().GetEventManager().QueueRemoveEvent(Room.RoomData, Room.Event.Category);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:17,代码来源:Rooms.cs

示例15: ApplyRoomEffect

        internal void ApplyRoomEffect()
        {
            Room Room = FirewindEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session, true))
            {
                return;
            }

            UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(Request.ReadUInt32());

            if (Item == null)
            {
                return;
            }

            string type = "floor";

            if (Item.GetBaseItem().Name.ToLower().Contains("wallpaper"))
            {
                type = "wallpaper";
            }
            else if (Item.GetBaseItem().Name.ToLower().Contains("landscape"))
            {
                type = "landscape";
            }

            switch (type)
            {
                case "floor":

                    Room.Floor = Item.Data.ToString();
                    Room.RoomData.Floor = Item.Data.ToString();

                    FirewindEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.FURNI_DECORATION_FLOOR);
                    break;

                case "wallpaper":

                    Room.Wallpaper = Item.Data.ToString();
                    Room.RoomData.Wallpaper = Item.Data.ToString();

                    FirewindEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.FURNI_DECORATION_WALL);
                    break;

                case "landscape":

                    Room.Landscape = Item.Data.ToString();
                    Room.RoomData.Landscape = Item.Data.ToString();
                    break;
            }

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("UPDATE rooms SET " + type + " = @extradata WHERE id = " + Room.RoomId);
                dbClient.addParameter("extradata", Item.Data);
                dbClient.runQuery();
            }

            Session.GetHabbo().GetInventoryComponent().RemoveItem(Item.Id, false);

            ServerMessage Message = new ServerMessage(Outgoing.RoomDecoration);
            Message.AppendStringWithBreak(type);
            Message.AppendStringWithBreak(Item.Data.ToString());
            Room.SendMessage(Message);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:66,代码来源:Rooms.cs


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