本文整理汇总了C#中Cyber.Messages.ServerMessage.GetBytes方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.GetBytes方法的具体用法?C# ServerMessage.GetBytes怎么用?C# ServerMessage.GetBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cyber.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.GetBytes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ModAlert
internal void ModAlert(ServerMessage Message)
{
byte[] bytes = Message.GetBytes();
foreach (GameClient current in this.clients.Values)
{
if (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
{
}
}
}
}
示例2: appendResponse
internal void appendResponse(ServerMessage message)
{
this.appendBytes(message.GetBytes());
}
示例3: SendMessage
internal void SendMessage(ServerMessage Message)
{
byte[] bytes = Message.GetBytes();
if (Message == null)
{
return;
}
if (this.GetConnection() == null)
{
return;
}
this.GetConnection().SendData(bytes);
}
示例4: SendMessageToUsersWithRights
internal void SendMessageToUsersWithRights(ServerMessage Message)
{
try
{
byte[] bytes = Message.GetBytes();
foreach (RoomUser current in this.roomUserManager.UserList.Values)
{
if (!current.IsBot)
{
GameClient client = current.GetClient();
if (client != null && this.CheckRights(client))
{
try
{
client.GetConnection().SendData(bytes);
}
catch (Exception pException)
{
Logging.HandleException(pException, "Room.SendMessageToUsersWithRights");
}
}
}
}
}
catch (Exception pException2)
{
Logging.HandleException(pException2, "Room.SendMessageToUsersWithRights");
}
}
示例5: SendMessage
internal void SendMessage(ServerMessage Message)
{
if (Message != null)
{
byte[] message = Message.GetBytes();
SendMessage(message);
}
}
示例6: BroadcastChatMessage
internal void BroadcastChatMessage(ServerMessage chatMsg, RoomUser roomUser, uint p)
{
try
{
var roomUsers = GetRoomUserManager().GetRoomUsers();
byte[] msg = chatMsg.GetBytes();
foreach (RoomUser User in roomUsers)
{
if (!User.OnCampingTent && roomUser.OnCampingTent)
continue;
else if (User.GetClient().GetHabbo().MutedUsers.Contains(p))
continue;
User.SendMessage(msg);
}
}
catch
{
}
}