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


C# ServerMessage.AppendString方法代码示例

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


在下文中一共展示了ServerMessage.AppendString方法的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: DeliverInstantMessage

 internal void DeliverInstantMessage(string message, uint convoID)
 {
     ServerMessage InstantMessage = new ServerMessage(134);
     InstantMessage.AppendUInt(convoID);
     InstantMessage.AppendString(message);
     GetClient().SendMessage(InstantMessage);
 }
开发者ID:habb0,项目名称:Bfly,代码行数:7,代码来源:HabboMessenger.cs

示例3: AnswerGuideRequest

        /// <summary>
        ///     Answers the guide request.
        /// </summary>
        internal void AnswerGuideRequest()
        {
            bool state = Request.GetBool();

            if (!state)
                return;

            GameClient requester = Session.GetHabbo().GuideOtherUser;
            ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("OnGuideSessionStartedMessageComposer"));

            message.AppendInteger(requester.GetHabbo().Id);
            message.AppendString(requester.GetHabbo().UserName);
            message.AppendString(requester.GetHabbo().Look);
            message.AppendInteger(Session.GetHabbo().Id);
            message.AppendString(Session.GetHabbo().UserName);
            message.AppendString(Session.GetHabbo().Look);
            requester.SendMessage(message);
            Session.SendMessage(message);
        }
开发者ID:AngelRmz,项目名称:Yupi,代码行数:22,代码来源:Guides.cs

示例4: AllowsHandling

        internal bool AllowsHandling(Point coordinate, RoomUser user)
        {
            if (!roomMatrix.ContainsKey(coordinate))
                return true;

            List<IWiredCondition> conditions = (List<IWiredCondition>)roomMatrix[coordinate];
            foreach (IWiredCondition condition in conditions)
            {
                if (!condition.AllowsExecution(user))
                    return false;
                ServerMessage message = new ServerMessage(Plus.Messages.Headers.Outgoing.UpdateFloorItemExtraData);
                message.AppendString(condition.GetItem().Id.ToString());
                message.AppendInt32(0);
                message.AppendString("0");
                room.SendMessage(message);
                condition.GetItem().ExtraData = "1";
                condition.GetItem().UpdateState(false, true);
            }

            return true;
        }
开发者ID:BjkGkh,项目名称:07052014,代码行数:21,代码来源:ConditionHandler.cs

示例5: RetrieveSongId

        /// <summary>
        /// Retrieves the song identifier.
        /// </summary>
        internal void RetrieveSongId()
        {
            string text = Request.GetString();

            uint songId = SoundMachineSongManager.GetSongId(text);

            if (songId != 0u)
            {
                var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("RetrieveSongIDMessageComposer"));
                serverMessage.AppendString(text);
                serverMessage.AppendInteger(songId);
                Session.SendMessage(serverMessage);
            }
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:17,代码来源:Music.cs

示例6: AlterForumThreadState

 /// <summary>
 /// Alters the state of the forum thread.
 /// </summary>
 internal void AlterForumThreadState()
 {
     int GroupId = Request.GetInteger();
     uint ThreadId = Request.GetUInteger();
     int StateToSet = Request.GetInteger();
     using (IQueryAdapter dbClient = AzureEmulator.GetDatabaseManager().GetQueryReactor())
     {
         dbClient.SetQuery(string.Format("SELECT * FROM groups_forums_posts WHERE group_id = '{0}' AND id = '{1}' LIMIT 1;", GroupId, ThreadId));
         DataRow Row = dbClient.GetRow();
         Guild Group = AzureEmulator.GetGame().GetGroupManager().GetGroup(GroupId);
         if (Row != null)
         {
             if ((uint)Row["poster_id"] == Session.GetHabbo().Id || Group.Admins.ContainsKey(Session.GetHabbo().Id))
             {
                 dbClient.SetQuery(string.Format("UPDATE groups_forums_posts SET hidden = @hid WHERE id = {0};", ThreadId));
                 dbClient.AddParameter("hid", (StateToSet == 10) ? "1" : "0");
                 dbClient.RunQuery();
             }
         }
         var Thread = new GroupForumPost(Row);
         var Notif = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
         Notif.AppendString((StateToSet == 10) ? "forums.thread.hidden" : "forums.thread.restored");
         Notif.AppendInteger(0);
         Session.SendMessage(Notif);
         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(Thread.Pinned);
         Message.AppendBool(Thread.Locked);
         Message.AppendInteger((AzureEmulator.GetUnixTimeStamp() - Thread.Timestamp));
         Message.AppendInteger(Thread.MessageCount + 1);
         Message.AppendInteger(0);
         Message.AppendInteger(0);
         Message.AppendInteger(0);
         Message.AppendString("");
         Message.AppendInteger((AzureEmulator.GetUnixTimeStamp() - Thread.Timestamp));
         Message.AppendByte(StateToSet);
         Message.AppendInteger(0);
         Message.AppendString(Thread.Hider);
         Message.AppendInteger(0);
         Session.SendMessage(Message);
     }
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:51,代码来源:Groups.cs

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

示例8: INFORETRIEVE

        public void INFORETRIEVE()
        {
            string username = NewSocket.split[2];
            string password = NewSocket.split[3];

            using (DatabaseClient dbClient = Program.Manager.GetClient())
            {
                dbClient.AddParamWithValue("username", username);
                dbClient.AddParamWithValue("password", password);

                try
                {
                    string checkdata = dbClient.ReadString("SELECT * FROM users WHERE username = @username AND password = @password");

                    if (checkdata != null)
                    {
                        DataRow dbRow = dbClient.ReadDataRow("SELECT * FROM users WHERE username = @username;");
                        Username = (String)dbRow["username"];

                        ServerMessage fuseMessage = new ServerMessage();
                        fuseMessage.Init("USEROBJECT");
                        fuseMessage.AppendString("name=" + (String)dbRow["username"]);
                        fuseMessage.AppendString("figure=" + (String)dbRow["figure"]);
                        fuseMessage.AppendString("birthday=" + (String)dbRow["dob"]);
                        fuseMessage.AppendString("phonenumber=");
                        fuseMessage.AppendString("customData=" + (String)dbRow["motto"]);
                        fuseMessage.AppendString("had_read_agreement=1");
                        fuseMessage.AppendString("sex=" + (String)dbRow["gender"]);
                        fuseMessage.AppendString("country=nl");
                        fuseMessage.AppendString("has_special_rights=0");
                        fuseMessage.AppendString("badge_type=1");
                        NewSocket.SendData(clientStream, fuseMessage);
                    }
                    else
                    {
                    }
                }
                catch
                {
                }
            }
        }
开发者ID:habb0,项目名称:ProjectTake,代码行数:42,代码来源:Handshake.cs

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

示例10: Handle

        public bool Handle(RoomUser user, Team team, RoomItem item)
        {
            if (user != null && !user.IsBot && user.GetClient() != null && !string.IsNullOrWhiteSpace(message))
            {
                ServerMessage servermsg = new ServerMessage();
                servermsg.Init(Outgoing.Whisp);
                servermsg.AppendInt32(user.VirtualId);
                servermsg.AppendString(message);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(-1);
                user.GetClient().SendMessage(servermsg);
                handler.OnEvent(itemID);
                return true;
            }

            return false;
        }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:19,代码来源:ShowMessage.cs

示例11: PurchaseGroup

        /// <summary>
        ///     Purchases the group.
        /// </summary>
        internal void PurchaseGroup()
        {
            if (Session == null || Session.GetHabbo().Credits < 10)
                return;

            List<int> gStates = new List<int>();
            string name = Request.GetString();
            string description = Request.GetString();
            uint roomid = Request.GetUInteger();
            int color = Request.GetInteger();
            int num3 = Request.GetInteger();

            Request.GetInteger();

            int guildBase = Request.GetInteger();
            int guildBaseColor = Request.GetInteger();
            int num6 = Request.GetInteger();
            RoomData roomData = Yupi.GetGame().GetRoomManager().GenerateRoomData(roomid);

            if (roomData.Owner != Session.GetHabbo().UserName)
                return;

            for (int i = 0; i < num6*3; i++)
                gStates.Add(Request.GetInteger());

            string image = Yupi.GetGame().GetGroupManager().GenerateGuildImage(guildBase, guildBaseColor, gStates);

            Group theGroup;

            Yupi.GetGame()
                .GetGroupManager()
                .CreateGroup(name, description, roomid, image, Session,
                    !Yupi.GetGame().GetGroupManager().SymbolColours.Contains(color) ? 1 : color,
                    !Yupi.GetGame().GetGroupManager().BackGroundColours.Contains(num3) ? 1 : num3, out theGroup);

            Session.SendMessage(CatalogPageComposer.PurchaseOk(0u, "CREATE_GUILD", 10));
            Response.Init(LibraryParser.OutgoingRequest("GroupRoomMessageComposer"));
            Response.AppendInteger(roomid);
            Response.AppendInteger(theGroup.Id);
            SendResponse();
            roomData.Group = theGroup;
            roomData.GroupId = theGroup.Id;
            roomData.SerializeRoomData(Response, Session, true);

            if (!Session.GetHabbo().InRoom || Session.GetHabbo().CurrentRoom.RoomId != roomData.Id)
            {
                Session.GetMessageHandler().PrepareRoomForUser(roomData.Id, roomData.PassWord);
                Session.GetHabbo().CurrentRoomId = roomData.Id;
            }

            if (Session.GetHabbo().CurrentRoom != null &&
                !Session.GetHabbo().CurrentRoom.LoadedGroups.ContainsKey(theGroup.Id))
                Session.GetHabbo().CurrentRoom.LoadedGroups.Add(theGroup.Id, theGroup.Badge);

            if (CurrentLoadingRoom != null && !CurrentLoadingRoom.LoadedGroups.ContainsKey(theGroup.Id))
                CurrentLoadingRoom.LoadedGroups.Add(theGroup.Id, theGroup.Badge);

            if (CurrentLoadingRoom != null)
            {
                ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("RoomGroupMessageComposer"));

                serverMessage.AppendInteger(CurrentLoadingRoom.LoadedGroups.Count);

                foreach (KeyValuePair<uint, string> current in CurrentLoadingRoom.LoadedGroups)
                {
                    serverMessage.AppendInteger(current.Key);
                    serverMessage.AppendString(current.Value);
                }

                CurrentLoadingRoom.SendMessage(serverMessage);
            }

            if (CurrentLoadingRoom == null || Session.GetHabbo().FavouriteGroup != theGroup.Id)
                return;

            ServerMessage serverMessage2 = new ServerMessage(LibraryParser.OutgoingRequest("ChangeFavouriteGroupMessageComposer"));

            serverMessage2.AppendInteger(
                CurrentLoadingRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id).VirtualId);
            serverMessage2.AppendInteger(theGroup.Id);
            serverMessage2.AppendInteger(3);
            serverMessage2.AppendString(theGroup.Name);

            CurrentLoadingRoom.SendMessage(serverMessage2);
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:88,代码来源:Groups.cs

示例12: OnTrigger

        internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            if (Item.ExtraData.Contains(Convert.ToChar(5).ToString()))
            {
                String[] Stuff = Item.ExtraData.Split(Convert.ToChar(5));
                Session.GetHabbo().Gender = Stuff[0].ToUpper();
                Dictionary<String, String> NewFig = new Dictionary<String, String>();
                NewFig.Clear();
                foreach (String Man in Stuff[1].Split('.'))
                {
                    foreach (String Fig in Session.GetHabbo().Look.Split('.'))
                    {
                        if (Fig.Split('-')[0] == Man.Split('-')[0])
                        {
                            if (NewFig.ContainsKey(Fig.Split('-')[0]) && !NewFig.ContainsValue(Man))
                            {
                                NewFig.Remove(Fig.Split('-')[0]);
                                NewFig.Add(Fig.Split('-')[0], Man);
                            }
                            else if (!NewFig.ContainsKey(Fig.Split('-')[0]) && !NewFig.ContainsValue(Man))
                            {
                                NewFig.Add(Fig.Split('-')[0], Man);
                            }
                        }
                        else
                        {
                            if (!NewFig.ContainsKey(Fig.Split('-')[0]))
                            {
                                NewFig.Add(Fig.Split('-')[0], Fig);
                            }
                        }
                    }
                }

                string Final = "";
                foreach (String Str in NewFig.Values)
                {
                    Final += Str + ".";
                }

                Session.GetHabbo().Look = Final.TrimEnd('.');

                using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.setQuery("UPDATE users SET look = @look, gender = @gender WHERE id = " + Session.GetHabbo().Id);
                    dbClient.addParameter("look", Session.GetHabbo().Look);
                    dbClient.addParameter("gender", Session.GetHabbo().Gender);
                    dbClient.runQuery();
                }

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

                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
                ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
                RoomUpdate.AppendInt32(User.VirtualId);
                RoomUpdate.AppendString(Session.GetHabbo().Look);
                RoomUpdate.AppendString(Session.GetHabbo().Gender.ToLower());
                RoomUpdate.AppendString(Session.GetHabbo().Motto);
                RoomUpdate.AppendInt32(Session.GetHabbo().AchievementPoints);
                Session.GetHabbo().CurrentRoom.SendMessage(RoomUpdate);
            }
        }
开发者ID:BjkGkh,项目名称:07052014,代码行数:68,代码来源:FurniInteractor.cs

示例13: ChangeMotto

        /// <summary>
        ///     Changes the motto.
        /// </summary>
        internal void ChangeMotto()
        {
            string text = Request.GetString();

            if (text == Session.GetHabbo().Motto)
                return;

            Session.GetHabbo().Motto = text;

            using (IQueryAdapter commitableQueryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
            {
                commitableQueryReactor.SetQuery($"UPDATE users SET motto = @motto WHERE id = '{Session.GetHabbo().Id}'");
                commitableQueryReactor.AddParameter("motto", text);
                commitableQueryReactor.RunQuery();
            }

            if (Session.GetHabbo().InRoom)
            {
                Room currentRoom = Session.GetHabbo().CurrentRoom;
                RoomUser roomUserByHabbo = currentRoom?.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (roomUserByHabbo == null)
                    return;

                ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserDataMessageComposer"));
                serverMessage.AppendInteger(roomUserByHabbo.VirtualId); //serverMessage.AppendInt32(-1);
                serverMessage.AppendString(Session.GetHabbo().Look);
                serverMessage.AppendString(Session.GetHabbo().Gender.ToLower());
                serverMessage.AppendString(Session.GetHabbo().Motto);
                serverMessage.AppendInteger(Session.GetHabbo().AchievementPoints);
                currentRoom.SendMessage(serverMessage);
            }

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

示例14: 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

示例15: UpdateBadges

        /// <summary>
        ///     Updates the badges.
        /// </summary>
        internal void UpdateBadges()
        {
            Session.GetHabbo().GetBadgeComponent().ResetSlots();

            using (IQueryAdapter commitableQueryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                commitableQueryReactor.RunFastQuery(
                    $"UPDATE users_badges SET badge_slot = 0 WHERE user_id = {Session.GetHabbo().Id}");

            for (int i = 0; i < 5; i++)
            {
                int slot = Request.GetInteger();
                string code = Request.GetString();

                if (code.Length == 0)
                    continue;

                if (!Session.GetHabbo().GetBadgeComponent().HasBadge(code) || slot < 1 || slot > 5)
                    return;

                Session.GetHabbo().GetBadgeComponent().GetBadge(code).Slot = slot;

                using (IQueryAdapter queryreactor2 = Yupi.GetDatabaseManager().GetQueryReactor())
                {
                    queryreactor2.SetQuery("UPDATE users_badges SET badge_slot = " + slot +
                                           " WHERE badge_id = @badge AND user_id = " + Session.GetHabbo().Id);
                    queryreactor2.AddParameter("badge", code);
                    queryreactor2.RunQuery();
                }
            }

            ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("UserBadgesMessageComposer"));
            serverMessage.AppendInteger(Session.GetHabbo().Id);

            serverMessage.StartArray();

            foreach (
                Badge badge in
                    Session.GetHabbo().GetBadgeComponent().BadgeList.Values.Cast<Badge>().Where(badge => badge.Slot > 0)
                )
            {
                serverMessage.AppendInteger(badge.Slot);
                serverMessage.AppendString(badge.Code);
                serverMessage.SaveArray();
            }

            serverMessage.EndArray();

            if (Session.GetHabbo().InRoom &&
                Yupi.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId) != null)
                Yupi.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).SendMessage(serverMessage);
            else
                Session.SendMessage(serverMessage);
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:56,代码来源:Users.cs


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