~ruther/NosSmooth

ref: 3b11028d105429744f186478d4908ea6b727531e NosSmooth/Local/NosSmooth.LocalCore/Network.h -rw-r--r-- 1.1 KiB
3b11028d — František Boháček Merge branch 'walk-command-handler' into 'main' 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include "ModuleHook.h"
#include "NetworkUnmanaged.h"

namespace NosSmoothCore
{
	public ref class Network
	{
	public:
		Network(NosSmoothCore::ModuleHook moduleHook);

		/// <summary>
		/// Send the given packet to the server.
		/// </summary>
		/// <param name="packet">The packed to send.</param>
		void SendPacket(System::String^ packet);
		
		/// <summary>
		/// Receive the given packet on the client.
		/// </summary>
		/// <param name="packet">The packet to receive.</param>
		void ReceivePacket(System::String^ packet);

		/// <summary>
		/// Sets the receive callback delegate to be called when packet is received.
		/// </summary>
		/// <param name="callback"></param>
		void SetReceiveCallback(NetworkCallback^ callback);

		/// <summary>
		/// Sets the send callback delegate to be called when the packet is sent.
		/// </summary>
		/// <param name="callback"></param>
		void SetSendCallback(NetworkCallback^ callback);

		/// <summary>
		/// Resets all the function hooks.
		/// </summary>
		void ResetHooks();
	private:
		NetworkUnmanaged* _networkUnmanaged;
		NetworkCallback^ _sendCallback;
		NetworkCallback^ _receiveCallback;
	};
}
Do not follow this link