Crossfire Client, Trunk
R21611
|
#include "client.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <SDL.h>
#include "common.h"
#include "version.h"
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
static int | parse_input (char *data, int len) |
static void | print_quickhelp () |
static void | print_usage () |
static void | print_version () |
Variables | |
static bool | debug = false |
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main client entry point.
Definition at line 208 of file main.c.
References cf_snd_exit(), cf_snd_init(), debug, parse_input(), print_quickhelp(), print_usage(), and print_version().
|
static |
Preliminary handler for Crossfire server sound2 and music commands that are received from the client via stdin.
The sound player differentiates sound2 and music commands by looking at the first parameter that comes in. Music commands consist of a single, quoted string that identifies the music to play, while a sound effect command has various numeric parameters followed by strings that identify what to play.
Sound2 data consists of whitespace delimited values: x, y, dir, vol, type, sound, and source. Type, sound, and source define what to play, while the other parameters may be used to figure out how to play it. x and y are offsets from the player to identify where the sound originated. dir can be set to indicate a direction that the source is travelling in. vol is an attenuation factor (0-100) that may be applied to the sound volume to make it possible, for example, to give map-designers the ability to suggest relative loudness of sounds in the environment.
FIXME: This is a work-in-progress. The sound2 was put into the server without a plan to fix the clients. cfsndserv is basically made obsolete by sound2. The basic fix resurrects some sound support but does not fully implement the features sound2 is supposed to provide.
data | A text buffer that (hopefully) has a sound or music command. |
len | The length of the text data in the command buffer. |
Definition at line 79 of file main.c.
References cf_play_music(), cf_play_sound(), and debug.
Referenced by main().
|
static |
|
static |
|
static |
Print detailed version information.
Definition at line 32 of file main.c.
References FULL_VERSION.
Referenced by main().
|
static |
Definition at line 29 of file main.c.
Referenced by main(), and parse_input().