Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » write_to_buffer returns?
Forum Rules | Mark all | Recent Posts

write_to_buffer returns?
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 25, 2003, 9:16 pm   Last edited Nov 24, 2007, 3:52 pm by Samson
Go to the top of the page
Go to the bottom of the page

Tonne

GroupMembers
Posts7
JoinedSep 25, 2003

I have the latest version of AFKmud
And when I try to do a write_to_buffer(d, "blah blah", 0 );
on multiple lines such as
write_to_buffer(d, "blah blah\r\n
blah blah\r\n
blah blah\r\n", 0 );

i get a " terminating error
and a error

Any suggestions?

Also, anyone successful with adding an pre-login ansi prompt?

-Tonne
       
Post is unread #2 Sep 26, 2003, 1:45 am   Last edited Nov 24, 2007, 3:52 pm by Samson
Go to the top of the page
Go to the bottom of the page

Tarl

GroupAFKMud Team
Posts26
JoinedJan 1, 2002

I would imagine your error is because you are breaking up the stuff in "'s across multiple lines. If memory serves me correctly (which is a dubious prospect at best :>;), you should be able to do:
write_to_buffer(d, "blah blah\r\n"
"blah blah\r\n"
"blah blah\r\n", 0 );
However, this might, or might not work (I haven't coded in C so long that I've got dustmites in that area of my brain ;), but I'm sure someone else will correct me if I'm wrong :>
       
Post is unread #3 Sep 26, 2003, 1:52 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

What you're doing is called multi-line string literals. gcc in their infinite wisdom decided that is no longer allowed and that's why you're getting errors. Just keep it all on the same line and you won't have an issue.
       
Post is unread #4 Sep 26, 2003, 11:21 am
Go to the top of the page
Go to the bottom of the page

Tonne

GroupMembers
Posts7
JoinedSep 25, 2003

That is totally wierd :P
But thank you, and also
How is do_who structured out?
I see do_who, do_smaug_who and do_afk_who
Can these be used and how are they strucured into who?
I am trying to call the do_who func in a switch for an accounts menu and get an implicit decleration of the function do_who

This code is unnreal Sampson, awesome job. Just tough navigating it all (for me anyways but its been 7 years since I worked on a mud)

I'm looking to add ansi pre-login query and add gboards but yikes :-)

Anyways thanks for helping out and thanks for reading this. Its great that a group of ppl are still around to help out old mudders even in this age of *gag* MMORPG's :-)

Tonne
       
Post is unread #5 Sep 29, 2003, 9:13 am
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Who works like this:

do_who grabs the player's interface, and issues the who command that works with that interface.

So basically, if you're looking at changing the AFKMud interface who, make your changes to afk_who. smaug_who and dale_who are the other two.

You can find these in the following files: iafk.c, ismaug.c, and idale.c

I believe do_who was moved to interface.c as well.

I want gboards in my MUD I think. But I've always hated pre-login ANSI... The more questions I gotta answer on my way into a MUD the less likely I am to give the game a chance. But that's my personal opinion.

As for getting around in the AFKMud source... just remember that grep is your friend. I think Samson's done a nice job of organizing his code too. If you ever wanted to find flags for OLC and BUILDING, you'd look in olc.h and build.c Go figure! *kick SMAUG* ;)

-- X
       
Post is unread #6 Sep 29, 2003, 9:16 am   Last edited Nov 24, 2007, 3:52 pm by Samson
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Oh, and if you NEED to do multi-line strings:

char buf[MSL];
sprintf( buf, "%s\r\n", "This is line one!" );
sprintf( buf+strlen(buf), "%s\r\n", "This is line two!" );
write_to_descriptor( buf, 0 );


Should do the trick.

-- X
       
Post is unread #7 Sep 29, 2003, 9:19 am
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Ah, and one last thing.


MUDs can be considered MMORPGs. I understood what you ment, but I the classification is wrong. Just like EverQuest is basically a graphical MUD.

MMORPG = Massively Multiplayer Online Roleplaying Game.
MUD = Multi-User Dungeon (Domain, Dimension, ect)

To be quite honest, EverQuest and the like barely fit into the MMORPG catagory. When was the last time you saw someone roleplaying in EQ? Well.. if being a bloody idiot is roleplaying, then there's a lot of it!

-- X
       
Pages:<< prev 1 next >>