On Sun, Jan 23, 2011 at 07:39:31AM -0700, Dave Smith wrote:
> Can you believe it's been nearly 8 years since this:
>
> http://glbattlepong.sourceforge.net/
Uh-huh. The mailing list is still "TBA", the CVS web interface is now
a broken link, the anonymous CVS access doesn't work, and my email
address is deprecated. At least the link to the SF project page still
works.
Perusing my old student "just hurry up and get the lab passed off so I
can start cramming for the physics exam tomorrow" code makes me want
to crawl under a rock. Who needs a realtime multiplayer network
protocol when you can just spam casted structs for all the objects in
the field over the wire? And we attempt to maintain 30fps on the
clients by iterating over all the objects and sending out the updates
on the network to each client... 30 times a second! (Well, that didn't
seem to work out, so we just cranked that rate up a bit arbitrarily).
After all, that's what the CS department admins give us all that
bandwidth for, isn't it?
---
void sendDatagramToServer( unsigned char* data, int dataSize ) {
if( sendto( sdClient, (void*)data, dataSize, 0, (struct sockaddr*)&serv_addr,
sizeof( struct sockaddr_in ) ) >= 0 ) {
} else {
printf( "Error sending datagram to server\n" );
}
}
...
inline void sendPaddleToServer( Paddle_t* newPaddle ) {
unsigned char data[ MAX_DATA_SIZE ];
data[0] = OBJECT_PADDLE;
memcpy( &data[1], newPaddle, sizeof( Paddle_t ) + 1 );
sendDatagramToServer( data, sizeof( Paddle_t ) + 1 );
}
---
That's just precious.
--------------------
BYU Unix Users Group
http://uug.byu.edu/
The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list