public static ServerMessage Compose(ModerationTicket Ticket) { string DisplayRoomName = string.Empty; if (Ticket.RoomId > 0) { RoomInfo Info = RoomInfoLoader.GetRoomInfo(Ticket.RoomId); DisplayRoomName = Info == null ? "(Unknown room " + Ticket.RoomId + ")" : Info.Name; } ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_TICKET); Message.AppendUInt32(Ticket.Id); Message.AppendUInt32(Ticket.TabId); Message.AppendUInt32(11); // ?? unknown Message.AppendUInt32(Ticket.CategoryId); Message.AppendUInt32(11); // ?? unknown Message.AppendUInt32(Ticket.Score); Message.AppendUInt32(Ticket.ReporteeUserId); Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Ticket.ReporteeUserId)); Message.AppendUInt32(Ticket.ReportedUserId); Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Ticket.ReportedUserId)); Message.AppendUInt32(Ticket.ModeratorUserId); Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Ticket.ModeratorUserId)); Message.AppendStringWithBreak(Ticket.Message); Message.AppendUInt32(Ticket.RoomId); Message.AppendStringWithBreak(DisplayRoomName); return(Message); }
public static ServerMessage Compose(RoomEvent Event) { ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_EVENT_INFO); if (Event == null) { Message.AppendStringWithBreak("-1"); } else { Message.AppendStringWithBreak(Event.OwnerId.ToString()); Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Event.OwnerId)); Message.AppendStringWithBreak(Event.RoomId.ToString()); Message.AppendInt32(Event.CategoryId); Message.AppendStringWithBreak(Event.Name); Message.AppendStringWithBreak(Event.Description); Message.AppendStringWithBreak(UnixTimestamp.GetDateTimeFromUnixTimestamp(Event.TimestampStarted).ToShortTimeString()); List <string> Tags = Event.Tags; Message.AppendInt32(Tags.Count); foreach (string Tag in Tags) { Message.AppendStringWithBreak(Tag); } } return(Message); }
public static ServerMessage Compose(uint UserId, Dictionary <ModerationRoomVisit, ReadOnlyCollection <ModerationChatlogEntry> > Entries) { string CharacterNameString = CharacterResolverCache.GetNameFromUid(UserId); ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_CHATLOGS_USER); Message.AppendUInt32(UserId); Message.AppendStringWithBreak(CharacterNameString); Message.AppendInt32(Entries.Count); foreach (KeyValuePair <ModerationRoomVisit, ReadOnlyCollection <ModerationChatlogEntry> > EntryData in Entries) { RoomInfo Info = RoomInfoLoader.GetRoomInfo(EntryData.Key.RoomId); Message.AppendBoolean(Info != null && Info.Type == RoomType.Public); Message.AppendUInt32(Info != null ? Info.Id : 0); Message.AppendStringWithBreak(Info != null ? Info.Name : "(Unknown room)"); Message.AppendInt32(EntryData.Value.Count); foreach (ModerationChatlogEntry Entry in EntryData.Value) { DateTime Time = UnixTimestamp.GetDateTimeFromUnixTimestamp(Entry.Timestamp); Message.AppendInt32(Time.Hour); Message.AppendInt32(Time.Minute); Message.AppendUInt32(Entry.UserId); Message.AppendStringWithBreak(Entry.UserId == UserId ? CharacterNameString : CharacterResolverCache.GetNameFromUid(Entry.UserId)); Message.AppendStringWithBreak(Entry.Message); } } return(Message); }
public static ServerMessage Compose(List <uint> Requests) { ServerMessage Message = new ServerMessage(OpcodesOut.MESSENGER_REQUESTS_LIST); Message.AppendInt32(Requests.Count); Message.AppendInt32(Requests.Count); foreach (uint RequestId in Requests) { Message.AppendUInt32(RequestId); Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(RequestId)); Message.AppendStringWithBreak(RequestId.ToString()); } return(Message); }
private static void GetIgnoredUsers(Session Session, ClientMessage Message) { ReadOnlyCollection <uint> IgnoredUsers = Session.IgnoreCache.List; List <string> Names = new List <string>(); foreach (uint IgnoredUser in IgnoredUsers) { string Name = CharacterResolverCache.GetNameFromUid(IgnoredUser); if (Name != "Unknown User" && !Names.Contains(Name)) { Names.Add(Name); } } Session.SendData(IgnoredUserListComposer.Compose(Names)); }
public static ServerMessage Compose(RoomInfo Info, ReadOnlyCollection <ModerationChatlogEntry> Entries) { ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_CHATLOGS_ROOM); Message.AppendBoolean(Info.Type == RoomType.Public); Message.AppendUInt32(Info.Id); Message.AppendStringWithBreak(Info.Name); Message.AppendInt32(Entries.Count); foreach (ModerationChatlogEntry Entry in Entries) { DateTime Time = UnixTimestamp.GetDateTimeFromUnixTimestamp(Entry.Timestamp); Message.AppendInt32(Time.Hour); Message.AppendInt32(Time.Minute); Message.AppendUInt32(Entry.UserId); Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Entry.UserId)); Message.AppendStringWithBreak(Entry.Message); } return(Message); }
public static ServerMessage Compose(uint UserId, ReadOnlyCollection <ModerationRoomVisit> Visits) { ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_ROOM_VISITS); Message.AppendUInt32(UserId); Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(UserId)); Message.AppendInt32(Visits.Count); foreach (ModerationRoomVisit Visit in Visits) { RoomInfo Info = RoomInfoLoader.GetRoomInfo(Visit.RoomId); DateTime Time = UnixTimestamp.GetDateTimeFromUnixTimestamp(Visit.TimestampEntered); Message.AppendBoolean(Info != null && Info.Type == RoomType.Public); Message.AppendUInt32(Info != null ? Info.Id : 0); Message.AppendStringWithBreak(Info != null ? Info.Name : "Unknown Room"); Message.AppendInt32(Time.Hour); Message.AppendInt32(Time.Minute); } return(Message); }
public static ServerMessage Compose(RoomInstance Instance) { ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_EDIT_INFO); Message.AppendUInt32(Instance.Info.Id); Message.AppendStringWithBreak(Instance.Info.Name); Message.AppendStringWithBreak(Instance.Info.Description); Message.AppendInt32((int)Instance.Info.AccessType); Message.AppendInt32(Instance.Info.CategoryId); Message.AppendInt32(Instance.Info.MaxUsers); Message.AppendInt32(Instance.Model.MaxUsers); Message.AppendInt32(Instance.Info.Tags.Count); foreach (string Tag in Instance.Info.Tags) { Message.AppendStringWithBreak(Tag); } Message.AppendInt32(Instance.UsersWithRights.Count); foreach (uint User in Instance.UsersWithRights) { Message.AppendUInt32(User); Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(User)); } // GQjl~rkfasfs!qwHHQFQFHHHIHIHHH Message.AppendInt32(Instance.UsersWithRights.Count); Message.AppendBoolean(Instance.Info.AllowPets); Message.AppendBoolean(Instance.Info.AllowPetEating); Message.AppendBoolean(Instance.Info.DisableRoomBlocking); Message.AppendBoolean(Instance.Info.HideWalls); Message.AppendInt32(Instance.Info.WallThickness); Message.AppendInt32(Instance.Info.FloorThickness); return(Message); }
private static void GiveRights(Session Session, ClientMessage Message) { RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId); if (Instance == null || !Instance.CheckUserRights(Session, true)) { return; } uint UserId = Message.PopWiredUInt32(); if (Instance.GiveUserRights(UserId)) { Session.SendData(RoomRightsGivenConfirmationComposer.Compose(Instance.RoomId, UserId, CharacterResolverCache.GetNameFromUid(UserId))); } }