Actually, that would be "man 2 read"
"man read" will get you the read used in bash scripts (at least on my
computer).
But, the call to read isn't a bad place to start.
read_from_descriptor is called from game_loop_unix.
if ( FD_ISSET( d->descriptor, &in_set ) )
{
if ( d->character != NULL )
d->character->timer = 0;
if ( !read_from_descriptor( d ) )
{
Right after that is the part that stops it from processing commands if the
player is in a wait state (lagged).
if ( d->character != NULL && d->character->wait > 0 )
{
--d->character->wait;
continue;
}
Then if the player isn't in a wait state, read_from_buffer pulls one line from
the descriptor's inbuf. That's then sent to the nanny function, where it
eventually gets sent to interpret.
So basically you're going to have to hijack the descriptor's inbuf before it
gets checked for a wait state.
At that point, you have to split the inbuf into lines (each line is a
command), then process and remove those commands that you want to happen
regardless of wait state.
If you choose to, you can stick the unprocessed commands into a queue to save
you the trouble of re-assembling then re-parsing the inbuf later. This will
require more structural changes to the code, but could be more efficient and
some people feel it's the "right way" to do it.
That's the gist of it. You'll have to get your hands pretty dirty.
--Palrich.
----- Original Message -----
From: "Steve Boleware" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, November 09, 2004 6:47 PM
Subject: Re: Read function
-blink-
now thas new...
at the base of things you are correct.. read is what gathers input
_but_ you went a little far.. read (and conversely write) are system level
functions that are part of the way the OS works :) at least that is my
understanding (flawed though it may be). check a little higher
for what you need, if I recall read is used a grand total of once in the
code.
in comm.c I think, it grabs the input that is waiting, in this case from the
socket.
(hint :: type man read to get info on the read function)
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, November 09, 2004 4:13 PM
Subject: Read function
I was wondering if anyone know where this function was? I have determined
that
it is the one that recieves input from the player and puts it into their
buffer
but I can't seem to find it. I've checked several websites for the
libraries for
C on the web, but none of them have it.
This function is in comm.c. Here is the declaration:
int read args( ( int fd, char *buf, int nbyte ) );
It is used in read_from_descriptor.
Thanks.
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom