本文整理汇总了C#中Essential.Messages.ServerMessage.GetBytes方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.GetBytes方法的具体用法?C# ServerMessage.GetBytes怎么用?C# ServerMessage.GetBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.GetBytes方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: method_61
public void method_61(ServerMessage Message5_0)
{
try
{
byte[] array = Message5_0.GetBytes();
for (int i = 0; i < this.RoomUsers.Length; i++)
{
RoomUser @class = this.RoomUsers[i];
if (@class != null && [email protected])
{
GameClient class2 = @class.GetClient();
if (class2 != null && this.method_26(class2))
{
try
{
class2.GetConnection().SendData(array);
}
catch
{
}
}
}
}
}
catch (InvalidOperationException)
{
}
}
示例2: SendMessage
public void SendMessage(ServerMessage Message)
{
if (Message != null)
{
if (this.IsMobileUser)
this.SendData(Encoding.Default.GetBytes(Message.GetMobileString()));
else
this.SendData(Message.GetBytes());
}
}
示例3: SendMessage
internal void SendMessage(ServerMessage Message5_0, List<uint> list_18)
{
try
{
if (this.RoomUsers != null)
{
byte[] array = Message5_0.GetBytes();
//Console.WriteLine("[ROOM][OUTGOING][" + Message5_0.Id + "] " + Message5_0.ToString());
for (int i = 0; i < this.RoomUsers.Length; i++)
{
RoomUser @class = this.RoomUsers[i];
if (@class != null && [email protected])
{
GameClient class2 = @class.GetClient();
if (class2 != null && (list_18 == null || !list_18.Contains(class2.GetHabbo().Id)))
{
try
{
class2.GetConnection().SendData(array);
}
catch
{
}
}
}
}
}
}
catch (InvalidOperationException)
{
}
}
示例4: method_60
internal void method_60(ServerMessage Message5_0, int int_17)
{
try
{
byte[] array = Message5_0.GetBytes();
for (int i = 0; i < this.RoomUsers.Length; i++)
{
RoomUser @class = this.RoomUsers[i];
if (@class != null && [email protected])
{
GameClient class2 = @class.GetClient();
if (class2 != null && class2.GetHabbo() != null && (ulong)class2.GetHabbo().Rank >= (ulong)((long)int_17))
{
try
{
class2.GetConnection().SendData(array);
}
catch
{
}
}
}
}
}
catch (InvalidOperationException)
{
}
}
示例5: SendToStaffs
internal void SendToStaffs(GameClient class16_1, ServerMessage Message5_0, bool IsAntiAd = true)
{
byte[] byte_ = Message5_0.GetBytes();
for (int i = 0; i < this.Clients.Length; i++)
{
GameClient @class = this.Clients[i];
if (@class != null && (@class != class16_1 || IsAntiAd))
{
try
{
if (@class.GetHabbo().HasFuse("receive_sa"))
{
@class.GetConnection().SendData(byte_);
}
}
catch
{
}
}
}
}
示例6: BroadcastMessage
internal void BroadcastMessage(ServerMessage message)
{
byte[] bytes = message.GetBytes();
for (int i = 0; i < this.Clients.Length; i++)
{
GameClient client = this.Clients[i];
if (client != null)
{
try
{
client.GetConnection().SendData(bytes);
}
catch { }
}
}
}
示例7: PingTask
private void PingTask()
{
int num = int.Parse(Essential.GetConfig().data["client.ping.interval"]);
if (num <= 100)
{
throw new ArgumentException("Invalid configuration value for ping interval! Must be above 100 miliseconds.");
}
while (true)
{
try
{
ServerMessage Message = new ServerMessage(Outgoing.Ping); // Updated
List<GameClient> list = new List<GameClient>();
List<GameClient> list2 = new List<GameClient>();
for (int i = 0; i < this.Clients.Length; i++)
{
GameClient @class = this.Clients[i];
if (@class != null)
{
if (@class.bool_0)
{
@class.bool_0 = false;
list2.Add(@class);
}
else
{
list.Add(@class);
}
}
}
foreach (GameClient @class in list)
{
/*try
{
@class.Disconnect("PING");
}
catch
{
}*/
}
byte[] byte_ = Message.GetBytes();
foreach (GameClient @class in list2)
{
try
{
@class.GetConnection().SendData(byte_);
}
catch
{
//@class.Disconnect("PING ERROR");
}
}
}
catch (Exception ex)
{
Logging.LogThreadException(ex.ToString(), "Connection checker task");
}
Thread.Sleep(num);
}
}
示例8: ParsePacket
//.........这里部分代码省略.........
{
dbClient.AddParamWithValue("param1", room.Id);
dbClient.AddParamWithValue("param2", Eventname);
dbClient.ExecuteQuery("INSERT INTO hp_aktivitaetenstream (`user_id`,`type`,`extra_data`,`extra_data2`,`timestamp`) VALUES ('" + room.OwnerId + "','makeevent',@param1,@param2,'" + Convert.ToInt32(Essential.GetUnixTimestamp()) + "');");
}
}
goto IL_C70;
}
default:
goto IL_C70;
}
using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
{
Essential.GetGame().GetCatalog().Initialize(class2);
}
Essential.GetGame().GetCatalog().InitializeCache();
Essential.GetGame().GetClientManager().BroadcastMessage(new ServerMessage(Outgoing.UpdateShop)); // Updated
goto IL_C70;
IL_34E:
num2 = uint.Parse(text2.Split(new char[]
{
' '
})[0]);
num3 = uint.Parse(text2.Split(new char[]
{
' '
})[1]);
GameClient class7 = Essential.GetGame().GetClientManager().GetClient(num2);
class4 = Essential.GetGame().GetRoomManager().GetRoom(num3);
if (class7 != null)
{
ServerMessage Message = new ServerMessage(Outgoing.RoomForward);
Message.AppendBoolean(class4.IsPublic);
Message.AppendUInt(class4.Id);
class7.SendMessage(Message);
goto IL_C70;
}
goto IL_C70;
IL_5BF:
uint_2 = uint.Parse(text2);
using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
{
Essential.GetGame().GetClientManager().GetClient(uint_2).GetHabbo().method_0(class2);
goto IL_C70;
}
IL_602:
Essential.Close();
goto IL_C70;
IL_633:
client = Essential.GetGame().GetClientManager().GetClient(uint.Parse(text2));
if (client != null)
{
int int_3 = 0;
using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
{
int_3 = (int)class2.ReadDataRow("SELECT credits FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1")[0];
}
client.GetHabbo().SetCredits(int_3,"MUS UPDATE","");
client.GetHabbo().UpdateCredits(false);
goto IL_C70;
}
goto IL_C70;
IL_6F7:
client = Essential.GetGame().GetClientManager().GetClient(uint.Parse(text2));
if (client != null)
{
int int_4 = 0;
using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
{
int_4 = (int)class2.ReadDataRow("SELECT activity_points FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1")[0];
}
client.GetHabbo().ActivityPoints = int_4;
client.GetHabbo().UpdateActivityPoints(false);
goto IL_C70;
}
goto IL_C70;
IL_839:
Essential.GetGame().GetClientManager().GetClient(uint.Parse(text2)).Disconnect("MUS");
goto IL_C70;
IL_880:
string text6 = text2.Split(new char[]
{
' '
})[0];
text5 = text2.Substring(text6.Length + 1);
Essential.GetGame().GetClientManager().GetClient(uint.Parse(text6)).SendNotification(text5);
}
}
IL_C70:
try
{
ServerMessage Message9 = new ServerMessage(Outgoing.MusAnswer);
Message9.AppendString("Essential 5");
Message9.AppendString("MUS Handler");
this.ClientSocket.Send(Message9.GetBytes());
}
catch {}
}