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


C# ServerMessage.GetReversedBytes方法代码示例

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


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

示例1: Execute

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

            var user = room.GetRoomUserManager().GetRoomUserByHabbo(pms[0]);
            if (user == null)
            {
                session.SendWhisper(TextManager.GetText("user_not_found"));
            }

            var gender = user.GetClient().GetHabbo().Gender;
            var look = user.GetClient().GetHabbo().Look;
            session.GetHabbo().Gender = gender;
            session.GetHabbo().Look = look;
            using (var adapter = AzureEmulator.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();
            }

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

            var 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());
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:35,代码来源:CopyLook.cs

示例2: Execute

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

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

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

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

            var data = roomFwd.GetReversedBytes();

            foreach (var user in users.Where(user => user != null && user.GetClient() != null)) user.GetClient().SendMessage(data);
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:17,代码来源:Unload.cs

示例3: Execute

        public override bool Execute(GameClient session, string[] pms)
        {
            var room = session.GetHabbo().CurrentRoom;
            using (var queryReactor = Azure.GetDatabaseManager().GetQueryReactor())
                queryReactor.RunFastQuery(string.Format("UPDATE rooms_data SET roomtype = 'public' WHERE id = {0}",
                    room.RoomId));
            var roomId = session.GetHabbo().CurrentRoom.RoomId;
            var users = new List<RoomUser>(session.GetHabbo().CurrentRoom.GetRoomUserManager().UserList.Values);

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

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

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

            var data = roomFwd.GetReversedBytes();

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

            return true;
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:23,代码来源:MakePublic.cs

示例4: AppendResponse

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

示例5: QueueBroadcaseMessage

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

示例6: ModAlert

 /// <summary>
 /// Mods the alert.
 /// </summary>
 /// <param name="message">The message.</param>
 internal void ModAlert(ServerMessage message)
 {
     var bytes = message.GetReversedBytes();
     foreach (
         var current in
             Clients.Values.Where(current => current != null && current.GetHabbo() != null))
     {
         if (current.GetHabbo().Rank != 4u && current.GetHabbo().Rank != 5u)
             if (current.GetHabbo().Rank != 6u)
                 continue;
         try
         {
             current.GetConnection().SendData(bytes);
         }
         catch
         {
         }
     }
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:23,代码来源:GameClientManager.cs

示例7: Load

        /// <summary>
        /// Loads this instance.
        /// </summary>
        public static void Load()
        {
            Cache.Clear();

            var message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
            message.AppendString("furni_placement_error");
            message.AppendInteger(1);
            message.AppendString("message");
            message.AppendString("${room.error.cant_set_item}");
            Cache.Add(StaticMessage.ErrorCantSetItem, message.GetReversedBytes());

            message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
            message.AppendString("furni_placement_error");
            message.AppendInteger(1);
            message.AppendString("message");
            message.AppendString("${room.error.cant_set_not_owner}");
            Cache.Add(StaticMessage.ErrorCantSetNotOwner, message.GetReversedBytes());

            message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
            message.AppendString("game_promo_small");
            message.AppendInteger(4);
            message.AppendString("title");
            message.AppendString("${generic.notice}");
            message.AppendString("message");
            message.AppendString("Now, the commands page opens in a different way");
            message.AppendString("linkUrl");
            message.AppendString("event:habbopages/chat/newway");
            message.AppendString("linkTitle");
            message.AppendString("${mod.alert.link}");
            Cache.Add(StaticMessage.NewWayToOpenCommandsList, message.GetReversedBytes());

            message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
            message.AppendString(string.Empty);
            message.AppendInteger(4);
            message.AppendString("title");
            message.AppendString("${generic.notice}");
            message.AppendString("message");
            message.AppendString("${catalog.gift_wrapping.receiver_not_found.title}");
            message.AppendString("linkUrl");
            message.AppendString("event:");
            message.AppendString("linkTitle");
            message.AppendString("ok");
            Cache.Add(StaticMessage.UserNotFound, message.GetReversedBytes());

            message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
            message.AppendString(string.Empty);
            message.AppendInteger(4);
            message.AppendString("title");
            message.AppendString("${generic.notice}");
            message.AppendString("message");
            message.AppendString("Has superado el máximo de furnis en el inventario. Solo se te mostrarán 2800 furnis, si quieres ver los restantes, coloca algunos furnis en tus salas.");
            message.AppendString("linkUrl");
            message.AppendString("event:");
            message.AppendString("linkTitle");
            message.AppendString("ok");
            Cache.Add(StaticMessage.AdviceMaxItems, message.GetReversedBytes());

            message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
            message.AppendString(string.Empty);
            message.AppendInteger(4);
            message.AppendString("title");
            message.AppendString("${generic.notice}");
            message.AppendString("message");
            message.AppendString("Has superado el máximo de furnis en el inventario. No puedes comprar más hasta que te desagas de algunos furnis.");
            message.AppendString("linkUrl");
            message.AppendString("event:");
            message.AppendString("linkTitle");
            message.AppendString("ok");
            Cache.Add(StaticMessage.AdvicePurchaseMaxItems, message.GetReversedBytes());

            message = new ServerMessage(LibraryParser.OutgoingRequest("CatalogueOfferConfigMessageComposer"));
            message.AppendInteger(100);// purchase_limit
            message.AppendInteger(6);// offer_multiplier
            message.AppendInteger(2);// free_objets_per_multiplier
            message.AppendInteger(1);// inversed_credit_reduction
            message.AppendInteger(2); // array count
            message.AppendInteger(40);
            message.AppendInteger(99);
            Cache.Add(StaticMessage.CatalogOffersConfiguration, message.GetReversedBytes());

            message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
            message.AppendString(string.Empty);
            message.AppendInteger(4);
            message.AppendString("title");
            message.AppendString("${notification.figureset.redeemed.success.title}");
            message.AppendString("message");
            message.AppendString("${notification.figureset.redeemed.success.message}");
            message.AppendString("linkUrl");
            message.AppendString("event:avatareditor/open");
            message.AppendString("linkTitle");
            message.AppendString("${notification.figureset.redeemed.success.linkTitle}");
            Cache.Add(StaticMessage.FiguresetRedeemed, message.GetReversedBytes());

            message.Dispose();
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:98,代码来源:StaticMessages.cs

示例8: ModAlert

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

            foreach (var 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:kessiler,项目名称:azureEmulator,代码行数:11,代码来源:GameClientManager.cs

示例9: 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;

            var bytes = message.GetReversedBytes();

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

示例10: 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 (var 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:kessiler,项目名称:azureEmulator,代码行数:25,代码来源:GameClient.cs

示例11: SendMessageToUsersWithRights

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

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

                    if (user.IsBot)
                        continue;

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

                    if (!CheckRights(usersClient))
                        continue;

                    usersClient.GetConnection().SendData(messagebytes);
                }
            }
            catch (Exception e)
            {
                Logging.HandleException(e, "SendMessageToUsersWithRights");
            }
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:34,代码来源:Room.cs

示例12: SendMessage

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

示例13: 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
            {
                var packetData = chatMsg.GetReversedBytes();

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

                    var 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)
                    {
                        Logging.HandleException(e, "Room.SendMessageToUsersWithRights");
                    }
                }
            }
            catch (Exception e)
            {
                Logging.HandleException(e, "Room.SendMessageToUsersWithRights");
            }
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:40,代码来源:Room.cs


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