public override void Compose(Yupi.Protocol.ISender session) { using (ServerMessage message = Pool.GetMessageBuffer(Id)) { session.Send(message); } }
public override void Compose(Yupi.Protocol.ISender room, int user, int respect) { using (ServerMessage message = Pool.GetMessageBuffer(Id)) { message.AppendInteger(user); message.AppendInteger(respect); room.Send(message); } }
private void PlantMonsterplant(IRouter router, Yupi.Protocol.ISender session, FloorItem <MonsterPlantBaseItem> mopla, RoomData room) { /* * int rarity = 0, internalRarity; * * if (room == null || mopla == null) * return; * * if ((mopla.GetBaseItem().InteractionType != Interaction.Moplaseed) && * (mopla.GetBaseItem().InteractionType != Interaction.RareMoplaSeed)) * return; * * if (string.IsNullOrEmpty(mopla.ExtraData) || mopla.ExtraData == "0") * rarity = 1; * * if (!string.IsNullOrEmpty(mopla.ExtraData) && mopla.ExtraData != "0") * rarity = int.TryParse(mopla.ExtraData, out internalRarity) ? internalRarity : 1; * * int getX = mopla.X; * int getY = mopla.Y; * * room.GetRoomItemHandler().RemoveFurniture(session, mopla.Id, false); * * Pet pet = CatalogManager.CreatePet(session.GetHabbo().Id, "Monsterplant", "pet_monster", "0", "0", rarity); * * router.GetComposer<SendMonsterplantIdMessageComposer> ().Compose (session, pet.PetId); * * using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor()) { * queryReactor.SetQuery("UPDATE pets_data SET room_id = @room, x = @x, y = @y WHERE id = @id"); * queryReactor.AddParameter("x", getX); * queryReactor.AddParameter("y", getY); * queryReactor.AddParameter("id", pet.PetId); * queryReactor.RunQuery (); * } * * pet.PlacedInRoom = true; * pet.RoomId = room.RoomId; * * RoomBot bot = new RoomBot(pet.PetId, pet.OwnerId, pet.RoomId, AiType.Pet, "freeroam", pet.Name, "", pet.Look, getX, getY, 0.0, 4, null, null, "", 0, ""); * * room.GetRoomUserManager().DeployBot(bot, pet); * * if (pet.DbState != DatabaseUpdateState.NeedsInsert) * pet.DbState = DatabaseUpdateState.NeedsUpdate; * * using (IQueryAdapter queryreactor2 = Yupi.GetDatabaseManager().GetQueryReactor()) * { * queryreactor2.SetQuery("DELETE FROM items_rooms WHERE id = @id"); * queryreactor2.AddParameter("id", mopla.Id); * queryreactor2.RunQuery (); * * room.GetRoomUserManager().SavePets(queryreactor2); * }*/ throw new NotImplementedException(); }
public override void Compose(Yupi.Protocol.ISender user1, Yupi.Protocol.ISender user2, LovelockItem loveLock) { using (ServerMessage message = Pool.GetMessageBuffer(Id)) { message.AppendInteger(loveLock.Id); message.AppendBool(true); // TODO use loveLock.InteractingUser user1.Send(message); user2.Send(message); } }
public override void Compose(Yupi.Protocol.ISender session, YoutubeTVItem tv, Dictionary <string, YoutubeVideo> videos) { using (ServerMessage message = Pool.GetMessageBuffer(Id)) { message.AppendInteger(tv.Id); message.AppendInteger(videos.Count); foreach (YoutubeVideo video in videos.Values) { message.AppendString(video.Id); message.AppendString(video.Name); message.AppendString(video.Description); } message.AppendString(tv.PlayingVideo.Id); session.Send(message); } }
public override void Compose(Yupi.Protocol.ISender session, UserAchievement userAchievement) { using (ServerMessage message = Pool.GetMessageBuffer(Id)) { message.AppendInteger(userAchievement.Achievement.Value); message.AppendInteger(userAchievement.Level.Level); message.AppendString(userAchievement.Achievement.DisplayName + userAchievement.Level.Level); message.AppendInteger(userAchievement.Level.Requirement); message.AppendInteger(userAchievement.Level.Requirement); message.AppendInteger(userAchievement.Level.RewardActivityPoints); message.AppendInteger(0); message.AppendInteger(userAchievement.Progress); message.AppendBool(userAchievement.Level.Level >= userAchievement.Achievement.GetMaxLevel()); message.AppendString(userAchievement.Achievement.Category); message.AppendString(string.Empty); message.AppendInteger(userAchievement.Achievement.GetMaxLevel()); message.AppendInteger(0); session.Send(message); } }
// TODO Hardcoded public override void Compose(Yupi.Protocol.ISender session, Achievement achievement, int level, int pointReward, int pixelReward) { using (ServerMessage message = Pool.GetMessageBuffer(Id)) { message.AppendInteger(achievement.Value); message.AppendInteger(level); message.AppendInteger(144); message.AppendString(achievement.DisplayName + level); message.AppendInteger(pointReward); message.AppendInteger(pixelReward); message.AppendInteger(0); message.AppendInteger(10); message.AppendInteger(21); message.AppendString(level > 1 ? achievement.DisplayName + (level - 1) : string.Empty); message.AppendString(achievement.Category); message.AppendBool(true); session.Send(message); } }
public override void Compose(Yupi.Protocol.ISender session, Achievement achievement, int level, int pointReward, int pixelReward) { // Do nothing by default. }
public override void Compose(Yupi.Protocol.ISender room, int user, int respect) { // Do nothing by default. }
public override void Compose(Yupi.Protocol.ISender session, YoutubeTVItem tv, Dictionary <string, YoutubeVideo> videos) { // Do nothing by default. }
public abstract void Compose(Yupi.Protocol.ISender session);