本文整理汇总了C#中Firewind.Messages.ServerMessage.AppendString方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendString方法的具体用法?C# ServerMessage.AppendString怎么用?C# ServerMessage.AppendString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Firewind.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
internal void Serialize(ref ServerMessage packet)
{
packet.AppendInt32(timeSpoken.Hour);
packet.AppendInt32(timeSpoken.Minute);
packet.AppendInt32(userID);
packet.AppendString(username);
packet.AppendString(message);
}
示例2: AppendToMessage
public void AppendToMessage(ServerMessage message)
{
message.AppendInt32(Data.Count);
foreach (KeyValuePair<string, string> pair in Data)
{
message.AppendString(pair.Key);
message.AppendString(pair.Value);
}
}
示例3: Serialize
internal void Serialize(ServerMessage Request)
{
// [email protected]22033860
Request.AppendInt32(FromUser);
Request.AppendString(mUsername);
Habbo user = FirewindEnvironment.getHabboForName(mUsername);
Request.AppendString((user != null) ? user.Look : "");
}
示例4: Compose
public static ServerMessage Compose(List<SongData> Songs)
{
ServerMessage Message = new ServerMessage(300);
Message.AppendInt32(Songs.Count);
foreach (SongData Song in Songs)
{
Message.AppendUInt(Song.Id);
Message.AppendString(Song.Name);
Message.AppendString(Song.Data);
Message.AppendInt32(Song.LengthMiliseconds);
Message.AppendString(Song.Artist);
}
return Message;
}
示例5: 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.AppendString(DisplayName);
Message.AppendInt32(Achievement.Levels.Count);
foreach (AchievementLevel Level in Achievement.Levels.Values)
{
Message.AppendInt32(Level.Level);
Message.AppendInt32(Level.Requirement);
}
}
return Message;
}
示例6: Compose
internal static ServerMessage Compose(int PlaylistCapacity, List<SongInstance> Playlist)
{
ServerMessage Message = new ServerMessage(Outgoing.PlayList);
Message.AppendInt32(PlaylistCapacity);
Message.AppendInt32(Playlist.Count);
foreach (SongInstance Song in Playlist)
{
Message.AppendUInt(Song.DiskItem.itemID);
Message.AppendUInt(Song.SongData.Id);
Message.AppendString(Song.SongData.Name);
Message.AppendString(Song.SongData.Data);
}
return Message;
}
示例7: Searialize
internal void Searialize(ServerMessage reply)
{
reply.AppendInt32(userID);
reply.AppendString(username);
reply.AppendString(motto);
bool Online = (FirewindEnvironment.GetGame().GetClientManager().GetClientByUserID(userID) != null);
reply.AppendBoolean(Online);
reply.AppendBoolean(false);
reply.AppendString(string.Empty);
reply.AppendInt32(0);
reply.AppendString(look);
reply.AppendString(last_online);
}
示例8: Compose
internal static ServerMessage Compose(Achievement Achievement, int Level, int PointReward, int PixelReward)
{
ServerMessage Message = new ServerMessage(Outgoing.UnlockAchievement);
Message.AppendUInt(Achievement.Id); // Achievement ID
Message.AppendInt32(Level); // Achieved level
Message.AppendInt32(144); // Unknown. Random useless number.
Message.AppendString(Achievement.GroupName + Level); // Achieved name
Message.AppendInt32(PointReward); // Point reward
Message.AppendInt32(PixelReward); // Pixel reward
Message.AppendInt32(0); // Unknown.
Message.AppendInt32(10); // Unknown.
Message.AppendInt32(21); // Unknown. (Extra reward?)
Message.AppendString(Level > 1 ? Achievement.GroupName + (Level - 1) : string.Empty);
Message.AppendString(Achievement.Category);
Message.AppendString(String.Empty);
Message.AppendInt32(0);
Message.AppendInt32(0);
return Message;
}
示例9: Compose
internal static ServerMessage Compose(Achievement Achievement, int TargetLevel, AchievementLevel TargetLevelData,
int TotalLevels, UserAchievement UserData)
{
ServerMessage Message = new ServerMessage(Outgoing.AchievementProgress);
Message.AppendUInt(Achievement.Id); // Unknown (ID?)
Message.AppendInt32(TargetLevel); // Target level
Message.AppendString(Achievement.GroupName + TargetLevel); // Target name/desc/badge
Message.AppendInt32(TargetLevelData.Requirement); // Progress req/target
Message.AppendInt32(TargetLevelData.RewardPixels); // Pixel reward
Message.AppendInt32(TargetLevelData.RewardPoints); // Unknown(??)
Message.AppendInt32(0); // ?
Message.AppendInt32(UserData != null ? UserData.Progress : 0); // Current progress
Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false); // Set 100% completed(??)
Message.AppendString(Achievement.Category); // Category
Message.AppendString(String.Empty);
Message.AppendInt32(TotalLevels); // Total amount of levels
Message.AppendInt32(0);
return Message;
}
示例10: SerializeFloor
internal void SerializeFloor(ServerMessage Message, Boolean Inventory)
{
Message.AppendUInt(Id);
Message.AppendString(mBaseItem.Type.ToString().ToUpper());
Message.AppendUInt(Id);
Message.AppendInt32(GetBaseItem().SpriteId);
Message.AppendInt32(Extra); // extra
Message.AppendInt32(Data.GetTypeID());
Data.AppendToMessage(Message);
Message.AppendBoolean(GetBaseItem().AllowRecycle);
Message.AppendBoolean(GetBaseItem().AllowTrade);
Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
Message.AppendBoolean(Marketplace.CanSellItem(this));
Message.AppendInt32(-1);
Message.AppendString("");
Message.AppendInt32(0);
}
示例11: TryRedeemVoucher
internal static void TryRedeemVoucher(GameClient Session, string Code)
{
if (!IsValidCode(Code))
{
ServerMessage Error = new ServerMessage(Outgoing.VoucherRedeemError);
Error.AppendRawInt32(0); // 0=invalid code,1=technical issue,3=redeem at webpage
Session.SendMessage(Error);
return;
}
int Value = GetVoucherValue(Code);
TryDeleteVoucher(Code);
Session.GetHabbo().Credits += Value;
Session.GetHabbo().UpdateCreditsBalance();
ServerMessage message = new ServerMessage(Outgoing.VoucherRedeemOk);
message.AppendString("Credits"); // productName
message.AppendString("Awesome"); // productDescription
Session.SendMessage(message);
}
示例12: Compose
internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
{
ServerMessage Message = new ServerMessage(Outgoing.AchievementList); //436
Message.AppendInt32(Achievements.Count);
foreach (Achievement Achievement in Achievements)
{
UserAchievement UserData = Session.GetHabbo().GetAchievementData(Achievement.GroupName);
int TargetLevel = (UserData != null ? UserData.Level + 1 : 1);
int TotalLevels = Achievement.Levels.Count;
if (TargetLevel > TotalLevels)
{
TargetLevel = TotalLevels;
}
AchievementLevel TargetLevelData = Achievement.Levels[TargetLevel];
Message.AppendUInt(Achievement.Id); // Unknown (ID?)
Message.AppendInt32(TargetLevel); // Target level
Message.AppendString(Achievement.GroupName + TargetLevel); // Target name/desc/badge
Message.AppendInt32(TargetLevelData.Requirement); // Progress req/target
Message.AppendInt32(TargetLevelData.RewardPixels); // Pixel reward
Message.AppendInt32(TargetLevelData.RewardPoints); // Unknown(??)
Message.AppendInt32(0);
Message.AppendInt32(UserData != null ? UserData.Progress : 0); // Current progress
Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false); // Set 100% completed(??)
Message.AppendString(Achievement.Category); // Category
Message.AppendString(String.Empty);
Message.AppendInt32(TotalLevels); // Total amount of levels
Message.AppendInt32(0);
}
Message.AppendBoolean(false);
Message.AppendBoolean(false);
return Message;
}
示例13: SerializeTo
internal void SerializeTo(RoomData data, ServerMessage Message)
{
Message.AppendString(data.OwnerId + "");
Message.AppendString(data.Owner);
Message.AppendString(RoomId + "");
Message.AppendInt32(Category);
Message.AppendString(Name);
Message.AppendString(Description);
Message.AppendString(StartTime);
Message.AppendInt32(Tags.Count);
foreach (string Tag in Tags.ToArray())
{
Message.AppendString(Tag);
}
}
示例14: Serialize
internal ServerMessage Serialize(GameClient Session)
{
ServerMessage Message = new ServerMessage(Outgoing.RoomEvent);
Message.AppendString(Session.GetHabbo().Id + "");
Message.AppendString(Session.GetHabbo().Username);
Message.AppendString(RoomId + "");
Message.AppendInt32(Category);
Message.AppendString(Name);
Message.AppendString(Description);
Message.AppendString(StartTime);
Message.AppendInt32(Tags.Count);
foreach (string Tag in Tags.ToArray())
{
Message.AppendString(Tag);
}
return Message;
}
示例15: Handle
public bool Handle(RoomUnit unit, Team team, RoomItem item)
{
RoomUser user = unit as RoomUser;
if (user != null && user.GetClient() != null)
{
ServerMessage servermsg = new ServerMessage();
servermsg.Init(Outgoing.Whisp);
servermsg.AppendInt32(user.VirtualID);
servermsg.AppendString(message);
servermsg.AppendInt32(0);
servermsg.AppendInt32(0);
servermsg.AppendInt32(-1);
user.GetClient().SendMessage(servermsg);
handler.OnEvent(itemID);
return true;
}
return false;
}