Esempio n. 1
0
 public override void Compose(Yupi.Protocol.ISender session, string badgeId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(1);
         message.AppendString(badgeId);
         session.Send(message);
     }
 }
Esempio n. 2
0
 public override void Compose(Yupi.Protocol.ISender session, UserInfo info)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(info.Id);
         message.Append(info.Tags);
         session.Send(message);
     }
 }
Esempio n. 3
0
 public override void Compose(Yupi.Protocol.ISender session, int virtualId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         // TODO VirtualId TO STRING?!
         message.AppendString(virtualId.ToString());
         session.Send(message);
     }
 }
 public override void Compose(Yupi.Protocol.ISender session, int habboId, string content)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(habboId);
         message.AppendString(content);
         session.Send(message);
     }
 }
Esempio n. 5
0
 public override void Compose(Yupi.Protocol.ISender room, RoomEntity user)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(1);
         Serialize(message, user);
         room.Send(message);
     }
 }
Esempio n. 6
0
 public override void Compose(Yupi.Protocol.ISender session)
 {
     // TODO Hardcoded message
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(0);
         session.Send(message);
     }
 }
Esempio n. 7
0
 public override void Compose(Yupi.Protocol.ISender session, int entityId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(entityId);
         message.AppendBool(true);
         session.Send(message);
     }
 }
Esempio n. 8
0
 public override void Compose(Yupi.Protocol.ISender session, State state, string username)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger((int)state);
         message.AppendString(username);
         session.Send(message);
     }
 }
Esempio n. 9
0
 public override void Compose(Yupi.Protocol.ISender session, int virtualId, int itemId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(virtualId);
         message.AppendInteger(itemId);
         session.Send(message);
     }
 }
Esempio n. 10
0
 public override void Compose(Yupi.Protocol.ISender session, RoomData room, UserInfo user)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(room.Id);
         message.AppendBool(room.HasOwnerRights(user));
         session.Send(message);
     }
 }
Esempio n. 11
0
 public override void Compose(Yupi.Protocol.ISender session, RoomData data)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendBool(data.HideWall);
         message.AppendInteger(data.WallThickness);
         message.AppendInteger(data.FloorThickness);
         session.Send(message);
     }
 }
Esempio n. 12
0
 public override void Compose(Yupi.Protocol.ISender session, ClubLevel clubLevel, Rank rank, bool isAmbadassor = false)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger((int)clubLevel);
         message.AppendInteger((int)rank);
         message.AppendBool(isAmbadassor);
         session.Send(message);
     }
 }
Esempio n. 13
0
 public override void Compose(Yupi.Protocol.ISender session, MessengerMessage msg)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(msg.From.Id);
         message.AppendString(msg.Text);
         message.AppendInteger((int)msg.Diff().TotalSeconds);
         session.Send(message);
     }
 }
Esempio n. 14
0
 public override void Compose(Yupi.Protocol.ISender session, int errorId, uint conversationId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(errorId);
         message.AppendInteger(conversationId);
         message.AppendString(string.Empty);
         session.Send(message);
     }
 }
Esempio n. 15
0
 public override void Compose(Yupi.Protocol.ISender session, FriendRequest request)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(request.From.Id);
         message.AppendString(request.From.Name);
         message.AppendString(request.From.Look);
         session.Send(message);
     }
 }
Esempio n. 16
0
 public override void Compose(Yupi.Protocol.ISender session, uint userId, string text)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(userId);
         message.AppendString(text);
         message.AppendInteger(0);
         session.Send(message);
     }
 }
 public override void Compose(Yupi.Protocol.ISender room, Habbo habbo)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(habbo.Info.Id);
         message.AppendInteger(habbo.Room.Data.Id);
         message.AppendString(habbo.Info.Name);
         room.Send(message);
     }
 }
Esempio n. 18
0
 public override void Compose(Yupi.Protocol.ISender session, string heightmap, int wallHeight)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendBool(true); // TODO Hardcoded
         message.AppendInteger(wallHeight);
         message.AppendString(heightmap);
         session.Send(message);
     }
 }
Esempio n. 19
0
 public override void Compose(Yupi.Protocol.ISender session, int roomId, UserInfo habbo)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(roomId);
         message.AppendInteger(habbo.Id);
         message.AppendString(habbo.Name);
         session.Send(message);
     }
 }
Esempio n. 20
0
 public override void Compose(Yupi.Protocol.ISender session, RoomData roomData)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(roomData.Id);
         message.AppendString(roomData.CCTs);
         message.AppendInteger(roomData.Id);
         session.Send(message);
     }
 }
Esempio n. 21
0
 public override void Compose(Yupi.Protocol.ISender session, int openHour, int openMinute, bool userThrownOut)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(openHour);
         message.AppendInteger(openMinute);
         message.AppendBool(userThrownOut);
         session.Send(message);
     }
 }
 public override void Compose(Yupi.Protocol.ISender session, Vector3 doorPos, int direction)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger((int)doorPos.X);
         message.AppendInteger((int)doorPos.Y);
         message.AppendInteger(direction);
         session.Send(message);
     }
 }
 public override void Compose(Yupi.Protocol.ISender session, PetEntity pet, int amount)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(pet.Info.Id);
         message.AppendInteger(pet.Id);
         message.AppendInteger(amount);
         session.Send(message);
     }
 }
 public override void Compose(Yupi.Protocol.ISender session)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(0); // i
         message.AppendInteger(0); // i2
         message.AppendInteger(1); // TODO Magic constants
         session.Send(message);
     }
 }
Esempio n. 25
0
 public override void Compose(Yupi.Protocol.ISender session, string newName)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(0); // TODO Magic constant
         message.AppendString(newName);
         message.AppendInteger(0);
         session.Send(message);
     }
 }
        // TODO Refactor
        public override void Compose(Yupi.Protocol.ISender session)
        {
            using (ServerMessage message = Pool.GetMessageBuffer(Id))
            {
                List <GroupBases>             bases            = GroupBaseRepository.All().ToList();
                List <GroupSymbols>           symbols          = SymbolRepository.All().ToList();
                List <GroupBaseColours>       baseColors       = BaseColorRepository.All().ToList();
                List <GroupSymbolColours>     symbolColors     = SymbolColorRepository.All().ToList();
                List <GroupBackGroundColours> backgroundColors = BackgroundColorRepository.All().ToList();

                message.AppendInteger(bases.Count);

                foreach (GroupBases groupBase in bases)
                {
                    message.AppendInteger(groupBase.Id);
                    message.AppendString(groupBase.Value1);
                    message.AppendString(groupBase.Value2);
                }

                message.AppendInteger(symbols.Count);

                foreach (GroupSymbols symbol in symbols)
                {
                    message.AppendInteger(symbol.Id);
                    message.AppendString(symbol.Value1);
                    message.AppendString(symbol.Value2);
                }

                message.AppendInteger(baseColors.Count);

                foreach (GroupBaseColours baseColor in baseColors)
                {
                    message.AppendInteger(baseColor.Id);
                    message.AppendString(baseColor.Colour);
                }

                message.AppendInteger(symbolColors.Count);

                foreach (GroupSymbolColours symbolColor in symbolColors)
                {
                    message.AppendInteger(symbolColor.Id);
                    message.AppendString(symbolColor.Colour.ToString());
                }

                message.AppendInteger(backgroundColors.Count);

                foreach (GroupBackGroundColours current5 in backgroundColors)
                {
                    message.AppendInteger(current5.Id);
                    message.AppendString(current5.Colour.ToString());
                }

                session.Send(message);
            }
        }
Esempio n. 27
0
 public override void Compose(Yupi.Protocol.ISender session, uint firstUserId, uint secondUserId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(firstUserId);
         message.AppendInteger(1);
         message.AppendInteger(secondUserId);
         message.AppendInteger(1);
         session.Send(message);
     }
 }
 public override void Compose(Yupi.Protocol.ISender session, Yupi.Model.Domain.AvatarEffect effect)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(effect.EffectId);
         message.AppendInteger(effect.Type);
         message.AppendInteger(effect.TotalDuration);
         message.AppendBool(effect.TotalDuration == -1); // TODO What does this mean actually?
         session.Send(message);
     }
 }
Esempio n. 29
0
 public override void Compose(Yupi.Protocol.ISender session, Poll poll)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(Id);
         message.AppendString(string.Empty); //?
         message.AppendString(poll.Invitation);
         message.AppendString("Test");       // whats this??
         session.Send(message);
     }
 }
Esempio n. 30
0
 public override void Compose(Yupi.Protocol.ISender session, HotelLandingManager manager, UserInfo user)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendString(manager.FurniReward.Classname);
         message.AppendInteger(manager.FurniReward.Id);
         message.AppendInteger(120); // TODO Magic constant
         message.AppendInteger(120 - user.Respect.Respect);
         session.Send(message);
     }
 }