本文整理汇总了C#中Pici.Messages.ServerMessage类的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage类的具体用法?C# ServerMessage怎么用?C# ServerMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerMessage类属于Pici.Messages命名空间,在下文中一共展示了ServerMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Trade
internal Trade(UInt32 UserOneId, UInt32 UserTwoId, UInt32 RoomId)
{
this.oneId = UserOneId;
this.twoId = UserTwoId;
this.Users = new TradeUser[2];
this.Users[0] = new TradeUser(UserOneId, RoomId);
this.Users[1] = new TradeUser(UserTwoId, RoomId);
this.TradeStage = 1;
this.RoomId = RoomId;
foreach (TradeUser User in Users)
{
if (!User.GetRoomUser().Statusses.ContainsKey("trd"))
{
User.GetRoomUser().AddStatus("trd", "");
User.GetRoomUser().UpdateNeeded = true;
}
}
ServerMessage Message = new ServerMessage(104);
Message.AppendUInt(UserOneId);
Message.AppendBoolean(true);
Message.AppendUInt(UserTwoId);
Message.AppendBoolean(true);
SendMessageToUsers(Message);
}
示例2: Compose
internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
{
ServerMessage Message = new ServerMessage(436); //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.AppendStringWithBreak(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(UserData != null ? UserData.Progress : 0); // Current progress
Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false); // Set 100% completed(??)
Message.AppendStringWithBreak(Achievement.Category); // Category
Message.AppendInt32(TotalLevels); // Total amount of levels
}
return Message;
}
示例3: Serialize
internal void Serialize(ref ServerMessage message)
{
foreach (ChatMessage chatMessage in listOfMessages)
{
chatMessage.Serialize(ref message);
}
}
示例4: 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;
}
示例5: DeliverInstantMessage
internal void DeliverInstantMessage(string message, uint convoID)
{
ServerMessage InstantMessage = new ServerMessage(134);
InstantMessage.AppendUInt(convoID);
InstantMessage.AppendString(message);
GetClient().SendMessage(InstantMessage);
}
示例6: SerializeTopic
internal static ServerMessage SerializeTopic(HelpTopic Topic)
{
ServerMessage Top = new ServerMessage(520);
Top.AppendUInt(Topic.TopicId);
Top.AppendStringWithBreak(Topic.Body);
return Top;
}
示例7: SerializeSearchResults
internal static ServerMessage SerializeSearchResults(string Query)
{
DataTable Results = null;
using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
{
if (dbClient.dbType == Pici.Storage.Database.DatabaseType.MySQL)
dbClient.setQuery("SELECT id,title FROM help_topics WHERE title LIKE @query OR body LIKE @query LIMIT 25");
else
dbClient.setQuery("SELECT TOP 25 id,title FROM help_topics WHERE title LIKE @query OR body LIKE @query");
dbClient.addParameter("query", Query + "%");
Results = dbClient.getTable();
}
// HII[KBCan I pay to be unbanned?
ServerMessage Search = new ServerMessage(521);
if (Results == null)
{
Search.AppendBoolean(false);
return Search;
}
Search.AppendInt32(Results.Rows.Count);
foreach (DataRow Row in Results.Rows)
{
Search.AppendUInt(Convert.ToUInt32(Row["id"]));
Search.AppendStringWithBreak((string)Row["title"]);
}
return Search;
}
示例8: Serialize
internal void Serialize(ServerMessage Request)
{
// [email protected]22033860
Request.AppendUInt(FromUser);
Request.AppendStringWithBreak(mUsername);
Request.AppendStringWithBreak(FromUser.ToString());
}
示例9: Serialize
internal void Serialize(ref ServerMessage packet)
{
packet.AppendInt32(timeSpoken.Hour);
packet.AppendInt32(timeSpoken.Minute);
packet.AppendUInt(userID);
packet.AppendStringWithBreak(username);
packet.AppendStringWithBreak(message);
}
示例10: Serialize
internal void Serialize(ServerMessage Message)
{
Message.AppendInt32(BackgroundImage);
Message.AppendInt32(ForegroundImage);
Message.AppendInt32(Items.Count);
foreach (KeyValuePair<int, int> Item in Items)
{
Message.AppendInt32(Item.Key);
Message.AppendInt32(Item.Value);
}
}
示例11: SerializeUpdate
internal static ServerMessage SerializeUpdate(MessengerBuddy friend)
{
ServerMessage reply = new ServerMessage(13);
reply.AppendInt32(0);
reply.AppendInt32(1);
reply.AppendInt32(0);
friend.Serialize(reply);
reply.AppendBoolean(false);
return reply;
}
示例12: Compose
internal static ServerMessage Compose(int PlaylistCapacity, List<SongInstance> Playlist)
{
ServerMessage Message = new ServerMessage(334);
Message.AppendInt32(PlaylistCapacity);
Message.AppendInt32(Playlist.Count);
foreach (SongInstance Song in Playlist)
{
Message.AppendUInt(Song.DiskItem.itemID);
Message.AppendUInt(Song.SongData.Id);
}
return Message;
}
示例13: MoveBall
internal void MoveBall(RoomItem item, GameClient mover, int newX, int newY)
{
if (item == null || mover == null)
return;
if (!room.GetGameMap().itemCanBePlacedHere(newX, newY))
return;
Point oldRoomCoord = item.Coordinate;
bool itemIsOnGameItem = GameItemOverlaps(item);
Double NewZ = room.GetGameMap().Model.SqFloorHeight[newX, newY];
ServerMessage Message = new ServerMessage(95);
Message.AppendUInt(item.Id);
Message.AppendInt32(3508);
Message.AppendInt32(item.Coordinate.X);
Message.AppendInt32(item.Coordinate.Y);
Message.AppendInt32(newX);
Message.AppendInt32(newY);
Message.AppendInt32(4);
Message.AppendStringWithBreak(NewZ.ToString());
Message.AppendStringWithBreak("H11");
Message.AppendInt32(-1);
Message.AppendInt32(0);
room.SendMessage(Message);
ServerMessage mMessage = new ServerMessage();
mMessage.Init(230); // Cf
mMessage.AppendInt32(item.Coordinate.X);
mMessage.AppendInt32(item.Coordinate.Y);
mMessage.AppendInt32(newX);
mMessage.AppendInt32(newY);
mMessage.AppendInt32(1);
mMessage.AppendUInt(item.Id);
mMessage.AppendStringWithBreak(item.GetZ.ToString().Replace(',', '.'));
mMessage.AppendStringWithBreak(NewZ.ToString().Replace(',', '.'));
mMessage.AppendInt32(0);
room.SendMessage(mMessage);
if (oldRoomCoord.X == newX && oldRoomCoord.Y == newY)
return;
room.GetRoomItemHandler().SetFloorItem(mover, item, newX, newY, item.Rot, false, false, false, false);
if (!itemIsOnGameItem)
HandleFootballGameItems(new Point(newX, newY), room.GetRoomUserManager().GetRoomUserByHabbo(mover.GetHabbo().Id));
}
示例14: Compose
internal static ServerMessage Compose(Achievement Achievement, int Level, int PointReward, int PixelReward)
{
ServerMessage Message = new ServerMessage(437);
Message.AppendUInt(Achievement.Id); // Achievement ID
Message.AppendInt32(Level); // Achieved level
Message.AppendInt32(144); // Unknown. Random useless number.
Message.AppendStringWithBreak(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.AppendStringWithBreak(Level > 1 ? Achievement.GroupName + (Level - 1) : string.Empty);
Message.AppendStringWithBreak(Achievement.Category);
return Message;
}
示例15: Compose
internal static ServerMessage Compose(Achievement Achievement, int TargetLevel, AchievementLevel TargetLevelData,
int TotalLevels, UserAchievement UserData)
{
ServerMessage Message = new ServerMessage(913);
Message.AppendUInt(Achievement.Id); // Unknown (ID?)
Message.AppendInt32(TargetLevel); // Target level
Message.AppendStringWithBreak(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(UserData != null ? UserData.Progress : 0); // Current progress
Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false); // Set 100% completed(??)
Message.AppendStringWithBreak(Achievement.Category); // Category
Message.AppendInt32(TotalLevels); // Total amount of levels
return Message;
}