--- deliantra/server/socket/sounds.C 2006/09/10 13:43:34 1.3 +++ deliantra/server/socket/sounds.C 2006/12/21 23:37:06 1.10 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_sound_c = - * "$Id: sounds.C,v 1.3 2006/09/10 13:43:34 root Exp $"; - */ - /* Send bug reports to Raphael Quinet (quinet@montefiore.ulg.ac.be) */ /** @@ -31,10 +25,10 @@ play_sound_player_only (player *pl, short soundnum, sint8 x, sint8 y) { char soundtype; - SockList sl; - if (!pl->socket.sound) + if (!pl->ns->sound) return; + /* Do some quick conversion to the sound type we want. */ if (soundnum >= SOUND_CAST_SPELL_0) { @@ -44,22 +38,22 @@ else soundtype = SOUND_NORMAL; - sl.buf = (unsigned char *) malloc (MAXSOCKBUF); - strcpy ((char *) sl.buf, "sound "); - sl.len = strlen ((char *) sl.buf); - SockList_AddChar (&sl, x); - SockList_AddChar (&sl, y); - SockList_AddShort (&sl, soundnum); - SockList_AddChar (&sl, soundtype); - Send_With_Handling (&pl->socket, &sl); - free (sl.buf); + packet sl; + + sl << "sound " + << uint8 (x) + << uint8 (y) + << uint16 (soundnum) + << uint8 (soundtype); + + pl->ns->send_packet (sl); } #define POW2(x) ((x) * (x)) /** Plays some sound on map at x,y. */ void -play_sound_map (mapstruct *map, int x, int y, short sound_num) +play_sound_map (maptile *map, int x, int y, short sound_num) { player *pl;