コード例 #1
0
 public override void Compose(Yupi.Protocol.ISender session, ChatMessage msg, int count = -1)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.Append(msg, count);
         session.Send(message);
     }
 }
コード例 #2
0
 public override void Compose(Yupi.Protocol.ISender room, int groupId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(groupId);
         room.Send(message);
     }
 }
コード例 #3
0
 public override void Compose(Yupi.Protocol.ISender session, CatalogOffer item)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.Append(item);
         session.Send(message);
     }
 }
コード例 #4
0
 public override void Compose(Yupi.Protocol.ISender session, int status)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(status); // TODO Use enum
         session.Send(message);
     }
 }
コード例 #5
0
 public override void Compose(Yupi.Protocol.ISender session, RoomData data)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.Append(data.Chat);
         session.Send(message);
     }
 }
コード例 #6
0
 public override void Compose(Yupi.Protocol.ISender session, ErrorCode error)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger((int)error);
         session.Send(message);
     }
 }
コード例 #7
0
 public override void Compose(Yupi.Protocol.ISender session, short code = 0)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendShort(code); // TODO Also possible without code & what does code mean.
         session.Send(message);
     }
 }
コード例 #8
0
 public override void Compose(Yupi.Protocol.ISender session)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(0); // TODO What does 0 mean?
         session.Send(message);
     }
 }
コード例 #9
0
 public override void Compose(Yupi.Protocol.ISender session, int points)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(points);
         session.Send(message);
     }
 }
コード例 #10
0
 public override void Compose(Yupi.Protocol.ISender session, int credits)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendString(credits.ToString());
         session.Send(message);
     }
 }
コード例 #11
0
 public override void Compose(Yupi.Protocol.ISender session, bool isPlaying)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendBool(isPlaying);
         session.Send(message);
     }
 }
コード例 #12
0
 public override void Compose(Yupi.Protocol.ISender session, string machineId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendString(machineId);
         session.Send(message);
     }
 }
コード例 #13
0
 public override void Compose(Yupi.Protocol.ISender session, Yupi.Model.Domain.AvatarEffect effect)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(effect.EffectId);
         session.Send(message);
     }
 }
コード例 #14
0
 public override void Compose(Yupi.Protocol.ISender session, string badgeName, bool hasBadge)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendString(badgeName);
         message.AppendBool(hasBadge);
         session.Send(message);
     }
 }
コード例 #15
0
 public override void Compose(Yupi.Protocol.ISender session)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendBool(true); //isOpen
         message.AppendBool(false);
         session.Send(message);
     }
 }
コード例 #16
0
 // TODO Create enum for Dances
 // TODO Replace entityId with RoomEntity EVERYWHERE!
 public override void Compose(Yupi.Protocol.ISender room, int entityId, Dance dance)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(entityId);
         message.AppendInteger(dance.Value);
         room.Send(message);
     }
 }
コード例 #17
0
 public override void Compose(Yupi.Protocol.ISender session, int credits, int seasonalCurrency)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(credits);
         message.AppendInteger(seasonalCurrency);
         session.Send(message);
     }
 }
コード例 #18
0
 public override void Compose(Yupi.Protocol.ISender session, int petId, int randomValue)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(petId);
         message.AppendInteger(randomValue);
         session.Send(message);
     }
 }
コード例 #19
0
 public override void Compose(Yupi.Protocol.ISender session, int roomId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(roomId);
         message.AppendInteger(0); // TODO Hardcoded
         session.Send(message);
     }
 }
コード例 #20
0
 public override void Compose(Yupi.Protocol.ISender session, int rating, bool canVote)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(rating);
         message.AppendBool(canVote);
         session.Send(message);
     }
 }
コード例 #21
0
 public override void Compose(Yupi.Protocol.ISender session, int itemId, int z)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(itemId);
         message.AppendInteger(Convert.ToUInt32(z * 100));
         session.Send(message);
     }
 }
コード例 #22
0
 public override void Compose(Yupi.Protocol.ISender session, RoomData room)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendString(room.Model.DisplayName);
         message.AppendInteger(room.Id);
         session.Send(message);
     }
 }
コード例 #23
0
 public override void Compose(Yupi.Protocol.ISender room, int entityId, bool isAsleep)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(entityId);
         message.AppendBool(isAsleep);
         room.Send(message);
     }
 }
コード例 #24
0
 public override void Compose(Yupi.Protocol.ISender session, int status, string name)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(status);
         message.AppendString(name);
         session.Send(message);
     }
 }
コード例 #25
0
 public override void Compose(Yupi.Protocol.ISender session, TradeUser first, TradeUser second)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         Serialize(first, message);
         Serialize(second, message);
         session.Send(message);
     }
 }
コード例 #26
0
 public override void Compose(Yupi.Protocol.ISender session, UserInfo user)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(user.UsersRooms.Count >= 75 ? 1 : 0); // TODO Enum
         message.AppendInteger(75);                                  // TODO Magic number
         session.Send(message);
     }
 }
コード例 #27
0
 public override void Compose(Yupi.Protocol.ISender session, string text)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendString(text);
         message.AppendString(string.Empty);
         session.Send(message);
     }
 }
コード例 #28
0
 public override void Compose(Yupi.Protocol.ISender session, UserInfo habbo)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendString(habbo.Look);
         message.AppendString(habbo.Gender.ToUpper()); // TODO Make sure gender is stored UPPER
         session.Send(message);
     }
 }
コード例 #29
0
 public override void Compose(Yupi.Protocol.ISender session, uint roomId, uint userId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendInteger(roomId);
         message.AppendInteger(userId);
         session.Send(message);
     }
 }
コード例 #30
0
 public override void Compose(Yupi.Protocol.ISender session, WallItem item, int pickerId)
 {
     using (ServerMessage message = Pool.GetMessageBuffer(Id))
     {
         message.AppendString(item.Id.ToString());
         message.AppendInteger(pickerId);
         session.Send(message);
     }
 }