Atrinik Server 2.5
Functions
commands/chat.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

int command_say (object *op, char *params)
int command_dmsay (object *op, char *params)
int command_shout (object *op, char *params)
int command_tell (object *op, char *params)
int command_t_tell (object *op, char *params)
static void emote_other (object *op, object *target, char *str, char *buf, size_t size, char *buf2, size_t size2, char *buf3, size_t size3, int emotion)
static void emote_self (object *op, char *buf, size_t size, char *buf2, size_t size2, int emotion)
static void emote_no_target (object *op, char *buf, size_t size, char *buf2, size_t size2, int emotion)
static int basic_emote (object *op, char *params, int emotion)

Detailed Description

This file handles communication related functions, like /dmsay, /say, /shout, etc.

Definition in file chat.c.


Function Documentation

static int basic_emote ( object op,
char *  params,
int  emotion 
) [static]

This function covers all the emotion commands a player can issue.

Based on the situation, it detects which emotion and how it should be performed.

If you want to add a new emotion command, you will need to modify one of the emote arrays in commands.c, add the emotion ID to commands.h and add a command wrapper to this function, similar to the functions below this one.

Parameters:
opPlayer doing the emotion.
paramsPossible parameters for the emotion (target name for the emotion, message for /me, etc).
emotionEmotion code, one of Emote command numbers.
Returns:
0.

Definition at line 875 of file chat.c.

int command_dmsay ( object op,
char *  params 
)

This command is only available to DMs.

It is similar to /shout, however, it will display the message in red only to other logged in DMs, or those with /dmsay command permission.

Parameters:
opThe object saying this.
paramsThe message.
Returns:
1 on success, 0 on failure.

Definition at line 61 of file chat.c.

int command_say ( object op,
char *  params 
)

Say command, used to say a message for the whole map to hear.

Parameters:
opThe object saying this.
paramsThe message.
Returns:
1 on success, 0 on failure.

Definition at line 38 of file chat.c.

int command_shout ( object op,
char *  params 
)

Shout command, used to shout a message for everyone to hear.

Parameters:
opThe object saying this
paramsThe message
Returns:
1 on success, 0 on failure

Definition at line 90 of file chat.c.

int command_t_tell ( object op,
char *  params 
)

Command to tell something to a target.

Usually used by the talk button in the client.

Parameters:
opThe object doing this command.
paramsThe message.
Returns:
1 on success, 0 on failure.

Definition at line 195 of file chat.c.

int command_tell ( object op,
char *  params 
)

Tell message to a single player.

Parameters:
opThe object doing the command.
paramsThe player name to send message to, and the message.
Returns:
1 on success, 0 on failure

Definition at line 116 of file chat.c.

static void emote_no_target ( object op,
char *  buf,
size_t  size,
char *  buf2,
size_t  size2,
int  emotion 
) [static]

Emotes player can do with no target.

Parameters:
opThe player doing the emotion.
bufBuffer containing string to send to everyone else on map.
sizeSize of 'buf'.
buf2Buffer containing string to send to player doing the emotion.
size2Size of 'buf2'.
emotionEmotion ID.

Definition at line 594 of file chat.c.

static void emote_other ( object op,
object target,
char *  str,
char *  buf,
size_t  size,
char *  buf2,
size_t  size2,
char *  buf3,
size_t  size3,
int  emotion 
) [static]

Look for an emote that is triggered with the command user either targetting someone else other than him, or passing the player name of the target as a parameter.

Parameters:
opThe player.
targetThe target object.
strName.
bufBuffer containing string to send to player.
sizeSize of 'buf'.
buf2Buffer containing string to send to target.
size2Size of 'buf2'.
buf3Buffer containing string to send to everyone else on map.
size3Size of 'buf3'.
emotionEmotion ID.

Definition at line 256 of file chat.c.

static void emote_self ( object op,
char *  buf,
size_t  size,
char *  buf2,
size_t  size2,
int  emotion 
) [static]

Look for an emote that is triggered with the command user being the target, hence the name 'self'.

Parameters:
opThe player doing the emotion.
bufBuffer containing string to send to player doing the emotion.
sizeSize of 'buf'.
buf2Buffer containing string to send to everyone else on map.
size2Size of 'buf2'.
emotionEmotion ID.

Definition at line 470 of file chat.c.