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); } }
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); } }