Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Development
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
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

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,397
632
ClarenceKe
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » Buffer Length
Forum Rules | Mark all | Recent Posts

Buffer Length
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 25, 2008, 1:44 pm
Go to the top of the page
Go to the bottom of the page

Krylan
Fledgling
GroupMembers
Posts39
JoinedApr 14, 2005

Alright, next question. I've never been able to figure this out for the life of me, but one of the main requests from builders was the ability to create really long lines in the buffer. They're interested in it just being one line until they press enter, so they can have really long programs.

Basically:

Instead of this:

like if you typed a long sentence like this and tried to post it in one line for a prog 
1) like if you typed a long sentence like this and
2) tried to post it in one line for a prog
3) it automatically breaks it up like this which screws your progs up

I want this:
like if you typed a long sentence like this and tried to post it in one line for a prog 
1) like if you typed a long sentence like this and tried to post it in one line for a prog 

       
Post is unread #2 Mar 25, 2008, 3:05 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

I believe Cronel's editor snippet allows > 80 length lines.
       
Post is unread #3 Mar 25, 2008, 3:06 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,874
JoinedJul 26, 2005

Take a look at build.c function edit_buffer
probably something like this
   if( edit->size + strlen( argument ) + 1 >= MAX_STRING_LENGTH - 1 )
      send_to_char( "You buffer is full.\r\n", ch );
   else
   {
      int b_end;
      int bm = 75;
      int bp = 0;
      int ep = 0;

      strcpy( buf, argument );

      b_end = strlen( buf );

      while( bp < b_end )
      {
         while( buf[bm] != ' ' && bm > bp )
            bm--;

         if( bm == bp )
            bm += 75;

         if( bm > b_end )
            bm = b_end;

         ep = 0;
         while( bp < bm )
         {
            edit->line[edit->on_line][ep] = buf[bp];
            bp++;
            ep++;
         }

         bm = bp + 75;
         bp++;

         edit->line[edit->on_line][ep] = '\0';
         edit->on_line++;

         if( edit->on_line > edit->numlines )
            edit->numlines++;
         if( edit->numlines > max_buf_lines )
         {
            edit->numlines = max_buf_lines;
            send_to_char( "Buffer full.\r\n", ch );
            save = TRUE;
            break;
         }
      }
   }

This is the part that wraps the text around that you put in.
Keep in mind that you are kind of limited by this in mud.h
struct editor_data
{
   short numlines;
   short on_line;
   short size;
   char line[49][81];
};

The line part is where the data is put so you have a size limit there. If you increase the size line can be etc... you need to find all the things that like to mess with the editor_data and make sure they are set to work right with the new size also.
       
Post is unread #4 Mar 25, 2008, 3:50 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,644
JoinedJan 1, 2002

If you want to raise the size of the individual line buffers, then you need to alter the editor_data struct in mud.h, as Remcon has pointed out already. Specifically, the line[49][81] part. That controls two things:
1. The number of lines (49) and,
2. The number of characters per line (81).

Also keep in mind, C starts counting with 0, and you can't use the last number in the list, so you're really talking about lines 0 thru 47, and characters 0 thru 80. Either way raising this and making sure the build.c code matches what you've changed will give you the extra line length you want. But I'm not sure it's going to be all that useful to allow people to create programs with 500 lines, each 1024 characters long since that would seriously bloat the area files.
       
Pages:<< prev 1 next >>