First part of chat info support.

The idea is to allow other clients know when the player is chatting,
fiddling with the console, etc.
This commit is contained in:
Bill Currie 2012-06-29 14:40:57 +09:00
parent a3fe8d56b8
commit 52146947c1
3 changed files with 19 additions and 3 deletions

View file

@ -38,5 +38,6 @@ void CL_Chat_User_Disconnected (int uid);
void CL_Chat_Check_Name (const char *name, int slot);
void CL_Chat_Flush_Ignores (void);
void CL_Chat_Init (void);
void CL_ChatInfo (int val);
#endif

View file

@ -136,6 +136,7 @@ typedef struct {
// private userinfo for sending to masterless servers
struct info_s *userinfo;
int chat;
// file transfer from server
QFile *download;

View file

@ -35,11 +35,14 @@
# include <strings.h>
#endif
#include "QF/info.h"
#include "QF/dstring.h"
#include "QF/llist.h"
#include "QF/cbuf.h"
#include "QF/cmd.h"
#include "QF/dstring.h"
#include "QF/info.h"
#include "QF/llist.h"
#include "QF/sys.h"
#include "QF/va.h"
#include "client.h"
#include "cl_chat.h"
@ -231,3 +234,14 @@ CL_Chat_Init (void)
Cmd_AddCommand ("ignore", CL_Ignore_f, "Ignores chat and name-change messages from a user.");
Cmd_AddCommand ("unignore", CL_Unignore_f, "Removes a previously ignored user from the ignore list.");
}
void
CL_ChatInfo (int val)
{
if (val < 1 || val > 3)
val = 0;
if (cls.chat != val) {
cls.chat = val;
Cbuf_AddText(cl_cbuf, va ("setinfo chat \"%d\"\n", val));
}
}