本文整理汇总了C#中Azure.Messages.ServerMessage.GetReversedBytes方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.GetReversedBytes方法的具体用法?C# ServerMessage.GetReversedBytes怎么用?C# ServerMessage.GetReversedBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Azure.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.GetReversedBytes方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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());
}
示例2: Execute
public override void Execute(GameClient session, string[] pms)
{
var roomId = session.GetHabbo().CurrentRoom.RoomId;
var users = new List<RoomUser>(session.GetHabbo().CurrentRoom.GetRoomUserManager().UserList.Values);
AzureEmulator.GetGame().GetRoomManager().UnloadRoom(session.GetHabbo().CurrentRoom, "Unload command");
if (!_reEnter) return;
AzureEmulator.GetGame().GetRoomManager().LoadRoom(roomId);
var roomFwd = new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer"));
roomFwd.AppendInteger(roomId);
var data = roomFwd.GetReversedBytes();
foreach (var user in users.Where(user => user != null && user.GetClient() != null)) user.GetClient().SendMessage(data);
}
示例3: Execute
public override bool Execute(GameClient session, string[] pms)
{
var room = session.GetHabbo().CurrentRoom;
using (var queryReactor = Azure.GetDatabaseManager().GetQueryReactor())
queryReactor.RunFastQuery(string.Format("UPDATE rooms_data SET roomtype = 'public' WHERE id = {0}",
room.RoomId));
var roomId = session.GetHabbo().CurrentRoom.RoomId;
var users = new List<RoomUser>(session.GetHabbo().CurrentRoom.GetRoomUserManager().UserList.Values);
Azure.GetGame().GetRoomManager().UnloadRoom(session.GetHabbo().CurrentRoom, "Unload command");
Azure.GetGame().GetRoomManager().LoadRoom(roomId);
var roomFwd = new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer"));
roomFwd.AppendInteger(roomId);
var data = roomFwd.GetReversedBytes();
foreach (var user in users.Where(user => user != null && user.GetClient() != null))
user.GetClient().SendMessage(data);
return true;
}
示例4: AppendResponse
/// <summary>
/// Appends the response.
/// </summary>
/// <param name="message">The message.</param>
internal void AppendResponse(ServerMessage message)
{
AppendBytes(message.GetReversedBytes());
}
示例5: QueueBroadcaseMessage
/// <summary>
/// Queues the broadcase message.
/// </summary>
/// <param name="message">The message.</param>
internal void QueueBroadcaseMessage(ServerMessage message)
{
_broadcastQueue.Enqueue(message.GetReversedBytes());
}
示例6: ModAlert
/// <summary>
/// Mods the alert.
/// </summary>
/// <param name="message">The message.</param>
internal void ModAlert(ServerMessage message)
{
var bytes = message.GetReversedBytes();
foreach (
var current in
Clients.Values.Where(current => current != null && current.GetHabbo() != null))
{
if (current.GetHabbo().Rank != 4u && current.GetHabbo().Rank != 5u)
if (current.GetHabbo().Rank != 6u)
continue;
try
{
current.GetConnection().SendData(bytes);
}
catch
{
}
}
}
示例7: Load
/// <summary>
/// Loads this instance.
/// </summary>
public static void Load()
{
Cache.Clear();
var message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString("furni_placement_error");
message.AppendInteger(1);
message.AppendString("message");
message.AppendString("${room.error.cant_set_item}");
Cache.Add(StaticMessage.ErrorCantSetItem, message.GetReversedBytes());
message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString("furni_placement_error");
message.AppendInteger(1);
message.AppendString("message");
message.AppendString("${room.error.cant_set_not_owner}");
Cache.Add(StaticMessage.ErrorCantSetNotOwner, message.GetReversedBytes());
message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString("game_promo_small");
message.AppendInteger(4);
message.AppendString("title");
message.AppendString("${generic.notice}");
message.AppendString("message");
message.AppendString("Now, the commands page opens in a different way");
message.AppendString("linkUrl");
message.AppendString("event:habbopages/chat/newway");
message.AppendString("linkTitle");
message.AppendString("${mod.alert.link}");
Cache.Add(StaticMessage.NewWayToOpenCommandsList, message.GetReversedBytes());
message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString(string.Empty);
message.AppendInteger(4);
message.AppendString("title");
message.AppendString("${generic.notice}");
message.AppendString("message");
message.AppendString("${catalog.gift_wrapping.receiver_not_found.title}");
message.AppendString("linkUrl");
message.AppendString("event:");
message.AppendString("linkTitle");
message.AppendString("ok");
Cache.Add(StaticMessage.UserNotFound, message.GetReversedBytes());
message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString(string.Empty);
message.AppendInteger(4);
message.AppendString("title");
message.AppendString("${generic.notice}");
message.AppendString("message");
message.AppendString("Has superado el máximo de furnis en el inventario. Solo se te mostrarán 2800 furnis, si quieres ver los restantes, coloca algunos furnis en tus salas.");
message.AppendString("linkUrl");
message.AppendString("event:");
message.AppendString("linkTitle");
message.AppendString("ok");
Cache.Add(StaticMessage.AdviceMaxItems, message.GetReversedBytes());
message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString(string.Empty);
message.AppendInteger(4);
message.AppendString("title");
message.AppendString("${generic.notice}");
message.AppendString("message");
message.AppendString("Has superado el máximo de furnis en el inventario. No puedes comprar más hasta que te desagas de algunos furnis.");
message.AppendString("linkUrl");
message.AppendString("event:");
message.AppendString("linkTitle");
message.AppendString("ok");
Cache.Add(StaticMessage.AdvicePurchaseMaxItems, message.GetReversedBytes());
message = new ServerMessage(LibraryParser.OutgoingRequest("CatalogueOfferConfigMessageComposer"));
message.AppendInteger(100);// purchase_limit
message.AppendInteger(6);// offer_multiplier
message.AppendInteger(2);// free_objets_per_multiplier
message.AppendInteger(1);// inversed_credit_reduction
message.AppendInteger(2); // array count
message.AppendInteger(40);
message.AppendInteger(99);
Cache.Add(StaticMessage.CatalogOffersConfiguration, message.GetReversedBytes());
message = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString(string.Empty);
message.AppendInteger(4);
message.AppendString("title");
message.AppendString("${notification.figureset.redeemed.success.title}");
message.AppendString("message");
message.AppendString("${notification.figureset.redeemed.success.message}");
message.AppendString("linkUrl");
message.AppendString("event:avatareditor/open");
message.AppendString("linkTitle");
message.AppendString("${notification.figureset.redeemed.success.linkTitle}");
Cache.Add(StaticMessage.FiguresetRedeemed, message.GetReversedBytes());
message.Dispose();
}
示例8: ModAlert
/// <summary>
/// Mods the alert.
/// </summary>
/// <param name="message">The message.</param>
internal void ModAlert(ServerMessage message)
{
var bytes = message.GetReversedBytes();
foreach (var current in Clients.Values.Where(current => current?.GetHabbo() != null).Where(current => (current.GetHabbo().Rank == 4u || current.GetHabbo().Rank == 5u) || current.GetHabbo().Rank == 6u))
current.GetConnection().SendData(bytes);
}
示例9: SendMessage
/// <summary>
/// Sends the message.
/// </summary>
/// <param name="message">The message.</param>
internal void SendMessage(ServerMessage message)
{
if (message == null)
return;
if (GetConnection() == null)
return;
var bytes = message.GetReversedBytes();
GetConnection().SendData(bytes);
}
示例10: GetBytesNotif
/// <summary>
/// Gets the bytes notif.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="title">The title.</param>
/// <param name="picture">The picture.</param>
/// <returns>System.Byte[].</returns>
public static byte[] GetBytesNotif(string message, string title = "Aviso", string picture = "")
{
using (var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer")))
{
serverMessage.AppendString(picture);
serverMessage.AppendInteger(4);
serverMessage.AppendString("title");
serverMessage.AppendString(title);
serverMessage.AppendString("message");
serverMessage.AppendString(message);
serverMessage.AppendString("linkUrl");
serverMessage.AppendString("event:");
serverMessage.AppendString("linkTitle");
serverMessage.AppendString("ok");
return serverMessage.GetReversedBytes();
}
}
示例11: SendMessageToUsersWithRights
/// <summary>
/// Sends the message to users with rights.
/// </summary>
/// <param name="message">The message.</param>
internal void SendMessageToUsersWithRights(ServerMessage message)
{
var messagebytes = message.GetReversedBytes();
try
{
foreach (var unit in _roomUserManager.UserList.Values)
{
var user = unit;
if (user == null)
continue;
if (user.IsBot)
continue;
var usersClient = user.GetClient();
if (usersClient == null || usersClient.GetConnection() == null)
continue;
if (!CheckRights(usersClient))
continue;
usersClient.GetConnection().SendData(messagebytes);
}
}
catch (Exception e)
{
Logging.HandleException(e, "SendMessageToUsersWithRights");
}
}
示例12: SendMessage
/// <summary>
/// Sends the message.
/// </summary>
/// <param name="message">The message.</param>
internal void SendMessage(ServerMessage message)
{
if (message != null)
SendMessage(message.GetReversedBytes());
}
示例13: BroadcastChatMessage
/// <summary>
/// Broadcasts the chat message.
/// </summary>
/// <param name="chatMsg">The chat MSG.</param>
/// <param name="roomUser">The room user.</param>
/// <param name="p">The p.</param>
internal void BroadcastChatMessage(ServerMessage chatMsg, RoomUser roomUser, uint p)
{
try
{
var packetData = chatMsg.GetReversedBytes();
foreach (var user in _roomUserManager.UserList.Values)
{
if (user.IsBot || user.IsPet)
continue;
var usersClient = user.GetClient();
if (usersClient == null || roomUser == null || usersClient.GetHabbo() == null)
continue;
try
{
if (user.OnCampingTent || !roomUser.OnCampingTent)
{
if (!usersClient.GetHabbo().MutedUsers.Contains(p))
usersClient.SendMessage(packetData);
}
}
catch (Exception e)
{
Logging.HandleException(e, "Room.SendMessageToUsersWithRights");
}
}
}
catch (Exception e)
{
Logging.HandleException(e, "Room.SendMessageToUsersWithRights");
}
}