本文整理匯總了C#中Snowlight.Communication.ClientMessage.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# ClientMessage.ToString方法的具體用法?C# ClientMessage.ToString怎麽用?C# ClientMessage.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Snowlight.Communication.ClientMessage
的用法示例。
在下文中一共展示了ClientMessage.ToString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ProcessData
private void ProcessData(byte[] Data)
{
if (Data.Length == 0)
{
return;
}
if (Data[0] == 64)
{
int Pos = 0;
while (Pos < Data.Length)
{
ClientMessage Message = null;
try
{
int MessageLength = Base64Encoding.DecodeInt32(new byte[] { Data[Pos++], Data[Pos++], Data[Pos++] });
uint MessageId = Base64Encoding.DecodeUInt32(new byte[] { Data[Pos++], Data[Pos++] });
byte[] Content = new byte[MessageLength - 2];
for (int i = 0; i < Content.Length; i++)
{
Content[i] = Data[Pos++];
}
Message = new ClientMessage(MessageId, Content);
}
catch (Exception)
{
SessionManager.StopSession(mId); // packet formatting exception
return;
}
if (Message != null)
{
if (Program.DEBUG)
{
Output.WriteLine("[RCV][" + mId + "]: "+ Message.Id + " " + Message.ToString(), OutputLevel.DebugInformation);
}
try
{
DataRouter.HandleData(this, Message);
}
catch (Exception e)
{
Output.WriteLine("Critical error in HandleData stack: " + e.Message + "\n\n" + e.StackTrace,
OutputLevel.CriticalError);
SessionManager.StopSession(mId);
return;
}
}
}
}
else if (Data[0] == 60)
{
Output.WriteLine("Sent crossdomain policy to client " + mId + ".", OutputLevel.DebugInformation);
SendData(CrossdomainPolicy.GetBytes());
SessionManager.StopSession(mId);
}
else
{
SessionManager.StopSession(mId);
}
}