I was supposed to post in-game screenshots last night. But i was too pissed of.
I'll do it tonight
Why i was pissed of?
You must be registered for see links
private static void HandleReceive(SocketAsyncEventArgs Args)
{
var token = Args.UserToken as AsyncUserToken;
try
{
if (Args.BytesTransferred > 0 && Args.SocketError == SocketError.Success)
{
var received = new byte[Args.BytesTransferred];
Array.Copy(_bufferManager.Buffer, Args.Offset, received, 0, Args.BytesTransferred);
//MessageHandler.HandleBytes(GetSession(token.Socket), ref received);
// Define Client
var client = new TcpClient();
// Define Stream And Use Client To Get It.
var stream = client.GetStream();
// Define Reader And Use Binaryreader Using The Stream.
var reader = new BinaryReader(stream);
var writer = new BinaryWriter(stream);
var bytes = new List<byte[]>();
var policyCheck = (reader.ReadByte() == 60) ? true : false;
var directory = new List<byte[]>();
if (!policyCheck)
{
writer.Flush();
}
while (reader.ReadByte() > 6)
{
int tMsgLen = reader.ReadInt32();
if (reader.ReadByte() < tMsgLen)
{
writer.Flush();
}
// Packet stuff
var clientMessage = new ClientMessageHandling(reader);
RevEnvironment.GetSession().HandleMessage(clientMessage);
}
if (policyCheck)
{
writer.Flush();
const string policy = "<?xml version=\"1.0\"?>\r\n"
+
"<!DOCTYPE cross-domain-policy SYSTEM \"/xml/dtds/cross-domain-policy.dtd\">\r\n"
+ "<cross-domain-policy>\r\n"
+ "<allow-access-from domain=\"*\" to-ports=\"*\" />\r\n"
+ "</cross-domain-policy>\0";
writer.Write(policy);
}
}
else
{
CloseClientSocket(Args);
}
}
catch
{
CloseClientSocket(Args);
}
finally
{
try
{
if (token != null) token.Socket.ReceiveAsync(Args);
}
catch (Exception exception)
{
Console.WriteLine(@"Error accepting Connection: " + exception.ToString());
}
}
}