示例#1
0
文件: mclient.c 项目: BlueKarl/gmsv
void mproto_Que_Send( int fd, int uid, int index, char* question)
{
	char buffer[65500], wheres[256];
	int checksum=0, floor, x, y;

	char *cdkey = CHAR_getChar( index, CHAR_CDKEY);
	char *charname = CHAR_getChar( index, CHAR_NAME);

	if( strlen( question) <= 0 ){
		CHAR_talkToCli( index, -1, "字串长度不足!", CHAR_COLORYELLOW);
		return;
	}
	memset( wheres, 0, sizeof( wheres));
	floor = CHAR_getInt( index, CHAR_FLOOR);
	x = CHAR_getInt( index, CHAR_X);
	y = CHAR_getInt( index, CHAR_Y);
	sprintf( wheres, "%d,%d,%d", floor, x, y);

	memset( buffer, 0, sizeof( buffer));
	strcpy(PersonalKey, MSPERSIONALKEY);
	checksum += util_mkint(buffer, uid);
	checksum += util_mkstring(buffer, cdkey);
	checksum += util_mkstring(buffer, charname);
	checksum += util_mkstring(buffer, question);
	checksum += util_mkstring(buffer, wheres);
	util_mkint(buffer, checksum);
	util_SendMesg(fd, MPROTO_QUE_SEND, buffer);
}
示例#2
0
文件: mclient.c 项目: BlueKarl/gmsv
void mproto_Type_Send( int fd, int playernum, int itemuse)
{
	char buffer[65500];
	int checksum=0;

	memset( buffer, 0, sizeof( buffer));
	strcpy(PersonalKey, MSPERSIONALKEY);
	checksum += util_mkint(buffer, playernum);
	checksum += util_mkint(buffer, itemuse);
	util_mkint(buffer, checksum);
	util_SendMesg(fd, MPROTO_TYPE_SEND, buffer);
}
示例#3
0
void lssproto_NC_send(int fd, int flg) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, flg);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_NC_SEND, buffer);
}
示例#4
0
void lssproto_Echo_send(int fd, char *test) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkstring(buffer, test);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_ECHO_SEND, buffer);
}
示例#5
0
void lssproto_PlayerNumGet_send(int fd, int logincount, int player) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, logincount);
  checksum += util_mkint(buffer, player);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_PLAYERNUMGET_SEND, buffer);
}
示例#6
0
void lssproto_ProcGet_send(int fd, char *data) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkstring(buffer, data);

  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_PROCGET_SEND, buffer);
}
示例#7
0
void lssproto_SPET_send(int fd, int standbypet, int result) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, standbypet);
  checksum += util_mkint(buffer, result);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_SPET_SEND, buffer);
}
示例#8
0
void lssproto_CharLogin_send(int fd, char *result, char *data) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkstring(buffer, result);
  checksum += util_mkstring(buffer, data);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_CHARLOGIN_SEND, buffer);
}
示例#9
0
void lssproto_EF_send(int fd, int effect, int level, char *option) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, effect);
  checksum += util_mkint(buffer, level);
  checksum += util_mkstring(buffer, option);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_EF_SEND, buffer);
}
示例#10
0
void lssproto_TK_send(int fd, int index, char *message, int color) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, index);
  checksum += util_mkstring(buffer, message);
  checksum += util_mkint(buffer, color);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_TK_SEND, buffer);
}
示例#11
0
void lssproto_SE_send(int fd, int x, int y, int senumber, int sw) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, x);
  checksum += util_mkint(buffer, y);
  checksum += util_mkint(buffer, senumber);
  checksum += util_mkint(buffer, sw);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_SE_SEND, buffer);
}
示例#12
0
void lssproto_PS_send(int fd, int result, int havepetindex, int havepetskill, int toindex) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, result);
  checksum += util_mkint(buffer, havepetindex);
  checksum += util_mkint(buffer, havepetskill);
  checksum += util_mkint(buffer, toindex);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_PS_SEND, buffer);
}
示例#13
0
void lssproto_EN_send(int fd, int result, int field) {
  char buffer[1024 * 64];
  int checksum = 0;

  //print(" EN_send ");

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, result);
  checksum += util_mkint(buffer, field);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_EN_SEND, buffer);
}
示例#14
0
文件: mclient.c 项目: BlueKarl/gmsv
// 回溯ok
void saacproto_ACRecalAllBackupOK_recv(char *uid, int userfdid, int GmCliId, char *id, int char_num, int date, char *char_data)
{
	char buffer[65500];
	int checksum=0;

	strcpy(buffer, "");
	strcpy(PersonalKey, MSPERSIONALKEY);
	checksum += util_mkstring(buffer, uid);
	checksum += util_mkint(buffer, userfdid);
	checksum += util_mkint(buffer, GmCliId);
	checksum += util_mkstring(buffer, id);
	checksum += util_mkint(buffer, char_num);
	checksum += util_mkint(buffer, date);
	checksum += util_mkstring(buffer, char_data);
	util_mkint(buffer, checksum);
	util_SendMesg(mfd, MPROTO_RECALL_BACKUP_OK_SEND, buffer);
}
示例#15
0
void lssproto_M_send(int fd, int fl, int x1, int y1, int x2, int y2, char *data) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, fl);
  checksum += util_mkint(buffer, x1);
  checksum += util_mkint(buffer, y1);
  checksum += util_mkint(buffer, x2);
  checksum += util_mkint(buffer, y2);
  checksum += util_mkstring(buffer, data);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_M_SEND, buffer);
}
示例#16
0
void lssproto_WN_send(int fd, int windowtype, int buttontype, int seqno, int objindex, char *data) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, windowtype);
  checksum += util_mkint(buffer, buttontype);
  checksum += util_mkint(buffer, seqno);
  checksum += util_mkint(buffer, objindex);
  checksum += util_mkstring(buffer, data);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_WN_SEND, buffer);

}
示例#17
0
文件: mclient.c 项目: BlueKarl/gmsv
void gserver_runtime()
{
	int checksum=0;
	char buffer[1024];
    time_t starttime1;

	if(mfd == -1) return;
    if( gserver_runtime_starttime0_flag ){
	    gserver_runtime_starttime0_flag = FALSE;
		gserver_runtime_starttime0 = time(NULL);
	}
	print("\nChange->传送时间给mserver\n");
	strcpy(buffer, "");
	strcpy(PersonalKey, MSPERSIONALKEY);
    starttime1 = time(NULL);
	checksum += util_mkint(buffer, (int)difftime(starttime1,gserver_runtime_starttime0));//传送的单位为秒
	util_mkint(buffer, checksum);
	util_SendMesg(mfd, MPROTO_RECALL_GSERVER_RUNTIME, buffer);
}
示例#18
0
void lssproto_PME_send(int fd, int objindex, int graphicsno, int x, int y, int dir, int flg, int no, char *cdata) {
  char buffer[1024 * 64];
  int checksum = 0;

  strcpy(buffer, "");

  CONNECT_getCdkey(fd, PersonalKey, 4096);
  strcat(PersonalKey, getPrivateKey());

  checksum += util_mkint(buffer, objindex);
  checksum += util_mkint(buffer, graphicsno);
  checksum += util_mkint(buffer, x);
  checksum += util_mkint(buffer, y);
  checksum += util_mkint(buffer, dir);
  checksum += util_mkint(buffer, flg);
  checksum += util_mkint(buffer, no);
  checksum += util_mkstring(buffer, cdata);
  util_mkint(buffer, checksum);
  util_SendMesg(fd, LSSPROTO_PME_SEND, buffer);
}
示例#19
0
文件: mclient.c 项目: BlueKarl/gmsv
void recal_get_count()
{
	FILE *fp;
	int i, j;
	char temp[3][15], c;
	char buffer[256], msg[64];
	int checksum=0;

	if(mfd == -1) return;

	if( !(fp=fopen("recal_count.txt", "r")) ){
		print("\n open recal_count.txt err !!");
	}

	memset(temp, 0, sizeof(temp));

	i=0; j=0;
	do{
       c = fgetc(fp);
	   if(c==' '){
			i=0; j++;
			continue;
	   }
       temp[j][i]=c;
       i++;
    }while(c != EOF);

	temp[2][i-2]=0;

	sprintf(msg,"%5s%4d%12s", temp[0], atoi(temp[1]), temp[2]);

	strcpy(buffer, "");
	strcpy(PersonalKey, MSPERSIONALKEY);
	checksum += util_mkstring(buffer, msg);

	util_mkint(buffer, checksum);
	util_SendMesg(mfd, MPROTO_RECALL_COUNT_SEND, buffer);

	fclose(fp);

}