本文整理汇总了C#中ServerMessage.AppendUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendUInt32方法的具体用法?C# ServerMessage.AppendUInt32怎么用?C# ServerMessage.AppendUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compose
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;
}
示例2: Compose
public static ServerMessage Compose(uint Code1, uint Code2)
{
ServerMessage Message = new ServerMessage(OpcodesOut.MESSENGER_ERROR_EVENT);
Message.AppendUInt32(Code1);
Message.AppendUInt32(Code2);
return Message;
}
示例3: Compose
public static ServerMessage Compose(uint RoomId, uint UserId)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_RIGHTS_REMOVED_CONFIRMATION);
Message.AppendUInt32(RoomId);
Message.AppendUInt32(UserId);
return Message;
}
示例4: Compose
public static ServerMessage Compose(Vector3 Source, Vector3 Target, uint RollerId, uint ActorId, uint ItemId)
{
bool ItemMode = ItemId > 0;
ServerMessage Message = new ServerMessage(OpcodesOut.ROLLER_EVENT);
Message.AppendInt32(Source.X);
Message.AppendInt32(Source.Y);
Message.AppendInt32(Target.X);
Message.AppendInt32(Target.Y);
Message.AppendBoolean(ItemMode);
if (ItemMode)
{
Message.AppendUInt32(ItemId);
}
else
{
Message.AppendUInt32(RollerId);
Message.AppendInt32(2);
Message.AppendUInt32(ActorId);
}
Message.AppendRawDouble(Source.Z);
Message.AppendRawDouble(Target.Z);
if (ItemMode)
{
Message.AppendUInt32(RollerId);
}
return Message;
}
示例5: Compose
public static ServerMessage Compose(uint ErrorId, uint ConversationId)
{
ServerMessage Message = new ServerMessage(OpcodesOut.MESSENGER_IM_ERROR);
Message.AppendUInt32(ErrorId);
Message.AppendUInt32(ConversationId);
return Message;
}
示例6: Compose
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;
}
示例7: Compose
public static ServerMessage Compose(List<CharacterInfo> Friends, List<CharacterInfo> NonFriends)
{
ServerMessage Message = new ServerMessage(OpcodesOut.MESSENGER_SEARCH_RESULT);
Message.AppendInt32(Friends.Count);
foreach (CharacterInfo Info in Friends)
{
Session FriendSession = SessionManager.GetSessionByCharacterId(Info.Id);
Message.AppendUInt32(Info.Id);
Message.AppendStringWithBreak(Info.Username);
Message.AppendStringWithBreak(Info.Motto);
Message.AppendBoolean(Info.HasLinkedSession);
Message.AppendBoolean(FriendSession != null ? FriendSession.InRoom : false);
Message.AppendStringWithBreak(string.Empty);
Message.AppendBoolean(true);
Message.AppendStringWithBreak(Info.HasLinkedSession ? Info.Figure : string.Empty);
if (Info.HasLinkedSession)
{
Message.AppendStringWithBreak(string.Empty);
}
else
{
DateTime LastOnline = UnixTimestamp.GetDateTimeFromUnixTimestamp(Info.TimestampLastOnline);
Message.AppendStringWithBreak(LastOnline.ToShortDateString() + " " + LastOnline.ToShortTimeString());
}
Message.AppendStringWithBreak(string.Empty);
}
Message.AppendInt32(NonFriends.Count);
foreach (CharacterInfo Info in NonFriends)
{
Message.AppendUInt32(Info.Id);
Message.AppendStringWithBreak(Info.Username);
Message.AppendStringWithBreak(Info.Motto);
Message.AppendBoolean(Info.HasLinkedSession);
Message.AppendBoolean(false); // TODO: InRoom (really needed here??)
Message.AppendStringWithBreak(string.Empty);
Message.AppendBoolean(false);
Message.AppendStringWithBreak(Info.HasLinkedSession ? Info.Figure : string.Empty);
if (Info.HasLinkedSession)
{
Message.AppendStringWithBreak(string.Empty);
}
else
{
DateTime LastOnline = UnixTimestamp.GetDateTimeFromUnixTimestamp(Info.TimestampLastOnline);
Message.AppendStringWithBreak(LastOnline.ToShortDateString() + " " + LastOnline.ToShortTimeString());
}
Message.AppendStringWithBreak(string.Empty);
}
return Message;
}
示例8: Compose
public static ServerMessage Compose(uint RoomId, uint UserId, string Name)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_RIGHTS_GIVEN_CONFIRMATION);
Message.AppendUInt32(RoomId);
Message.AppendUInt32(UserId);
Message.AppendStringWithBreak(Name);
return Message;
}
示例9: Compose
public static ServerMessage Compose(uint UserOne, bool UserOneCanTrade, uint UserTwo, bool UserTwoCanTrade)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_TRADE_INITIATED);
Message.AppendUInt32(UserOne);
Message.AppendBoolean(UserOneCanTrade);
Message.AppendUInt32(UserTwo);
Message.AppendBoolean(UserTwoCanTrade);
return Message;
}
示例10: SerializeInventoryItem
public static void SerializeInventoryItem(ServerMessage Message, Item Item)
{
int TypeNumber = 1;
uint SecondaryId = 0;
switch (Item.Definition.Behavior)
{
default:
case ItemBehavior.StaticItem:
TypeNumber = 1;
break;
case ItemBehavior.Wallpaper:
TypeNumber = 2;
break;
case ItemBehavior.Floor:
TypeNumber = 3;
break;
case ItemBehavior.Landscape:
TypeNumber = 4;
break;
case ItemBehavior.MusicDisk:
TypeNumber = 8;
uint.TryParse(Item.DisplayFlags, out SecondaryId);
break;
}
Message.AppendUInt32(Item.Id); // Item ID in the negatives (0 - id)
Message.AppendStringWithBreak(Item.Definition.TypeLetter.ToUpper()); // Type (I, S, E, etc)
Message.AppendUInt32(Item.Id); // Item ID in the positives (0 + id)
Message.AppendUInt32(Item.Definition.SpriteId); // Sprite
Message.AppendInt32(TypeNumber);
Message.AppendStringWithBreak(Item.DisplayFlags); // Unknown
Message.AppendBoolean(Item.CanRecycle);
Message.AppendBoolean(Item.CanTrade);
Message.AppendBoolean(Item.Definition.AllowInventoryStack);
Message.AppendBoolean(Item.CanSell);
Message.AppendInt32(-1);
if (Item.Definition.Type == ItemType.FloorItem)
{
Message.AppendStringWithBreak(string.Empty);
Message.AppendUInt32(SecondaryId);
}
}
示例11: Compose
public static ServerMessage Compose(uint DisplayId, Pet Pet)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_PET_UPDATE);
Message.AppendInt32(9);
Message.AppendUInt32(DisplayId);
Message.AppendUInt32(DisplayId);
Message.AppendStringWithBreak(Pet.Name);
Message.AppendInt32(Pet.Type);
Message.AppendInt32(Pet.Race);
Message.AppendStringWithBreak(Pet.ColorCode);
return Message;
}
示例12: Compose
public static ServerMessage Compose(int PlaylistCapacity, List<SongInstance> Playlist)
{
ServerMessage Message = new ServerMessage(OpcodesOut.JUKEBOX_PLAYLIST);
Message.AppendInt32(PlaylistCapacity);
Message.AppendInt32(Playlist.Count);
foreach (SongInstance Song in Playlist)
{
Message.AppendUInt32(Song.DiskItem.Id);
Message.AppendUInt32(Song.SongData.Id);
}
return Message;
}
示例13: Compose
public static ServerMessage Compose(uint CharacterId, SortedDictionary<int, Badge> Badges)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_USER_BADGES);
Message.AppendUInt32(CharacterId);
Message.AppendInt32(Badges.Count);
foreach (Badge Badge in Badges.Values)
{
Message.AppendUInt32(Badge.Id);
Message.AppendStringWithBreak(Badge.Code);
}
return Message;
}
示例14: SerializeOfficialItem
private static void SerializeOfficialItem(NavigatorOfficialItem Item, ServerMessage Message)
{
RoomInstance Instance = null;
RoomInfo Info = null;
if (!Item.IsCategory)
{
Instance = Item.TryGetRoomInstance();
Info = Item.GetRoomInfo();
}
int Type = 3;
if (Item.IsCategory)
{
Type = 4;
}
else if (Info != null && Info.Type == RoomType.Flat)
{
Type = 2;
}
Message.AppendUInt32(Item.Id);
Message.AppendStringWithBreak(Item.Name);
Message.AppendStringWithBreak(Item.Descr);
Message.AppendInt32((int)Item.DisplayType);
Message.AppendStringWithBreak(Item.BannerLabel);
Message.AppendStringWithBreak(Item.ImageType == NavigatorOfficialItemImageType.External ? Item.Image : string.Empty);
Message.AppendUInt32(Item.ParentId);
Message.AppendInt32(Info != null ? Info.CurrentUsers : 0);
Message.AppendInt32(Type);
if (Item.IsCategory)
{
Message.AppendBoolean(Item.CategoryAutoExpand); // Category auto expand
}
else if (Info != null && Info.Type == RoomType.Public)
{
Message.AppendStringWithBreak(Item.ImageType == NavigatorOfficialItemImageType.Internal ? Item.Image : string.Empty);
Message.AppendInt32(0); // Appears to be nothing but junk!
Message.AppendInt32(0); // Something to do with room parts (e.g. lido part 0 & 1) default 0
Message.AppendStringWithBreak(Info.SWFs);
Message.AppendInt32(Info.MaxUsers);
Message.AppendUInt32(Info.Id);
}
else if (Info != null && Info.Type == RoomType.Flat)
{
NavigatorRoomListComposer.SerializeRoom(Message, Info);
}
}
示例15: Compose
public static ServerMessage Compose(uint CategoryId, List<HelpTopic> Topics)
{
ServerMessage Message = new ServerMessage(OpcodesOut.HELP_TOPIC_LIST);
Message.AppendUInt32(CategoryId);
Message.AppendStringWithBreak(string.Empty);
Message.AppendInt32(Topics.Count);
foreach (HelpTopic Topic in Topics)
{
Message.AppendUInt32(Topic.Id);
Message.AppendStringWithBreak(Topic.Title);
}
return Message;
}