KaVir protocol snippet

Posted by Joeyfogas on Tue 08 May 2018 12:45 AM — 37 posts, 115,456 views.

#0
Installing the snippet on FUSS 1.9 and am getting these errors...



  Compiling ../o/protocol.o....
protocol.c: In function ‘protocol_t* ProtocolCreate()’:
protocol.c:294: error: invalid conversion from ‘void*’ to ‘protocol_t*’
protocol.c:318: error: invalid conversion from ‘void*’ to ‘MSDP_t**’
protocol.c:322: error: invalid conversion from ‘void*’ to ‘MSDP_t*’
protocol.c: In function ‘void ProtocolDestroy(protocol_t*)’:
protocol.c:353: error: cannot convert ‘MSDP_t*’ to ‘const char*’ for argument ‘1’ to ‘bool in_hash_table(const char*)’
protocol.c:353: error: cannot convert ‘MSDP_t*’ to ‘const char*’ for argument ‘1’ to ‘int str_free(const char*)’
protocol.c:356: error: cannot convert ‘MSDP_t**’ to ‘const char*’ for argument ‘1’ to ‘bool in_hash_table(const char*)’
protocol.c:356: error: cannot convert ‘MSDP_t**’ to ‘const char*’ for argument ‘1’ to ‘int str_free(const char*)’
protocol.c:359: error: cannot convert ‘protocol_t*’ to ‘const char*’ for argument ‘1’ to ‘bool in_hash_table(const char*)’
protocol.c:359: error: cannot convert ‘protocol_t*’ to ‘const char*’ for argument ‘1’ to ‘int str_free(const char*)’
protocol.c: In function ‘void MSDPSetTable(descriptor_t*, variable_t, const char*)’:
protocol.c:1418: error: invalid conversion from ‘void*’ to ‘char*’
protocol.c: In function ‘void MSDPSetArray(descriptor_t*, variable_t, const char*)’:
protocol.c:1454: error: invalid conversion from ‘void*’ to ‘char*’
protocol.c: In function ‘void SoundSend(descriptor_t*, const char*)’:
protocol.c:1559: warning: comparison between signed and unsigned integer expressions
protocol.c:1562: error: invalid conversion from ‘void*’ to ‘char*’
protocol.c: In function ‘void PerformSubnegotiation(descriptor_t*, char, char*, int)’:
protocol.c:1989: error: invalid conversion from ‘void*’ to ‘char*’
protocol.c: In function ‘void ExecuteMSDPPair(descriptor_t*, const char*, const char*)’:
protocol.c:2455: error: invalid conversion from ‘void*’ to ‘char*’
protocol.c: In function ‘char* AllocString(const char*)’:
protocol.c:2882: error: invalid conversion from ‘void*’ to ‘char*’
make[1]: *** [../o/protocol.o] Error 1




I have followed instructions inside the snippet for smaug, as well as the instructions here: https://www.gammon.com.au/forum/?id=12367 (which did solve the protocol.h issue)

any ideas? or is there an updated version for FUSS?
#1
ok got it down to linking issues now



../o/act_comm.o: In function `send_rip_screen(char_data*)':
/home/carinus/MASTER/carinus/src/act_comm.c:2478: undefined reference to `write_to_buffer(descriptor_data*, char const*, unsigned int)'
../o/act_comm.o: In function `send_rip_title(char_data*)':
/home/carinus/MASTER/carinus/src/act_comm.c:2494: undefined reference to `write_to_buffer(descriptor_data*, char const*, unsigned int)'
../o/act_comm.o: In function `send_ansi_title(char_data*)':
/home/carinus/MASTER/carinus/src/act_comm.c:2510: undefined reference to `write_to_buffer(descriptor_data*, char const*, unsigned int)'
../o/act_comm.o: In function `send_ascii_title(char_data*)':
/home/carinus/MASTER/carinus/src/act_comm.c:2526: undefined reference to `write_to_buffer(descriptor_data*, char const*, unsigned int)'
../o/color.o: In function `do_color':
/home/carinus/MASTER/carinus/src/color.c:405: undefined reference to `write_to_buffer(descriptor_data*, char const*, unsigned int)'
../o/color.o:/home/carinus/MASTER/carinus/src/color.c:407: more undefined references to `write_to_buffer(descriptor_data*, char const*, unsigned int)' follow
collect2: ld returned 1 exit status

USA Global Moderator #2
link?
#3
https://github.com/Xavious/MSDP_Protocol_Handler

ok here's the update.. i finally got it to compile... everything looking good.. .no warnings...

I boot up the mud... I get the greeting and a new line that says "MXP Enabled"

but..... I can't send any commands... my name, password... nothing lol

edit: I have re-traced all the steps and I did not miss anything that it asked me for. Anyone ever run into this?
Amended on Wed 09 May 2018 01:20 AM by Joeyfogas
USA Global Moderator #4
Ok, but can you provide a link to the complete thing that you're having trouble with? Help me help you.
Australia Forum Administrator #5
Can't send commands ... that sounds familiar.

Template:version
Please help us by advising the version of MUSHclient you are using. Use the Help menu -> About MUSHclient.
#6
fiendish I am not sure what you are asking for? I provided the link above to the protocol snippet... it was after that Install that I could no longer send commands.

I mean, I could provide a link to my code if that is what you are asking.
Australia Forum Administrator #7
To reproduce an error such as the one you are having we need to know the exact code you are compiling, not just the snippet you are adding in.
#8
there are 2 files, protocol.c and protocol.h Using the "install smaug" readme in the link above, using FUSS 1.9. Protocol.h and protocol.c have been edited to the following....


Protocol.h
https://pastebin.com/fWHNEzeD

Protocol.c
https://pastebin.com/ihG119UH
Amended on Wed 09 May 2018 04:48 PM by Joeyfogas
USA Global Moderator #9
I'm helpful, but I'm also lazy and cranky.

I'm not going to go get smaug for myself. I'm not going to decide which one is the right one. I'm not going to apply diffs or patches or other edits. And I'm definitely not going to read any readmes about how to do any of the preceding. One assumes that you've already done those things so that we don't have to. So help me help you by not making me play fetch and save me the unnecessary steps of having to work to get to where you are now.

Please provide a nice single self-contained download that is an exact and complete copy of the entire thing, any adjacent thing, and any even remotely related thing that you are currently trying to run so that helping you is as painless for me as possible.
Amended on Thu 10 May 2018 01:50 AM by Fiendish
#10
my apologies, I thought you were asking for the specific code I was using, not then entire sha-bang.

But fair enough, sorry for the misunderstanding.

http://s000.tinyupload.com/?file_id=04448760901596383933

there is the complete code in one rar file.


other notes:

I am compiling on gcc (GCC) 4.4.7 and on (Red Hat 4.4.7-18)

On my end, there are no warnings or errors.
USA Global Moderator #11
Ok. I've downloaded it. Then what?

No, I'll save you a step. I set the wayback machine to 1998 and ran make inside src with -std=c++98, because it doesn't compile by modern C++ standards. And then I typed
$ ./smaug

and it said

$ ./smaug

Thu May 10 21:01:19 2018 :: Booting Database
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Thu May 10 21:01:19 2018 :: [*****] BOOT: ---------------------[ Boot Log ]--------------------
Thu May 10 21:01:19 2018 :: Initializing libdl support...
Thu May 10 21:01:19 2018 :: Loading commands...
Thu May 10 21:01:19 2018 :: Loading spec_funs...
Thu May 10 21:01:19 2018 :: Loading sysdata configuration...
Thu May 10 21:01:19 2018 :: [*****] BUG: fread_sysdata: no match: Counter
Thu May 10 21:01:19 2018 :: [*****] BUG: fread_sysdata: no match: 2
Thu May 10 21:01:19 2018 :: Loading overland maps....
Thu May 10 21:01:19 2018 :: Initializing map grid array....
Thu May 10 21:01:19 2018 :: Loading continent of Carinus.....
Thu May 10 21:01:19 2018 :: Loading continent of Map 2.....
Thu May 10 21:01:19 2018 :: Loading continent of Map 3.....
Thu May 10 21:01:19 2018 :: Loading overland map exits....
Thu May 10 21:01:19 2018 :: Loading overland landmarks....
Thu May 10 21:01:19 2018 :: Loading socials
Thu May 10 21:01:19 2018 :: Loading skill table
Thu May 10 21:01:19 2018 :: Sorting skill table...
Thu May 10 21:01:19 2018 :: Creating skill table sorted by type...
Thu May 10 21:01:19 2018 :: Remapping slots to sns
Thu May 10 21:01:19 2018 :: Loading classes
Thu May 10 21:01:19 2018 :: Loading races
Thu May 10 21:01:19 2018 :: Loading news data
Thu May 10 21:01:19 2018 :: Loading liquids
Thu May 10 21:01:19 2018 :: Loading mixtures
Thu May 10 21:01:19 2018 :: Loading herb table
Thu May 10 21:01:19 2018 :: Loading tongues
Thu May 10 21:01:19 2018 :: Loading quest bit tables
Thu May 10 21:01:19 2018 :: Loading MSSP Data...
Thu May 10 21:01:19 2018 :: Initializing random number generator
Thu May 10 21:01:19 2018 :: Setting time and weather.
Thu May 10 21:01:19 2018 :: Loading holiday chart...
Thu May 10 21:01:19 2018 :: Loading DNS cache...
Thu May 10 21:01:19 2018 :: Assigning gsn's
Thu May 10 21:01:19 2018 :: Reading in area files...
area.lst: No such file or directory

$

Ok. Then what?
Amended on Fri 11 May 2018 12:09 AM by Fiendish
#12
I downloaded the compressed file to see if I forgot to add area.lst, however it is in there. you should have everything you need in that download.

try recopying the area folder. I always use the command "./startup (yourportnumber) &"
Amended on Fri 11 May 2018 01:35 AM by Joeyfogas
USA Global Moderator #13
startup is not flagged executable in this download you gave me.
USA Global Moderator #14

$ chmod +x startup
$ ./startup

: Command not found.
: Command not found.
: No such file or directory.

$


Ok, now what?
Amended on Fri 11 May 2018 01:25 AM by Fiendish
#15
I honestly do not know what to tell you..

I downloaded the same file I linked you to... I typed make in the src directory,


[carinus@condor src]$ make
make -s smaug
  Compiling ../o/agemobcomm.o....
  Compiling ../o/agecommand.o....
  Compiling ../o/act_comm.o....
  Compiling ../o/act_info.o....
  Compiling ../o/act_move.o....
  Compiling ../o/act_obj.o....
  Compiling ../o/act_wiz.o....
  Compiling ../o/ban.o....
  Compiling ../o/boards.o....
  Compiling ../o/bank.o....
  Compiling ../o/bits.o....
  Compiling ../o/build.o....
  Compiling ../o/calendar.o....
  Compiling ../o/clans.o....
  Compiling ../o/color.o....
  Compiling ../o/comm.o....
  Compiling ../o/comments.o....
  Compiling ../o/const.o....
  Compiling ../o/db.o....
  Compiling ../o/deity.o....
  Compiling ../o/dns.o....
  Compiling ../o/fight.o....
  Compiling ../o/greyowl_smaugFUSS.o....
  Compiling ../o/greyowl_overland.o....
  Compiling ../o/handler.o....
  Compiling ../o/hashstr.o....
  Compiling ../o/hint.o....
  Compiling ../o/hotboot.o....
  Compiling ../o/house.o....
  Compiling ../o/imm_host.o....
  Compiling ../o/interp.o....
  Compiling ../o/liquids.o....
  Compiling ../o/magic.o....
  Compiling ../o/makeobjs.o....
  Compiling ../o/mapout.o....
  Compiling ../o/mapper.o....
  Compiling ../o/mccp.o....
  Compiling ../o/misc.o....
  Compiling ../o/mpxset.o....
  Compiling ../o/mssp.o....
  Compiling ../o/mud_comm.o....
  Compiling ../o/mud_prog.o....
  Compiling ../o/news.o....
  Compiling ../o/overland.o....
  Compiling ../o/planes.o....
  Compiling ../o/player.o....
  Compiling ../o/polymorph.o....
  Compiling ../o/protocol.o....
  Compiling ../o/renumber.o....
  Compiling ../o/reset.o....
  Compiling ../o/save.o....
  Compiling ../o/services.o....
  Compiling ../o/sha256.o....
  Compiling ../o/shops.o....
  Compiling ../o/skills.o....
  Compiling ../o/special.o....
  Compiling ../o/tables.o....
  Compiling ../o/track.o....
  Compiling ../o/update.o....
  Compiling ../o/variables.o....
  Compiling ../o/weather.o....
  Compiling ../o/webwho.o....
Generating dependency file ...
Done compiling mud.
make -s dns
Done compiling DNS resolver.
[carinus@condor src]$


Then I ran startup

[carinus@condor src]$ ./startup 6002 &
[1] 12275
[carinus@condor src]$ 


I cannot recreate what is happening on your end... so I am at a loss on what to tell you. I literally just did this with the same files...
USA Global Moderator #16
No, I'll save you a step.

I cd ../area and then ../src/smaug while thinking to myself, "wtf, this is a really bad way to invoke a program."

And then it starts up, with


Thu May 10 22:32:02 2018 :: Booting Database
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Thu May 10 22:32:02 2018 :: [*****] BOOT: ---------------------[ Boot Log ]--------------------
Thu May 10 22:32:02 2018 :: Initializing libdl support...
Thu May 10 22:32:02 2018 :: Loading commands...
Thu May 10 22:32:02 2018 :: Loading spec_funs...
Thu May 10 22:32:02 2018 :: Loading sysdata configuration...
Thu May 10 22:32:02 2018 :: [*****] BUG: fread_sysdata: no match: Counter
Thu May 10 22:32:02 2018 :: [*****] BUG: fread_sysdata: no match: 2
Thu May 10 22:32:02 2018 :: Loading overland maps....
Thu May 10 22:32:02 2018 :: Initializing map grid array....
Thu May 10 22:32:02 2018 :: Loading continent of Carinus.....
Thu May 10 22:32:02 2018 :: Loading continent of Map 2.....
Thu May 10 22:32:02 2018 :: Loading continent of Map 3.....
Thu May 10 22:32:02 2018 :: Loading overland map exits....
Thu May 10 22:32:02 2018 :: Loading overland landmarks....
Thu May 10 22:32:02 2018 :: Loading socials
Thu May 10 22:32:02 2018 :: Loading skill table
Thu May 10 22:32:02 2018 :: Sorting skill table...
Thu May 10 22:32:02 2018 :: Creating skill table sorted by type...
Thu May 10 22:32:02 2018 :: Remapping slots to sns
Thu May 10 22:32:02 2018 :: Loading classes
Thu May 10 22:32:02 2018 :: Loading races
Thu May 10 22:32:02 2018 :: Loading news data
Thu May 10 22:32:02 2018 :: Loading liquids
Thu May 10 22:32:02 2018 :: Loading mixtures
Thu May 10 22:32:02 2018 :: Loading herb table
Thu May 10 22:32:02 2018 :: Loading tongues
Thu May 10 22:32:02 2018 :: Loading quest bit tables
Thu May 10 22:32:02 2018 :: Loading MSSP Data...
Thu May 10 22:32:02 2018 :: Initializing random number generator
Thu May 10 22:32:02 2018 :: Setting time and weather.
Thu May 10 22:32:02 2018 :: Loading holiday chart...
Thu May 10 22:32:02 2018 :: Loading DNS cache...
Thu May 10 22:32:02 2018 :: Assigning gsn's
Thu May 10 22:32:02 2018 :: Reading in area files...
Thu May 10 22:32:02 2018 :: [*****] BUG: add_help: duplicate: GOTO.  Deleting.
Thu May 10 22:32:02 2018 :: [*****] FILE: help.are LINE: 5206
Thu May 10 22:32:02 2018 :: [*****] BUG: add_help: duplicate: REDIT.  Deleting.
Thu May 10 22:32:02 2018 :: [*****] FILE: help.are LINE: 13037
(help.are)
limbo.are     : Rooms:     2 - 99    Objs:     2 - 99    Mobs:     1 - 99
newacad.are   : Rooms: 10300 - 10499 Objs: 10300 - 10499 Mobs: 10300 - 10499
newgate.are   : Rooms:   100 - 199   Objs:   100 - 199   Mobs:   100 - 199
newdark.are   : Rooms: 21000 - 21499 Objs: 21000 - 21435 Mobs: 21000 - 21499
gods.are      : Rooms:  1200 - 1202  Objs:  1200 - 1200  Mobs:  1200 - 1200
plains.are    : Rooms:   300 - 345   Objs:   300 - 313   Mobs:   300 - 350
haon.are      : Rooms:  6000 - 6156  Objs:  6000 - 6155  Mobs:  6000 - 6117
midennir.are  : Rooms:  3500 - 3590  Objs:  3500 - 3550  Mobs:  3500 - 3550
sewer.are     : Rooms:  7001 - 7445  Objs:  7190 - 7310  Mobs:  7000 - 7206
redferne.are  : Rooms:  7900 - 7918  Objs:  7909 - 7911  Mobs:  7900 - 7900
grove.are     : Rooms:  8901 - 8999  Objs:  8900 - 8919  Mobs:  8900 - 8911
dwarven.are   : Rooms:  6500 - 6554  Objs:  6502 - 6519  Mobs:  6500 - 6517
daycare.are   : Rooms:  6601 - 6651  Objs:  6600 - 6647  Mobs:  6600 - 6610
grave.are     : Rooms:  3600 - 3651  Objs:  3600 - 3613  Mobs:  3600 - 3605
chapel.are    : Rooms:  3405 - 3475  Objs:  3400 - 3430  Mobs:  3400 - 3416
astral.are    : Rooms:   800 - 899   Objs:   800 - 899   Mobs:   800 - 899
Build.are     : Rooms:  9500 - 9589  Objs:     0 - 0     Mobs:     0 - 0
Thu May 10 22:32:02 2018 :: [*****] BUG: fread_fuss_object: no match: d
Thu May 10 22:32:02 2018 :: [*****] FILE: pixie.are LINE: 209
Thu May 10 22:32:02 2018 :: [*****] BUG: fread_fuss_object: no match: d
Thu May 10 22:32:02 2018 :: [*****] FILE: pixie.are LINE: 210
Thu May 10 22:32:02 2018 :: [*****] BUG: fread_fuss_object: no match: d
Thu May 10 22:32:02 2018 :: [*****] FILE: pixie.are LINE: 211
Thu May 10 22:32:02 2018 :: [*****] BUG: fread_fuss_object: no match: d
Thu May 10 22:32:02 2018 :: [*****] FILE: pixie.are LINE: 232
Thu May 10 22:32:02 2018 :: [*****] BUG: fread_fuss_object: no match: d
Thu May 10 22:32:02 2018 :: [*****] FILE: pixie.are LINE: 233
Thu May 10 22:32:02 2018 :: [*****] BUG: fread_fuss_object: no match: d
Thu May 10 22:32:02 2018 :: [*****] FILE: pixie.are LINE: 246
Thu May 10 22:32:02 2018 :: [*****] BUG: fread_fuss_object: no match: d
Thu May 10 22:32:02 2018 :: [*****] FILE: pixie.are LINE: 267
pixie.are     : Rooms:  2070 - 2099  Objs:  2070 - 2077  Mobs:  2070 - 2073
export.are    : Rooms:  9810 - 9899  Objs:  9810 - 9899  Mobs:  9800 - 9899
srefuge.are   : Rooms:  1500 - 1599  Objs:  1500 - 1599  Mobs:  1500 - 1599
manor.are     : Rooms:  2400 - 2499  Objs:  2400 - 2499  Mobs:  2405 - 2484
unholy.are    : Rooms:  2101 - 2172  Objs:  2101 - 2150  Mobs:  2101 - 2120
gallery.are   : Rooms: 24800 - 24899 Objs: 24800 - 24899 Mobs: 24800 - 24899
housing.are   : Rooms: 50000 - 54999 Objs: 50000 - 54999 Mobs: 50000 - 54999
Thu May 10 22:32:02 2018 :: [*****] BUG: load_continent: Invalid area continent, set to 'alsherok' by default.
Thu May 10 22:32:02 2018 :: [*****] FILE: carinus.are LINE: 17
carinus.are   : Rooms: 30000 - 30099 Objs:     0 - 0     Mobs: 30000 - 30099
map2.are      : Rooms: 30100 - 30199 Objs:     0 - 0     Mobs: 30100 - 30199
map3.are      : Rooms: 30200 - 30299 Objs:     0 - 0     Mobs: 30200 - 30299
Thu May 10 22:32:02 2018 :: Fixing exits
Thu May 10 22:32:02 2018 :: Initializing economy
Thu May 10 22:32:02 2018 :: Resetting areas
Thu May 10 22:32:02 2018 :: Loading overland resets...
Thu May 10 22:32:02 2018 :: Loading buildlist
Thu May 10 22:32:02 2018 :: ../gods/Bob
Thu May 10 22:32:02 2018 :: ../gods/Mitchell
Thu May 10 22:32:02 2018 :: ../gods/Ubraxis
Thu May 10 22:32:02 2018 :: ../gods/Morain
Thu May 10 22:32:02 2018 :: ../gods/Ilnwnll
Thu May 10 22:32:02 2018 :: ../gods/Xander
Thu May 10 22:32:02 2018 :: ../gods/Lfour
Thu May 10 22:32:02 2018 :: ../gods/Darren
Thu May 10 22:32:02 2018 :: ../gods/Bennet
Thu May 10 22:32:02 2018 :: Loading boards
Thu May 10 22:32:02 2018 :: ../boards/immortal.brd
Thu May 10 22:32:02 2018 :: ../boards/highgod.brd
Thu May 10 22:32:02 2018 :: Loading vault list
Thu May 10 22:32:02 2018 :: $
Thu May 10 22:32:02 2018 ::  Done vaults 
Thu May 10 22:32:02 2018 :: Loading clans
Thu May 10 22:32:02 2018 :: Loading clans...
Thu May 10 22:32:02 2018 :: vampire.gui
Thu May 10 22:32:02 2018 :: Cannot open vault - ../clans/vampire.gui.vault
Thu May 10 22:32:02 2018 :: druid.gui
Thu May 10 22:32:02 2018 :: Cannot open vault - ../clans/druid.gui.vault
Thu May 10 22:32:02 2018 :: warrior.gui
Thu May 10 22:32:02 2018 :: Cannot open vault - ../clans/warrior.gui.vault
Thu May 10 22:32:02 2018 :: augurer.gui
Thu May 10 22:32:02 2018 :: Cannot open vault - ../clans/augurer.gui.vault
Thu May 10 22:32:02 2018 :: thief.gui
Thu May 10 22:32:02 2018 :: Cannot open vault - ../clans/thief.gui.vault
Thu May 10 22:32:02 2018 :: cleric.gui
Thu May 10 22:32:02 2018 :: Cannot open vault - ../clans/cleric.gui.vault
Thu May 10 22:32:02 2018 :: mage.gui
Thu May 10 22:32:02 2018 :: Cannot open vault - ../clans/mage.gui.vault
Thu May 10 22:32:02 2018 :: ranger.gui
Thu May 10 22:32:02 2018 :: Cannot open vault - ../clans/ranger.gui.vault
Thu May 10 22:32:02 2018 :: $
Thu May 10 22:32:02 2018 ::  Done clans 
Thu May 10 22:32:02 2018 :: Loading councils
Thu May 10 22:32:02 2018 :: Loading councils...
Thu May 10 22:32:02 2018 :: $
Thu May 10 22:32:02 2018 ::  Done councils 
Thu May 10 22:32:02 2018 :: Loading deities
Thu May 10 22:32:02 2018 :: Loading deities...
Thu May 10 22:32:02 2018 :: $
Thu May 10 22:32:02 2018 ::  Done deities 
Thu May 10 22:32:02 2018 :: Loading watches
Thu May 10 22:32:02 2018 :: Loading bans
Thu May 10 22:32:02 2018 :: Done.
Thu May 10 22:32:02 2018 :: Loading reserved names
Thu May 10 22:32:02 2018 :: Loading corpses
Thu May 10 22:32:02 2018 :: Loading Immortal Hosts
Thu May 10 22:32:02 2018 :: Done.
Thu May 10 22:32:02 2018 :: Loading Projects
Thu May 10 22:32:02 2018 :: Loading Morphs
Thu May 10 22:32:02 2018 :: Done.
Thu May 10 22:32:02 2018 :: Loading Housing System, Home Accessories Data, and Home Auctioning System
Thu May 10 22:32:02 2018 :: Loading login messages
Thu May 10 22:32:02 2018 :: Initializing socket
Thu May 10 22:32:02 2018 :: (Name Not Set) ready on port 4000.
Thu May 10 22:32:02 2018 :: [*****] BUG: online.html: fopen
online.html: No such file or directory
Thu May 10 22:33:17 2018 :: [*****] BUG: online.html: fopen
online.html: No such file or directory


Now my first question is: How do you feel about all those "[*****] BUG" messages?
Amended on Fri 11 May 2018 01:45 AM by Fiendish
#17
not very strong. each of them are easily resolvable and do not prevent the game from functioning. They aren't the problem
USA Global Moderator #18
Quote:
I cannot recreate what is happening on your end.

I believe it, because your version of GCC is about 70 years old. 4.4.0? I have 7.3.1. Anyway, I have it running.

Have you compiled it with debug flags enabled and attached a debugger to it?
Amended on Fri 11 May 2018 01:49 AM by Fiendish
#19
lol.. it's a free server, so I can't complain about free
#20
no, honestly I have googled, read here about gdb debugging, I have exhausted the internet ... and for WHATEVER reason, I NEVER get the output the tutorials claim I should get. So gdb has been lost to me and I am stuck trying to rely on reasonable guesses and trial and error.

edit: I am starting to think that Smaug is haunted.
Amended on Fri 11 May 2018 01:53 AM by Joeyfogas
USA Global Moderator #21
Quote:
I NEVER get the output the tutorials claim I should get.

Probably because your version of gdb is 70 years old.
#22
you may be right
#23
and again, thanks for helping with this. I saw on the MUD discord channel people talking about this snippet today, so others may run into this issue soon. If a solution is found it could save a lot of future headaches.
Australia Forum Administrator #24
There was a bug in MUSHclient a while back where, under some circumstances, no data would be sent to the server. If you advise which version of MUSHclient you are using that would help.

Also, does my gdb tutorial not work? In what way?
USA Global Moderator #25
So I run gdb ../src/smaug
then I tell it to run. then it runs.
then I hit ctrl-c and type bt and it shows me


#0  0x00007ffff6e0aad7 in select () from /lib64/libc.so.6
#1  0x00000000004d89b9 in game_loop () at comm.c:970
#2  0x00000000004d7851 in main (argc=1, argv=0x7fffffffdf88) at comm.c:551


Oh look. game_loop in comm.c.

So I open comm.c.

blah blah. game_loop. blah blah.

calls accept_new. what does that do?

blah blah.

calls new_descriptor. what does that do?

blah blah blah. lol bans. blah blah.

oh look, here it sends the greeting.

blah blah...and nothing else...

go back to game_loop ...

not idling out
...
not getting disconnected
...
not dns

...blah blah...

calls read_from_buffer. What does that do?

Gosh. The first thing it does is set read_buf[0] = '\0';

What an odd thing to do. I wonder what the effect of that is?

oh look. for i = 0 blah blah if( read_buf[i] == '\0') return;

So read_from_buffer does absolutely nothing. okaaayy.

blah blah...hm.. end of that loop.

update_handler?

blah blah blah nope.

Output sounds reasonable.

blah blah blah

ugh

blah blah

write_to_descriptor. finally. What does it do?

not much...

ugh. this is dumb. where does the password get set?

search for "password"

Oh look. nanny. Deal with sockets that haven't logged in yet.

So I need to make it to nanny. It's just after read_from_buffer.

Except the code will never get to nanny, because read_from_buffer does nothing.



This is just a wild guess, but did you edit this code, specifically read_from_buffer in comm.c, to make it do less than it used to?
Amended on Fri 11 May 2018 03:37 AM by Fiendish
#26
the only thing I did to that was per instruction. 2 lines were added


In game_loop():

    read_from_buffer( d );
    if ( d->incomm[0] != '\0' )
    {
        d->fcommand     = TRUE;

        if ( d->pProtocol != NULL )      /* <--- Add this line */
            d->pProtocol->WriteOOB = 0;  /* <--- Add this line */

If d->fcommand is set to TRUE anywhere else, do the same there.
Australia Forum Administrator #27
OK, this is my third attempt to get from you what version of MUSHclient you are using (if you are using it at all)?
Australia Forum Administrator #28

but….. I can’t send any commands… my name, password… nothing lol

gdb is useful in two main situations:

  • The server crashes and you want to know why (this doesn’t seem to apply to you)

  • The code is doing something you don’t expect (this seems more to be your case)

In the first case, typing “bt” (backtrace) basically tells you where the code was when it crashed.

In the second case it is more useful to put a breakpoint in a function where you are expecting to be (eventually) and then see why branch X is taken when you expected branch Y.

So when you say you can’t send any commands, perhaps put a breakpoint in “nanny” and see if, when you send your name, nanny is even called.

You could also turn on packet debugging in MUSHclient - perhaps what is happening is that data is arriving, but being discarded for some reason.

#29
sorry nick, i didn't see that message. I am trying this on Zmud (newest version trial), Gmud, Mudlet 3.9, and beipMU 3.0

all yielding no results.

edit: and fiendish, I checked my read_from_buffer function against stock, and nothing inside the function itself was changed.
Amended on Fri 11 May 2018 05:26 AM by Joeyfogas
Australia Forum Administrator #30
Well, I presume you can send the commands, but what you are saying is the server doesn't react. The routines in comm.c are where input is handled.

In particular, if you haven't logged on, then in nanny:

So you could do something like this:


nick@Ubuntu-Windows:~/Development/smaugfuss/area$ gdb ../src/smaug
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
...
(gdb) break nanny
Breakpoint 1 at 0x4d5c09: file comm.c, line 2600.
(gdb) run
Starting program: /home/nick/Development/smaugfuss/src/smaug 
Fri May 11 16:50:20 2018 :: Booting Database
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Fri May 11 16:50:20 2018 :: [*****] BOOT: ---------------------[ Boot Log ]--------------------
Fri May 11 16:50:20 2018 :: Initializing libdl support...
Fri May 11 16:50:20 2018 :: Loading commands...
Fri May 11 16:50:20 2018 :: Loading spec_funs...
... blah blah ...
Fri May 11 16:50:20 2018 :: Loading Projects
Fri May 11 16:50:20 2018 :: Loading Morphs
Fri May 11 16:50:20 2018 :: Done.
Fri May 11 16:50:20 2018 :: Initializing socket
Fri May 11 16:50:20 2018 :: (Name Not Set) ready on port 4000.

... now you login and type your name, eg "nick" ...

Breakpoint 1, nanny (d=0xcd5cd0, argument=0x7fffffffd910 "nick") at comm.c:2600
2600	   while( isspace( *argument ) )
(gdb) list
2595	/*
2596	 * Deal with sockets that haven't logged in yet.
2597	 */
2598	void nanny( DESCRIPTOR_DATA * d, char *argument )
2599	{
2600	   while( isspace( *argument ) )
2601	      argument++;
2602	
2603	   switch ( d->connected )
2604	   {
(gdb) (Press <enter> to repeat the previous command, in this case "list")
2605	      default:
2606	         bug( "%s: bad d->connected %d.", __FUNCTION__, d->connected );
2607	         close_socket( d, TRUE );
2608	         return;
2609	
2610	      case CON_GET_NAME:
2611	         nanny_get_name( d, argument );
2612	         break;
2613	
2614	      case CON_GET_OLD_PASSWORD:
(gdb) 



This shows that your input was received. Then you can do "next" or "step". "next" goes onto the next (executed) line without going into sub-functions, but "step" will follow functions down. If you end up in a boring function (like, "isspace") you can type "finish" to leave that function and go back up to the higher-level function.

You can also usefully see what variables contain, eg "p foo" will print the value in foo.

Also try typing "list" which lists the source around where you currently are, to give you some context.
Amended on Fri 11 May 2018 06:03 AM by Nick Gammon
USA Global Moderator #31
Except that with this code you'll never actually reach nanny.
USA Global Moderator #32
Quote:
edit: and fiendish, I checked my read_from_buffer function against stock, and nothing inside the function itself was changed.

Let's say that I don't believe you, and, to be clear, I don't. Now what steps could you take to be more convincing here?
Amended on Sat 12 May 2018 04:23 PM by Fiendish
#33
Taken from STOCK.

you can compare



/*
 * Transfer one line from input buffer to input line.
 */
void read_from_buffer( DESCRIPTOR_DATA * d )
{
   int i, j, k, iac = 0;

   /*
    * Hold horses if pending command already.
    */
   if( d->incomm[0] != '\0' )
      return;

   /*
    * Look for at least one new line.
    */
   for( i = 0; i < MAX_INBUF_SIZE && d->inbuf[i] != '\n' && d->inbuf[i] != '\r'; i++ )
   {
      if( d->inbuf[i] == '\0' )
         return;
   }

   /*
    * Canonical input processing.
    */
   for( i = 0, k = 0; d->inbuf[i] != '\n' && d->inbuf[i] != '\r'; i++ )
   {
      if( k >= 254 )
      {
         write_to_descriptor( d, "Line too long.\r\n", 0 );

         /*
          * skip the rest of the line 
          */
         /*
          * for ( ; d->inbuf[i] != '\0' || i>= MAX_INBUF_SIZE ; i++ )
          * {
          * if ( d->inbuf[i] == '\n' || d->inbuf[i] == '\r' )
          * break;
          * }
          */
         d->inbuf[i] = '\n';
         d->inbuf[i + 1] = '\0';
         break;
      }

      if( d->inbuf[i] == ( signed char )IAC )
         iac = 1;
      else if( iac == 1
               && ( d->inbuf[i] == ( signed char )DO || d->inbuf[i] == ( signed char )DONT
                    || d->inbuf[i] == ( signed char )WILL ) )
         iac = 2;
      else if( iac == 2 )
      {
         iac = 0;
         if( d->inbuf[i] == ( signed char )TELOPT_COMPRESS2 )
         {
            if( d->inbuf[i - 1] == ( signed char )DO )
               compressStart( d );
            else if( d->inbuf[i - 1] == ( signed char )DONT )
               compressEnd( d );
         }
      }
      else if( d->inbuf[i] == '\b' && k > 0 )
         --k;
      else if( isascii( d->inbuf[i] ) && isprint( d->inbuf[i] ) )
         d->incomm[k++] = d->inbuf[i];
   }

   /*
    * Finish off the line.
    */
   if( k == 0 )
      d->incomm[k++] = ' ';
   d->incomm[k] = '\0';

   /*
    * Deal with bozos with #repeat 1000 ...
    */
   if( k > 1 || d->incomm[0] == '!' )
   {
      if( d->incomm[0] != '!' && strcmp( d->incomm, d->inlast ) )
      {
         d->repeat = 0;
      }
      else
      {
         if( ++d->repeat >= 20 )
         {
/*		log_printf( "%s input spamming!", d->host );
*/
            write_to_descriptor( d, "\r\n*** PUT A LID ON IT!!! ***\r\nYou cannot enter the same command more than 20 consecutive times!\r\n", 0 );
            mudstrlcpy( d->incomm, "quit", MAX_INPUT_LENGTH );
         }
      }
   }

   /*
    * Do '!' substitution.
    */
   if( d->incomm[0] == '!' )
      mudstrlcpy( d->incomm, d->inlast, MAX_INPUT_LENGTH );
   else
      mudstrlcpy( d->inlast, d->incomm, MAX_INPUT_LENGTH );

   /*
    * Shift the input buffer.
    */
   while( d->inbuf[i] == '\n' || d->inbuf[i] == '\r' )
      i++;
   for( j = 0; ( d->inbuf[j] = d->inbuf[i + j] ) != '\0'; j++ )
      ;
   return;
}

Amended on Sun 13 May 2018 02:29 AM by Nick Gammon
#34
ok I apologize, there was a step in there I took too literally. Fiendish, thank you for being so blunt. I did finally find the problem in the read_from_buffer
#35
there was this in the instruction..



Then replace every instance of "d->inbuf" with "read_buf", so that everything 
goes into the temporary buffer rather than directly into the characters input 
buffer.


I guess I took that literally and replaced everywhere, even in the read_from_buffer. restoring the "d->inbuf" in that area fixed it.
USA Global Moderator #36
Glad to be of service. :)