本文整理汇总了C#中ServerMessage.AppendInt32方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendInt32方法的具体用法?C# ServerMessage.AppendInt32怎么用?C# ServerMessage.AppendInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compose
public static ServerMessage Compose(ModerationTicket Ticket, RoomInfo Info, ReadOnlyCollection<ModerationChatlogEntry> Entries)
{
ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_CHATLOGS_TICKET);
Message.AppendUInt32(Ticket.Id);
Message.AppendUInt32(Ticket.ReporteeUserId);
Message.AppendUInt32(Ticket.ReportedUserId);
Message.AppendUInt32(Ticket.Id); // Number to display in title. Chatlog ID?
Message.AppendBoolean(Info != null ? Info.Type == RoomType.Public : false);
Message.AppendUInt32(Info != null ? Info.Id : 0);
Message.AppendStringWithBreak(Info != null ? Info.Name : "(Unknown room)");
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(Entry.UserName);
Message.AppendStringWithBreak(Entry.Message);
}
return Message;
}
示例2: Compose
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;
}
示例3: Compose
public static ServerMessage Compose(List<Achievement> Achievements)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ACHIEVEMENT_DATA_LIST);
Message.AppendInt32(Achievements.Count);
foreach (Achievement Achievement in Achievements)
{
string DisplayName = Achievement.GroupName;
if (DisplayName.StartsWith("ACH_"))
{
DisplayName = DisplayName.Substring(4);
}
Message.AppendStringWithBreak(DisplayName);
Message.AppendInt32(Achievement.Levels.Count);
foreach (AchievementLevel Level in Achievement.Levels.Values)
{
Message.AppendInt32(Level.Number);
Message.AppendInt32(Level.Requirement);
}
}
return Message;
}
示例4: Compose
public static ServerMessage Compose(List<RoomActor> Actors)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_USER_STATUS_LIST);
Message.AppendInt32(Actors.Count);
foreach (RoomActor Actor in Actors)
{
// a|rBPCRB0.0JJ//
Message.AppendUInt32(Actor.Id);
Message.AppendInt32(Actor.Position.X);
Message.AppendInt32(Actor.Position.Y);
Message.AppendRawDouble(Actor.Position.Z);
Message.AppendInt32(Actor.HeadRotation);
Message.AppendInt32(Actor.BodyRotation);
Message.AppendRawString("/");
foreach (KeyValuePair<string, string> Status in Actor.UserStatusses)
{
Message.AppendRawString(Status.Key + ' ' + Status.Value + '/');
}
Message.AppendStringWithBreak("/");
}
return Message;
}
示例5: Compose
public static ServerMessage Compose(int Balance, int NotifyAmount)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ACTIVITY_POINTS_BALANCE);
Message.AppendInt32(Balance);
Message.AppendInt32(NotifyAmount);
return Message;
}
示例6: Compose
internal static ServerMessage Compose(List<Achievement> Achievements)
{
ServerMessage Message = new ServerMessage(627); //627
Message.AppendInt32(Achievements.Count);
foreach (Achievement Achievement in Achievements)
{
string DisplayName = Achievement.GroupName;
if (DisplayName.StartsWith("ACH_"))
{
DisplayName = DisplayName.Substring(4);
}
Message.AppendStringWithBreak(DisplayName);
Message.AppendInt32(Achievement.Levels.Count);
foreach (AchievementLevel Level in Achievement.Levels.Values)
{
Message.AppendInt32(Level.Level);
Message.AppendInt32(Level.Requirement);
}
}
return Message;
}
示例7: Compose
public static ServerMessage Compose(AvatarEffect Effect)
{
ServerMessage Message = new ServerMessage(OpcodesOut.USER_EFFECT_ADDED);
Message.AppendInt32(Effect.SpriteId);
Message.AppendInt32((int)Effect.Duration);
return Message;
}
示例8: 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;
}
示例9: 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;
}
示例10: Compose
public static ServerMessage Compose(uint ActorId, string MessageText, int EmotionId, ChatType ChatType)
{
StringBuilder TextBuilder = new StringBuilder();
Dictionary<int, string> LinkRefs = new Dictionary<int, string>();
string[] Bits = MessageText.Split(' ');
int i = 0;
int j = 0;
foreach (string Bit in Bits)
{
if (j > 0)
{
TextBuilder.Append(' ');
}
if (Bit.StartsWith("http://"))
{
LinkRefs.Add(i, Bit);
TextBuilder.Append("{" + i++ + "}");
}
else if (Bit.StartsWith("www."))
{
LinkRefs.Add(i, Bit);
TextBuilder.Append("{" + i++ + "}");
}
else
{
TextBuilder.Append(Bit);
}
j++;
}
ServerMessage Message = new ServerMessage(ChatType == ChatType.Say ? OpcodesOut.ROOM_CHAT_SAY : (ChatType ==
ChatType.Whisper ? OpcodesOut.ROOM_CHAT_WHISPER : OpcodesOut.ROOM_CHAT_SHOUT));
Message.AppendUInt32(ActorId);
Message.AppendStringWithBreak(TextBuilder.ToString());
Message.AppendInt32(EmotionId);
Message.AppendInt32(LinkRefs.Count);
foreach (KeyValuePair<int, string> LinkedRef in LinkRefs)
{
string Url = LinkedRef.Value;
if (!Url.StartsWith("http://"))
{
Url = "http://" + Url;
}
Message.AppendStringWithBreak("/link_to.php?url=" + HttpUtility.UrlEncode(Url) + "&hash=xx");
Message.AppendStringWithBreak(LinkedRef.Value);
Message.AppendBoolean(false); // Trusted URL (instaopen)
}
Message.AppendInt32(0); // No idea
Message.AppendBoolean(true);
return Message;
}
示例11: 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;
}
示例12: Serialize
internal void Serialize(ref ServerMessage packet)
{
packet.AppendInt32(timeSpoken.Hour);
packet.AppendInt32(timeSpoken.Minute);
packet.AppendUInt(userID);
packet.AppendStringWithBreak(username);
packet.AppendStringWithBreak(message);
}
示例13: Compose
public static ServerMessage Compose(int errorcode)
{
//Send a server error alert (connection.server.error)
ServerMessage Message = new ServerMessage(OpcodesOut.ERROR_NOTIFICATION);
Message.AppendInt32(1);
Message.AppendInt32(errorcode);
return Message;
}
示例14: Compose
public static ServerMessage Compose()
{
// com.sulake.habbo.communication.messages.incoming.availability.AvailabilityStatusMessageEvent;
ServerMessage Message = new ServerMessage(290); // TODO: Update opcodes + find out what this is used for?
Message.AppendInt32(1);
Message.AppendInt32(0);
return Message;
}
示例15: Compose
public static ServerMessage Compose()
{
ServerMessage Message = new ServerMessage(628); // TODO: Update Opcodes
Message.AppendInt32(1);
Message.AppendInt32(0);
Message.AppendInt32(2971);
return Message;
}