本文整理汇总了C#中Azure.Messages.ServerMessage类的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage类的具体用法?C# ServerMessage怎么用?C# ServerMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerMessage类属于Azure.Messages命名空间,在下文中一共展示了ServerMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SerializeQuest
/// <summary>
/// Serializes the quest.
/// </summary>
/// <param name="Message">The message.</param>
/// <param name="Session">The session.</param>
/// <param name="Quest">The quest.</param>
/// <param name="Category">The category.</param>
internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
{
if (Message == null || Session == null)
{
return;
}
int amountOfQuestsInCategory = AzureEmulator.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Category);
{
int num = (Quest == null) ? amountOfQuestsInCategory : (Quest.Number - 1);
int num2 = (Quest == null) ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);
if (Quest != null && Quest.IsCompleted(num2))
{
num++;
}
Message.AppendString(Category);
Message.AppendInteger((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : num));
Message.AppendInteger((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory));
Message.AppendInteger((Quest == null) ? 3 : Quest.RewardType);
Message.AppendInteger((Quest == null) ? 0u : Quest.Id);
Message.AppendBool(Quest != null && Session.GetHabbo().CurrentQuestId == Quest.Id);
Message.AppendString((Quest == null) ? string.Empty : Quest.ActionName);
Message.AppendString((Quest == null) ? string.Empty : Quest.DataBit);
Message.AppendInteger((Quest == null) ? 0 : Quest.Reward);
Message.AppendString((Quest == null) ? string.Empty : Quest.Name);
Message.AppendInteger(num2);
Message.AppendInteger((Quest == null) ? 0u : Quest.GoalData);
Message.AppendInteger((Quest == null) ? 0 : Quest.TimeUnlock);
Message.AppendString("");
Message.AppendString("");
Message.AppendBool(true);
}
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:40,代码来源:QuestListComposer.cs
示例2: 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)
{
var flatCat = Azure.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);
try
{
var rooms = Azure.GetGame().GetRoomManager().GetActiveRooms();
Azure.GetGame()
.GetNavigator()
.SerializeNavigatorPopularRoomsNews(ref message, rooms, flatCatId, direct);
}
catch
{
message.AppendInteger(0);
}
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:31,代码来源:SearchResultList.cs
示例3: Serialize
/// <summary>
/// Serializes the specified message.
/// </summary>
/// <param name="message">The message.</param>
internal void Serialize(ServerMessage message)
{
message.StartArray();
foreach (var clothing1 in Clothing)
{
var item1 = AzureEmulator.GetGame().GetClothingManager().GetClothesInFurni(clothing1);
foreach (var clothe in item1.Clothes)
{
message.AppendInteger(clothe);
}
message.SaveArray();
}
message.EndArray();
message.StartArray();
foreach (var clothing2 in Clothing)
{
var item2 = AzureEmulator.GetGame().GetClothingManager().GetClothesInFurni(clothing2);
foreach (var clothe in item2.Clothes)
{
message.AppendString(item2.ItemName);
}
message.SaveArray();
}
message.EndArray();
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:29,代码来源:UserClothing.cs
示例4: SendTicketToModerators
/// <summary>
/// Sends the ticket to moderators.
/// </summary>
/// <param name="ticket">The ticket.</param>
internal static void SendTicketToModerators(SupportTicket ticket)
{
var message = new ServerMessage(LibraryParser.OutgoingRequest("ModerationToolIssueMessageComposer"));
message = ticket.Serialize(message);
Azure.GetGame().GetClientManager().StaffAlert(message);
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:11,代码来源:ModerationTool.cs
示例5: Execute
public override void Execute(GameClient session, string[] pms)
{
var room = session.GetHabbo().CurrentRoom;
var user = room.GetRoomUserManager().GetRoomUserByHabbo(pms[0]);
if (user == null)
{
session.SendWhisper(TextManager.GetText("user_not_found"));
}
var gender = user.GetClient().GetHabbo().Gender;
var look = user.GetClient().GetHabbo().Look;
session.GetHabbo().Gender = gender;
session.GetHabbo().Look = look;
using (var adapter = AzureEmulator.GetDatabaseManager().GetQueryReactor())
{
adapter.SetQuery(
"UPDATE users SET gender = @gender, look = @look WHERE id = " + session.GetHabbo().Id);
adapter.AddParameter("gender", gender);
adapter.AddParameter("look", look);
adapter.RunQuery();
}
var myUser = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().UserName);
if (myUser == null)
return;
var message = new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserDataMessageComposer"));
message.AppendInteger(myUser.VirtualId);
message.AppendString(session.GetHabbo().Look);
message.AppendString(session.GetHabbo().Gender.ToLower());
message.AppendString(session.GetHabbo().Motto);
message.AppendInteger(session.GetHabbo().AchievementPoints);
room.SendMessage(message.GetReversedBytes());
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:35,代码来源:CopyLook.cs
示例6: Execute
public override void Execute(GameClient session, string[] pms)
{
var str = string.Join(" ", pms);
var message = new ServerMessage(LibraryParser.OutgoingRequest("BroadcastNotifMessageComposer"));
message.AppendString(string.Format("{0}\r\n- {1}", str, session.GetHabbo().UserName));
AzureEmulator.GetGame().GetClientManager().QueueBroadcaseMessage(message);
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:7,代码来源:HotelAlert.cs
示例7: Execute
public override bool Execute(GameClient client, string[] pms)
{
var message =
new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString("Azure");
message.AppendInteger(4);
message.AppendString("title");
message.AppendString("ManiaEVO 1.2");
message.AppendString("message");
var info = new StringBuilder();
info.Append("<h5><b>ManiaEVO 1.2 - Base: Azure</b><h5></br></br>");
info.Append("<br />");
info.AppendFormat(
"<b><br />Desenvolvedores:</b> <br />iPlezier <br />Claudi0<br />Kessiler <br /><br /> ");
info.AppendFormat(
"<b>Créditos:</b> <br />Jamal, Claudio, Boris, Lucca, Antoine, IhToN<br /> <br /> ");
info.AppendFormat("<b>Estatisticas:</b> <br />");
var userCount = Azure.GetGame().GetClientManager().Clients.Count;
var roomsCount = Azure.GetGame().GetRoomManager().LoadedRooms.Count;
info.AppendFormat("<b>Usuários:</b> {0} em {1}{2}.<br /><br /><br />", userCount, roomsCount,
(roomsCount == 1) ? " Quarto" : " Quartos");
message.AppendString(info.ToString());
message.AppendString("linkUrl");
message.AppendString("event:");
message.AppendString("linkTitle");
message.AppendString("ok");
client.SendMessage(message);
return true;
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:31,代码来源:About.cs
示例8: MatchingPollResults
internal static void MatchingPollResults(GameClient client, Poll poll)
{
var room = client.GetHabbo().CurrentRoom;
if (poll == null || poll.Type != PollType.Matching || room == null)
return;
var users = room.GetRoomUserManager().GetRoomUsers();
for (var i = 0; i < 10; i++)
{
Thread.Sleep(1000);
foreach (var roomUser in users)
{
var user = Azure.GetHabboById(roomUser.UserId);
if (user.AnsweredPool)
{
var 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 (var roomUser in users)
Azure.GetHabboById(roomUser.UserId).AnsweredPool = false;
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:32,代码来源:StartQuestion.cs
示例9: Execute
public override void Execute(GameClient session, string[] pms)
{
var head = session.GetHabbo().Look.Split('.').FirstOrDefault(element => element.StartsWith("hd-"));
var 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 (var dbClient = AzureEmulator.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery(
"UPDATE users SET look = @look WHERE id = " + session.GetHabbo().Id);
dbClient.AddParameter("look", session.GetHabbo().Look);
dbClient.RunQuery();
}
var room = session.GetHabbo().CurrentRoom;
var user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (user == null) return;
var 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);
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:30,代码来源:FaceLess.cs
示例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 = Azure.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) ? 0u : 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;
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:31,代码来源:QuestCompletedComposer.cs
示例11: Execute
public override bool Execute(GameClient session, string[] pms)
{
using (var adapter = Azure.GetDatabaseManager().GetQueryReactor())
{
FurniDataParser.SetCache();
Azure.GetGame().GetItemManager().LoadItems(adapter);
Azure.GetGame().GetCatalog().Initialize(adapter);
Azure.GetGame().ReloadItems();
FurniDataParser.Clear();
}
Azure.GetGame()
.GetClientManager()
.QueueBroadcaseMessage(
new ServerMessage(LibraryParser.OutgoingRequest("PublishShopMessageComposer")));
var 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");
Azure.GetGame().GetClientManager().QueueBroadcaseMessage(message);
return true;
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:30,代码来源:LTD.cs
示例12: GetServerMessage
internal ServerMessage GetServerMessage(ServerMessage message, RoomItem item)
{
var cracks = 0;
var cracks_max = MaxCracks(item.GetBaseItem().Name);
if (AzureEmulator.IsNum(item.ExtraData))
cracks = Convert.ToInt16(item.ExtraData);
var state = "0";
if (cracks >= cracks_max)
state = "14";
else if (cracks >= cracks_max * 6 / 7)
state = "12";
else if (cracks >= cracks_max * 5 / 7)
state = "10";
else if (cracks >= cracks_max * 4 / 7)
state = "8";
else if (cracks >= cracks_max * 3 / 7)
state = "6";
else if (cracks >= cracks_max * 2 / 7)
state = "4";
else if (cracks >= cracks_max * 1 / 7)
state = "2";
message.AppendInteger(7);
message.AppendString(state); //state (0-7)
message.AppendInteger(cracks); //actual
message.AppendInteger(cracks_max); //max
return message;
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:27,代码来源:CrackableEggHandler.cs
示例13: SerializeQuest
/// <summary>
/// Serializes the quest.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="session">The session.</param>
/// <param name="quest">The quest.</param>
/// <param name="category">The category.</param>
internal static void SerializeQuest(ServerMessage message, GameClient session, Quest quest, string category)
{
if (message == null || session == null)
{
return;
}
var amountOfQuestsInCategory = Azure.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(category);
{
var num = (quest == null) ? amountOfQuestsInCategory : (quest.Number - 1);
var num2 = (quest == null) ? 0 : session.GetHabbo().GetQuestProgress(quest.Id);
if (quest != null && quest.IsCompleted(num2))
{
num++;
}
message.AppendString(category);
message.AppendInteger((quest == null) ? 0 : (quest.Category.Contains("xmas2012") ? 0 : num));
message.AppendInteger((quest == null)
? 0
: (quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory));
message.AppendInteger((quest == null) ? 3 : quest.RewardType);
message.AppendInteger((quest == null) ? 0u : quest.Id);
message.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id);
message.AppendString((quest == null) ? string.Empty : quest.ActionName);
message.AppendString((quest == null) ? string.Empty : quest.DataBit);
message.AppendInteger((quest == null) ? 0 : quest.Reward);
message.AppendString((quest == null) ? string.Empty : quest.Name);
message.AppendInteger(num2);
message.AppendInteger((quest == null) ? 0u : quest.GoalData);
message.AppendInteger((quest == null) ? 0 : quest.TimeUnlock);
message.AppendString("");
message.AppendString("");
message.AppendBool(true);
}
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:42,代码来源:QuestListComposer.cs
示例14: SmallPromoComposer
/// <summary>
/// Smalls the promo composer.
/// </summary>
/// <param name="message">The message.</param>
/// <returns>ServerMessage.</returns>
internal ServerMessage SmallPromoComposer(ServerMessage message)
{
message.AppendInteger(HotelViewPromosIndexers.Count);
foreach (var current in HotelViewPromosIndexers)
current.Serialize(message);
return message;
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:12,代码来源:HotelView.cs
示例15: GenerateMessage
internal void GenerateMessage(ServerMessage message)
{
message.Init(LibraryParser.OutgoingRequest("TargetedOfferMessageComposer"));
message.AppendInteger(1);//show
message.AppendInteger(Id);
message.AppendString(Identifier);
message.AppendString(Identifier);
message.AppendInteger(CostCredits);
if (CostDiamonds > 0)
{
message.AppendInteger(CostDiamonds);
message.AppendInteger(105);
}
else
{
message.AppendInteger(CostDuckets);
message.AppendInteger(0);
}
message.AppendInteger(PurchaseLimit);
var TimeLeft = ExpirationTime - AzureEmulator.GetUnixTimeStamp();
message.AppendInteger(TimeLeft);
message.AppendString(Title);
message.AppendString(Description);
message.AppendString(Image);
message.AppendString("");
message.StartArray();
foreach (string Product in Products)
{
message.AppendString(Product);
message.SaveArray();
}
message.EndArray();
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:33,代码来源:TargetedOffers.cs
示例16: Serialize
/// <summary>
/// Serializes the specified message.
/// </summary>
/// <param name="message">The message.</param>
internal void Serialize(ServerMessage message)
{
message.StartArray();
foreach (
var item1 in
Clothing.Select(clothing1 => Azure.GetGame().GetClothingManager().GetClothesInFurni(clothing1)))
{
foreach (var clothe in item1.Clothes)
message.AppendInteger(clothe);
message.SaveArray();
}
message.EndArray();
message.StartArray();
foreach (
var item2 in
Clothing.Select(clothing2 => Azure.GetGame().GetClothingManager().GetClothesInFurni(clothing2)))
{
foreach (var clothe in item2.Clothes)
message.AppendString(item2.ItemName);
message.SaveArray();
}
message.EndArray();
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:30,代码来源:UserClothing.cs
示例17: Execute
public override void Execute(GameClient session, string[] pms)
{
var client = AzureEmulator.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null)
{
session.SendWhisper(TextManager.GetText("user_not_found"));
return;
}
if (client.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(TextManager.GetText("user_is_higher_rank"));
return;
}
int time;
if (!int.TryParse(pms[1], out time))
{
session.SendWhisper(TextManager.GetText("enter_numbers"));
return;
}
client.GetHabbo().FloodTime = AzureEmulator.GetUnixTimeStamp() + Convert.ToInt32(pms[1]);
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("FloodFilterMessageComposer"));
serverMessage.AppendInteger(Convert.ToInt32(pms[1]));
client.SendMessage(serverMessage);
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:25,代码来源:FloodUser.cs
示例18: ComposeIndex
/// <summary>
/// Composes the index.
/// </summary>
/// <param name="rank">The rank.</param>
/// <param name="type">The type.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage ComposeIndex(uint rank, string type)
{
IEnumerable<CatalogPage> pages =
Azure.GetGame().GetCatalog().Categories.Values.OfType<CatalogPage>().ToList();
var sortedPages = pages.Where(x => x.ParentId == -2 && x.MinRank <= rank).OrderBy(x => x.OrderNum);
if (type == "NORMAL")
sortedPages = pages.Where(x => x.ParentId == -1 && x.MinRank <= rank).OrderBy(x => x.OrderNum);
var message = new ServerMessage(LibraryParser.OutgoingRequest("CatalogueIndexMessageComposer"));
message.AppendBool(true);
message.AppendInteger(0);
message.AppendInteger(-1);
message.AppendString("root");
message.AppendString(string.Empty);
message.AppendInteger(0);
message.AppendInteger(sortedPages.Count());
foreach (var cat in sortedPages)
{
message.AppendBool(cat.Visible);
message.AppendInteger(cat.IconImage);
message.AppendInteger(cat.PageId);
message.AppendString(cat.CodeName);
message.AppendString(cat.Caption);
message.AppendInteger(cat.FlatOffers.Count);
foreach (var i in cat.FlatOffers.Keys)
message.AppendInteger(i);
var sortedSubPages =
pages.Where(x => x.ParentId == cat.PageId && x.MinRank <= rank).OrderBy(x => x.OrderNum);
message.AppendInteger(sortedSubPages.Count());
foreach (var subCat in sortedSubPages)
{
message.AppendBool(subCat.Visible);
message.AppendInteger(subCat.IconImage);
message.AppendInteger(subCat.PageId);
message.AppendString(subCat.CodeName);
message.AppendString(subCat.Caption);
message.AppendInteger(subCat.FlatOffers.Count);
foreach (var i2 in subCat.FlatOffers.Keys)
message.AppendInteger(i2);
message.AppendInteger(0);
}
}
message.AppendBool(false);
message.AppendString(type);
return message;
}
开发者ID:kessiler,项目名称:azureEmulator,代码行数:64,代码来源:CatalogPageComposer.cs
示例19: Serialize
internal void Serialize(ref ServerMessage message)
{
Habbo habbo = AzureEmulator.GetHabboById(UserId);
message.AppendInteger(AzureEmulator.DifferenceInMilliSeconds(TimeStamp, DateTime.Now));
message.AppendInteger(UserId);
message.AppendString(habbo == null ? "*User not found*" : habbo.UserName);
message.AppendString(Message);
message.AppendBool(true);
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:9,代码来源:Chatlog.cs
示例20: CompleteUserTalent
/// <summary>
/// Completes the user talent.
/// </summary>
/// <param name="Session">The session.</param>
/// <param name="Talent">The talent.</param>
internal void CompleteUserTalent(GameClient Session, Talent Talent)
{
if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().CurrentTalentLevel < Talent.Level || Session.GetHabbo().Talents.ContainsKey(Talent.Id))
return;
if (!LevelIsCompleted(Session, Talent.Type, Talent.Level))
return;
if (!string.IsNullOrEmpty(Talent.Prize) && Talent.PrizeBaseItem > 0u)
{
Item item = AzureEmulator.GetGame().GetItemManager().GetItem(Talent.PrizeBaseItem);
AzureEmulator.GetGame().GetCatalog().DeliverItems(Session, item, 1, "", 0, 0, "");
}
var value = new UserTalent(Talent.Id, 1);
Session.GetHabbo().Talents.Add(Talent.Id, value);
using (IQueryAdapter queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
{
queryReactor.RunFastQuery(string.Concat("REPLACE INTO users_talents VALUES (", Session.GetHabbo().Id, ", ", Talent.Id, ", ", 1, ");"));
}
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("TalentLevelUpMessageComposer"));
serverMessage.AppendString(Talent.Type);
serverMessage.AppendInteger(Talent.Level);
serverMessage.AppendInteger(0);
if (Talent.Type == "citizenship" && Talent.Level == 4)
{
serverMessage.AppendInteger(2);
serverMessage.AppendString("HABBO_CLUB_VIP_7_DAYS");
serverMessage.AppendInteger(7);
serverMessage.AppendString(Talent.Prize);
serverMessage.AppendInteger(0);
}
else
{
serverMessage.AppendInteger(1);
serverMessage.AppendString(Talent.Prize);
serverMessage.AppendInteger(0);
}
Session.SendMessage(serverMessage);
if (Talent.Type == "citizenship")
{
if (Talent.Level == 3)
AzureEmulator.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_Citizenship", 1);
else if (Talent.Level == 4)
{
Session.GetHabbo().GetSubscriptionManager().AddSubscription(7);
using (IQueryAdapter queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
{
queryReactor.RunFastQuery(string.Concat(new object[]
{
"UPDATE users SET talent_status = 'helper' WHERE id = ",
Session.GetHabbo().Id,
";"
}));
}
}
}
}
开发者ID:BjkGkh,项目名称:Azure2,代码行数:62,代码来源:TalentManager.cs
注:本文中的Azure.Messages.ServerMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论