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


C# ServerMessage.Append方法代码示例

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


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

示例1: SendMassMessage

 internal static void SendMassMessage(string Message)
 {
     try
     {
         ServerMessage HotelAlert = new ServerMessage(808);
         HotelAlert.Append("Important Notice from Hotel Management");
         HotelAlert.Append(Message);
         PiciEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(HotelAlert);
     }
     catch (Exception e) { Logging.HandleException(e, "PiciEnvironment.SendMassMessage"); }
 }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:11,代码来源:PiciEnvironment.cs

示例2: deleteMission

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

            TargetClient = PiciEnvironment.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

            PiciEnvironment.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.Append(User.VirtualId);
            RoomUpdate.Append(Session.GetHabbo().Look);
            RoomUpdate.Append(Session.GetHabbo().Gender.ToLower());
            RoomUpdate.Append(Session.GetHabbo().Motto);
            Room.SendMessage(RoomUpdate);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:43,代码来源:ChatCommandHandler.cs

示例3: 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(161);
            nMessage.Append(LanguageLocale.GetValue("hotelallert.notice") + "\r\n" + Message + "\r\n-" + Session.GetHabbo().Username);
            nMessage.Append(Link);
            PiciEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(nMessage);

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

示例4: roomalert

        internal void roomalert()
        {
            Room TargetRoom = Session.GetHabbo().CurrentRoom;
            TargetRoom = PiciEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (TargetRoom == null)
                return;

            string Msg = MergeParams(Params, 1);

            ServerMessage nMessage = new ServerMessage();
            nMessage.Init(161);
            nMessage.Append(Msg);

            PiciEnvironment.GetGame().GetModerationTool().LogStaffEntry(Session.GetHabbo().Username, string.Empty, "Alert", "Room alert with message [" + Msg + "]");
            TargetRoom.QueueRoomMessage(nMessage);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:17,代码来源:ChatCommandHandler.cs

示例5: commands

 internal void commands()
 {
     ServerMessage nMessage = new ServerMessage();
     nMessage.Init(810);
     nMessage.Append(1);
     nMessage.Append(ChatCommandRegister.GenerateCommandList(Session));
     Session.GetConnection().SendData(nMessage.GetBytes());
 }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:8,代码来源:ChatCommandHandler.cs

示例6: SerializeMusicDiscs

        internal ServerMessage SerializeMusicDiscs()
        {
            ServerMessage Message = new ServerMessage(333);
            Message.Append(discs.Count);

            foreach (UserItem SongDisk in discs.Values)
            {
                uint SongId = 0;
                uint.TryParse(SongDisk.ExtraData, out SongId);

                Message.Append(SongDisk.Id);
                Message.Append(SongId);
            }

            return Message;
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:16,代码来源:InventoryComponent.cs

示例7: processCommand

        internal void processCommand(String data)
        {
            String header = data.Split(Convert.ToChar(1))[0];
            String param = data.Split(Convert.ToChar(1))[1];

            Logging.WriteLine("[MUSConnection.ProcessCommand]: " + data);

            GameClient Client = null;
            switch (header.ToLower())
            {
                case "updatecredits":
                    {
                        if (param == "ALL")
                        {
                         //   PiciEnvironment.GetGame().GetClientManager().GetClient()
                        }
                        else
                        {
                            Client = PiciEnvironment.GetGame().GetClientManager().GetClientByUserID(uint.Parse(param));

                            if (Client == null)
                            {
                                return;
                            }

                            DataRow newCredits;

                            using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
                            {
                                dbClient.setQuery("SELECT credits FROM users WHERE id = @userid");
                                dbClient.addParameter("userid", (int)Client.GetHabbo().Id);
                                newCredits = dbClient.getRow();
                            }

                            Client.GetHabbo().Credits = (int)newCredits["credits"];
                            Client.GetHabbo().UpdateCreditsBalance();
                        }

                        break;
                    }
                case "signout":
                    {
                        PiciEnvironment.GetGame().GetClientManager().GetClientByUserID(uint.Parse(param)).Disconnect();
                        break;
                    }

                case "ha":
                    {
                        //String extradata = data.Split(Convert.ToChar(1))[2];

                        ServerMessage HotelAlert = new ServerMessage(810);
                        HotelAlert.Append(1);
                        HotelAlert.Append(LanguageLocale.GetValue("hotelallert.notice") + "\r\n" +
                        param + "\r\n");

                        /*if (extradata.Contains("://"))
                        {
                            Console.WriteLine("TEST");
                            HotelAlert.Append(extradata);
                        }*/

                        PiciEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(HotelAlert);
                        break;
                    }
                case "useralert":
                    {
                        String extradata = data.Split(Convert.ToChar(1))[2];
                        String url = extradata.Split(Convert.ToChar(1))[0];
                        GameClient TargetClient = null;
                        TargetClient = PiciEnvironment.GetGame().GetClientManager().GetClientByUsername(param);

                        if (TargetClient == null)
                        {
                            return;
                        }
                        if (url.Contains("://"))
                        {
                            extradata = extradata + Convert.ToChar(2) + url;
                        }
                        TargetClient.SendNotif(extradata);
                        break;
                    }

                default:
                    {
                        Logging.WriteLine("Unrecognized MUS packet: " + data);
                        break;
                    }
            }
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:90,代码来源:MusSocket.cs

示例8: ApplyRoomEffect

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

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

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

            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.ExtraData;
                    Room.RoomData.Floor = Item.ExtraData;

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

                case "wallpaper":

                    Room.Wallpaper = Item.ExtraData;
                    Room.RoomData.Wallpaper = Item.ExtraData;

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

                case "landscape":

                    Room.Landscape = Item.ExtraData;
                    Room.RoomData.Landscape = Item.ExtraData;
                    break;
            }

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

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

            ServerMessage Message = new ServerMessage(46);
            Message.Append(type);
            Message.Append(Item.ExtraData);
            Room.SendMessage(Message);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:66,代码来源:Rooms.cs

示例9: ChangeMotto

        internal void ChangeMotto()
        {
            string Motto = PiciEnvironment.FilterInjectionChars(Request.PopFixedString());

            if (Motto == Session.GetHabbo().Motto) // Prevents spam?
            {
                return;
            }

            //if (Motto.Length < 0)
            //{
            //    return; // trying to fk the client :D
            //} Congratulations. The string length can not hold calue < 0. Stupid -_-"

            Session.GetHabbo().Motto = Motto;

            using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("UPDATE users SET motto = @motto WHERE id = '" + Session.GetHabbo().Id + "'");
                dbClient.addParameter("motto", Motto);
                dbClient.runQuery();
            }

            PiciEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.PROFILE_CHANGE_MOTTO);

            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(266);
                RoomUpdate.Append(User.VirtualId);
                RoomUpdate.Append(Session.GetHabbo().Look);
                RoomUpdate.Append(Session.GetHabbo().Gender.ToLower());
                RoomUpdate.Append(Session.GetHabbo().Motto);
                RoomUpdate.Append(Session.GetHabbo().AchievementPoints);
                Room.SendMessage(RoomUpdate);
            }

            PiciEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_Motto", 1);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:52,代码来源:Users.cs

示例10: Dance

        internal void Dance()
        {
            Room Room = PiciEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null)
            {
                return;
            }

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

            if (User == null)
            {
                return;
            }

            User.Unidle();

            int DanceId = Request.PopWiredInt32();

            DanceId = 0;

            if (DanceId > 0 && User.CarryItemID > 0)
            {
                User.CarryItem(0);
            }

            User.DanceId = DanceId;

            ServerMessage DanceMessage = new ServerMessage(480);
            DanceMessage.Append(User.VirtualId);
            DanceMessage.Append(DanceId);
            Room.SendMessage(DanceMessage);

            PiciEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.SOCIAL_DANCE);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:36,代码来源:Rooms.cs

示例11: GiveRespect

        internal void GiveRespect()
        {
            Room Room = PiciEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || Session.GetHabbo().DailyRespectPoints <= 0)
            {
                return;
            }

            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Request.PopWiredUInt());

            if (User == null || User.GetClient().GetHabbo().Id == Session.GetHabbo().Id || User.IsBot)
            {
                return;
            }

            PiciEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.SOCIAL_RESPECT);

            PiciEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_RespectEarned", 1);
            PiciEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(User.GetClient(), "ACH_RespectGiven", 1);

            Session.GetHabbo().DailyRespectPoints--;
            User.GetClient().GetHabbo().Respect++;

            using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("UPDATE users SET respect = respect + 1 WHERE id = " + User.GetClient().GetHabbo().Id);
                dbClient.runFastQuery("UPDATE users SET daily_respect_points = daily_respect_points - 1 WHERE id = " + Session.GetHabbo().Id);
            }

            // FxkqUzYP_
            ServerMessage Message = new ServerMessage(440);
            Message.Append(User.GetClient().GetHabbo().Id);
            Message.Append(User.GetClient().GetHabbo().Respect);
            Room.SendMessage(Message);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:36,代码来源:Rooms.cs

示例12: Whisper

        internal void Whisper()
        {
            if (PiciEnvironment.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;

            string Params = PiciEnvironment.FilterInjectionChars(Request.PopFixedString());
            string ToUser = Params.Split(' ')[0];
            string Message = Params.Substring(ToUser.Length + 1);
            Message = LanguageLocale.FilterSwearwords(Message);
            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            RoomUser User2 = Room.GetRoomUserManager().GetRoomUserByHabbo(ToUser);

            ServerMessage TellMsg = new ServerMessage();
            TellMsg.Init(25);
            TellMsg.Append(User.VirtualId);
            TellMsg.Append(Message);
            TellMsg.AppendBoolean(false);

            if (User != null && !User.IsBot)
            {
                User.GetClient().SendMessage(TellMsg);
            }

            User.Unidle();

            if (User2 != null && !User2.IsBot)
            {
                if (!User2.GetClient().GetHabbo().MutedUsers.Contains(Session.GetHabbo().Id))
                    User2.GetClient().SendMessage(TellMsg);
            }
            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(27);
                Packet.Append(30); //Blocked for 30sec
                User.GetClient().SendMessage(Packet);
                return;
            }
            FloodTime = DateTime.Now;
            FloodCount++;

            List<RoomUser> ToNotify = Room.GetRoomUserManager().GetRoomUserByRank(4);
            if (ToNotify.Count > 0)
            {
                ServerMessage NotifyMessage = new ServerMessage();
                NotifyMessage.Init(25);
                NotifyMessage.Append(User.VirtualId);
                NotifyMessage.Append(LanguageLocale.GetValue("moderation.whisper") + ToUser + ": " + Message);
                NotifyMessage.AppendBoolean(false);

                foreach (RoomUser user in ToNotify)
                    if (user != null)
                        if (user.HabboId != User2.HabboId && user.HabboId != User.HabboId)
                            if (user.GetClient() != null)
                                user.GetClient().SendMessage(NotifyMessage);
            }
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:79,代码来源:Rooms.cs

示例13: Wave

        internal void Wave()
        {
            Room Room = PiciEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null)
            {
                return;
            }

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

            if (User == null)
            {
                return;
            }

            User.Unidle();

            User.DanceId = 0;

            ServerMessage Message = new ServerMessage(481);
            Message.Append(User.VirtualId);
            Room.SendMessage(Message);

            PiciEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.SOCIAL_WAVE);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:26,代码来源:Rooms.cs

示例14: StopTyping

        internal void StopTyping()
        {
            Room Room = PiciEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null)
            {
                return;
            }

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

            if (User == null)
            {
                return;
            }

            ServerMessage Message = new ServerMessage(361);
            Message.Append(User.VirtualId);
            Message.AppendBoolean(false);
            Room.SendMessage(Message);
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:21,代码来源:Rooms.cs

示例15: StopEvent

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

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

            //Room.Event = null;

            ServerMessage Message = new ServerMessage(370);
            Message.Append("-1");
            Room.SendMessage(Message);

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


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