www.pudn.com > gamedata.rar > msg.c


/* 
    消息处理 模块 
*/ 
#include "stdafx.h" 
 
// 系统消息发送 
int sysmessage(SOCKET s, BYTE mode, char *buf, int distance, BOOL broadcast) 
{ 
	// 10 00 00 00 05 01 1D BB B6 D3 AD CA B9 D3 C3 20 BE F6 D5 BD B1 BF B1 BF 20 30 2E 30 37 20 B2 E2 CA D4 B0 E6 
	 
	int i, t1, ret; 
 
	BYTE lpSource[512]; 
 
	t1 = strlen(buf); 
 
	memset(lpSource, 0x00, sizeof(lpSource)); 
 
	lpSource[0] = 0x00; 
	lpSource[1] = 0x00; 
	lpSource[2] = 0x00;     
	lpSource[3] = 0x00; 
	lpSource[4] = 0x05; 
	lpSource[5] = (BYTE)mode; 
	lpSource[6] = (BYTE)t1; 
 
	for(i=0;i