本文整理汇总了C#中Yupi.Messages.ServerMessage.AppendInteger方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendInteger方法的具体用法?C# ServerMessage.AppendInteger怎么用?C# ServerMessage.AppendInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Yupi.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MatchingPollResults
internal static void MatchingPollResults(GameClient client, Poll poll)
{
Room room = client.GetHabbo().CurrentRoom;
if (poll == null || poll.Type != PollType.Matching || room == null)
return;
HashSet<RoomUser> users = room.GetRoomUserManager().GetRoomUsers();
for (int i = 0; i < 10; i++)
{
Thread.Sleep(1000);
foreach (RoomUser roomUser in users)
{
Habbo user = Yupi.GetHabboById(roomUser.UserId);
if (user.AnsweredPool)
{
ServerMessage result =
new ServerMessage(LibraryParser.OutgoingRequest("MatchingPollResultMessageComposer"));
result.AppendInteger(poll.Id);
result.AppendInteger(2);
result.AppendString("0");
result.AppendInteger(poll.AnswersNegative);
result.AppendString("1");
result.AppendInteger(poll.AnswersPositive);
client.SendMessage(result);
}
}
}
foreach (RoomUser roomUser in users)
Yupi.GetHabboById(roomUser.UserId).AnsweredPool = false;
}
示例2: Execute
public override bool Execute(GameClient session, string[] pms)
{
if (!session.GetHabbo().Look.Contains("hd-"))
return true;
string head = session.GetHabbo().Look.Split('.').FirstOrDefault(element => element.StartsWith("hd-"));
string color = "1";
if (!string.IsNullOrEmpty(head))
{
color = head.Split('-')[2];
session.GetHabbo().Look = session.GetHabbo().Look.Replace('.' + head, string.Empty);
}
session.GetHabbo().Look += ".hd-99999-" + color;
using (IQueryAdapter dbClient = Yupi.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery(
"UPDATE users SET look = @look WHERE id = " + session.GetHabbo().Id);
dbClient.AddParameter("look", session.GetHabbo().Look);
dbClient.RunQuery();
}
Room room = session.GetHabbo().CurrentRoom;
RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (user == null) return true;
ServerMessage roomUpdate = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserDataMessageComposer"));
roomUpdate.AppendInteger(user.VirtualId);
roomUpdate.AppendString(session.GetHabbo().Look);
roomUpdate.AppendString(session.GetHabbo().Gender.ToLower());
roomUpdate.AppendString(session.GetHabbo().Motto);
roomUpdate.AppendInteger(session.GetHabbo().AchievementPoints);
room.SendMessage(roomUpdate);
return true;
}
示例3: GetServerMessage
internal ServerMessage GetServerMessage(ServerMessage message, RoomItem item)
{
int cracks = 0;
int cracksMax = MaxCracks(item.GetBaseItem().Name);
if (Yupi.IsNum(item.ExtraData))
cracks = Convert.ToInt16(item.ExtraData);
string state = "0";
if (cracks >= cracksMax)
state = "14";
else if (cracks >= cracksMax*6/7)
state = "12";
else if (cracks >= cracksMax*5/7)
state = "10";
else if (cracks >= cracksMax*4/7)
state = "8";
else if (cracks >= cracksMax*3/7)
state = "6";
else if (cracks >= cracksMax*2/7)
state = "4";
else if (cracks >= cracksMax*1/7)
state = "2";
message.AppendInteger(7);
message.AppendString(state); //state (0-7)
message.AppendInteger(cracks); //actual
message.AppendInteger(cracksMax); //max
return message;
}
示例4: GenerateMessage
internal static void GenerateMessage(Pet pet)
{
ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("PetRespectNotificationMessageComposer"));
serverMessage.AppendInteger(1);
serverMessage.AppendInteger(pet.VirtualId);
pet.SerializeInventory(serverMessage);
pet.Room.SendMessage(serverMessage);
}
示例5: GenerateMessage
internal static void GenerateMessage(Pet pet, uint amount)
{
ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("AddPetExperienceMessageComposer"));
serverMessage.AppendInteger(pet.PetId);
serverMessage.AppendInteger(pet.VirtualId);
serverMessage.AppendInteger(amount);
pet.Room.SendMessage(serverMessage);
}
示例6: Serialize
internal void Serialize(ref ServerMessage message)
{
Habbo habbo = Yupi.GetHabboById(UserId);
message.AppendInteger(Yupi.DifferenceInMilliSeconds(TimeStamp, DateTime.Now));
message.AppendInteger(UserId);
message.AppendString(habbo == null ? "*User not found*" : habbo.UserName);
message.AppendString(Message);
message.AppendBool(GlobalMessage);
}
示例7: GenerateMessage
internal static void GenerateMessage(Pet pet, ServerMessage message, bool levelAfterName = false)
{
message.AppendInteger(pet.PetId);
message.AppendString(pet.Name);
if (levelAfterName)
message.AppendInteger(pet.Level);
message.AppendInteger(pet.RaceId);
message.AppendInteger(pet.Race);
message.AppendString(pet.Type == "pet_monster" ? "ffffff" : pet.Color);
message.AppendInteger(pet.Type == "pet_monster" ? 0u : pet.RaceId);
if (pet.Type == "pet_monster" && pet.MoplaBreed != null)
{
string[] array = pet.MoplaBreed.PlantData.Substring(12).Split(' ');
string[] array2 = array;
foreach (string s in array2)
message.AppendInteger(int.Parse(s));
message.AppendInteger(pet.MoplaBreed.GrowingStatus);
return;
}
message.AppendInteger(0);
message.AppendInteger(0);
}
示例8: Searialize
/// <summary>
/// Searializes the specified reply.
/// </summary>
/// <param name="reply">The reply.</param>
internal void Searialize(ServerMessage reply)
{
reply.AppendInteger(UserId);
reply.AppendString(UserName);
reply.AppendString(Motto);
reply.AppendBool(Yupi.GetGame().GetClientManager().GetClient(UserId) != null);
reply.AppendBool(false);
reply.AppendString(string.Empty);
reply.AppendInteger(0);
reply.AppendString(Look);
reply.AppendString(LastOnline);
}
示例9: SerializePromotionsResultListFlatcats
/// <summary>
/// Serializes the promotions result list flatcats.
/// </summary>
/// <param name="flatCatId">The flat cat identifier.</param>
/// <param name="direct">if set to <c>true</c> [direct].</param>
/// <param name="message">The message.</param>
internal static void SerializePromotionsResultListFlatcats(int flatCatId, bool direct, ServerMessage message)
{
PublicCategory flatCat = Yupi.GetGame().GetNavigator().GetFlatCat(flatCatId);
message.AppendString("new_ads");
message.AppendString(flatCat.Caption);
message.AppendInteger(0);
message.AppendBool(true);
message.AppendInteger(-1);
KeyValuePair<RoomData, uint>[] rooms = Yupi.GetGame().GetRoomManager().GetEventRooms();
Yupi.GetGame().GetNavigator().SerializeNavigatorPopularRoomsNews(ref message, rooms, flatCatId, direct);
}
示例10: Compose
/// <summary>
/// Composes the specified session.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="quest">The quest.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(GameClient session, Quest quest)
{
var amountOfQuestsInCategory = Yupi.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(quest.Category);
var i = quest == null ? amountOfQuestsInCategory : quest.Number;
var i2 = quest == null ? 0 : session.GetHabbo().GetQuestProgress(quest.Id);
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("QuestCompletedMessageComposer"));
serverMessage.AppendString(quest.Category);
serverMessage.AppendInteger(i);
serverMessage.AppendInteger(quest.Name.Contains("xmas2012") ? 1 : amountOfQuestsInCategory);
serverMessage.AppendInteger(quest == null ? 3 : quest.RewardType);
serverMessage.AppendInteger(quest == null ? 0 : quest.Id);
serverMessage.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id);
serverMessage.AppendString(quest == null ? string.Empty : quest.ActionName);
serverMessage.AppendString(quest == null ? string.Empty : quest.DataBit);
serverMessage.AppendInteger(quest == null ? 0 : quest.Reward);
serverMessage.AppendString(quest == null ? string.Empty : quest.Name);
serverMessage.AppendInteger(i2);
serverMessage.AppendInteger(quest == null ? 0u : quest.GoalData);
serverMessage.AppendInteger(quest == null ? 0 : quest.TimeUnlock);
serverMessage.AppendString("");
serverMessage.AppendString("");
serverMessage.AppendBool(true);
serverMessage.AppendBool(true);
return serverMessage;
}
示例11: Execute
public override bool Execute(GameClient client, string[] pms)
{
ServerMessage message =
new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString("Yupi");
message.AppendInteger(4);
message.AppendString("title");
message.AppendString("Yupi");
message.AppendString("message");
StringBuilder info = new StringBuilder();
info.Append("<h5><b>Yupi - Based on Azure Emulator</b><h5></br></br>");
info.Append("<br />");
info.AppendFormat(
"<b><br />Developed by:</b> <br />Kessiler Rodrigues (Kessiler)<br />Claudio Santoro (sant0ro/bi0s) <br />Rafael Oliveira (iPlezier) <br /><br /> ");
info.AppendFormat(
"<b>Thanks to:</b> <br />Jamal, Mike Santifort, Martinmine, Rockster, The old Azure Team, Bruna F., and to all people that uses Yupi.<br /> <br /> ");
info.AppendFormat("<b>Warning:</b><br />1. This emulator was planned to be used for ManiaHotel (maniahotel.com.br) <br />2. Please don't sell this emulator or earn money with it<br />3. All rights reserved to Sulake Corporation Oy<br />4. All Emulator rights for Mania Dev<br />");
message.AppendString(info.ToString());
message.AppendString("linkUrl");
message.AppendString("event:");
message.AppendString("linkTitle");
message.AppendString("ok");
client.SendMessage(message);
return true;
}
示例12: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (client.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
int time;
if (!int.TryParse(pms[1], out time))
{
session.SendWhisper(Yupi.GetLanguage().GetVar("enter_numbers"));
return true;
}
client.GetHabbo().FloodTime = Yupi.GetUnixTimeStamp() + Convert.ToInt32(pms[1]);
ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("FloodFilterMessageComposer"));
serverMessage.AppendInteger(Convert.ToInt32(pms[1]));
client.SendMessage(serverMessage);
return true;
}
示例13: SerializeSearchResultListFlatcats
/// <summary>
/// Serializes the search result list flatcats.
/// </summary>
/// <param name="flatCatId">The flat cat identifier.</param>
/// <param name="direct">if set to <c>true</c> [direct].</param>
/// <param name="message">The message.</param>
internal static void SerializeSearchResultListFlatcats(int flatCatId, bool direct, ServerMessage message)
{
PublicCategory flatCat = Yupi.GetGame().GetNavigator().GetFlatCat(flatCatId);
if (flatCat == null)
return;
message.AppendString($"category__{flatCat.Caption}");
message.AppendString(flatCat.Caption);
message.AppendInteger(0);
message.AppendBool(true);
message.AppendInteger(-1);
KeyValuePair<RoomData, uint>[] rooms = Yupi.GetGame().GetRoomManager().GetActiveRooms();
Yupi.GetGame().GetNavigator().SerializeNavigatorPopularRoomsNews(ref message, rooms, flatCatId, direct);
}
示例14: GenerateMessage
internal static void GenerateMessage(Pet pet)
{
ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("RespectPetComposer"));
serverMessage.AppendInteger(pet.VirtualId);
serverMessage.AppendBool(true);
pet.Room.SendMessage(serverMessage);
}
示例15: Execute
public override bool Execute(GameClient session, string[] pms)
{
using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
{
FurnitureDataManager.SetCache();
Yupi.GetGame().GetItemManager().LoadItems(adapter);
Yupi.GetGame().GetCatalog().Initialize(adapter);
Yupi.GetGame().ReloadItems();
FurnitureDataManager.Clear();
}
Yupi.GetGame()
.GetClientManager()
.QueueBroadcaseMessage(
new ServerMessage(LibraryParser.OutgoingRequest("PublishShopMessageComposer")));
ServerMessage message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString("ninja_promo_LTD");
message.AppendInteger(4);
message.AppendString("title");
message.AppendString("Novo Raro Limitado!");
message.AppendString("message");
message.AppendString(
"<i><h1>Como Assim?</h1>, Um Novo Raro Limitado foi Adicionado na Loja!<br> Descubra como ele é Abrindo a Loja!</br>");
message.AppendString("linkUrl");
message.AppendString("event:catalog/open/ultd_furni");
message.AppendString("linkTitle");
message.AppendString("Ver o Raro");
Yupi.GetGame().GetClientManager().QueueBroadcaseMessage(message);
return true;
}