 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
35 #define MAX_SOUND_DISTANCE 10
61 if (!emitter->
map && !(emitter->
env && emitter->
env->
map))
64 source = emitter->
map ? emitter : emitter->
env;
69 int distance = (
MIN(dx, dy) * 3 +
FABS(dx-dy) * 2) / 2;
73 volume = distance ? volume / distance : volume;
100 #define POW2(x) ((x)*(x))
113 void play_sound_map(int8_t sound_type,
object *emitter,
int dir,
const char *action) {
117 if (!emitter->
map && !(emitter->
env && emitter->
env->
map))
120 source = emitter->
map ? emitter : emitter->
env;
const char * get_name_of_region_for_map(const mapstruct *m)
Gets the name of a region for a map.
player * next
Pointer to next player, NULL if this is last.
player * first_player
First player.
void player_update_bg_music(object *player)
#define FABS(x)
Decstations have trouble with fabs()...
uint32_t sound
Client sound mode.
struct archetype * arch
Pointer to archetype.
void SockList_AddString(SockList *sl, const char *data)
Adds a string without length.
object * ob
The object representing the player.
struct mapstruct * map
Pointer to the map in which this object is present.
#define MAX_SOUND_DISTANCE
Maximum distance a player may hear a sound from.
void play_sound_map(int8_t sound_type, object *emitter, int dir, const char *action)
Plays a sound on a map.
int ihypot(int a, int b)
Rough estimate of hypot(a, b).
#define SND_EFFECTS
Those flags are for the 'socket.sound' field.
Plugin animator file specs[Config] name
int16_t y
Position in the map for this object.
object clone
An object from which to do object_copy()
void SockList_AddChar(SockList *sl, unsigned char c)
Adds an 8 bit value.
uint8_t type
PLAYER, BULLET, etc.
#define MAX_SOUNDS_TICK
Maximum number of sounds a player can receive for each tick.
void send_background_music(player *pl, const char *music)
Sends background music to client.
#define SND_MUTE
Don't sent anything for now.
uint8_t sound_chance
Probability, 1 to 100, of the object emitting a sound.
sstring race
Human, goblin, dragon, etc.
void SockList_Init(SockList *sl)
Initializes the SockList instance.
void SockList_Term(SockList *sl)
Frees all resources allocated by a SockList instance.
int8_t sounds_this_tick
Number of sounds sent this tick.
sstring name
The name of the object, obviously...
char * background_music
Background music to use for this map.
object * env
Pointer to the object which is the environment.
#define SND_MUSIC
Client wants background music info.
const typedef char * sstring
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
Adds a data block prepended with an 8 bit length field.
void play_sound_player_only(player *pl, int8_t sound_type, object *emitter, int dir, const char *action)
Plays a sound for specified player only.
static char const * pick_bg_music(mapstruct *map)
socket_struct * socket
Socket information for this player.
void Send_With_Handling(socket_struct *ns, SockList *sl)
Calls Write_To_Socket to send data to the client.
Contains the base information we use to make up a packet we want to send.