// for u8_encodech
#include "ft2.h"
+#include <pthread.h>
+
float con_cursorspeed = 4;
// lines up from bottom to display
extern cvar_t timestamps;
extern cvar_t timeformat;
extern qboolean sys_nostdout;
+
+// -- Akari: attempted to make this somewhat thread safe.... works.... sometimes
+
+pthread_mutex_t con_print_mutex = PTHREAD_MUTEX_INITIALIZER;
+
void Con_MaskPrint(int additionalmask, const char *msg)
{
static int mask = 0;
static int index = 0;
static char line[MAX_INPUTLINE];
+ pthread_mutex_lock(&con_print_mutex);
+
for (;*msg;msg++)
{
Con_Rcon_AddChar(*msg);
mask = 0;
}
}
+
+ pthread_mutex_unlock(&con_print_mutex);
}
/*
// LordHavoc: speedup, and other improvements
if (chat_mode < 0)
- dpsnprintf(temptext, sizeof(temptext), "]%s%s", chat_buffer, cursor);
+ dpsnprintf(temptext, sizeof(temptext), "]%s%c", chat_buffer, cursor);
+ else if(chat_mode == 2)
+ {
+ if(chat_buffer[0] == '#' || chat_buffer[0] == '&') //Channels are yellow, nicks are green
+ dpsnprintf(temptext, sizeof(temptext), "(IRC)target:^3%s^7%c", chat_buffer, cursor);
+ else
+ dpsnprintf(temptext, sizeof(temptext), "(IRC)target:^2%s^7%c", chat_buffer, cursor);
+ }
+ else if(chat_mode == 3)
+ dpsnprintf(temptext, sizeof(temptext), "(IRC)message:%s%c", chat_buffer, cursor);
else if(chat_mode)
- dpsnprintf(temptext, sizeof(temptext), "say_team:%s%s", chat_buffer, cursor);
+ dpsnprintf(temptext, sizeof(temptext), "say_team:%s%c", chat_buffer, cursor);
else
- dpsnprintf(temptext, sizeof(temptext), "say:%s%s", chat_buffer, cursor);
+ dpsnprintf(temptext, sizeof(temptext), "say:%s%c", chat_buffer, cursor);
// FIXME word wrap
inputsize = (numChatlines ? con_chatsize : con_notifysize).value;
extern int Nicks_CompleteChatLine(char *buffer, size_t size, unsigned int pos);
+extern void Irc_SetLastChannel(const char *value);
+extern const char* Irc_GetLastChannel();
+extern void Irc_SendMessage(const char *msg);
+
static void
Key_Message (int key, int ascii)
{
{
if(chat_mode < 0)
Cmd_ExecuteString(chat_buffer, src_command); // not Cbuf_AddText to allow semiclons in args; however, this allows no variables then. Use aliases!
+ else if(chat_mode == 2)
+ Irc_SetLastChannel(chat_buffer);
+ else if(chat_mode == 3)
+ Irc_SendMessage(chat_buffer);
else
Cmd_ForwardStringToServer(va("%s %s", chat_mode ? "say_team" : "say ", chat_buffer));
- key_dest = key_game;
+ //after IRC target input, go to message input
+ if(chat_mode != 2)
+ key_dest = key_game;
+ else
+ chat_mode = 3;
+
chat_bufferlen = 0;
chat_buffer[0] = 0;
return;