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


C# ServerMessage.GetReversedBytes方法代码示例

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


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

示例1: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            Room room = session.GetHabbo().CurrentRoom;

            using (IQueryAdapter commitableQueryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                commitableQueryReactor.RunFastQuery(
                    $"UPDATE rooms_data SET roomtype = 'public' WHERE id = {room.RoomId}");

            uint roomId = session.GetHabbo().CurrentRoom.RoomId;
            List<RoomUser> users = new List<RoomUser>(session.GetHabbo().CurrentRoom.GetRoomUserManager().UserList.Values);

            Yupi.GetGame().GetRoomManager().UnloadRoom(session.GetHabbo().CurrentRoom, "Unload command");

            Yupi.GetGame().GetRoomManager().LoadRoom(roomId);

            ServerMessage roomFwd = new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer"));
            roomFwd.AppendInteger(roomId);

            byte[] data = roomFwd.GetReversedBytes();

            foreach (RoomUser user in users.Where(user => user != null && user.GetClient() != null))
                user.GetClient().SendMessage(data);

            return true;
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:25,代码来源:MakePublic.cs

示例2: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            uint roomId = session.GetHabbo().CurrentRoom.RoomId;
            List<RoomUser> users = new List<RoomUser>(session.GetHabbo().CurrentRoom.GetRoomUserManager().UserList.Values);

            Yupi.GetGame().GetRoomManager().UnloadRoom(session.GetHabbo().CurrentRoom, "Unload command");

            if (!_reEnter)
                return true;
            Yupi.GetGame().GetRoomManager().LoadRoom(roomId);

            ServerMessage roomFwd = new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer"));
            roomFwd.AppendInteger(roomId);

            byte[] data = roomFwd.GetReversedBytes();

            foreach (RoomUser user in users.Where(user => user != null && user.GetClient() != null))
                user.GetClient().SendMessage(data);
            return true;
        }
开发者ID:sgf,项目名称:Yupi,代码行数:20,代码来源:Unload.cs

示例3: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            Room room = session.GetHabbo().CurrentRoom;

            RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(pms[0]);
            if (user == null)
            {
                session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
                return true;
            }

            string gender = user.GetClient().GetHabbo().Gender;
            string look = user.GetClient().GetHabbo().Look;
            session.GetHabbo().Gender = gender;
            session.GetHabbo().Look = look;
            using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
            {
                adapter.SetQuery(
                    "UPDATE users SET gender = @gender, look = @look WHERE id = " + session.GetHabbo().Id);
                adapter.AddParameter("gender", gender);
                adapter.AddParameter("look", look);
                adapter.RunQuery();
            }

            RoomUser myUser = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().UserName);
            if (myUser == null) return true;

            ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserDataMessageComposer"));
            message.AppendInteger(myUser.VirtualId);
            message.AppendString(session.GetHabbo().Look);
            message.AppendString(session.GetHabbo().Gender.ToLower());
            message.AppendString(session.GetHabbo().Motto);
            message.AppendInteger(session.GetHabbo().AchievementPoints);
            room.SendMessage(message.GetReversedBytes());

            return true;
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:37,代码来源:CopyLook.cs

示例4: QueueBroadcaseMessage

 /// <summary>
 ///     Queues the broadcase message.
 /// </summary>
 /// <param name="message">The message.</param>
 internal void QueueBroadcaseMessage(ServerMessage message)
 {
     _broadcastQueue.Enqueue(message.GetReversedBytes());
 }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:8,代码来源:GameClientManager.cs

示例5: ModAlert

        /// <summary>
        ///     Mods the alert.
        /// </summary>
        /// <param name="message">The message.</param>
        internal void ModAlert(ServerMessage message)
        {
            byte[] bytes = message.GetReversedBytes();

            foreach (
                GameClient current in
                    Clients.Values.Where(current => current?.GetHabbo() != null)
                        .Where(
                            current =>
                                current.GetHabbo().Rank == 4u || current.GetHabbo().Rank == 5u ||
                                current.GetHabbo().Rank == 6u))
                current.GetConnection().SendData(bytes);
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:17,代码来源:GameClientManager.cs

示例6: SendMessage

        /// <summary>
        ///     Sends the message.
        /// </summary>
        /// <param name="message">The message.</param>
        internal void SendMessage(ServerMessage message)
        {
            if (message == null)
                return;

            if (GetConnection() == null)
                return;

            byte[] bytes = message.GetReversedBytes();

            GetConnection().SendData(bytes);
        }
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:16,代码来源:GameClient.cs

示例7: GetBytesNotif

        /// <summary>
        ///     Gets the bytes notif.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="title">The title.</param>
        /// <param name="picture">The picture.</param>
        /// <returns>System.Byte[].</returns>
        public static byte[] GetBytesNotif(string message, string title = "Aviso", string picture = "")
        {
            using (
                ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"))
                )
            {
                serverMessage.AppendString(picture);
                serverMessage.AppendInteger(4);
                serverMessage.AppendString("title");
                serverMessage.AppendString(title);
                serverMessage.AppendString("message");
                serverMessage.AppendString(message);
                serverMessage.AppendString("linkUrl");
                serverMessage.AppendString("event:");
                serverMessage.AppendString("linkTitle");
                serverMessage.AppendString("ok");

                return serverMessage.GetReversedBytes();
            }
        }
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:27,代码来源:GameClient.cs

示例8: AppendResponse

 /// <summary>
 ///     Appends the response.
 /// </summary>
 /// <param name="message">The message.</param>
 internal void AppendResponse(ServerMessage message)
 {
     AppendBytes(message.GetReversedBytes());
 }
开发者ID:weslley17w,项目名称:Yupi,代码行数:8,代码来源:QueuedServerMessage.cs

示例9: SendMessageToUsersWithRights

        /// <summary>
        ///     Sends the message to users with rights.
        /// </summary>
        /// <param name="message">The message.</param>
        internal void SendMessageToUsersWithRights(ServerMessage message)
        {
            byte[] messagebytes = message.GetReversedBytes();

            try
            {
                foreach (RoomUser unit in _roomUserManager.UserList.Values)
                {
                    RoomUser user = unit;
                    if (user == null)
                        continue;

                    if (user.IsBot)
                        continue;

                    GameClient usersClient = user.GetClient();
                    if (usersClient == null || usersClient.GetConnection() == null)
                        continue;

                    if (!CheckRights(usersClient))
                        continue;

                    usersClient.GetConnection().SendData(messagebytes);
                }
            }
            catch (Exception e)
            {
                ServerLogManager.LogException(e, "Yupi.Game.Rooms.Room.SendMessageToUsersWithRights");
            }
        }
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:34,代码来源:Room.cs

示例10: SendMessage

 /// <summary>
 ///     Sends the message.
 /// </summary>
 /// <param name="message">The message.</param>
 internal void SendMessage(ServerMessage message)
 {
     if (message != null)
         SendMessage(message.GetReversedBytes());
 }
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:9,代码来源:Room.cs

示例11: BroadcastChatMessage

        /// <summary>
        ///     Broadcasts the chat message.
        /// </summary>
        /// <param name="chatMsg">The chat MSG.</param>
        /// <param name="roomUser">The room user.</param>
        /// <param name="p">The p.</param>
        internal void BroadcastChatMessage(ServerMessage chatMsg, RoomUser roomUser, uint p)
        {
            try
            {
                byte[] packetData = chatMsg.GetReversedBytes();

                foreach (RoomUser user in _roomUserManager.UserList.Values)
                {
                    if (user.IsBot || user.IsPet)
                        continue;

                    GameClient usersClient = user.GetClient();
                    if (usersClient == null || roomUser == null || usersClient.GetHabbo() == null)
                        continue;

                    try
                    {
                        if (user.OnCampingTent || !roomUser.OnCampingTent)
                        {
                            if (!usersClient.GetHabbo().MutedUsers.Contains(p))
                                usersClient.SendMessage(packetData);
                        }
                    }
                    catch (Exception e)
                    {
                        ServerLogManager.LogException(e, "Yupi.Game.Rooms.Room.SendMessageToUsersWithRights");
                    }
                }
            }
            catch (Exception e)
            {
                ServerLogManager.LogException(e, "Yupi.Game.Rooms.Room.SendMessageToUsersWithRights");
            }
        }
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:40,代码来源:Room.cs


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