sendpack qui fonctionne avec le client
This commit is contained in:
		| @@ -116,5 +116,15 @@ namespace netprot { | ||||
| 	bool Deserialize(ErrorLog* errlog, char* buf, const uint32_t buflen); // srv | ||||
|  | ||||
| 	PacketType getType(char* buf, uint32_t buflen); // srv/cli | ||||
| }  | ||||
|  | ||||
| 	template <class T> void sendPack(SOCKET sock, T* pack, char** buf, uint32_t* buflen); | ||||
|  | ||||
| 	template <class T> | ||||
| 	void sendPack(SOCKET sock, T* pack, char** buf, uint32_t* buflen) { | ||||
| 		netprot::Serialize(pack, buf, buflen); | ||||
| 		send(sock, *buf, *buflen, 0); | ||||
| 		*buflen = BUFFER_LENGTH; | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user