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


C# ServerMessage.AppendBool方法代码示例

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


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

示例1: GetPetBreeds

        public void GetPetBreeds()
        {
            string type = Request.GetString();

            string petType = PetTypeManager.GetPetTypeByHabboPetType(type);

            uint petId = PetTypeManager.GetPetRaceByItemName(petType);

            List<PetRace> races = PetTypeManager.GetRacesByPetType(petType);

            ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("SellablePetBreedsMessageComposer"));

            message.AppendString(type);
            message.AppendInteger(races.Count);

            foreach (PetRace current in races)
            {
                message.AppendInteger(petId);
                message.AppendInteger(current.ColorOne);
                message.AppendInteger(current.ColorTwo);
                message.AppendBool(current.HasColorOne);
                message.AppendBool(current.HasColorTwo);
            }

            Session.SendMessage(message);
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:26,代码来源:Rooms.cs

示例2: OpenQuests

 /// <summary>
 ///     Opens the quests.
 /// </summary>
 public void OpenQuests()
 {
     ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("QuestListMessageComposer"));
     serverMessage.AppendInteger(0);
     serverMessage.AppendBool(Request != null);
     Session.SendMessage(serverMessage);
 }
开发者ID:weslley17w,项目名称:Yupi,代码行数:10,代码来源:Users.cs

示例3: GetPetBreeds

 public void GetPetBreeds()
 {
     var type = Request.GetString();
     string petType;
     var petId = PetRace.GetPetId(type, out petType);
     var races = PetRace.GetRacesForRaceId(petId);
     var message = new ServerMessage(LibraryParser.OutgoingRequest("SellablePetBreedsMessageComposer"));
     message.AppendString(petType);
     message.AppendInteger(races.Count);
     foreach (var current in races)
     {
         message.AppendInteger(petId);
         message.AppendInteger(current.Color1);
         message.AppendInteger(current.Color2);
         message.AppendBool(current.Has1Color);
         message.AppendBool(current.Has2Color);
     }
     Session.SendMessage(message);
 }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:19,代码来源:Rooms.cs

示例4: CallGuide

        /// <summary>
        ///     Calls the guide.
        /// </summary>
        internal void CallGuide()
        {
            Request.GetBool();

            int userId = Request.GetIntegerFromString();
            string message = Request.GetString();

            GuideManager guideManager = Yupi.GetGame().GetGuideManager();

            if (guideManager.GuidesCount <= 0)
            {
                Response.Init(LibraryParser.OutgoingRequest("OnGuideSessionError"));
                Response.AppendInteger(0);
                SendResponse();
                return;
            }

            GameClient guide = guideManager.GetRandomGuide();

            if (guide == null)
            {
                Response.Init(LibraryParser.OutgoingRequest("OnGuideSessionError"));
                Response.AppendInteger(0);
                SendResponse();
                return;
            }

            ServerMessage onGuideSessionAttached =
                new ServerMessage(LibraryParser.OutgoingRequest("OnGuideSessionAttachedMessageComposer"));
            onGuideSessionAttached.AppendBool(false);
            onGuideSessionAttached.AppendInteger(userId);
            onGuideSessionAttached.AppendString(message);
            onGuideSessionAttached.AppendInteger(30);
            Session.SendMessage(onGuideSessionAttached);

            ServerMessage onGuideSessionAttached2 =
                new ServerMessage(LibraryParser.OutgoingRequest("OnGuideSessionAttachedMessageComposer"));
            onGuideSessionAttached2.AppendBool(true);
            onGuideSessionAttached2.AppendInteger(userId);
            onGuideSessionAttached2.AppendString(message);
            onGuideSessionAttached2.AppendInteger(15);
            guide.SendMessage(onGuideSessionAttached2);
            guide.GetHabbo().GuideOtherUser = Session;
            Session.GetHabbo().GuideOtherUser = guide;
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:48,代码来源:Guides.cs

示例5: AddSaddle


//.........这里部分代码省略.........
                        case 15:
                            num3 = 69;
                            break;

                        case 16:
                            num3 = 73;
                            break;
                    }
                    pet.PetData.Race = num3.ToString();
                    using (
                        var queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
                    {
                        queryReactor.RunFastQuery("UPDATE pets_data SET race = '" + pet.PetData.Race + "' WHERE id = " + pet.PetData.PetId);
                        queryReactor.RunFastQuery(string.Format("DELETE FROM items_rooms WHERE id={0} LIMIT 1", item.Id));
                        goto IL_40C;
                    }
                }
                if (item.GetBaseItem().Name.Contains("horse_hairstyle"))
                {
                    var s3 = item.GetBaseItem().Name.Split('_')[2];
                    var num4 = 100;
                    num4 += int.Parse(s3);
                    pet.PetData.PetHair = num4;
                    using (
                        var queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
                    {
                        queryReactor.RunFastQuery("UPDATE pets_data SET pethair = '" + pet.PetData.PetHair + "' WHERE id = " + pet.PetData.PetId);
                        queryReactor.RunFastQuery(string.Format("DELETE FROM items_rooms WHERE id={0} LIMIT 1", item.Id));
                        goto IL_40C;
                    }
                }
                if (item.GetBaseItem().Name.Contains("saddle"))
                {
                    pet.PetData.HaveSaddle = true;
                    using (
                        var queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
                    {
                        queryReactor.RunFastQuery(string.Format("UPDATE pets_data SET have_saddle = 1 WHERE id = {0}",
                            pet.PetData.PetId));
                        queryReactor.RunFastQuery(string.Format("DELETE FROM items_rooms WHERE id={0} LIMIT 1", item.Id));
                    }
                    goto IL_40C;
                }
                if (item.GetBaseItem().Name == "mnstr_fert")
                {
                    if (pet.PetData.MoplaBreed.LiveState == MoplaState.Grown) return;
                    isForHorse = false;
                    pet.PetData.MoplaBreed.GrowingStatus = 7;
                    pet.PetData.MoplaBreed.LiveState = MoplaState.Grown;
                    pet.PetData.MoplaBreed.UpdateInDb();
                    using (var queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
                    {
                        queryReactor.RunFastQuery(string.Format("DELETE FROM items_rooms WHERE id={0} LIMIT 1", item.Id));
                    }
                }
            IL_40C:
                room.GetRoomItemHandler().RemoveFurniture(Session, item.Id, false);
                var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("SetRoomUserMessageComposer"));
                serverMessage.AppendInteger(1);
                pet.Serialize(serverMessage, false);
                room.SendMessage(serverMessage);
                if (isForHorse)
                {
                    var serverMessage2 = new ServerMessage(LibraryParser.OutgoingRequest("SerializePetMessageComposer"));
                    serverMessage2.AppendInteger(pet.PetData.VirtualId);
                    serverMessage2.AppendInteger(pet.PetData.PetId);
                    serverMessage2.AppendInteger(pet.PetData.Type);
                    serverMessage2.AppendInteger(int.Parse(pet.PetData.Race));
                    serverMessage2.AppendString(pet.PetData.Color.ToLower());
                    if (pet.PetData.HaveSaddle)
                    {
                        serverMessage2.AppendInteger(2);
                        serverMessage2.AppendInteger(3);
                        serverMessage2.AppendInteger(4);
                        serverMessage2.AppendInteger(9);
                        serverMessage2.AppendInteger(0);
                        serverMessage2.AppendInteger(3);
                        serverMessage2.AppendInteger(pet.PetData.PetHair);
                        serverMessage2.AppendInteger(pet.PetData.HairDye);
                        serverMessage2.AppendInteger(3);
                        serverMessage2.AppendInteger(pet.PetData.PetHair);
                        serverMessage2.AppendInteger(pet.PetData.HairDye);
                    }
                    else
                    {
                        serverMessage2.AppendInteger(1);
                        serverMessage2.AppendInteger(2);
                        serverMessage2.AppendInteger(2);
                        serverMessage2.AppendInteger(pet.PetData.PetHair);
                        serverMessage2.AppendInteger(pet.PetData.HairDye);
                        serverMessage2.AppendInteger(3);
                        serverMessage2.AppendInteger(pet.PetData.PetHair);
                        serverMessage2.AppendInteger(pet.PetData.HairDye);
                    }
                    serverMessage2.AppendBool(pet.PetData.HaveSaddle);
                    serverMessage2.AppendBool(pet.RidingHorse);
                    room.SendMessage(serverMessage2);
                }
            }
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:101,代码来源:Items.cs

示例6: RemoveSaddle

 internal void RemoveSaddle()
 {
     var room =
         AzureEmulator.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
     if (room == null || (!room.RoomData.AllowPets && !room.CheckRights(Session, true, false)))
         return;
     var petId = Request.GetUInteger();
     var pet = room.GetRoomUserManager().GetPet(petId);
     if (pet == null || pet.PetData == null || pet.PetData.OwnerId != Session.GetHabbo().Id || !pet.RidingHorse)
         return;
     pet.PetData.HaveSaddle = false;
     using (var queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
     {
         queryReactor.RunFastQuery(string.Format("UPDATE pets_data SET have_saddle = 0 WHERE id = {0}",
             pet.PetData.PetId));
         queryReactor.RunFastQuery(
             string.Format("INSERT INTO items_rooms (user_id, base_item) VALUES ({0}, 4221);",
                 Session.GetHabbo().Id));
     }
     Session.GetHabbo().GetInventoryComponent().UpdateItems(true);
     var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("SetRoomUserMessageComposer"));
     serverMessage.AppendInteger(1);
     pet.Serialize(serverMessage, false);
     room.SendMessage(serverMessage);
     var serverMessage2 = new ServerMessage(LibraryParser.OutgoingRequest("SerializePetMessageComposer"));
     serverMessage2.AppendInteger(pet.PetData.VirtualId);
     serverMessage2.AppendInteger(pet.PetData.PetId);
     serverMessage2.AppendInteger(pet.PetData.Type);
     serverMessage2.AppendInteger(int.Parse(pet.PetData.Race));
     serverMessage2.AppendString(pet.PetData.Color.ToLower());
     serverMessage2.AppendInteger(1);
     serverMessage2.AppendInteger(2);
     serverMessage2.AppendInteger(2);
     serverMessage2.AppendInteger(pet.PetData.PetHair);
     serverMessage2.AppendInteger(pet.PetData.HairDye);
     serverMessage2.AppendInteger(3);
     serverMessage2.AppendInteger(pet.PetData.PetHair);
     serverMessage2.AppendInteger(pet.PetData.HairDye);
     serverMessage2.AppendBool(pet.PetData.HaveSaddle);
     serverMessage2.AppendBool(pet.RidingHorse);
     room.SendMessage(serverMessage2);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:42,代码来源:Items.cs

示例7: TriggerLoveLock

        internal void TriggerLoveLock(RoomItem loveLock)
        {
            var loveLockParams = loveLock.ExtraData.Split(Convert.ToChar(5));

            try
            {
                if (loveLockParams[0] == "1")
                    return;

                Point pointOne;
                Point pointTwo;

                switch (loveLock.Rot)
                {
                    case 2:
                        pointOne = new Point(loveLock.X, loveLock.Y + 1);
                        pointTwo = new Point(loveLock.X, loveLock.Y - 1);
                        break;

                    case 4:
                        pointOne = new Point(loveLock.X - 1, loveLock.Y);
                        pointTwo = new Point(loveLock.X + 1, loveLock.Y);
                        break;

                    default:
                        return;
                }

                var roomUserOne = loveLock.GetRoom().GetRoomUserManager().GetUserForSquare(pointOne.X, pointOne.Y);
                var roomUserTwo = loveLock.GetRoom().GetRoomUserManager().GetUserForSquare(pointTwo.X, pointTwo.Y);

                RoomUser user = loveLock.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (roomUserOne == null || roomUserTwo == null)
                {
                    user.MoveTo(loveLock.X, loveLock.Y + 1);
                    return;
                }

                if (roomUserOne.GetClient() == null || roomUserTwo.GetClient() == null)
                {
                    Session.SendNotif(TextManager.GetText("lovelock_error_2"));
                    return;
                }

                roomUserOne.CanWalk = false;
                roomUserTwo.CanWalk = false;

                var lockDialogue = new ServerMessage(LibraryParser.OutgoingRequest("LoveLockDialogueMessageComposer"));
                lockDialogue.AppendInteger(loveLock.Id);
                lockDialogue.AppendBool(true);

                loveLock.InteractingUser = roomUserOne.GetClient().GetHabbo().Id;
                loveLock.InteractingUser2 = roomUserTwo.GetClient().GetHabbo().Id;

                roomUserOne.GetClient().SendMessage(lockDialogue);
                roomUserTwo.GetClient().SendMessage(lockDialogue);
            }
            catch
            {
                Session.SendNotif(TextManager.GetText("lovelock_error_3"));
            }
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:63,代码来源:Items.cs

示例8: GetPromotionableRooms

        internal void GetPromotionableRooms()
        {
            ServerMessage serverMessage = new ServerMessage();
            serverMessage.Init(LibraryParser.OutgoingRequest("CatalogPromotionGetRoomsMessageComposer"));
            serverMessage.AppendBool(true);
            serverMessage.AppendInteger(Session.GetHabbo().UsersRooms.Count);

            foreach (RoomData current in Session.GetHabbo().UsersRooms)
            {
                serverMessage.AppendInteger(current.Id);
                serverMessage.AppendString(current.Name);
                serverMessage.AppendBool(false);
            }

            Response = serverMessage;
            SendResponse();
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:17,代码来源:Rooms.cs

示例9: AllowAllRide

 internal void AllowAllRide()
 {
     var room =
         AzureEmulator.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
     var num = Request.GetUInteger();
     var pet = room.GetRoomUserManager().GetPet(num);
     if (pet.PetData.AnyoneCanRide == 1)
     {
         using (var queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
             queryReactor.RunFastQuery(string.Format("UPDATE pets_data SET anyone_ride=0 WHERE id={0} LIMIT 1",
                 num));
         pet.PetData.AnyoneCanRide = 0;
     }
     else
     {
         using (var queryreactor2 = AzureEmulator.GetDatabaseManager().GetQueryReactor())
             queryreactor2.RunFastQuery(string.Format("UPDATE pets_data SET anyone_ride=1 WHERE id={0} LIMIT 1",
                 num));
         pet.PetData.AnyoneCanRide = 1;
     }
     var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("PetInfoMessageComposer"));
     serverMessage.AppendInteger(pet.PetData.PetId);
     serverMessage.AppendString(pet.PetData.Name);
     serverMessage.AppendInteger(pet.PetData.Level);
     serverMessage.AppendInteger(20);
     serverMessage.AppendInteger(pet.PetData.Experience);
     serverMessage.AppendInteger(pet.PetData.ExperienceGoal);
     serverMessage.AppendInteger(pet.PetData.Energy);
     serverMessage.AppendInteger(100);
     serverMessage.AppendInteger(pet.PetData.Nutrition);
     serverMessage.AppendInteger(150);
     serverMessage.AppendInteger(pet.PetData.Respect);
     serverMessage.AppendInteger(pet.PetData.OwnerId);
     serverMessage.AppendInteger(pet.PetData.Age);
     serverMessage.AppendString(pet.PetData.OwnerName);
     serverMessage.AppendInteger(1);
     serverMessage.AppendBool(pet.PetData.HaveSaddle);
     serverMessage.AppendBool(
         AzureEmulator.GetGame()
             .GetRoomManager()
             .GetRoom(pet.PetData.RoomId)
             .GetRoomUserManager()
             .GetRoomUserByVirtualId(pet.PetData.VirtualId)
             .RidingHorse);
     serverMessage.AppendInteger(0);
     serverMessage.AppendInteger(pet.PetData.AnyoneCanRide);
     serverMessage.AppendInteger(0);
     serverMessage.AppendInteger(0);
     serverMessage.AppendInteger(0);
     serverMessage.AppendInteger(0);
     serverMessage.AppendInteger(0);
     serverMessage.AppendInteger(0);
     serverMessage.AppendString("");
     serverMessage.AppendBool(false);
     serverMessage.AppendInteger(-1);
     serverMessage.AppendInteger(-1);
     serverMessage.AppendInteger(-1);
     serverMessage.AppendBool(false);
     room.SendMessage(serverMessage);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:60,代码来源:Items.cs

示例10: MountOnPet


//.........这里部分代码省略.........
            var flag = Request.GetBool();
            var pet = room.GetRoomUserManager().GetPet(petId);

            if (pet == null || pet.PetData == null || !pet.RidingHorse)
                return;

            if (pet.PetData.AnyoneCanRide == 0 && pet.PetData.OwnerId != roomUserByHabbo.UserId)
            {
                Session.SendNotif(TextManager.GetText("horse_error_1"));
                return;
            }

            if (flag)
            {
                if (pet.RidingHorse)
                {
                    var value = PetLocale.GetValue("pet.alreadymounted");
                    var random = new Random();
                    pet.Chat(null, value[random.Next(0, (value.Length - 1))], false, 0, 0);
                }
                else if (!roomUserByHabbo.RidingHorse)
                {
                    pet.Statusses.Remove("sit");
                    pet.Statusses.Remove("lay");
                    pet.Statusses.Remove("snf");
                    pet.Statusses.Remove("eat");
                    pet.Statusses.Remove("ded");
                    pet.Statusses.Remove("jmp");

                    int x = roomUserByHabbo.X, y = roomUserByHabbo.Y;

                    room.SendMessage(room.GetRoomItemHandler().UpdateUserOnRoller(pet, new Point(x, y), 0u, room.GetGameMap().SqAbsoluteHeight(x, y)));
                    room.GetRoomUserManager().UpdateUserStatus(pet, false);
                    room.SendMessage(room.GetRoomItemHandler().UpdateUserOnRoller(roomUserByHabbo, new Point(x, y), 0u, room.GetGameMap().SqAbsoluteHeight(x, y) + 1.0));
                    room.GetRoomUserManager().UpdateUserStatus(roomUserByHabbo, false);
                    pet.ClearMovement();
                    roomUserByHabbo.RidingHorse = true;
                    pet.RidingHorse = true;
                    pet.HorseId = ((uint)roomUserByHabbo.VirtualId);
                    roomUserByHabbo.HorseId = Convert.ToUInt32(pet.VirtualId);
                    roomUserByHabbo.ApplyEffect(77);
                    roomUserByHabbo.Z += 1.0;
                    roomUserByHabbo.UpdateNeeded = true;
                    pet.UpdateNeeded = true;
                }
            }
            else if (roomUserByHabbo.VirtualId == pet.HorseId)
            {
                pet.Statusses.Remove("sit");
                pet.Statusses.Remove("lay");
                pet.Statusses.Remove("snf");
                pet.Statusses.Remove("eat");
                pet.Statusses.Remove("ded");
                pet.Statusses.Remove("jmp");
                roomUserByHabbo.RidingHorse = false;
                roomUserByHabbo.HorseId = 0u;
                pet.RidingHorse = false;
                pet.HorseId = 0u;
                roomUserByHabbo.MoveTo((new Point(roomUserByHabbo.X + 2, roomUserByHabbo.Y + 2)));

                roomUserByHabbo.ApplyEffect(-1);
                roomUserByHabbo.UpdateNeeded = true;
                pet.UpdateNeeded = true;
            }
            else
            {
                Session.SendNotif(TextManager.GetText("horse_error_2"));
                return;
            }

            var clientByUserId = AzureEmulator.GetGame().GetClientManager().GetClientByUserId(Session.GetHabbo().Id);
            if (Session.GetHabbo().Id != pet.PetData.OwnerId)
            {
                if (clientByUserId != null)
                {
                    AzureEmulator.GetGame().GetAchievementManager().ProgressUserAchievement(clientByUserId, "ACH_HorseRent", 1, false);
                }
            }

            var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("SerializePetMessageComposer"));
            serverMessage.AppendInteger(pet.PetData.VirtualId);
            serverMessage.AppendInteger(pet.PetData.PetId);
            serverMessage.AppendInteger(pet.PetData.Type);
            serverMessage.AppendInteger(int.Parse(pet.PetData.Race));
            serverMessage.AppendString(pet.PetData.Color.ToLower());
            serverMessage.AppendInteger(2);
            serverMessage.AppendInteger(3);
            serverMessage.AppendInteger(4);
            serverMessage.AppendInteger(9);
            serverMessage.AppendInteger(0);
            serverMessage.AppendInteger(3);
            serverMessage.AppendInteger(pet.PetData.PetHair);
            serverMessage.AppendInteger(pet.PetData.HairDye);
            serverMessage.AppendInteger(3);
            serverMessage.AppendInteger(pet.PetData.PetHair);
            serverMessage.AppendInteger(pet.PetData.HairDye);
            serverMessage.AppendBool(pet.PetData.HaveSaddle);
            serverMessage.AppendBool(pet.RidingHorse);
            room.SendMessage(serverMessage);
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:101,代码来源:Items.cs

示例11: LoadSettings

        /// <summary>
        ///     Loads the settings.
        /// </summary>
        internal void LoadSettings()
        {
            UserPreferences preferences = Session.GetHabbo().Preferences;
            ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("LoadVolumeMessageComposer"));

            serverMessage.AppendIntegersArray(preferences.Volume, ',', 3, 0, 100);

            serverMessage.AppendBool(preferences.PreferOldChat);
            serverMessage.AppendBool(preferences.IgnoreRoomInvite);
            serverMessage.AppendBool(preferences.DisableCameraFollow);
            serverMessage.AppendInteger(3); // collapse friends (3 = no)
            serverMessage.AppendInteger(preferences.ChatColor); //bubble
            Session.SendMessage(serverMessage);
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:17,代码来源:Users.cs

示例12: FindMoreFriends

 internal void FindMoreFriends()
 {
     var allRooms = AzureEmulator.GetGame().GetRoomManager().GetActiveRooms();
     Random rnd = new Random();
     var randomRoom = allRooms[rnd.Next(allRooms.Length)].Key;
     var success = new ServerMessage(LibraryParser.OutgoingRequest("FindMoreFriendsSuccessMessageComposer"));
     if (randomRoom == null)
     {
         success.AppendBool(false);
         Session.SendMessage(success);
         return;
     }
     success.AppendBool(true);
     Session.SendMessage(success);
     var roomFwd = new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer"));
     roomFwd.AppendInteger(randomRoom.Id);
     Session.SendMessage(roomFwd);
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:18,代码来源:Users.cs

示例13: UpdateThreadState

        /// <summary>
        /// Updates the state of the thread.
        /// </summary>
        internal void UpdateThreadState()
        {
            uint groupId = Request.GetUInteger();
            uint threadId = Request.GetUInteger();
            bool pin = Request.GetBool();
            bool Lock = Request.GetBool();

            using (IQueryAdapter dbClient = Azure.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery($"SELECT * FROM groups_forums_posts WHERE group_id = '{groupId}' AND id = '{threadId}' LIMIT 1;");
                DataRow row = dbClient.GetRow();

                Guild theGroup = Azure.GetGame().GetGroupManager().GetGroup(groupId);

                if (row != null)
                {
                    if ((uint)row["poster_id"] == Session.GetHabbo().Id || theGroup.Admins.ContainsKey(Session.GetHabbo().Id))
                    {
                        dbClient.SetQuery($"UPDATE groups_forums_posts SET pinned = @pin , locked = @lock WHERE id = {threadId};");
                        dbClient.AddParameter("pin", (pin) ? "1" : "0");
                        dbClient.AddParameter("lock", (Lock) ? "1" : "0");
                        dbClient.RunQuery();
                    }
                }

                var thread = new GroupForumPost(row);

                if (thread.Pinned != pin)
                {
                    var notif = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));

                    notif.AppendString((pin) ? "forums.thread.pinned" : "forums.thread.unpinned");
                    notif.AppendInteger(0);
                    Session.SendMessage(notif);
                }

                if (thread.Locked != Lock)
                {
                    var notif2 = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));

                    notif2.AppendString((Lock) ? "forums.thread.locked" : "forums.thread.unlocked");
                    notif2.AppendInteger(0);
                    Session.SendMessage(notif2);
                }

                if (thread.ParentId != 0)
                    return;

                var message = new ServerMessage(LibraryParser.OutgoingRequest("GroupForumThreadUpdateMessageComposer"));
                message.AppendInteger(groupId);
                message.AppendInteger(thread.Id);
                message.AppendInteger(thread.PosterId);
                message.AppendString(thread.PosterName);
                message.AppendString(thread.Subject);
                message.AppendBool(pin);
                message.AppendBool(Lock);
                message.AppendInteger((Azure.GetUnixTimeStamp() - thread.Timestamp));
                message.AppendInteger(thread.MessageCount + 1);
                message.AppendInteger(0);
                message.AppendInteger(0);
                message.AppendInteger(1);
                message.AppendString("");
                message.AppendInteger((Azure.GetUnixTimeStamp() - thread.Timestamp));
                message.AppendByte((thread.Hidden) ? 10 : 1);
                message.AppendInteger(1);
                message.AppendString(thread.Hider);
                message.AppendInteger(0);

                Session.SendMessage(message);
            }
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:74,代码来源:Groups.cs

示例14: RoomUserAction

        internal void RoomUserAction()
        {
            var room = Azure.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
            if (room == null)
                return;
            var roomUserByHabbo = room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (roomUserByHabbo == null)
                return;
            roomUserByHabbo.UnIdle();
            var num = Request.GetInteger();
            roomUserByHabbo.DanceId = 0;

            var action = new ServerMessage(LibraryParser.OutgoingRequest("RoomUserActionMessageComposer"));
            action.AppendInteger(roomUserByHabbo.VirtualId);
            action.AppendInteger(num);
            room.SendMessage(action);

            if (num == 5)
            {
                roomUserByHabbo.IsAsleep = true;
                var sleep = new ServerMessage(LibraryParser.OutgoingRequest("RoomUserIdleMessageComposer"));
                sleep.AppendInteger(roomUserByHabbo.VirtualId);
                sleep.AppendBool(roomUserByHabbo.IsAsleep);
                room.SendMessage(sleep);
            }
            Azure.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.SocialWave);
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:27,代码来源:Rooms.cs

示例15: RoomFloorAndWallComposer

 internal static ServerMessage RoomFloorAndWallComposer(Room room)
 {
     ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("RoomFloorWallLevelsMessageComposer"));
     serverMessage.AppendBool(room.RoomData.HideWall);
     serverMessage.AppendInteger(room.RoomData.WallThickness);
     serverMessage.AppendInteger(room.RoomData.FloorThickness);
     return serverMessage;
 }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:8,代码来源:Rooms.cs


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