Ejemplo n.º 1
0
void CHAR_playerTalkedfunc( int charaindex, int talkindex,char* message, int color, int channel )
{
    int     fd;
    char    lastbuf[4096];
    char    mesgbuf[4096];
    char    escapebuf[4096];
    int fmindex = CHAR_getInt( charaindex, CHAR_FMINDEX );
    fd = getfdFromCharaIndex( charaindex );
    if( fd == -1 )return;
    if( (channel>-1) && (fmindex>0) ) {
        if( channel == 0 ) {
            snprintf( lastbuf,sizeof(lastbuf),"P|[×å]%s",
                      makeEscapeString( CHAR_appendNameAndTitle(talkindex, message, mesgbuf,sizeof(mesgbuf)),
                                        escapebuf,sizeof(escapebuf) ));
        }
#ifdef _FMVER21
        else if( channel == FAMILY_MAXCHANNEL && CHAR_getInt( talkindex, CHAR_FMLEADERFLAG ) == FMMEMBER_LEADER ) {
#else
        else if( channel == FAMILY_MAXCHANNEL && CHAR_getInt( talkindex, CHAR_FMLEADERFLAG ) == 1 ) {
#endif
            snprintf( lastbuf,sizeof(lastbuf),"P|[×峤¹ã²¥]%s",
                      makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
                                       escapebuf,sizeof(escapebuf) ));
        } else {
            snprintf( lastbuf,sizeof(lastbuf),"P|[%d]%s",channel,
                      makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
                                       escapebuf,sizeof(escapebuf) ));
        }
    } else {
        snprintf( lastbuf,sizeof(lastbuf),"P|%s",
                  makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
                                   escapebuf,sizeof(escapebuf) ));
    }
    lssproto_TK_send( fd, CHAR_getWorkInt( talkindex, CHAR_WORKOBJINDEX ),lastbuf, color);
}
Ejemplo n.º 2
0
int CHAR_talkToCli(int talkedcharaindex, int talkcharaindex, char *message, CHAR_COLOR color) {
  static char lastbuf[2048];
  static char escapebuf[2048];
  static char mesgbuf[1024];
  int fd;

  if(!CHAR_CHECKINDEX(talkedcharaindex))
    return FALSE;
  if(CHAR_getInt(talkedcharaindex, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER) {
    print("err CHAR_talkToCli CHAR_WHICHTYPE != CHAR_TYPEPLAYER\n");
    return FALSE;
  }

  fd = getfdFromCharaIndex(talkedcharaindex);
  if(fd == -1) {
    print("err CHAR_talkToCli can't get fd from:%d \n", talkedcharaindex);
    return FALSE;
  }

  if(color < CHAR_COLORWHITE && color > CHAR_COLORGREEN2) {
    print("CHAR_talkToCli color err\n");
    return FALSE;
  }
  snprintf(lastbuf, sizeof(lastbuf), "P|%s", makeEscapeString(CHAR_appendNameAndTitle(talkcharaindex, message, mesgbuf, sizeof(mesgbuf)), escapebuf, sizeof(escapebuf)));
  int talkchar = -1;
  if(talkcharaindex != -1)
    talkchar = CHAR_getWorkInt(talkcharaindex, CHAR_WORKOBJINDEX);
  lssproto_TK_send(fd, talkchar, lastbuf, color);
  return TRUE;
}
Ejemplo n.º 3
0
void CHAR_playerTalkedfunc( int charaindex, int talkindex,char* message, int color, int channel )
{
    int     fd;
    char    lastbuf[4096];
    char    mesgbuf[4096];
    char    escapebuf[4096];
    int fmindex = CHAR_getInt( charaindex, CHAR_FMINDEX );
    fd = getfdFromCharaIndex( charaindex );
    if( fd == -1 )return;
    if( (channel>-1) && (fmindex>0) ){
		if( channel == 0 ){
#ifndef _CHANNEL_MODIFY
			snprintf( lastbuf,sizeof(lastbuf),"P|[族]%s",
#else
			snprintf( lastbuf,sizeof(lastbuf),"P|F|[族]%s",
#endif
				makeEscapeString( CHAR_appendNameAndTitle(talkindex, message, mesgbuf,sizeof(mesgbuf)),
				escapebuf,sizeof(escapebuf) ));
		}
#ifdef _FMVER21	                  
		else if( channel == FAMILY_MAXCHANNEL && CHAR_getInt( talkindex, CHAR_FMLEADERFLAG ) == FMMEMBER_LEADER ){
Ejemplo n.º 4
0
			snprintf( lastbuf,sizeof(lastbuf),"P|F|[族]%s",
#endif
				makeEscapeString( CHAR_appendNameAndTitle(talkindex, message, mesgbuf,sizeof(mesgbuf)),
				escapebuf,sizeof(escapebuf) ));
		}
#ifdef _FMVER21	                  
		else if( channel == FAMILY_MAXCHANNEL && CHAR_getInt( talkindex, CHAR_FMLEADERFLAG ) == FMMEMBER_LEADER ){
#else
		else if( channel == FAMILY_MAXCHANNEL && CHAR_getInt( talkindex, CHAR_FMLEADERFLAG ) == 1 ){
#endif
#ifndef _CHANNEL_MODIFY
			snprintf( lastbuf,sizeof(lastbuf),"P|[族長廣播]%s",
#else
			snprintf( lastbuf,sizeof(lastbuf),"P|F|[族長廣播]%s",
#endif
				makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
				escapebuf,sizeof(escapebuf) ));
		}else{
			snprintf( lastbuf,sizeof(lastbuf),"P|[%d]%s",channel,
				makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
				escapebuf,sizeof(escapebuf) ));
		}
	}else{
#ifdef _CHANNEL_MODIFY
		if(CHAR_getFlg(talkindex,CHAR_ISPARTYCHAT) && (CHAR_getWorkInt(talkindex,CHAR_WORKPARTYMODE) != CHAR_PARTY_NONE))
				snprintf( lastbuf,sizeof(lastbuf),"P|T|[隊]%s",
				makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
				escapebuf,sizeof(escapebuf) ));
		else
#ifdef _FONT_SIZE
				snprintf( lastbuf,sizeof(lastbuf),"P|P|%s|%d",