Jump to content
  • 0

Need some help with defpattern / pcre


Pinky

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   3
  • Joined:  03/27/12
  • Last Seen:  

I'm not sure if i should have posted this in the linux support, or rathena, since i don't even know which side is causing this problem, so i posted it here.

========

@r16827

Centos 6.3

========

As reported in the bugtracker before http://rathena.org/b...attern-broken/:

defpattern isn't working, since i'm not able to make an npc 'read' what i type in the chat.

for example with the doc/sample/npc_pcre.txt script, that one doesnt work either anymore.

I've been gone for more than 1 - 2 years, so i have no idea if there were any updates related to the functioning of defpattern.

But in any case... it seems like a bug to me. Either on my side, or rathena.

I thought it was because of pcre wasn't installed on my system, but i realised that 'that' wasn't the reason, since pcre was already installed on my centos system when i checked, I even manually installed pcre-8.0 to see if there was any difference...

:S so now im clueless and need some help from whoever has knowledge with centos, pcre and whatsoever.

-sh-4.1$ ./configure --with-pcre
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether make sets $(MAKE)... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for ar... /usr/bin/ar
checking whether byte ordering is bigendian... no
checking whether gcc produces 32bit code... no
checking whether gcc supports __thread specifier (TLS)... yes
checking whether gcc supports -Wno-unused-parameter... yes
checking whether gcc supports -flto... no
checking whether gcc supports -Wno-pointer-sign... yes
checking whether gcc can actually use -Wno-pointer-sign... yes
checking whether gcc supports -Wno-switch... yes
checking whether gcc supports -fPIC... yes
checking whether gcc supports -fno-strict-aliasing... yes
checking for setrlimit... yes
checking for strnlen... yes
checking for uselocale... yes
checking for newlocale... yes
checking for freelocale... yes
checking xlocale.h usability... yes
checking xlocale.h presence... yes
checking for xlocale.h... yes
checking for inflateEnd in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing sqrt... -lm
checking for library containing clock_gettime... -lrt
checking whether CLOCK_MONOTONIC is supported and works... yes
checking for pthread_create in -lpthread... yes
checking for pthread_sigmask in -lpthread... yes
checking for pthread_attr_init in -lpthread... yes
checking for pthread_attr_setstacksize in -lpthread... yes
checking for pthread_attr_destroy in -lpthread... yes
checking for pthread_cancel in -lpthread... yes
checking for pthread_join in -lpthread... yes
checking for mysql_config... /usr/bin/mysql_config
checking for mysql_init in -lmysqlclient... yes
checking mysql.h usability... yes
checking mysql.h presence... yes
checking for mysql.h... yes
checking MySQL library (required)... yes (5.1.61)
checking for pcre_study in -lpcre... yes
checking PCRE library (optional)... yes
checking host OS... Linux
checking for MinGW... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/common/Makefile
config.status: creating 3rdparty/mt19937ar/Makefile
config.status: creating 3rdparty/libconfig/Makefile
config.status: creating src/char/Makefile
config.status: creating src/login/Makefile
config.status: creating src/map/Makefile
config.status: creating src/tool/Makefile
config.status: creating src/test/Makefile
-sh-4.1$

thats the configure output i get, looks pretty normal to me.

-sh-4.1$ make clean
make[1]: Entering directory `/home/****/trunk/src/common'
       CLEAN   common
make[1]: Leaving directory `/home/****/trunk/src/common'
make[1]: Entering directory `/home/****/trunk/3rdparty/mt19937ar'
       CLEAN   mt19937ar
make[1]: Leaving directory `/home/****/trunk/3rdparty/mt19937ar'
make[1]: Entering directory `/home/****/trunk/3rdparty/libconfig'
       CLEAN   libconfig
make[1]: Leaving directory `/home/****/trunk/3rdparty/libconfig'
make[1]: Entering directory `/home/****/trunk/src/login'
       CLEAN   login
make[1]: Leaving directory `/home/****/trunk/src/login'
make[1]: Entering directory `/home/****/trunk/src/char'
       CLEAN   char
make[1]: Leaving directory `/home/****/trunk/src/char'
make[1]: Entering directory `/home/****/trunk/src/map'
       CLEAN   map
make[1]: Leaving directory `/home/****/trunk/src/map'
make[1]: Entering directory `/home/****/trunk/src/tool'
       CLEAN   tool
make[1]: Leaving directory `/home/****/trunk/src/tool'
make[1]: Entering directory `/home/****/trunk/src/test'
       CLEAN   test
make[1]: Leaving directory `/home/****/trunk/src/test'
-sh-4.1$ make sql
make[1]: Entering directory `/home/****/trunk/3rdparty/mt19937ar'
       CC      mt19937ar.c
make[1]: Leaving directory `/home/****/trunk/3rdparty/mt19937ar'
make[1]: Entering directory `/home/****/trunk/3rdparty/libconfig'
       CC      libconfig.c
       CC      grammar.c
       CC      scanctx.c
       CC      scanner.c
       CC      strbuf.c
make[1]: Leaving directory `/home/****/trunk/3rdparty/libconfig'
make[1]: Entering directory `/home/****/trunk/src/common'
       MKDIR   obj_all
       CC      core.c
       CC      socket.c
       CC      timer.c
       CC      db.c
       CC      lock.c
       CC      nullpo.c
       CC      malloc.c
       CC      showmsg.c
       CC      strlib.c
       CC      utils.c
       CC      grfio.c
       CC      mapindex.c
       CC      ers.c
       CC      md5calc.c
       CC      core.c
       CC      socket.c
       CC      malloc.c
       CC      random.c
       CC      des.c
       CC      conf.c
       CC      thread.c
       CC      mutex.c
       CC      raconf.c
       CC      mempool.c
       AR      obj_all/common.a
       MKDIR   obj_sql
       CC      sql.c
       AR      obj_sql/common_sql.a
make[1]: Leaving directory `/home/****/trunk/src/common'
make[1]: Entering directory `/home/****/trunk/src/login'
       MKDIR   obj_sql
       CC      login.c
       CC      account_sql.c
       CC      ipban_sql.c
       CC      loginlog_sql.c
       LD      login-server_sql
make[1]: Leaving directory `/home/****/trunk/src/login'
make[1]: Entering directory `/home/****/trunk/src/char'
       MKDIR   obj_sql
       CC      char.c
       CC      inter.c
       CC      int_party.c
       CC      int_guild.c
       CC      int_storage.c
       CC      int_pet.c
       CC      int_homun.c
       CC      int_mail.c
       CC      int_auction.c
       CC      int_quest.c
       CC      int_mercenary.c
       CC      int_elemental.c
       LD      char-server_sql
make[1]: Leaving directory `/home/****/trunk/src/char'
make[1]: Entering directory `/home/****/trunk/src/map'
       MKDIR   obj_sql
       CC      map.c
       CC      chrif.c
       CC      clif.c
clif.c: In function âclif_parse_CreateChatRoomâ:
clif.c:10552: warning: parameter names (without types) in function declaration
       CC      pc.c
       CC      status.c
status.c: In function âstatus_change_startâ:
status.c:8336: warning: implicit declaration of function âclif_getareachar_charâ
       CC      npc.c
       CC      npc_chat.c
       CC      chat.c
       CC      path.c
       CC      itemdb.c
       CC      mob.c
mob.c: In function âmob_script_callbackâ:
mob.c:3621: warning: cast to pointer from integer of different size
mob.c:3621: warning: cast to pointer from integer of different size
mob.c:3621: warning: passing argument 1 of âlinkdb_replaceâ from incompatible pointer type
../common/db.h:881: note: expected âstruct linkdb_node **â but argument is of type âstruct DBMap **â
mob.c:3623: warning: cast to pointer from integer of different size
mob.c:3623: warning: cast to pointer from integer of different size
mob.c:3623: warning: passing argument 1 of âlinkdb_replaceâ from incompatible pointer type
../common/db.h:881: note: expected âstruct linkdb_node **â but argument is of type âstruct DBMap **â
mob.c:3624: warning: cast to pointer from integer of different size
mob.c:3624: warning: cast to pointer from integer of different size
mob.c:3624: warning: passing argument 1 of âlinkdb_replaceâ from incompatible pointer type
../common/db.h:881: note: expected âstruct linkdb_node **â but argument is of type âstruct DBMap **â
mob.c:3626: warning: cast to pointer from integer of different size
mob.c:3626: warning: cast to pointer from integer of different size
mob.c:3626: warning: passing argument 1 of âlinkdb_replaceâ from incompatible pointer type
../common/db.h:881: note: expected âstruct linkdb_node **â but argument is of type âstruct DBMap **â
mob.c: In function âmob_deadâ:
mob.c:2449: warning: âi_dataâ may be used uninitialized in this function
       CC      script.c
script.c: In function âbuildin_getmobdataâ:
script.c:15987: warning: cast to pointer from integer of different size
script.c:15988: warning: cast to pointer from integer of different size
script.c:15989: warning: cast to pointer from integer of different size
script.c:15990: warning: cast to pointer from integer of different size
script.c:15991: warning: cast to pointer from integer of different size
script.c:15992: warning: cast to pointer from integer of different size
script.c:15993: warning: cast to pointer from integer of different size
script.c:15994: warning: cast to pointer from integer of different size
script.c:15995: warning: cast to pointer from integer of different size
script.c:15996: warning: cast to pointer from integer of different size
script.c:15997: warning: cast to pointer from integer of different size
script.c:15998: warning: cast to pointer from integer of different size
script.c:15999: warning: cast to pointer from integer of different size
script.c:16000: warning: cast to pointer from integer of different size
script.c:16001: warning: cast to pointer from integer of different size
script.c:16002: warning: cast to pointer from integer of different size
script.c:16003: warning: cast to pointer from integer of different size
script.c:16004: warning: cast to pointer from integer of different size
script.c:16005: warning: cast to pointer from integer of different size
script.c:16006: warning: cast to pointer from integer of different size
script.c:16007: warning: cast to pointer from integer of different size
script.c:16008: warning: cast to pointer from integer of different size
script.c:16009: warning: cast to pointer from integer of different size
script.c:16010: warning: cast to pointer from integer of different size
script.c:16014: warning: cast to pointer from integer of different size
       CC      storage.c
       CC      skill.c
       CC      atcommand.c
       CC      battle.c
       CC      battleground.c
       CC      intif.c
       CC      trade.c
       CC      party.c
       CC      vending.c
       CC      guild.c
       CC      pet.c
       CC      log.c
       CC      mail.c
       CC      date.c
       CC      unit.c
       CC      homunculus.c
       CC      mercenary.c
       CC      quest.c
       CC      instance.c
       CC      buyingstore.c
       CC      searchstore.c
       CC      duel.c
       CC      pc_groups.c
       CC      elemental.c
       CC      mapreg_sql.c
       LD      map-server_sql
make[1]: Leaving directory `/****/trunk/src/map'
building conf/import folder...

The build output looks normal aswell.

So either my centos system is just being a wacko and need to reinstall it all over, or there's something else going on.

I will be grateful to the person(s) who are willing to help me or can point me out what's being missed, or anything.

P.S. the map warnings are my own custom source modifications, so dont worry about it. Also **** stands for my server's name, sensored.

Thanks,

Pinky

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Yes, the configure and compile look fine to me too.

Can you try loading trunk/doc/sample/npc_pcre.txt and see if the NPC responds to any of those phrases?

"hi hello" --> "How do you do. Please state your problem."

"do you have a name?" --> "I am not interested in names"

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   3
  • Joined:  03/27/12
  • Last Seen:  

yea i did, nor that or my custom npc seem to be working. So im stuck... =/ cant find the reason...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

It works for me on Windows (compiled with Visual Studio 2010).

tuuQL.jpg

I will test on Linux now.

Edit: rAthena r16831 on CentOS 6.3 - works for me too.

hmm what client are you using? (I tested with 2010-07-30aRagexeRE)

I wonder if |00 in your messages is confusing the defpatterns.

Try this defpattern, which will match everything and print what the npc "sees" to debugmes:

prontera,155,188,0	script	test	910,{
end;

QuoteALL:
debugmes "$@p0$ = " + $@p0$;
end;

OnInit:
defpattern 1, "(.*)", "QuoteALL";
activatepset 1;
end;
}

Edited by Brian
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   3
  • Joined:  03/27/12
  • Last Seen:  

|00 messages? thats what ive been thinking too lately, but anyway i used the npc that u showed me and it doesnt really do anything either.

anyway im using the 2012-04-10aRagexeRE_S clnt. try using that one and see what u get

BTW did you use centos 6.3 64bits? because thats what im using, i was wondering if my pcre lib files were in the wrong path, but i already did some tests with that and it wasnt the case. and centos doesnt seem to have pcre 8.0 at all, it only has the 7.x build.

Edited by Pinky
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Yes I used CentOS 6.3 (64-bit).

pcre-devel-7.8-4.el6.x86_64

gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)

post-237-0-20227600-1351392006_thumb.png

hmm, could you try with a clean copy of rAthena?

And I will try with the 2012-04-10aRagexeRE_S client.

Edited by Brian
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  02/18/12
  • Last Seen:  

Try this: http://rathena.org/b...disguise-event/ I had the same problem, try do the thing that Annie suggested to see if you're getting the |00 in debug, if you are, just copy the def pattern that emmistry posted, and it should work...

Edited by LOLSIF
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   3
  • Joined:  03/27/12
  • Last Seen:  

its not th client, i just compiled a clean version of rathena, seems like theres something wrong with my own version... damn, now i have to sniff through every bit of src code ive created to see whats causing this issue

Edit:

okay fixed! thanks everyone, i noticed it was my custom mob_chat causing the problem, i didnt complete merging it to rathena, so it was partly working and it didnt want to listen to players broadcast anymore but only to mobs, lol XD

Normally you would get a compile error if something is missing, but the merge replaced in clif.c the map_foreachinrange(npc_chat_sub, &sd->bl, AREA_SIZE, BL_NPC, text, textlen, &sd->bl); with my mob_chat's values function, instead of creating a new line instead.

im glad i solved it

Edited by Pinky
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...