mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
End merge(Good Work btd)
This commit is contained in:
parent
51b16803d7
commit
d24ca19752
|
@ -1656,7 +1656,7 @@ void CClient::Run()
|
||||||
Input()->MouseModeRelative();
|
Input()->MouseModeRelative();
|
||||||
|
|
||||||
// process pending commands
|
// process pending commands
|
||||||
m_pConsole->StoreCommands(false);
|
m_pConsole->StoreCommands(false, -1);
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
@ -1808,31 +1808,31 @@ void CClient::Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CClient::Con_Connect(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_Connect(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
str_copy(pSelf->m_aCmdConnect, pResult->GetString(0), sizeof(pSelf->m_aCmdConnect));
|
str_copy(pSelf->m_aCmdConnect, pResult->GetString(0), sizeof(pSelf->m_aCmdConnect));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_Disconnect(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_Disconnect(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
pSelf->Disconnect();
|
pSelf->Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_Quit(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_Quit(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
pSelf->Quit();
|
pSelf->Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_Minimize(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_Minimize(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
pSelf->Graphics()->Minimize();
|
pSelf->Graphics()->Minimize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_Ping(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_Ping(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
|
|
||||||
|
@ -1841,25 +1841,25 @@ void CClient::Con_Ping(IConsole::IResult *pResult, void *pUserData)
|
||||||
pSelf->m_PingStartTime = time_get();
|
pSelf->m_PingStartTime = time_get();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_Screenshot(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_Screenshot(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
pSelf->Graphics()->TakeScreenshot();
|
pSelf->Graphics()->TakeScreenshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_Rcon(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_Rcon(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
pSelf->Rcon(pResult->GetString(0));
|
pSelf->Rcon(pResult->GetString(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_RconAuth(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_RconAuth(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
pSelf->RconAuth("", pResult->GetString(0));
|
pSelf->RconAuth("", pResult->GetString(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_AddFavorite(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_AddFavorite(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
NETADDR Addr;
|
NETADDR Addr;
|
||||||
|
@ -1944,7 +1944,7 @@ const char *CClient::DemoPlayer_Play(const char *pFilename)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_Play(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_Play(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
pSelf->DemoPlayer_Play(pResult->GetString(0));
|
pSelf->DemoPlayer_Play(pResult->GetString(0));
|
||||||
|
@ -1962,13 +1962,13 @@ void CClient::DemoRecorder_Start(const char *pFilename)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_Record(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_Record(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
pSelf->DemoRecorder_Start(pResult->GetString(0));
|
pSelf->DemoRecorder_Start(pResult->GetString(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::Con_StopRecord(IConsole::IResult *pResult, void *pUserData)
|
void CClient::Con_StopRecord(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CClient *pSelf = (CClient *)pUserData;
|
CClient *pSelf = (CClient *)pUserData;
|
||||||
pSelf->m_DemoRecorder.Stop();
|
pSelf->m_DemoRecorder.Stop();
|
||||||
|
@ -1978,30 +1978,30 @@ void CClient::RegisterCommands()
|
||||||
{
|
{
|
||||||
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
||||||
// register server dummy commands for tab completion
|
// register server dummy commands for tab completion
|
||||||
m_pConsole->Register("kick", "i", CFGFLAG_SERVER, 0, 0, "Kick player with specified id");
|
m_pConsole->Register("kick", "i", CFGFLAG_SERVER, 0, 0, "Kick player with specified id", 0);
|
||||||
m_pConsole->Register("ban", "s?i", CFGFLAG_SERVER, 0, 0, "Ban player with ip/id for x minutes");
|
m_pConsole->Register("ban", "s?i", CFGFLAG_SERVER, 0, 0, "Ban player with ip/id for x minutes", 0);
|
||||||
m_pConsole->Register("unban", "s", CFGFLAG_SERVER, 0, 0, "Unban ip");
|
m_pConsole->Register("unban", "s", CFGFLAG_SERVER, 0, 0, "Unban ip", 0);
|
||||||
m_pConsole->Register("bans", "", CFGFLAG_SERVER, 0, 0, "Show banlist");
|
m_pConsole->Register("bans", "", CFGFLAG_SERVER, 0, 0, "Show banlist", 0);
|
||||||
m_pConsole->Register("status", "", CFGFLAG_SERVER, 0, 0, "List players");
|
m_pConsole->Register("status", "", CFGFLAG_SERVER, 0, 0, "List players", 0);
|
||||||
m_pConsole->Register("shutdown", "", CFGFLAG_SERVER, 0, 0, "Shut down");
|
m_pConsole->Register("shutdown", "", CFGFLAG_SERVER, 0, 0, "Shut down", 0);
|
||||||
m_pConsole->Register("record", "s", CFGFLAG_SERVER, 0, 0, "Record to a file");
|
m_pConsole->Register("record", "s", CFGFLAG_SERVER, 0, 0, "Record to a file", 0);
|
||||||
m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, 0, 0, "Stop recording");
|
m_pConsole->Register("stoprecord", "", CFGFLAG_SERVER, 0, 0, "Stop recording", 0);
|
||||||
m_pConsole->Register("reload", "", CFGFLAG_SERVER, 0, 0, "Reload the map");
|
m_pConsole->Register("reload", "", CFGFLAG_SERVER, 0, 0, "Reload the map", 0);
|
||||||
|
|
||||||
m_pConsole->Register("quit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds");
|
m_pConsole->Register("quit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", 0);
|
||||||
m_pConsole->Register("exit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds");
|
m_pConsole->Register("exit", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Quit, this, "Quit Teeworlds", 0);
|
||||||
m_pConsole->Register("minimize", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Minimize, this, "Minimize Teeworlds");
|
m_pConsole->Register("minimize", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Minimize, this, "Minimize Teeworlds", 0);
|
||||||
m_pConsole->Register("connect", "s", CFGFLAG_CLIENT, Con_Connect, this, "Connect to the specified host/ip");
|
m_pConsole->Register("connect", "s", CFGFLAG_CLIENT, Con_Connect, this, "Connect to the specified host/ip", 0);
|
||||||
m_pConsole->Register("disconnect", "", CFGFLAG_CLIENT, Con_Disconnect, this, "Disconnect from the server");
|
m_pConsole->Register("disconnect", "", CFGFLAG_CLIENT, Con_Disconnect, this, "Disconnect from the server", 0);
|
||||||
m_pConsole->Register("ping", "", CFGFLAG_CLIENT, Con_Ping, this, "Ping the current server");
|
m_pConsole->Register("ping", "", CFGFLAG_CLIENT, Con_Ping, this, "Ping the current server", 0);
|
||||||
m_pConsole->Register("screenshot", "", CFGFLAG_CLIENT, Con_Screenshot, this, "Take a screenshot");
|
m_pConsole->Register("screenshot", "", CFGFLAG_CLIENT, Con_Screenshot, this, "Take a screenshot", 0);
|
||||||
m_pConsole->Register("rcon", "r", CFGFLAG_CLIENT, Con_Rcon, this, "Send specified command to rcon");
|
m_pConsole->Register("rcon", "r", CFGFLAG_CLIENT, Con_Rcon, this, "Send specified command to rcon", 0);
|
||||||
m_pConsole->Register("rcon_auth", "s", CFGFLAG_CLIENT, Con_RconAuth, this, "Authenticate to rcon");
|
m_pConsole->Register("rcon_auth", "s", CFGFLAG_CLIENT, Con_RconAuth, this, "Authenticate to rcon", 0);
|
||||||
m_pConsole->Register("play", "r", CFGFLAG_CLIENT, Con_Play, this, "Play the file specified");
|
m_pConsole->Register("play", "r", CFGFLAG_CLIENT, Con_Play, this, "Play the file specified", 0);
|
||||||
m_pConsole->Register("record", "s", CFGFLAG_CLIENT, Con_Record, this, "Record to the file");
|
m_pConsole->Register("record", "s", CFGFLAG_CLIENT, Con_Record, this, "Record to the file", 0);
|
||||||
m_pConsole->Register("stoprecord", "", CFGFLAG_CLIENT, Con_StopRecord, this, "Stop recording");
|
m_pConsole->Register("stoprecord", "", CFGFLAG_CLIENT, Con_StopRecord, this, "Stop recording", 0);
|
||||||
|
|
||||||
m_pConsole->Register("add_favorite", "s", CFGFLAG_CLIENT, Con_AddFavorite, this, "Add a server as a favorite");
|
m_pConsole->Register("add_favorite", "s", CFGFLAG_CLIENT, Con_AddFavorite, this, "Add a server as a favorite", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static CClient m_Client;
|
static CClient m_Client;
|
||||||
|
|
|
@ -269,18 +269,18 @@ public:
|
||||||
void Run();
|
void Run();
|
||||||
|
|
||||||
|
|
||||||
static void Con_Connect(IConsole::IResult *pResult, void *pUserData);
|
static void Con_Connect(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_Disconnect(IConsole::IResult *pResult, void *pUserData);
|
static void Con_Disconnect(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_Quit(IConsole::IResult *pResult, void *pUserData);
|
static void Con_Quit(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_Minimize(IConsole::IResult *pResult, void *pUserData);
|
static void Con_Minimize(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_Ping(IConsole::IResult *pResult, void *pUserData);
|
static void Con_Ping(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_Screenshot(IConsole::IResult *pResult, void *pUserData);
|
static void Con_Screenshot(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_Rcon(IConsole::IResult *pResult, void *pUserData);
|
static void Con_Rcon(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_RconAuth(IConsole::IResult *pResult, void *pUserData);
|
static void Con_RconAuth(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_AddFavorite(IConsole::IResult *pResult, void *pUserData);
|
static void Con_AddFavorite(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_Play(IConsole::IResult *pResult, void *pUserData);
|
static void Con_Play(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_Record(IConsole::IResult *pResult, void *pUserData);
|
static void Con_Record(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void Con_StopRecord(IConsole::IResult *pResult, void *pUserData);
|
static void Con_StopRecord(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
|
|
||||||
// DDRace
|
// DDRace
|
||||||
virtual const char* GetCurrentMap();
|
virtual const char* GetCurrentMap();
|
||||||
|
|
|
@ -11,7 +11,7 @@ bool CBinds::CBindsSpecial::OnInput(IInput::CEvent Event)
|
||||||
if(Event.m_Flags&IInput::FLAG_PRESS)
|
if(Event.m_Flags&IInput::FLAG_PRESS)
|
||||||
Stroke = 1;
|
Stroke = 1;
|
||||||
|
|
||||||
m_pBinds->GetConsole()->ExecuteLineStroked(Stroke, m_pBinds->m_aaKeyBindings[Event.m_Key]);
|
m_pBinds->GetConsole()->ExecuteLineStroked(Stroke, m_pBinds->m_aaKeyBindings[Event.m_Key], 4, -1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ bool CBinds::OnInput(IInput::CEvent e)
|
||||||
int Stroke = 0;
|
int Stroke = 0;
|
||||||
if(e.m_Flags&IInput::FLAG_PRESS)
|
if(e.m_Flags&IInput::FLAG_PRESS)
|
||||||
Stroke = 1;
|
Stroke = 1;
|
||||||
Console()->ExecuteLineStroked(Stroke, m_aaKeyBindings[e.m_Key]);
|
Console()->ExecuteLineStroked(Stroke, m_aaKeyBindings[e.m_Key], 4, -1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,16 +121,16 @@ void CBinds::OnConsoleInit()
|
||||||
if(pConfig)
|
if(pConfig)
|
||||||
pConfig->RegisterCallback(ConfigSaveCallback, this);
|
pConfig->RegisterCallback(ConfigSaveCallback, this);
|
||||||
|
|
||||||
Console()->Register("bind", "sr", CFGFLAG_CLIENT, ConBind, this, "Bind key to execute the command");
|
Console()->Register("bind", "sr", CFGFLAG_CLIENT, ConBind, this, "Bind key to execute the command", 0);
|
||||||
Console()->Register("unbind", "s", CFGFLAG_CLIENT, ConUnbind, this, "Unbind key");
|
Console()->Register("unbind", "s", CFGFLAG_CLIENT, ConUnbind, this, "Unbind key", 0);
|
||||||
Console()->Register("unbindall", "", CFGFLAG_CLIENT, ConUnbindAll, this, "Unbind all keys");
|
Console()->Register("unbindall", "", CFGFLAG_CLIENT, ConUnbindAll, this, "Unbind all keys", 0);
|
||||||
Console()->Register("dump_binds", "", CFGFLAG_CLIENT, ConDumpBinds, this, "Dump binds");
|
Console()->Register("dump_binds", "", CFGFLAG_CLIENT, ConDumpBinds, this, "Dump binds", 0);
|
||||||
|
|
||||||
// default bindings
|
// default bindings
|
||||||
SetDefaults();
|
SetDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBinds::ConBind(IConsole::IResult *pResult, void *pUserData)
|
void CBinds::ConBind(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CBinds *pBinds = (CBinds *)pUserData;
|
CBinds *pBinds = (CBinds *)pUserData;
|
||||||
const char *pKeyName = pResult->GetString(0);
|
const char *pKeyName = pResult->GetString(0);
|
||||||
|
@ -148,7 +148,7 @@ void CBinds::ConBind(IConsole::IResult *pResult, void *pUserData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CBinds::ConUnbind(IConsole::IResult *pResult, void *pUserData)
|
void CBinds::ConUnbind(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CBinds *pBinds = (CBinds *)pUserData;
|
CBinds *pBinds = (CBinds *)pUserData;
|
||||||
const char *pKeyName = pResult->GetString(0);
|
const char *pKeyName = pResult->GetString(0);
|
||||||
|
@ -166,14 +166,14 @@ void CBinds::ConUnbind(IConsole::IResult *pResult, void *pUserData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CBinds::ConUnbindAll(IConsole::IResult *pResult, void *pUserData)
|
void CBinds::ConUnbindAll(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CBinds *pBinds = (CBinds *)pUserData;
|
CBinds *pBinds = (CBinds *)pUserData;
|
||||||
pBinds->UnbindAll();
|
pBinds->UnbindAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CBinds::ConDumpBinds(IConsole::IResult *pResult, void *pUserData)
|
void CBinds::ConDumpBinds(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CBinds *pBinds = (CBinds *)pUserData;
|
CBinds *pBinds = (CBinds *)pUserData;
|
||||||
char aBuf[1024];
|
char aBuf[1024];
|
||||||
|
|
|
@ -9,10 +9,10 @@ class CBinds : public CComponent
|
||||||
|
|
||||||
int GetKeyId(const char *pKeyName);
|
int GetKeyId(const char *pKeyName);
|
||||||
|
|
||||||
static void ConBind(IConsole::IResult *pResult, void *pUserData);
|
static void ConBind(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConUnbind(IConsole::IResult *pResult, void *pUserData);
|
static void ConUnbind(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConUnbindAll(IConsole::IResult *pResult, void *pUserData);
|
static void ConUnbindAll(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConDumpBinds(IConsole::IResult *pResult, void *pUserData);
|
static void ConDumpBinds(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
class IConsole *GetConsole() const { return Console(); }
|
class IConsole *GetConsole() const { return Console(); }
|
||||||
|
|
||||||
static void ConfigSaveCallback(class IConfig *pConfig, void *pUserData);
|
static void ConfigSaveCallback(class IConfig *pConfig, void *pUserData);
|
||||||
|
|
|
@ -9,19 +9,19 @@
|
||||||
#include "controls.h"
|
#include "controls.h"
|
||||||
|
|
||||||
const float ZoomStep = 0.75f;
|
const float ZoomStep = 0.75f;
|
||||||
void CCamera::ConZoomPlus(IConsole::IResult *pResult, void *pUserData) {
|
void CCamera::ConZoomPlus(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||||
if(g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace)
|
if(g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace)
|
||||||
((CCamera *)pUserData)->m_Zoom *= 1/ZoomStep;
|
((CCamera *)pUserData)->m_Zoom *= 1/ZoomStep;
|
||||||
}
|
}
|
||||||
void CCamera::ConZoomMinus(IConsole::IResult *pResult, void *pUserData) {
|
void CCamera::ConZoomMinus(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||||
if(g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace)
|
if(g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace)
|
||||||
((CCamera *)pUserData)->m_Zoom *= ZoomStep;
|
((CCamera *)pUserData)->m_Zoom *= ZoomStep;
|
||||||
}
|
}
|
||||||
void CCamera::ConZoomReset(IConsole::IResult *pResult, void *pUserData) {
|
void CCamera::ConZoomReset(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||||
if(g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace)
|
if(g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace)
|
||||||
((CCamera *)pUserData)->m_Zoom = 1.0f;
|
((CCamera *)pUserData)->m_Zoom = 1.0f;
|
||||||
}
|
}
|
||||||
void CCamera::ConCameraFree(IConsole::IResult *pResult, void *pUserData) {
|
void CCamera::ConCameraFree(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||||
if(!((CCamera *)pUserData)->m_pClient->m_Snap.m_Spectate && (g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace))
|
if(!((CCamera *)pUserData)->m_pClient->m_Snap.m_Spectate && (g_Config.m_ClRaceCheats == 1 || ((CCamera *)pUserData)->m_pClient->m_IsRace))
|
||||||
((CCamera *)pUserData)->m_Free = ((CCamera *)pUserData)->m_Free ? false : true;
|
((CCamera *)pUserData)->m_Free = ((CCamera *)pUserData)->m_Free ? false : true;
|
||||||
}
|
}
|
||||||
|
@ -77,10 +77,10 @@ void CCamera::OnRender()
|
||||||
|
|
||||||
void CCamera::OnConsoleInit()
|
void CCamera::OnConsoleInit()
|
||||||
{
|
{
|
||||||
Console()->Register("zoom+", "", CFGFLAG_CLIENT, ConZoomPlus, this, "Zoom increse");
|
Console()->Register("zoom+", "", CFGFLAG_CLIENT, ConZoomPlus, this, "Zoom increse", 0);
|
||||||
Console()->Register("zoom-", "", CFGFLAG_CLIENT, ConZoomMinus, this, "Zoom decrese");
|
Console()->Register("zoom-", "", CFGFLAG_CLIENT, ConZoomMinus, this, "Zoom decrese", 0);
|
||||||
Console()->Register("zoom", "", CFGFLAG_CLIENT, ConZoomReset, this, "Zoom reset");
|
Console()->Register("zoom", "", CFGFLAG_CLIENT, ConZoomReset, this, "Zoom reset", 0);
|
||||||
Console()->Register("camera_free", "", CFGFLAG_CLIENT, ConCameraFree, this, "Free camera On/Off");
|
Console()->Register("camera_free", "", CFGFLAG_CLIENT, ConCameraFree, this, "Free camera On/Off", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGameClient::CSnapState::CCharacterInfo* CCamera::getCharacter(int Id) {
|
CGameClient::CSnapState::CCharacterInfo* CCamera::getCharacter(int Id) {
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
class CCamera : public CComponent
|
class CCamera : public CComponent
|
||||||
{
|
{
|
||||||
|
|
||||||
static void ConZoomPlus(IConsole::IResult *pResult, void *pUserData);
|
static void ConZoomPlus(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConZoomMinus(IConsole::IResult *pResult, void *pUserData);
|
static void ConZoomMinus(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConZoomReset(IConsole::IResult *pResult, void *pUserData);
|
static void ConZoomReset(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConCameraFree(IConsole::IResult *pResult, void *pUserData);
|
static void ConCameraFree(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
|
|
||||||
CGameClient::CSnapState::CCharacterInfo* getCharacter(int Id);
|
CGameClient::CSnapState::CCharacterInfo* getCharacter(int Id);
|
||||||
|
|
||||||
|
|
|
@ -48,18 +48,18 @@ void CChat::OnStateChange(int NewState, int OldState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChat::ConSay(IConsole::IResult *pResult, void *pUserData)
|
void CChat::ConSay(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
|
|
||||||
((CChat*)pUserData)->Say(0, pResult->GetString(0));
|
((CChat*)pUserData)->Say(0, pResult->GetString(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChat::ConSayTeam(IConsole::IResult *pResult, void *pUserData)
|
void CChat::ConSayTeam(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CChat*)pUserData)->Say(1, pResult->GetString(0));
|
((CChat*)pUserData)->Say(1, pResult->GetString(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChat::ConChat(IConsole::IResult *pResult, void *pUserData)
|
void CChat::ConChat(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
const char *pMode = pResult->GetString(0);
|
const char *pMode = pResult->GetString(0);
|
||||||
if(str_comp(pMode, "all") == 0)
|
if(str_comp(pMode, "all") == 0)
|
||||||
|
@ -70,27 +70,27 @@ void CChat::ConChat(IConsole::IResult *pResult, void *pUserData)
|
||||||
((CChat*)pUserData)->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "console", "expected all or team as mode");
|
((CChat*)pUserData)->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "console", "expected all or team as mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChat::ConShowChat(IConsole::IResult *pResult, void *pUserData)
|
void CChat::ConShowChat(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CChat *)pUserData)->m_Show = pResult->GetInteger(0) != 0;
|
((CChat *)pUserData)->m_Show = pResult->GetInteger(0) != 0;
|
||||||
}
|
}
|
||||||
void CChat::ConUpChat(IConsole::IResult *pResult, void *pUserData) {
|
void CChat::ConUpChat(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||||
((CChat*)pUserData)->m_ChatMoving = true;
|
((CChat*)pUserData)->m_ChatMoving = true;
|
||||||
((CChat*)pUserData)->m_RenderLine = (((CChat*)pUserData)->m_RenderLine - 1)%MAX_LINES;
|
((CChat*)pUserData)->m_RenderLine = (((CChat*)pUserData)->m_RenderLine - 1)%MAX_LINES;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChat::ConDownChat(IConsole::IResult *pResult, void *pUserData) {
|
void CChat::ConDownChat(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||||
((CChat*)pUserData)->m_ChatMoving = true;
|
((CChat*)pUserData)->m_ChatMoving = true;
|
||||||
((CChat*)pUserData)->m_RenderLine = (((CChat*)pUserData)->m_RenderLine + 1)%MAX_LINES;
|
((CChat*)pUserData)->m_RenderLine = (((CChat*)pUserData)->m_RenderLine + 1)%MAX_LINES;
|
||||||
}
|
}
|
||||||
void CChat::OnConsoleInit()
|
void CChat::OnConsoleInit()
|
||||||
{
|
{
|
||||||
Console()->Register("say", "r", CFGFLAG_CLIENT, ConSay, this, "Say in chat");
|
Console()->Register("say", "r", CFGFLAG_CLIENT, ConSay, this, "Say in chat", 0);
|
||||||
Console()->Register("say_team", "r", CFGFLAG_CLIENT, ConSayTeam, this, "Say in team chat");
|
Console()->Register("say_team", "r", CFGFLAG_CLIENT, ConSayTeam, this, "Say in team chat", 0);
|
||||||
Console()->Register("chat", "s", CFGFLAG_CLIENT, ConChat, this, "Enable chat with all/team mode");
|
Console()->Register("chat", "s", CFGFLAG_CLIENT, ConChat, this, "Enable chat with all/team mode", 0);
|
||||||
Console()->Register("chat_up", "", CFGFLAG_CLIENT, ConUpChat, this, "Show early message");
|
Console()->Register("chat_up", "", CFGFLAG_CLIENT, ConUpChat, this, "Show early message", 0);
|
||||||
Console()->Register("chat_down", "", CFGFLAG_CLIENT, ConDownChat, this, "Show last message");
|
Console()->Register("chat_down", "", CFGFLAG_CLIENT, ConDownChat, this, "Show last message", 0);
|
||||||
Console()->Register("+show_chat", "", CFGFLAG_CLIENT, ConShowChat, this, "Show chat");
|
Console()->Register("+show_chat", "", CFGFLAG_CLIENT, ConShowChat, this, "Show chat", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CChat::OnInput(IInput::CEvent e)
|
bool CChat::OnInput(IInput::CEvent e)
|
||||||
|
|
|
@ -38,12 +38,12 @@ class CChat : public CComponent
|
||||||
int m_Mode;
|
int m_Mode;
|
||||||
bool m_Show;
|
bool m_Show;
|
||||||
|
|
||||||
static void ConSay(IConsole::IResult *pResult, void *pUserData);
|
static void ConSay(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConSayTeam(IConsole::IResult *pResult, void *pUserData);
|
static void ConSayTeam(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConChat(IConsole::IResult *pResult, void *pUserData);
|
static void ConChat(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConShowChat(IConsole::IResult *pResult, void *pUserData);
|
static void ConShowChat(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConUpChat(IConsole::IResult *pResult, void *pUserData);
|
static void ConUpChat(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConDownChat(IConsole::IResult *pResult, void *pUserData);
|
static void ConDownChat(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ void CGameConsole::CInstance::ClearBacklog()
|
||||||
void CGameConsole::CInstance::ExecuteLine(const char *pLine)
|
void CGameConsole::CInstance::ExecuteLine(const char *pLine)
|
||||||
{
|
{
|
||||||
if(m_Type == 0)
|
if(m_Type == 0)
|
||||||
m_pGameConsole->m_pConsole->ExecuteLine(pLine);
|
m_pGameConsole->m_pConsole->ExecuteLine(pLine, 4, -1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(m_pGameConsole->Client()->RconAuthed())
|
if(m_pGameConsole->Client()->RconAuthed())
|
||||||
|
@ -607,32 +607,32 @@ void CGameConsole::Dump(int Type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameConsole::ConToggleLocalConsole(IConsole::IResult *pResult, void *pUserData)
|
void CGameConsole::ConToggleLocalConsole(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CGameConsole *)pUserData)->Toggle(0);
|
((CGameConsole *)pUserData)->Toggle(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameConsole::ConToggleRemoteConsole(IConsole::IResult *pResult, void *pUserData)
|
void CGameConsole::ConToggleRemoteConsole(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CGameConsole *)pUserData)->Toggle(1);
|
((CGameConsole *)pUserData)->Toggle(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameConsole::ConClearLocalConsole(IConsole::IResult *pResult, void *pUserData)
|
void CGameConsole::ConClearLocalConsole(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CGameConsole *)pUserData)->m_LocalConsole.ClearBacklog();
|
((CGameConsole *)pUserData)->m_LocalConsole.ClearBacklog();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameConsole::ConClearRemoteConsole(IConsole::IResult *pResult, void *pUserData)
|
void CGameConsole::ConClearRemoteConsole(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CGameConsole *)pUserData)->m_RemoteConsole.ClearBacklog();
|
((CGameConsole *)pUserData)->m_RemoteConsole.ClearBacklog();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameConsole::ConDumpLocalConsole(IConsole::IResult *pResult, void *pUserData)
|
void CGameConsole::ConDumpLocalConsole(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CGameConsole *)pUserData)->Dump(0);
|
((CGameConsole *)pUserData)->Dump(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameConsole::ConDumpRemoteConsole(IConsole::IResult *pResult, void *pUserData)
|
void CGameConsole::ConDumpRemoteConsole(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CGameConsole *)pUserData)->Dump(1);
|
((CGameConsole *)pUserData)->Dump(1);
|
||||||
}
|
}
|
||||||
|
@ -661,12 +661,12 @@ void CGameConsole::OnConsoleInit()
|
||||||
//
|
//
|
||||||
Console()->RegisterPrintCallback(ClientConsolePrintCallback, this);
|
Console()->RegisterPrintCallback(ClientConsolePrintCallback, this);
|
||||||
|
|
||||||
Console()->Register("toggle_local_console", "", CFGFLAG_CLIENT, ConToggleLocalConsole, this, "Toggle local console");
|
Console()->Register("toggle_local_console", "", CFGFLAG_CLIENT, ConToggleLocalConsole, this, "Toggle local console", 0);
|
||||||
Console()->Register("toggle_remote_console", "", CFGFLAG_CLIENT, ConToggleRemoteConsole, this, "Toggle remote console");
|
Console()->Register("toggle_remote_console", "", CFGFLAG_CLIENT, ConToggleRemoteConsole, this, "Toggle remote console", 0);
|
||||||
Console()->Register("clear_local_console", "", CFGFLAG_CLIENT, ConClearLocalConsole, this, "Clear local console");
|
Console()->Register("clear_local_console", "", CFGFLAG_CLIENT, ConClearLocalConsole, this, "Clear local console", 0);
|
||||||
Console()->Register("clear_remote_console", "", CFGFLAG_CLIENT, ConClearRemoteConsole, this, "Clear remote console");
|
Console()->Register("clear_remote_console", "", CFGFLAG_CLIENT, ConClearRemoteConsole, this, "Clear remote console", 0);
|
||||||
Console()->Register("dump_local_console", "", CFGFLAG_CLIENT, ConDumpLocalConsole, this, "Dump local console");
|
Console()->Register("dump_local_console", "", CFGFLAG_CLIENT, ConDumpLocalConsole, this, "Dump local console", 0);
|
||||||
Console()->Register("dump_remote_console", "", CFGFLAG_CLIENT, ConDumpRemoteConsole, this, "Dump remote console");
|
Console()->Register("dump_remote_console", "", CFGFLAG_CLIENT, ConDumpRemoteConsole, this, "Dump remote console", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -60,12 +60,12 @@ class CGameConsole : public CComponent
|
||||||
|
|
||||||
static void PossibleCommandsRenderCallback(const char *pStr, void *pUser);
|
static void PossibleCommandsRenderCallback(const char *pStr, void *pUser);
|
||||||
static void ClientConsolePrintCallback(const char *pStr, void *pUserData);
|
static void ClientConsolePrintCallback(const char *pStr, void *pUserData);
|
||||||
static void ConToggleLocalConsole(IConsole::IResult *pResult, void *pUserData);
|
static void ConToggleLocalConsole(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConToggleRemoteConsole(IConsole::IResult *pResult, void *pUserData);
|
static void ConToggleRemoteConsole(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConClearLocalConsole(IConsole::IResult *pResult, void *pUserData);
|
static void ConClearLocalConsole(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConClearRemoteConsole(IConsole::IResult *pResult, void *pUserData);
|
static void ConClearRemoteConsole(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConDumpLocalConsole(IConsole::IResult *pResult, void *pUserData);
|
static void ConDumpLocalConsole(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConDumpRemoteConsole(IConsole::IResult *pResult, void *pUserData);
|
static void ConDumpRemoteConsole(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CGameConsole();
|
CGameConsole();
|
||||||
|
|
|
@ -36,12 +36,12 @@ void CControls::OnPlayerDeath()
|
||||||
m_LastData.m_WantedWeapon = m_InputData.m_WantedWeapon = 0;
|
m_LastData.m_WantedWeapon = m_InputData.m_WantedWeapon = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ConKeyInputState(IConsole::IResult *pResult, void *pUserData)
|
static void ConKeyInputState(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((int *)pUserData)[0] = pResult->GetInteger(0);
|
((int *)pUserData)[0] = pResult->GetInteger(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ConKeyInputCounter(IConsole::IResult *pResult, void *pUserData)
|
static void ConKeyInputCounter(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
int *v = (int *)pUserData;
|
int *v = (int *)pUserData;
|
||||||
if(((*v)&1) != pResult->GetInteger(0))
|
if(((*v)&1) != pResult->GetInteger(0))
|
||||||
|
@ -56,37 +56,37 @@ struct CInputSet
|
||||||
int m_Value;
|
int m_Value;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void ConKeyInputSet(IConsole::IResult *pResult, void *pUserData)
|
static void ConKeyInputSet(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CInputSet *pSet = (CInputSet *)pUserData;
|
CInputSet *pSet = (CInputSet *)pUserData;
|
||||||
if(pResult->GetInteger(0))
|
if(pResult->GetInteger(0))
|
||||||
*pSet->m_pVariable = pSet->m_Value;
|
*pSet->m_pVariable = pSet->m_Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ConKeyInputNextPrevWeapon(IConsole::IResult *pResult, void *pUserData)
|
static void ConKeyInputNextPrevWeapon(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CInputSet *pSet = (CInputSet *)pUserData;
|
CInputSet *pSet = (CInputSet *)pUserData;
|
||||||
ConKeyInputCounter(pResult, pSet->m_pVariable);
|
ConKeyInputCounter(pResult, pSet->m_pVariable, ClientID);
|
||||||
pSet->m_pControls->m_InputData.m_WantedWeapon = 0;
|
pSet->m_pControls->m_InputData.m_WantedWeapon = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CControls::OnConsoleInit()
|
void CControls::OnConsoleInit()
|
||||||
{
|
{
|
||||||
// game commands
|
// game commands
|
||||||
Console()->Register("+left", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputDirectionLeft, "Move left");
|
Console()->Register("+left", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputDirectionLeft, "Move left", 0);
|
||||||
Console()->Register("+right", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputDirectionRight, "Move right");
|
Console()->Register("+right", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputDirectionRight, "Move right", 0);
|
||||||
Console()->Register("+jump", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputData.m_Jump, "Jump");
|
Console()->Register("+jump", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputData.m_Jump, "Jump", 0);
|
||||||
Console()->Register("+hook", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputData.m_Hook, "Hook");
|
Console()->Register("+hook", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputData.m_Hook, "Hook", 0);
|
||||||
Console()->Register("+fire", "", CFGFLAG_CLIENT, ConKeyInputCounter, &m_InputData.m_Fire, "Fire");
|
Console()->Register("+fire", "", CFGFLAG_CLIENT, ConKeyInputCounter, &m_InputData.m_Fire, "Fire", 0);
|
||||||
|
|
||||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 1}; Console()->Register("+weapon1", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to hammer"); }
|
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 1}; Console()->Register("+weapon1", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to hammer", 0); }
|
||||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 2}; Console()->Register("+weapon2", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to gun"); }
|
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 2}; Console()->Register("+weapon2", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to gun", 0); }
|
||||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 3}; Console()->Register("+weapon3", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to shotgun"); }
|
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 3}; Console()->Register("+weapon3", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to shotgun", 0); }
|
||||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 4}; Console()->Register("+weapon4", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to grenade"); }
|
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 4}; Console()->Register("+weapon4", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to grenade", 0); }
|
||||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 5}; Console()->Register("+weapon5", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to rifle"); }
|
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 5}; Console()->Register("+weapon5", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to rifle", 0); }
|
||||||
|
|
||||||
{ static CInputSet s_Set = {this, &m_InputData.m_NextWeapon, 0}; Console()->Register("+nextweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to next weapon"); }
|
{ static CInputSet s_Set = {this, &m_InputData.m_NextWeapon, 0}; Console()->Register("+nextweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to next weapon", 0); }
|
||||||
{ static CInputSet s_Set = {this, &m_InputData.m_PrevWeapon, 0}; Console()->Register("+prevweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to previous weapon"); }
|
{ static CInputSet s_Set = {this, &m_InputData.m_PrevWeapon, 0}; Console()->Register("+prevweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to previous weapon", 0); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void CControls::OnMessage(int Msg, void *pRawMsg)
|
void CControls::OnMessage(int Msg, void *pRawMsg)
|
||||||
|
|
|
@ -14,20 +14,20 @@ CEmoticon::CEmoticon()
|
||||||
OnReset();
|
OnReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEmoticon::ConKeyEmoticon(IConsole::IResult *pResult, void *pUserData)
|
void CEmoticon::ConKeyEmoticon(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CEmoticon *)pUserData)->m_Active = pResult->GetInteger(0) != 0;
|
((CEmoticon *)pUserData)->m_Active = pResult->GetInteger(0) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEmoticon::ConEmote(IConsole::IResult *pResult, void *pUserData)
|
void CEmoticon::ConEmote(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CEmoticon *)pUserData)->Emote(pResult->GetInteger(0));
|
((CEmoticon *)pUserData)->Emote(pResult->GetInteger(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEmoticon::OnConsoleInit()
|
void CEmoticon::OnConsoleInit()
|
||||||
{
|
{
|
||||||
Console()->Register("+emote", "", CFGFLAG_CLIENT, ConKeyEmoticon, this, "Open emote selector");
|
Console()->Register("+emote", "", CFGFLAG_CLIENT, ConKeyEmoticon, this, "Open emote selector", 0);
|
||||||
Console()->Register("emote", "i", CFGFLAG_CLIENT, ConEmote, this, "Use emote");
|
Console()->Register("emote", "i", CFGFLAG_CLIENT, ConEmote, this, "Use emote", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEmoticon::OnReset()
|
void CEmoticon::OnReset()
|
||||||
|
|
|
@ -13,8 +13,8 @@ class CEmoticon : public CComponent
|
||||||
vec2 m_SelectorMouse;
|
vec2 m_SelectorMouse;
|
||||||
int m_SelectedEmote;
|
int m_SelectedEmote;
|
||||||
|
|
||||||
static void ConKeyEmoticon(IConsole::IResult *pResult, void *pUserData);
|
static void ConKeyEmoticon(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConEmote(IConsole::IResult *pResult, void *pUserData);
|
static void ConEmote(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CEmoticon();
|
CEmoticon();
|
||||||
|
|
|
@ -715,7 +715,7 @@ void CMenus::RenderServerbrowser(CUIRect MainView)
|
||||||
|
|
||||||
void CMenus::ConchainServerbrowserUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
void CMenus::ConchainServerbrowserUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
||||||
{
|
{
|
||||||
pfnCallback(pResult, pCallbackUserData);
|
pfnCallback(pResult, pCallbackUserData, -1);
|
||||||
if(pResult->NumArguments() && g_Config.m_UiPage == PAGE_FAVORITES && ((CMenus *)pUserData)->Client()->State() == IClient::STATE_OFFLINE)
|
if(pResult->NumArguments() && g_Config.m_UiPage == PAGE_FAVORITES && ((CMenus *)pUserData)->Client()->State() == IClient::STATE_OFFLINE)
|
||||||
((CMenus *)pUserData)->ServerBrowser()->Refresh(IServerBrowser::TYPE_FAVORITES);
|
((CMenus *)pUserData)->ServerBrowser()->Refresh(IServerBrowser::TYPE_FAVORITES);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ void CMenus::RenderRCON(CUIRect MainView)
|
||||||
|
|
||||||
|
|
||||||
str_format(buf, sizeof(buf), "rcon kick %d", m_RCONSelectedPlayer);
|
str_format(buf, sizeof(buf), "rcon kick %d", m_RCONSelectedPlayer);
|
||||||
m_pClient->Console()->ExecuteLine(buf);
|
m_pClient->Console()->ExecuteLine(buf, 4, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static int s_KillButton = 0;
|
static int s_KillButton = 0;
|
||||||
|
@ -107,7 +107,7 @@ void CMenus::RenderRCON(CUIRect MainView)
|
||||||
|
|
||||||
|
|
||||||
str_format(buf, sizeof(buf), "rcon kill_pl %d", m_RCONSelectedPlayer);
|
str_format(buf, sizeof(buf), "rcon kill_pl %d", m_RCONSelectedPlayer);
|
||||||
m_pClient->Console()->ExecuteLine(buf);
|
m_pClient->Console()->ExecuteLine(buf, 4, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static int s_MuteButton = 0;
|
static int s_MuteButton = 0;
|
||||||
|
@ -117,7 +117,7 @@ void CMenus::RenderRCON(CUIRect MainView)
|
||||||
|
|
||||||
|
|
||||||
str_format(buf, sizeof(buf), "rcon mute %d 100", m_RCONSelectedPlayer);
|
str_format(buf, sizeof(buf), "rcon mute %d 100", m_RCONSelectedPlayer);
|
||||||
m_pClient->Console()->ExecuteLine(buf);
|
m_pClient->Console()->ExecuteLine(buf, 4, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static int s_BanButton = 0;
|
static int s_BanButton = 0;
|
||||||
|
@ -127,7 +127,7 @@ void CMenus::RenderRCON(CUIRect MainView)
|
||||||
|
|
||||||
|
|
||||||
str_format(buf, sizeof(buf), "rcon ban %d 300", m_RCONSelectedPlayer);
|
str_format(buf, sizeof(buf), "rcon ban %d 300", m_RCONSelectedPlayer);
|
||||||
m_pClient->Console()->ExecuteLine(buf);
|
m_pClient->Console()->ExecuteLine(buf, 4, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ CScoreboard::CScoreboard()
|
||||||
OnReset();
|
OnReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CScoreboard::ConKeyScoreboard(IConsole::IResult *pResult, void *pUserData)
|
void CScoreboard::ConKeyScoreboard(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CScoreboard *)pUserData)->m_Active = pResult->GetInteger(0) != 0;
|
((CScoreboard *)pUserData)->m_Active = pResult->GetInteger(0) != 0;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ void CScoreboard::OnReset()
|
||||||
|
|
||||||
void CScoreboard::OnConsoleInit()
|
void CScoreboard::OnConsoleInit()
|
||||||
{
|
{
|
||||||
Console()->Register("+scoreboard", "", CFGFLAG_CLIENT, ConKeyScoreboard, this, "Show scoreboard");
|
Console()->Register("+scoreboard", "", CFGFLAG_CLIENT, ConKeyScoreboard, this, "Show scoreboard", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CScoreboard::RenderGoals(float x, float y, float w)
|
void CScoreboard::RenderGoals(float x, float y, float w)
|
||||||
|
|
|
@ -8,7 +8,7 @@ class CScoreboard : public CComponent
|
||||||
void RenderSpectators(float x, float y, float w);
|
void RenderSpectators(float x, float y, float w);
|
||||||
void RenderScoreboard(float x, float y, float w, int Team, const char *pTitle);
|
void RenderScoreboard(float x, float y, float w, int Team, const char *pTitle);
|
||||||
|
|
||||||
static void ConKeyScoreboard(IConsole::IResult *pResult, void *pUserData);
|
static void ConKeyScoreboard(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
|
|
||||||
bool m_Active;
|
bool m_Active;
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
//#include <game/client/gameclient.h>
|
//#include <game/client/gameclient.h>
|
||||||
#include "voting.h"
|
#include "voting.h"
|
||||||
|
|
||||||
void CVoting::ConCallvote(IConsole::IResult *pResult, void *pUserData)
|
void CVoting::ConCallvote(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CVoting *pSelf = (CVoting*)pUserData;
|
CVoting *pSelf = (CVoting*)pUserData;
|
||||||
pSelf->Callvote(pResult->GetString(0), pResult->GetString(1));
|
pSelf->Callvote(pResult->GetString(0), pResult->GetString(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVoting::ConVote(IConsole::IResult *pResult, void *pUserData)
|
void CVoting::ConVote(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
CVoting *pSelf = (CVoting *)pUserData;
|
CVoting *pSelf = (CVoting *)pUserData;
|
||||||
if(str_comp_nocase(pResult->GetString(0), "yes") == 0)
|
if(str_comp_nocase(pResult->GetString(0), "yes") == 0)
|
||||||
|
@ -107,8 +107,8 @@ void CVoting::OnReset()
|
||||||
|
|
||||||
void CVoting::OnConsoleInit()
|
void CVoting::OnConsoleInit()
|
||||||
{
|
{
|
||||||
Console()->Register("callvote", "sr", CFGFLAG_CLIENT, ConCallvote, this, "Call vote");
|
Console()->Register("callvote", "sr", CFGFLAG_CLIENT, ConCallvote, this, "Call vote", 0);
|
||||||
Console()->Register("vote", "r", CFGFLAG_CLIENT, ConVote, this, "Vote yes/no");
|
Console()->Register("vote", "r", CFGFLAG_CLIENT, ConVote, this, "Vote yes/no", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVoting::OnMessage(int MsgType, void *pRawMsg)
|
void CVoting::OnMessage(int MsgType, void *pRawMsg)
|
||||||
|
|
|
@ -8,8 +8,8 @@ class CVoting : public CComponent
|
||||||
{
|
{
|
||||||
CHeap m_Heap;
|
CHeap m_Heap;
|
||||||
|
|
||||||
static void ConCallvote(IConsole::IResult *pResult, void *pUserData);
|
static void ConCallvote(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConVote(IConsole::IResult *pResult, void *pUserData);
|
static void ConVote(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
|
|
||||||
int64 m_Closetime;
|
int64 m_Closetime;
|
||||||
char m_aDescription[512];
|
char m_aDescription[512];
|
||||||
|
|
|
@ -103,7 +103,7 @@ static int gs_LoadTotal;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void ConServerDummy(IConsole::IResult *pResult, void *pUserData)
|
static void ConServerDummy(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
dbg_msg("client", "this command is not available on the client");
|
dbg_msg("client", "this command is not available on the client");
|
||||||
}
|
}
|
||||||
|
@ -192,33 +192,33 @@ void CGameClient::OnConsoleInit()
|
||||||
m_Input.Add(m_pBinds);
|
m_Input.Add(m_pBinds);
|
||||||
|
|
||||||
// add the some console commands
|
// add the some console commands
|
||||||
Console()->Register("team", "i", CFGFLAG_CLIENT, ConTeam, this, "Switch team");
|
Console()->Register("team", "i", CFGFLAG_CLIENT, ConTeam, this, "Switch team", 0);
|
||||||
Console()->Register("kill", "", CFGFLAG_CLIENT, ConKill, this, "Kill yourself");
|
Console()->Register("kill", "", CFGFLAG_CLIENT, ConKill, this, "Kill yourself", 0);
|
||||||
|
|
||||||
// register server dummy commands for tab completion
|
// register server dummy commands for tab completion
|
||||||
|
|
||||||
Console()->Register("tune", "si", CFGFLAG_SERVER, ConServerDummy, 0, "Tune variable to value");
|
Console()->Register("tune", "si", CFGFLAG_SERVER, ConServerDummy, 0, "Tune variable to value", 0);
|
||||||
Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConServerDummy, 0, "Reset tuning");
|
Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConServerDummy, 0, "Reset tuning", 0);
|
||||||
Console()->Register("tune_dump", "", CFGFLAG_SERVER, ConServerDummy, 0, "Dump tuning");
|
Console()->Register("tune_dump", "", CFGFLAG_SERVER, ConServerDummy, 0, "Dump tuning", 0);
|
||||||
Console()->Register("change_map", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Change map");
|
Console()->Register("change_map", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Change map", 0);
|
||||||
Console()->Register("restart", "?i", CFGFLAG_SERVER, ConServerDummy, 0, "Restart in x seconds");
|
Console()->Register("restart", "?i", CFGFLAG_SERVER, ConServerDummy, 0, "Restart in x seconds", 0);
|
||||||
Console()->Register("broadcast", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Broadcast message");
|
Console()->Register("broadcast", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Broadcast message", 0);
|
||||||
//MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_SERVER, con_serverdummy, 0);
|
//MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_SERVER, con_serverdummy, 0);
|
||||||
Console()->Register("set_team", "ii", CFGFLAG_SERVER, ConServerDummy, 0, "Set team of player to team");
|
Console()->Register("set_team", "ii", CFGFLAG_SERVER, ConServerDummy, 0, "Set team of player to team", 0);
|
||||||
Console()->Register("addvote", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Add a voting option");
|
Console()->Register("addvote", "r", CFGFLAG_SERVER, ConServerDummy, 0, "Add a voting option", 0);
|
||||||
//MACRO_REGISTER_COMMAND("vote", "", CFGFLAG_SERVER, con_serverdummy, 0);
|
//MACRO_REGISTER_COMMAND("vote", "", CFGFLAG_SERVER, con_serverdummy, 0);
|
||||||
Console()->Register("map_hack", "", CFGFLAG_CLIENT, ConMapHack, 0, "Tune variable to value");
|
Console()->Register("map_hack", "", CFGFLAG_CLIENT, ConMapHack, 0, "Tune variable to value", 0);
|
||||||
|
|
||||||
Console()->Register("tune", "si", CFGFLAG_SERVER, 0, 0, "Tune variable to value");
|
Console()->Register("tune", "si", CFGFLAG_SERVER, 0, 0, "Tune variable to value", 0);
|
||||||
Console()->Register("tune_reset", "", CFGFLAG_SERVER, 0, 0, "Reset tuning");
|
Console()->Register("tune_reset", "", CFGFLAG_SERVER, 0, 0, "Reset tuning", 0);
|
||||||
Console()->Register("tune_dump", "", CFGFLAG_SERVER, 0, 0, "Dump tuning");
|
Console()->Register("tune_dump", "", CFGFLAG_SERVER, 0, 0, "Dump tuning", 0);
|
||||||
Console()->Register("change_map", "r", CFGFLAG_SERVER, 0, 0, "Change map");
|
Console()->Register("change_map", "r", CFGFLAG_SERVER, 0, 0, "Change map", 0);
|
||||||
Console()->Register("restart", "?i", CFGFLAG_SERVER, 0, 0, "Restart in x seconds");
|
Console()->Register("restart", "?i", CFGFLAG_SERVER, 0, 0, "Restart in x seconds", 0);
|
||||||
Console()->Register("broadcast", "r", CFGFLAG_SERVER, 0, 0, "Broadcast message");
|
Console()->Register("broadcast", "r", CFGFLAG_SERVER, 0, 0, "Broadcast message", 0);
|
||||||
Console()->Register("say", "r", CFGFLAG_SERVER, 0, 0, "Say in chat");
|
Console()->Register("say", "r", CFGFLAG_SERVER, 0, 0, "Say in chat", 0);
|
||||||
Console()->Register("set_team", "ii", CFGFLAG_SERVER, 0, 0, "Set team of player to team");
|
Console()->Register("set_team", "ii", CFGFLAG_SERVER, 0, 0, "Set team of player to team", 0);
|
||||||
Console()->Register("addvote", "r", CFGFLAG_SERVER, 0, 0, "Add a voting option");
|
Console()->Register("addvote", "r", CFGFLAG_SERVER, 0, 0, "Add a voting option", 0);
|
||||||
Console()->Register("vote", "r", CFGFLAG_SERVER, 0, 0, "Force a vote to yes/no");
|
Console()->Register("vote", "r", CFGFLAG_SERVER, 0, 0, "Force a vote to yes/no", 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1097,23 +1097,23 @@ void CGameClient::SendKill(int ClientId)
|
||||||
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
|
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameClient::ConTeam(IConsole::IResult *pResult, void *pUserData)
|
void CGameClient::ConTeam(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CGameClient*)pUserData)->SendSwitchTeam(pResult->GetInteger(0));
|
((CGameClient*)pUserData)->SendSwitchTeam(pResult->GetInteger(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameClient::ConKill(IConsole::IResult *pResult, void *pUserData)
|
void CGameClient::ConKill(IConsole::IResult *pResult, void *pUserData, int ClientID)
|
||||||
{
|
{
|
||||||
((CGameClient*)pUserData)->SendKill(-1);
|
((CGameClient*)pUserData)->SendKill(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameClient::ConMapHack(IConsole::IResult *pResult, void *pUserData) {
|
void CGameClient::ConMapHack(IConsole::IResult *pResult, void *pUserData, int ClientID) {
|
||||||
g_Config.m_GfxClearFull ^= 1;
|
g_Config.m_GfxClearFull ^= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameClient::ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
void CGameClient::ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
||||||
{
|
{
|
||||||
pfnCallback(pResult, pCallbackUserData);
|
pfnCallback(pResult, pCallbackUserData, -1);
|
||||||
if(pResult->NumArguments())
|
if(pResult->NumArguments())
|
||||||
((CGameClient*)pUserData)->SendInfo(false);
|
((CGameClient*)pUserData)->SendInfo(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,9 +72,9 @@ class CGameClient : public IGameClient
|
||||||
|
|
||||||
int64 m_LastSendInfo;
|
int64 m_LastSendInfo;
|
||||||
|
|
||||||
static void ConTeam(IConsole::IResult *pResult, void *pUserData);
|
static void ConTeam(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConKill(IConsole::IResult *pResult, void *pUserData);
|
static void ConKill(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
static void ConMapHack(IConsole::IResult *pResult, void *pUserData);
|
static void ConMapHack(IConsole::IResult *pResult, void *pUserData, int ClientID);
|
||||||
|
|
||||||
static void ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
static void ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue