Register for your free account! | Forgot your password?

You last visited: Today at 21:36

  • Please register to post and access all features, it's quick, easy and FREE!


CXLoader

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2009
Posts: 60
Received Thanks: 154
CXLoader

This is what CoPackets uses to get/send the packets while loaded in conquer.



So CXLoader loads up CoPackets and then calls "CX_Startup" passing the 2 functions that you call to send and receive packets. It then looks for functions names "CX_Send" and "CX_Recv" and calls those when packets are sent and received.

This is what the main part of CoPackets looks like.
Code:
	public class SendRecvClass
	{
		static SendRecvClass self;
		public static SendRecvClass Self
		{
			get
			{
				if (self == null)
					self = new SendRecvClass();
				return self;
			}
		}
		public MulticastDelegate SendFunc;
		public MulticastDelegate RecvFunc;
		public void Send(byte[] b)
		{
			SendFunc.DynamicInvoke(b);
		}
		public void Recv(byte[] b)
		{
			RecvFunc.DynamicInvoke(b);
		}
		public static void CX_Send(byte[] b)
		{
			bool block = false;

			if (Self.OnSend != null)
				Self.OnSend(b, ref block);

			if (!block)
				Self.Send(b);
		}

		public static void CX_Recv(byte[] b)
		{
			bool block = false;

			if (Self.OnRecv != null)
				Self.OnRecv(b, ref block);

			if (!block)
				Self.Recv(b);
		}

		public delegate void OnSendD(byte[] b, ref bool block);
		public event OnSendD OnSend;

		public delegate void OnRecvD(byte[] b, ref bool block);
		public event OnRecvD OnRecv;

	}

	public class Startup
	{
		public static void Start()
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			Application.Run(new MainForm());
		}
		public static void CX_Startup(Object ps1, Object ps2)
		{
			SendRecvClass.Self.SendFunc = (MulticastDelegate)ps1;
			SendRecvClass.Self.RecvFunc = (MulticastDelegate)ps2;

			Thread t = new Thread(new ThreadStart(Start));
			t.Start();
		}
	}
So to get the packets sent and received you do
Code:
			SendRecvClass.Self.OnSend += new SendRecvClass.OnSendD(Self_OnSend);
			SendRecvClass.Self.OnRecv += new SendRecvClass.OnRecvD(Self_OnRecv);
And to send packets packets to the client you do

Code:
SendRecvClass.Self.Send(ByteArray);
SendRecvClass.Self.Recv(ByteArray);



high9 is offline  
Thanks
3 Users
Old 04/28/2010, 14:42   #2
 
elite*gold: 0
Join Date: Apr 2007
Posts: 906
Received Thanks: 1,431
lol wonder how long before the next set of memory proxies start flying out :P


Warlax is offline  
Old 04/29/2010, 00:18   #3
 
elite*gold: 0
Join Date: Jul 2008
Posts: 15
Received Thanks: 1
can u explain for what i use that prog in conq
waellove is offline  
Old 04/29/2010, 00:19   #4
 
elite*gold: 0
Join Date: Oct 2008
Posts: 76
Received Thanks: 26
High is always on top of these things. Thanks for releasing it.


jediderek1 is offline  
Old 05/04/2010, 17:29   #5
 
elite*gold: 0
Join Date: Nov 2005
Posts: 121
Received Thanks: 184
Nifty


BEanErzzz is offline  
Reply



« C# Help | [Help]C# How to convert memory value to string? »



All times are GMT +1. The time now is 21:36.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.