mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge branch 'master' of http://github.com/GreYFoXGTi/DDRace
This commit is contained in:
commit
b790b5f1bc
2
bam.lua
2
bam.lua
|
@ -134,7 +134,7 @@ function build(settings)
|
|||
|
||||
if config.compiler.driver == "cl" then
|
||||
settings.cc.flags:Add("/wd4244")
|
||||
settings.cc.flags:Add("/EHsc")
|
||||
--settings.cc.flags:Add("/EHsc")
|
||||
else
|
||||
settings.cc.flags:Add("-Wall")
|
||||
if platform == "macosx" then
|
||||
|
|
|
@ -94,15 +94,15 @@ MACRO_CONFIG_STR(SvReservedSlotsPass, sv_reserved_slots_pass, 32, "", CFGFLAG_SE
|
|||
MACRO_CONFIG_STR(SvRconPasswordAdmin, sv_admin_pass, 32, "", CFGFLAG_SERVER, "Remote console administrator password", 4)
|
||||
MACRO_CONFIG_STR(SvRconPasswordModer, sv_mod_pass, 32, "", CFGFLAG_SERVER, "Remote console moderator password", 4)
|
||||
MACRO_CONFIG_STR(SvRconPasswordHelper, sv_helper_pass, 32, "", CFGFLAG_SERVER, "Remote console helper password", 4)
|
||||
MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER, "Whether players can hammer/grenade/laser eachother or not", 3)
|
||||
MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER, "Turns endless hooking on/off", 3)
|
||||
MACRO_CONFIG_INT(SvHit, sv_hit, 1, 0, 1, CFGFLAG_SERVER, "Whether players can hammer/grenade/laser eachother or not", 4)
|
||||
MACRO_CONFIG_INT(SvEndlessDrag, sv_endless_drag, 0, 0, 1, CFGFLAG_SERVER, "Turns endless hooking on/off", 4)
|
||||
|
||||
MACRO_CONFIG_INT(SvCheats, sv_cheats, 0, 0, 1, CFGFLAG_SERVER, "Turns cheats on/off", 4)
|
||||
MACRO_CONFIG_INT(SvCheatTime, sv_cheattime, 0, 0, 1, CFGFLAG_SERVER, "Whether the time of players will be stopped on cheating or not", 3)
|
||||
MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off", 3)
|
||||
MACRO_CONFIG_INT(SvCheatTime, sv_cheattime, 0, 0, 1, CFGFLAG_SERVER, "Whether the time of players will be stopped on cheating or not", 4)
|
||||
MACRO_CONFIG_INT(SvEndlessSuperHook, sv_endless_super_hook, 0, 0, 1, CFGFLAG_SERVER, "Endless hook for super players on/off", 4)
|
||||
|
||||
MACRO_CONFIG_INT(SvAllowColorChange, sv_allow_color_change, 1, 0, 1, CFGFLAG_SERVER, "Whether color change is allowed (to block rainbow mod)", 3)
|
||||
MACRO_CONFIG_INT(SvHideScore, sv_hide_score, 0, 0, 1, CFGFLAG_SERVER, "Whether players scores will be announced or not", 3)
|
||||
//MACRO_CONFIG_INT(SvAllowColorChange, sv_allow_color_change, 1, 0, 1, CFGFLAG_SERVER, "Whether color change is allowed (to block rainbow mod)", 3)
|
||||
MACRO_CONFIG_INT(SvHideScore, sv_hide_score, 0, 0, 1, CFGFLAG_SERVER, "Whether players scores will be announced or not", 4)
|
||||
MACRO_CONFIG_INT(SvTimer, sv_timer, 0, 0, 1, CFGFLAG_SERVER, "Whether timer commands are allowed or not", 3)
|
||||
MACRO_CONFIG_INT(SvPauseable, sv_pauseable, 1, 0, 1, CFGFLAG_SERVER, "Whether players can pause their char or not", 3)
|
||||
MACRO_CONFIG_INT(SvPauseTime, sv_pause_time, 0, 0, 1, CFGFLAG_SERVER, "Whether '/pause' and 'sv_max_dc_restore' pauses the time of player or not", 3)
|
||||
|
@ -112,19 +112,21 @@ MACRO_CONFIG_INT(SvEmoticonDelay, sv_emoticon_delay, 3, 0, 9999, CFGFLAG_SERVER,
|
|||
|
||||
MACRO_CONFIG_INT(SvChatDelay, sv_chat_delay, 1, 0, 9999, CFGFLAG_SERVER, "The time in seconds between chat messages", 3)
|
||||
MACRO_CONFIG_INT(SvTeamChangeDelay, sv_team_change_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between team changes (spectator/in game)", 3)
|
||||
MACRO_CONFIG_INT(SvInfoChangeDelay, sv_info_change_delay, 5, 0, 9999, CFGFLAG_SERVER, "The time in seconds between info changes (name/skin/color)", 3)
|
||||
MACRO_CONFIG_INT(SvInfoChangeDelay, sv_info_change_delay, 5, 0, 9999, CFGFLAG_SERVER, "The time in seconds between info changes (name/skin/color), to avoid ranbow mod set this to a very high time", 3)
|
||||
MACRO_CONFIG_INT(SvVoteMapTimeDelay, sv_vote_map_delay,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between map votes", 3)
|
||||
MACRO_CONFIG_INT(SvVoteDelay, sv_vote_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between any vote", 3)
|
||||
MACRO_CONFIG_INT(SvVoteKickTimeDelay, sv_vote_kick_delay,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kick votes", 3)
|
||||
MACRO_CONFIG_INT(SvKillDelay, sv_kill_delay,3,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kills", 3)
|
||||
MACRO_CONFIG_INT(SvSuicidePenalty, sv_suicide_penalty,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kill or /kills and respawn", 3)
|
||||
|
||||
MACRO_CONFIG_INT(SvVotePercentage, sv_vote_percentage, 50, 1, 100, CFGFLAG_SERVER, "The percent of people that need to agree or deny for the vote to succeed/fail", 3)
|
||||
MACRO_CONFIG_INT(SvVotePercentage, sv_vote_percentage, 50, 1, 100, CFGFLAG_SERVER, "The percent of people that need to agree or deny for the vote to succeed/fail", 4)
|
||||
MACRO_CONFIG_INT(SvShotgunBulletSound, sv_shotgun_bullet_sound, 0, 0, 1, CFGFLAG_SERVER, "Crazy shotgun bullet sound on/off", 3)
|
||||
|
||||
MACRO_CONFIG_INT(SvCheckpointSave, sv_checkpoint_save, 1, 0, 1, CFGFLAG_SERVER, "Whether to save checkpoint times to the score file", 3)
|
||||
MACRO_CONFIG_STR(SvScoreFolder, sv_score_folder, 32, "records", CFGFLAG_SERVER, "Folder to save score files to", 3)
|
||||
|
||||
|
||||
#if defined(CONF_SQL)
|
||||
MACRO_CONFIG_INT(SvUseSQL, sv_use_sql, 0, 0, 1, CFGFLAG_SERVER, "Enables SQL DB instead of record file", 4)
|
||||
MACRO_CONFIG_STR(SvSqlUser, sv_sql_user, 32, "nameless", CFGFLAG_SERVER, "SQL User", 4)
|
||||
MACRO_CONFIG_STR(SvSqlPw, sv_sql_pw, 32, "tee", CFGFLAG_SERVER, "SQL Password", 4)
|
||||
|
@ -132,6 +134,7 @@ MACRO_CONFIG_STR(SvSqlIp, sv_sql_ip, 32, "127.0.0.1", CFGFLAG_SERVER, "SQL Datab
|
|||
MACRO_CONFIG_INT(SvSqlPort, sv_sql_port, 3306, 0, 65535, CFGFLAG_SERVER, "SQL Database port", 4)
|
||||
MACRO_CONFIG_STR(SvSqlDatabase, sv_sql_database, 16, "teeworlds", CFGFLAG_SERVER, "SQL Database name", 4)
|
||||
MACRO_CONFIG_STR(SvSqlPrefix, sv_sql_prefix, 16, "record", CFGFLAG_SERVER, "SQL Database table prefix", 4)
|
||||
#endif
|
||||
|
||||
MACRO_CONFIG_INT(SvDDRaceRules, sv_ddrace_rules, 1, 0, 1, CFGFLAG_SERVER, "Whether the default mod rules are displayed or not", 4)
|
||||
MACRO_CONFIG_STR(SvRulesLine1, sv_rules_line1, 40, "", CFGFLAG_SERVER, "Rules line 1", 4)
|
||||
|
@ -146,13 +149,14 @@ MACRO_CONFIG_STR(SvRulesLine9, sv_rules_line9, 40, "", CFGFLAG_SERVER, "Rules li
|
|||
MACRO_CONFIG_STR(SvRulesLine10, sv_rules_line10, 40, "", CFGFLAG_SERVER, "Rules line 10", 4)
|
||||
//MACRO_CONFIG_INT(SvReconnectTime, sv_reconnect_time,5,0,9999,CFGFLAG_SERVER, "The time in seconds between leaves and joins of clients with the same ip", 3)
|
||||
|
||||
MACRO_CONFIG_INT(SvTeam, sv_team, 0, -1, 1, CFGFLAG_SERVER, "Teams configuration", 3)
|
||||
MACRO_CONFIG_INT(SvTeam, sv_team, 0, -1, 1, CFGFLAG_SERVER, "Teams configuration", 4)
|
||||
MACRO_CONFIG_INT(SvTeamStrict, sv_team_strict, 0, 0, 1, CFGFLAG_SERVER, "Kill or not all team if someone left game in team", 4)
|
||||
|
||||
MACRO_CONFIG_STR(SvAnnouncementFileName, sv_announcement_filename, 24, "announcement.txt", CFGFLAG_SERVER, "file which will have the announcement, each one at a line", 3)
|
||||
MACRO_CONFIG_INT(SvAnnouncementInterval, sv_announcement_interval, 30, 15, 9999, CFGFLAG_SERVER, "time(minutes) in which the announcement will be displayed from the announcement file", 3)
|
||||
|
||||
MACRO_CONFIG_INT(SvOldLaser, sv_old_laser, 0, 0, 1, CFGFLAG_SERVER, "Whether lasers can hit you if you hsot them and that they pull you towards the bounce origin (0 for DDRace Beta) or lasers can;t hit you if you shot them, and they pull others towards the shooter", 4)
|
||||
MACRO_CONFIG_INT(SvOldLaser, sv_old_laser, 0, 0, 1, CFGFLAG_SERVER, "Whether lasers can hit you if you shot them and that they pull you towards the bounce origin (0 for DDRace Beta) or lasers can't hit you if you shot them, and they pull others towards the shooter", 4)
|
||||
MACRO_CONFIG_INT(SvSlashMe, sv_slash_me, 0, 0, 1, CFGFLAG_SERVER, "Whether /me is active on the server or not", 4)
|
||||
|
||||
MACRO_CONFIG_INT(ConnTimeout, conn_timeout, 15, 5, 100, CFGFLAG_CLIENT|CFGFLAG_SERVER, "Network timeout", 4)
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ CONSOLE_COMMAND("credits", "", CFGFLAG_SERVER, ConCredits, this, "Shows the cred
|
|||
CONSOLE_COMMAND("emote", "?si", CFGFLAG_SERVER, ConEyeEmote, this, "Sets your tee's eye emote", -1)
|
||||
CONSOLE_COMMAND("broadmsg", "", CFGFLAG_SERVER, ConToggleBroadcast, this, "Toggle Showing the Server's Broadcast message during race", -1)
|
||||
CONSOLE_COMMAND("eyeemote", "", CFGFLAG_SERVER, ConEyeEmote, this, "Toggles whether you automatically use eyeemotes with standard emotes", -1)
|
||||
CONSOLE_COMMAND("flags", "", CFGFLAG_SERVER, ConFlags, this, "Shows gameplay information for this server", -1)
|
||||
CONSOLE_COMMAND("settings", "?s", CFGFLAG_SERVER, ConSettings, this, "Shows gameplay information for this server", -1)
|
||||
CONSOLE_COMMAND("fly", "", CFGFLAG_SERVER, ConToggleFly, this, "Toggles whether you fly by pressing jump", 1)
|
||||
CONSOLE_COMMAND("help", "?r", CFGFLAG_SERVER, ConHelp, this, "Helps you with commands", -1)
|
||||
CONSOLE_COMMAND("info", "", CFGFLAG_SERVER, ConInfo, this, "Shows info about this server", -1)
|
||||
|
|
|
@ -1883,6 +1883,8 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
|
|||
if(int Result = DoButton_Ex(m_Map.m_lGroups[g]->m_lLayers[i], aBuf, g==m_SelectedGroup&&i==m_SelectedLayer, &Button,
|
||||
BUTTON_CONTEXT, Localize("Select layer. Right click for properties."), 0))
|
||||
{
|
||||
if(m_Map.m_lGroups[g]->m_lLayers[i] == m_Map.m_pTeleLayer || m_Map.m_lGroups[g]->m_lLayers[i] == m_Map.m_pSpeedupLayer)
|
||||
m_Brush.Clear();
|
||||
m_SelectedLayer = i;
|
||||
m_SelectedGroup = g;
|
||||
static int s_LayerPopupId = 0;
|
||||
|
@ -2539,6 +2541,19 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
CUIRect Button;
|
||||
CEnvelope *pNewEnv = 0;
|
||||
|
||||
// Delete button
|
||||
if(m_Map.m_lEnvelopes.size())
|
||||
{
|
||||
ToolBar.VSplitRight(5.0f, &ToolBar, &Button);
|
||||
ToolBar.VSplitRight(50.0f, &ToolBar, &Button);
|
||||
static int s_DelButton = 0;
|
||||
if(DoButton_Editor(&s_DelButton, Localize("Delete"), 0, &Button, 0, Localize("Delete this envelope")))
|
||||
m_Map.DeleteEnvelope(m_SelectedEnvelope);
|
||||
|
||||
// little space
|
||||
ToolBar.VSplitRight(10.0f, &ToolBar, &Button);
|
||||
}
|
||||
|
||||
ToolBar.VSplitRight(50.0f, &ToolBar, &Button);
|
||||
static int s_New4dButton = 0;
|
||||
if(DoButton_Editor(&s_New4dButton, Localize("Color+"), 0, &Button, 0, Localize("Creates a new color envelope")))
|
||||
|
@ -2549,7 +2564,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
static int s_New2dButton = 0;
|
||||
if(DoButton_Editor(&s_New2dButton, Localize("Pos.+"), 0, &Button, 0, Localize("Creates a new pos envelope")))
|
||||
pNewEnv = m_Map.NewEnvelope(3);
|
||||
|
||||
|
||||
// Delete button
|
||||
if(m_SelectedEnvelope >= 0)
|
||||
{
|
||||
|
|
|
@ -452,6 +452,7 @@ public:
|
|||
~CLayerTele();
|
||||
|
||||
CTeleTile *m_pTeleTile;
|
||||
unsigned m_TeleNum;
|
||||
|
||||
virtual void Resize(int NewW, int NewH);
|
||||
virtual void Shift(int Direction);
|
||||
|
@ -466,6 +467,9 @@ public:
|
|||
~CLayerSpeedup();
|
||||
|
||||
CSpeedupTile *m_pSpeedupTile;
|
||||
unsigned m_SpeedupForce;
|
||||
unsigned m_SpeedupMaxSpeed;
|
||||
unsigned m_SpeedupAngle;
|
||||
|
||||
virtual void Resize(int NewW, int NewH);
|
||||
virtual void Shift(int Direction);
|
||||
|
@ -490,6 +494,8 @@ public:
|
|||
~CLayerSwitch();
|
||||
|
||||
CSwitchTile *m_pSwitchTile;
|
||||
unsigned m_SwitchNum;
|
||||
unsigned m_SwitchDelay;
|
||||
|
||||
virtual void Resize(int NewW, int NewH);
|
||||
virtual void Shift(int Direction);
|
||||
|
|
|
@ -617,10 +617,16 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
|
|||
|
||||
for(int i = 0; i < pTiles->m_Width*pTiles->m_Height; i++)
|
||||
{
|
||||
if(((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Force > 0 && (((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Type == TILE_BOOST))
|
||||
((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = ((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Type;
|
||||
if(((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Force > 0)
|
||||
{
|
||||
((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = TILE_BOOST;
|
||||
((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Type = TILE_BOOST;
|
||||
}
|
||||
else
|
||||
{
|
||||
((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = 0;
|
||||
((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Type = 0;
|
||||
}
|
||||
}
|
||||
|
||||
DataFile.UnloadData(pTilemapItem->m_Speedup);
|
||||
|
|
|
@ -166,6 +166,7 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
|
|||
if(pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEIN || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEOUT || pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Type == TILE_TELEINEVIL)
|
||||
m_pEditor->m_TeleNum = pGrabbed->m_pTeleTile[y*pGrabbed->m_Width+x].m_Number;
|
||||
}
|
||||
pGrabbed->m_TeleNum = m_pEditor->m_TeleNum;
|
||||
}
|
||||
else if(m_pEditor->GetSelectedLayer(0) == m_pEditor->m_Map.m_pSpeedupLayer)
|
||||
{
|
||||
|
@ -195,6 +196,9 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
|
|||
m_pEditor->m_SpeedupMaxSpeed = pGrabbed->m_pSpeedupTile[y*pGrabbed->m_Width+x].m_MaxSpeed;
|
||||
}
|
||||
}
|
||||
pGrabbed->m_SpeedupForce = m_pEditor->m_SpeedupForce;
|
||||
pGrabbed->m_SpeedupMaxSpeed = m_pEditor->m_SpeedupMaxSpeed;
|
||||
pGrabbed->m_SpeedupAngle = m_pEditor->m_SpeedupAngle;
|
||||
}
|
||||
else if(m_pEditor->GetSelectedLayer(0) == m_pEditor->m_Map.m_pSwitchLayer)
|
||||
{
|
||||
|
@ -223,6 +227,8 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
|
|||
m_pEditor->m_SwitchDelay = pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Delay;
|
||||
}
|
||||
}
|
||||
pGrabbed->m_SwitchNum = m_pEditor->m_SwitchNum;
|
||||
pGrabbed->m_SwitchDelay = m_pEditor->m_SwitchDelay;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -620,9 +626,13 @@ void CLayerTele::BrushDraw(CLayer *pBrush, float wx, float wy)
|
|||
|
||||
if(l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINEVIL || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEOUT)
|
||||
{
|
||||
/*if(l->m_pTeleTile[y*l->m_Width+x].m_Number)
|
||||
if(m_pEditor->m_TeleNum != l->m_TeleNum)
|
||||
{
|
||||
m_pTeleTile[fy*m_Width+fx].m_Number = m_pEditor->m_TeleNum;
|
||||
}
|
||||
else if(l->m_pTeleTile[y*l->m_Width+x].m_Number)
|
||||
m_pTeleTile[fy*m_Width+fx].m_Number = l->m_pTeleTile[y*l->m_Width+x].m_Number;
|
||||
else*/
|
||||
else
|
||||
{
|
||||
if(!m_pEditor->m_TeleNum)
|
||||
{
|
||||
|
@ -772,18 +782,26 @@ void CLayerSpeedup::BrushDraw(CLayer *pBrush, float wx, float wy)
|
|||
int fy = y+sy;
|
||||
if(fx<0 || fx >= m_Width || fy < 0 || fy >= m_Height)
|
||||
continue;
|
||||
|
||||
|
||||
if(l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOST)
|
||||
{
|
||||
/*if(l->m_pSpeedupTile[y*l->m_Width+x].m_Force || l->m_pSpeedupTile[y*l->m_Width+x].m_Angle)
|
||||
if(m_pEditor->m_SpeedupAngle != l->m_SpeedupAngle || m_pEditor->m_SpeedupForce != l->m_SpeedupForce || m_pEditor->m_SpeedupMaxSpeed != l->m_SpeedupMaxSpeed)
|
||||
{
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Force = l->m_pSpeedupTile[y*l->m_Width+x].m_Force;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Angle = l->m_pSpeedupTile[y*l->m_Width+x].m_Angle;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Force = m_pEditor->m_SpeedupForce;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_MaxSpeed = m_pEditor->m_SpeedupMaxSpeed;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Angle = m_pEditor->m_SpeedupAngle;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Type = l->m_pTiles[y*l->m_Width+x].m_Index;
|
||||
m_pTiles[fy*m_Width+fx].m_Index = l->m_pTiles[y*l->m_Width+x].m_Index;
|
||||
}
|
||||
else */
|
||||
if(m_pEditor->m_SpeedupForce)
|
||||
else if(l->m_pSpeedupTile[y*l->m_Width+x].m_Force)
|
||||
{
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Force = l->m_pSpeedupTile[y*l->m_Width+x].m_Force;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Angle = l->m_pSpeedupTile[y*l->m_Width+x].m_Angle;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_MaxSpeed = l->m_pSpeedupTile[y*l->m_Width+x].m_MaxSpeed;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Type = l->m_pTiles[y*l->m_Width+x].m_Index;
|
||||
m_pTiles[fy*m_Width+fx].m_Index = l->m_pTiles[y*l->m_Width+x].m_Index;
|
||||
}
|
||||
else if(m_pEditor->m_SpeedupForce)
|
||||
{
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Force = m_pEditor->m_SpeedupForce;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_MaxSpeed = m_pEditor->m_SpeedupMaxSpeed;
|
||||
|
@ -843,13 +861,11 @@ void CLayerSpeedup::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
|
|||
if(!pLt->m_pSpeedupTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_Force && m_pEditor->m_SpeedupForce && m_pTiles[fy*m_Width+fx].m_Index > 0)
|
||||
{
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Force = m_pEditor->m_SpeedupForce;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_MaxSpeed = m_pEditor->m_SpeedupMaxSpeed;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Angle = m_pEditor->m_SpeedupAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Force = pLt->m_pSpeedupTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_Force;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_MaxSpeed = pLt->m_pSpeedupTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_MaxSpeed;
|
||||
m_pSpeedupTile[fy*m_Width+fx].m_Angle = pLt->m_pSpeedupTile[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)].m_Angle;
|
||||
}
|
||||
}
|
||||
|
@ -1024,9 +1040,17 @@ void CLayerSwitch::BrushDraw(CLayer *pBrush, float wx, float wy)
|
|||
|
||||
if(l->m_pTiles[y*l->m_Width+x].m_Index >= (ENTITY_ARMOR_1 + ENTITY_OFFSET) && l->m_pTiles[y*l->m_Width+x].m_Index <= (ENTITY_DOOR + ENTITY_OFFSET) || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_SWITCHOPEN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_SWITCHCLOSE || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_SWITCHTIMEDOPEN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_SWITCHTIMEDCLOSE)
|
||||
{
|
||||
/*if(l->m_pSwitchTile[y*l->m_Width+x].m_Number)
|
||||
if(m_pEditor->m_SwitchNum != l->m_SwitchNum || m_pEditor->m_SwitchDelay != l->m_SwitchDelay)
|
||||
{
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Number = m_pEditor->m_SwitchNum;
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Delay = m_pEditor->m_SwitchDelay;
|
||||
}
|
||||
else if(l->m_pSwitchTile[y*l->m_Width+x].m_Number)
|
||||
{
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Number = l->m_pSwitchTile[y*l->m_Width+x].m_Number;
|
||||
else*/
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Delay = l->m_pSwitchTile[y*l->m_Width+x].m_Delay;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!m_pEditor->m_SwitchNum)
|
||||
{
|
||||
|
@ -1038,12 +1062,14 @@ void CLayerSwitch::BrushDraw(CLayer *pBrush, float wx, float wy)
|
|||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Number = m_pEditor->m_SwitchNum;
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Delay = m_pEditor->m_SwitchDelay;
|
||||
}
|
||||
}
|
||||
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Type = l->m_pTiles[y*l->m_Width+x].m_Index;
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Flags = l->m_pTiles[y*l->m_Width+x].m_Flags;
|
||||
m_pSwitchTile[fy*m_Width+fx].m_Delay = m_pEditor->m_SwitchDelay;
|
||||
m_pTiles[fy*m_Width+fx].m_Index = l->m_pTiles[y*l->m_Width+x].m_Index;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -529,7 +529,7 @@ void CGameContext::ConHelp(IConsole::IResult *pResult, void *pUserData, int Clie
|
|||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "/cmdlist will show a list of all chat commands");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "/help + any command will show you the help for this command");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "Example /help flags will display the help about ");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "Example /help settings will display the help about ");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -542,29 +542,87 @@ void CGameContext::ConHelp(IConsole::IResult *pResult, void *pUserData, int Clie
|
|||
}
|
||||
}
|
||||
|
||||
void CGameContext::ConFlags(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
void CGameContext::ConSettings(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
|
||||
char buf[64];
|
||||
float temp1;
|
||||
float temp2;
|
||||
pSelf->m_Tuning.Get("player_collision",&temp1);
|
||||
pSelf->m_Tuning.Get("player_hooking",&temp2);
|
||||
str_format(buf, sizeof(buf), "Flags: cheats[%s]%s%s collision[%s] hooking[%s]",
|
||||
g_Config.m_SvCheats?"yes":"no",
|
||||
(g_Config.m_SvCheats)?" w/Time":"",
|
||||
(g_Config.m_SvCheats)?(g_Config.m_SvCheatTime)?"[yes]":"[no]":"",
|
||||
temp1?"yes":"no",
|
||||
temp2?"yes":"no");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", buf);
|
||||
|
||||
str_format(buf, sizeof(buf), "endless hook[%s] weapons effect others[%s]",g_Config.m_SvEndlessDrag?"yes":"no",g_Config.m_SvHit?"yes":"no");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", buf);
|
||||
if(g_Config.m_SvPauseable)
|
||||
if(pResult->NumArguments() == 0)
|
||||
{
|
||||
str_format(buf, sizeof(buf), "Server Allows /pause with%s",g_Config.m_SvPauseTime?" time pause.":"out time pause.");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", buf);
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "to check a server setting say /settings and setting's name, setting names are:");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "teams, cheats, collision, hooking, endlesshooking, me, ");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "hitting, oldlaser, timeout, votes, pause and scores");
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *pArg = pResult->GetString(0);
|
||||
char aBuf[256];
|
||||
float ColTemp;
|
||||
float HookTemp;
|
||||
pSelf->m_Tuning.Get("player_collision", &ColTemp);
|
||||
pSelf->m_Tuning.Get("player_hooking", &HookTemp);
|
||||
if(str_comp(pArg, "cheats") == 0)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%s%s",
|
||||
g_Config.m_SvCheats?"People can cheat":"People can't cheat",
|
||||
(g_Config.m_SvCheats)?(g_Config.m_SvCheatTime)?" with time":" without time":"");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf);
|
||||
if(g_Config.m_SvCheats)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%s", g_Config.m_SvEndlessSuperHook?"super can hook you forever":"super can only hook you for limited time");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf);
|
||||
str_format(aBuf, sizeof(aBuf), "%s", g_Config.m_SvTimer?"admins have the power to control your time":"admins have no power over your time");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf);
|
||||
}
|
||||
}
|
||||
else if(str_comp(pArg, "teams") == 0)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%s %s", !g_Config.m_SvTeam?"Teams are available on this server":g_Config.m_SvTeam==-1?"Teams are not available on this server":"You have to be in a team to play on this server", !g_Config.m_SvTeamStrict?"and if you die in a team only you die":"and if you die in a team all of you die");
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf);
|
||||
}
|
||||
else if(str_comp(pArg, "collision") == 0)
|
||||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", ColTemp?"Players can collide on this server":"Players Can't collide on this server");
|
||||
}
|
||||
else if(str_comp(pArg, "hooking") == 0)
|
||||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", HookTemp?"Players can hook each other on this server":"Players Can't hook each other on this server");
|
||||
}
|
||||
else if(str_comp(pArg, "endlesshooking") == 0)
|
||||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", g_Config.m_SvEndlessDrag?"Players can hook time is unlimited":"Players can hook time is limited");
|
||||
}
|
||||
else if(str_comp(pArg, "hitting") == 0)
|
||||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", g_Config.m_SvHit?"Player's weapons affect each other":"Player's weapons has no affect on each other");
|
||||
}
|
||||
else if(str_comp(pArg, "oldlaser") == 0)
|
||||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", g_Config.m_SvOldLaser?"Lasers can hit you if you shot them and that they pull you towards the bounce origin (Like DDRace Beta)":"Lasers can't hit you if you shot them, and they pull others towards the shooter");
|
||||
}
|
||||
else if(str_comp(pArg, "me") == 0)
|
||||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", g_Config.m_SvSlashMe?"Players can use /me commands the famous IRC Command":"Players Can't use the /me command");
|
||||
}
|
||||
else if(str_comp(pArg, "timeout") == 0)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "The Server Timeout is currently set to %d", g_Config.m_ConnTimeout);
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf);
|
||||
}
|
||||
else if(str_comp(pArg, "votes") == 0)
|
||||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", g_Config.m_SvVoteKick?"Players can use Callvote menu tab to kick offenders":"Players Can't use the Callvote menu tab to kick offenders");
|
||||
if(g_Config.m_SvVoteKick)
|
||||
str_format(aBuf, sizeof(aBuf), "Players are banned for %d second(s) if they get voted off", g_Config.m_SvVoteKickBantime);
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", g_Config.m_SvVoteKickBantime?aBuf:"Players are just kicked and not banned if they get voted off");
|
||||
}
|
||||
else if(str_comp(pArg, "pause") == 0)
|
||||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", g_Config.m_SvPauseable?g_Config.m_SvPauseTime?"/pause is available on this server and it pauses your time too":"/pause is available on this server but it doesn't pause your time":"/pause is NOT available on this server");
|
||||
}
|
||||
else if(str_comp(pArg, "scores") == 0)
|
||||
{
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", g_Config.m_SvHideScore?"Scores are private on this server":"Scores are public on this server");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -792,7 +850,10 @@ void CGameContext::ConMe(IConsole::IResult *pResult, void *pUserData, int Client
|
|||
char aBuf[256 + 24];
|
||||
|
||||
str_format(aBuf, 256 + 24, "'%s' %s", pSelf->Server()->ClientName(ClientId), pResult->GetString(0));
|
||||
pSelf->SendChat(-2, CGameContext::CHAT_ALL, aBuf, ClientId);
|
||||
if(g_Config.m_SvSlashMe)
|
||||
pSelf->SendChat(-2, CGameContext::CHAT_ALL, aBuf, ClientId);
|
||||
else
|
||||
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "/me is disabled on this server, admin can enable it by using sv_slash_me");
|
||||
}
|
||||
|
||||
void CGameContext::ConToggleEyeEmote(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
|
|
|
@ -277,7 +277,7 @@ void CGameContext::SendChatResponse(const char *pLine, void *pUser)
|
|||
void CGameContext::SendChat(int ChatterClientId, int Team, const char *pText, int SpamProtectionClientId)
|
||||
{
|
||||
if(SpamProtectionClientId >= 0 && SpamProtectionClientId < MAX_CLIENTS)
|
||||
if(/*g_Config.m_SvSpamprotection && */m_apPlayers[SpamProtectionClientId]->m_Last_Chat
|
||||
if(g_Config.m_SvSpamprotection && m_apPlayers[SpamProtectionClientId]->m_Last_Chat
|
||||
&& m_apPlayers[SpamProtectionClientId]->m_Last_Chat + Server()->TickSpeed() + g_Config.m_SvChatDelay > Server()->Tick())
|
||||
return;
|
||||
else
|
||||
|
@ -730,7 +730,7 @@ void CGameContext::OnClientDrop(int ClientId)
|
|||
void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
||||
{
|
||||
void *pRawMsg = m_NetObjHandler.SecureUnpackMsg(MsgId, pUnpacker);
|
||||
CPlayer *pPlayer = m_apPlayers[ClientId];
|
||||
CPlayer *p = m_apPlayers[ClientId];
|
||||
|
||||
if(!pRawMsg)
|
||||
{
|
||||
|
@ -745,9 +745,9 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
CNetMsg_Cl_Say *pMsg = (CNetMsg_Cl_Say *)pRawMsg;
|
||||
int Team = pMsg->m_Team;
|
||||
//if(Team)
|
||||
int GameTeam = ((CGameControllerDDRace*)m_pController)->m_Teams.m_Core.Team(pPlayer->GetCID());
|
||||
int GameTeam = ((CGameControllerDDRace*)m_pController)->m_Teams.m_Core.Team(p->GetCID());
|
||||
if(Team) {
|
||||
Team = (pPlayer->GetTeam() == -1) ? CHAT_SPEC : (GameTeam == 0 ? CHAT_ALL : GameTeam);
|
||||
Team = (p->GetTeam() == -1) ? CHAT_SPEC : (GameTeam == 0 ? CHAT_ALL : GameTeam);
|
||||
} else {
|
||||
Team = CHAT_ALL;
|
||||
}
|
||||
|
@ -794,12 +794,12 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
}
|
||||
else if(MsgId == NETMSGTYPE_CL_CALLVOTE)
|
||||
{
|
||||
if(/*g_Config.m_SvSpamprotection && */pPlayer->m_Last_VoteTry && pPlayer->m_Last_VoteTry + Server()->TickSpeed() * g_Config.m_SvVoteDelay > Server()->Tick())
|
||||
if(g_Config.m_SvSpamprotection && p->m_Last_VoteTry && p->m_Last_VoteTry + Server()->TickSpeed() * g_Config.m_SvVoteDelay > Server()->Tick())
|
||||
return;
|
||||
|
||||
int64 Now = Server()->Tick();
|
||||
pPlayer->m_Last_VoteTry = Now;
|
||||
if(pPlayer->GetTeam() == -1)
|
||||
p->m_Last_VoteTry = Now;
|
||||
if(p->GetTeam() == -1)
|
||||
{
|
||||
SendChatTarget(ClientId, "Spectators aren't allowed to start a vote.");
|
||||
return;
|
||||
|
@ -811,8 +811,8 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
return;
|
||||
}
|
||||
|
||||
int Timeleft = pPlayer->m_Last_VoteCall + Server()->TickSpeed()*60 - Now;
|
||||
if(pPlayer->m_Last_VoteCall && Timeleft > 0)
|
||||
int Timeleft = p->m_Last_VoteCall + Server()->TickSpeed()*60 - Now;
|
||||
if(p->m_Last_VoteCall && Timeleft > 0)
|
||||
{
|
||||
char aChatmsg[512] = {0};
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "You must wait %d seconds before making another vote", (Timeleft/Server()->TickSpeed())+1);
|
||||
|
@ -853,7 +853,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
|
||||
if(!pOption)
|
||||
{
|
||||
if (pPlayer->m_Authed < 3) // allow admins to call any vote they want
|
||||
if (p->m_Authed < 3) // allow admins to call any vote they want
|
||||
{
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' isn't an option on this server", pMsg->m_Value);
|
||||
SendChatTarget(ClientId, aChatmsg);
|
||||
|
@ -885,7 +885,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
m_apPlayers[ClientId]->m_Last_KickVote = time_get();
|
||||
return;
|
||||
}
|
||||
else if(!g_Config.m_SvVoteKick && pPlayer->m_Authed < 2) // allow admins to call kick votes even if they are forbidden
|
||||
else if(!g_Config.m_SvVoteKick && p->m_Authed < 2) // allow admins to call kick votes even if they are forbidden
|
||||
{
|
||||
SendChatTarget(ClientId, "Server does not allow voting to kick players");
|
||||
m_apPlayers[ClientId]->m_Last_KickVote = time_get();
|
||||
|
@ -903,7 +903,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
SendChatTarget(ClientId, "You can't kick yourself");
|
||||
return;
|
||||
}
|
||||
if(ComparePlayers(m_apPlayers[KickId], pPlayer))
|
||||
if(ComparePlayers(m_apPlayers[KickId], p))
|
||||
{
|
||||
SendChatTarget(ClientId, "You can't kick admins");
|
||||
m_apPlayers[ClientId]->m_Last_KickVote = time_get();
|
||||
|
@ -946,10 +946,10 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
{
|
||||
SendChat(-1, CGameContext::CHAT_ALL, aChatmsg);
|
||||
StartVote(aDesc, aCmd);
|
||||
pPlayer->m_Vote = 1;
|
||||
pPlayer->m_VotePos = m_VotePos = 1;
|
||||
p->m_Vote = 1;
|
||||
p->m_VotePos = m_VotePos = 1;
|
||||
m_VoteCreator = ClientId;
|
||||
pPlayer->m_Last_VoteCall = Now;
|
||||
p->m_Last_VoteCall = Now;
|
||||
}
|
||||
}
|
||||
else if(MsgId == NETMSGTYPE_CL_VOTE)
|
||||
|
@ -957,14 +957,14 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
if(!m_VoteCloseTime)
|
||||
return;
|
||||
|
||||
if(pPlayer->m_Vote == 0)
|
||||
if(p->m_Vote == 0)
|
||||
{
|
||||
CNetMsg_Cl_Vote *pMsg = (CNetMsg_Cl_Vote *)pRawMsg;
|
||||
if(!pMsg->m_Vote)
|
||||
return;
|
||||
|
||||
pPlayer->m_Vote = pMsg->m_Vote;
|
||||
pPlayer->m_VotePos = ++m_VotePos;
|
||||
p->m_Vote = pMsg->m_Vote;
|
||||
p->m_VotePos = ++m_VotePos;
|
||||
m_VoteUpdate = true;
|
||||
}
|
||||
}
|
||||
|
@ -972,7 +972,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
{
|
||||
CNetMsg_Cl_SetTeam *pMsg = (CNetMsg_Cl_SetTeam *)pRawMsg;
|
||||
|
||||
if(pPlayer->GetTeam() == pMsg->m_Team || (/*g_Config.m_SvSpamprotection &&*/ pPlayer->m_Last_SetTeam && pPlayer->m_Last_SetTeam+Server()->TickSpeed() * g_Config.m_SvTeamChangeDelay > Server()->Tick()))
|
||||
if(p->GetTeam() == pMsg->m_Team || (g_Config.m_SvSpamprotection && p->m_Last_SetTeam && p->m_Last_SetTeam+Server()->TickSpeed() * g_Config.m_SvTeamChangeDelay > Server()->Tick()))
|
||||
return;
|
||||
|
||||
// Switch team on given client and kill/respawn him
|
||||
|
@ -981,13 +981,13 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
//if(m_pController->CanChangeTeam(pPlayer, pMsg->m_Number))
|
||||
//{
|
||||
//CCharacter* pChr=GetPlayerChar(ClientId);
|
||||
if(pPlayer->GetTeam()==-1 && pPlayer->m_InfoSaved)
|
||||
if(p->GetTeam()==-1 && p->m_InfoSaved)
|
||||
SendChatTarget(ClientId,"Use /pause first then you can kill");
|
||||
else{
|
||||
pPlayer->m_Last_SetTeam = Server()->Tick();
|
||||
if(pPlayer->GetTeam() == -1 || pMsg->m_Team == -1)
|
||||
p->m_Last_SetTeam = Server()->Tick();
|
||||
if(p->GetTeam() == -1 || pMsg->m_Team == -1)
|
||||
m_VoteUpdate = true;
|
||||
pPlayer->SetTeam(pMsg->m_Team);
|
||||
p->SetTeam(pMsg->m_Team);
|
||||
}
|
||||
|
||||
//if(pChr && pMsg->m_Number!=-1 && pChr->m_Paused)
|
||||
|
@ -1008,7 +1008,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
}
|
||||
else if (MsgId == NETMSGTYPE_CL_ISDDRACE)
|
||||
{
|
||||
pPlayer->m_IsUsingDDRaceClient = true;
|
||||
p->m_IsUsingDDRaceClient = true;
|
||||
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "%d use DDRace Client", ClientId);
|
||||
|
@ -1044,20 +1044,18 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, -1);
|
||||
}
|
||||
}
|
||||
else if(MsgId == NETMSGTYPE_CL_CHANGEINFO || MsgId == NETMSGTYPE_CL_STARTINFO)
|
||||
else if (MsgId == NETMSGTYPE_CL_CHANGEINFO || MsgId == NETMSGTYPE_CL_STARTINFO)
|
||||
{
|
||||
CNetMsg_Cl_ChangeInfo *pMsg = (CNetMsg_Cl_ChangeInfo *)pRawMsg;
|
||||
|
||||
if(/*g_Config.m_SvSpamprotection &&*/ pPlayer->m_Last_ChangeInfo && pPlayer->m_Last_ChangeInfo + Server()->TickSpeed() * g_Config.m_SvInfoChangeDelay > Server()->Tick())
|
||||
if(g_Config.m_SvSpamprotection && p->m_Last_ChangeInfo && p->m_Last_ChangeInfo + Server()->TickSpeed() * g_Config.m_SvInfoChangeDelay > Server()->Tick())
|
||||
return;
|
||||
|
||||
pPlayer->m_Last_ChangeInfo = time_get();
|
||||
if(!pPlayer->m_ColorSet|| g_Config.m_SvAllowColorChange)
|
||||
{
|
||||
pPlayer->m_TeeInfos.m_UseCustomColor = pMsg->m_UseCustomColor;
|
||||
pPlayer->m_TeeInfos.m_ColorBody = pMsg->m_ColorBody;
|
||||
pPlayer->m_TeeInfos.m_ColorFeet = pMsg->m_ColorFeet;
|
||||
}
|
||||
p->m_Last_ChangeInfo = Server()->Tick();
|
||||
|
||||
p->m_TeeInfos.m_UseCustomColor = pMsg->m_UseCustomColor;
|
||||
p->m_TeeInfos.m_ColorBody = pMsg->m_ColorBody;
|
||||
p->m_TeeInfos.m_ColorFeet = pMsg->m_ColorFeet;
|
||||
|
||||
// copy old name
|
||||
char aOldName[MAX_NAME_LENGTH];
|
||||
|
@ -1072,9 +1070,9 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
}
|
||||
|
||||
// set skin
|
||||
str_copy(pPlayer->m_TeeInfos.m_SkinName, pMsg->m_pSkin, sizeof(pPlayer->m_TeeInfos.m_SkinName));
|
||||
str_copy(p->m_TeeInfos.m_SkinName, pMsg->m_pSkin, sizeof(p->m_TeeInfos.m_SkinName));
|
||||
|
||||
//m_pController->OnPlayerInfoChange(pPlayer);
|
||||
//m_pController->OnPlayerInfoChange(p);
|
||||
|
||||
if(MsgId == NETMSGTYPE_CL_STARTINFO)
|
||||
{
|
||||
|
@ -1102,13 +1100,13 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
{
|
||||
CNetMsg_Cl_Emoticon *pMsg = (CNetMsg_Cl_Emoticon *)pRawMsg;
|
||||
|
||||
if(/*g_Config.m_SvSpamprotection &&*/ pPlayer->m_Last_Emote && pPlayer->m_Last_Emote+Server()->TickSpeed()*g_Config.m_SvEmoticonDelay > Server()->Tick())
|
||||
if(g_Config.m_SvSpamprotection && p->m_Last_Emote && p->m_Last_Emote+Server()->TickSpeed()*g_Config.m_SvEmoticonDelay > Server()->Tick())
|
||||
return;
|
||||
|
||||
pPlayer->m_Last_Emote = Server()->Tick();
|
||||
p->m_Last_Emote = Server()->Tick();
|
||||
|
||||
SendEmoticon(ClientId, pMsg->m_Emoticon);
|
||||
CCharacter* pChr = pPlayer->GetCharacter();
|
||||
CCharacter* pChr = p->GetCharacter();
|
||||
if(pChr && g_Config.m_SvEmotionalTees && pChr->m_EyeEmote)
|
||||
{
|
||||
switch(pMsg->m_Emoticon)
|
||||
|
@ -1145,12 +1143,12 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
|
||||
else if(MsgId == NETMSGTYPE_CL_KILL && !m_World.m_Paused)
|
||||
{
|
||||
if(pPlayer->m_Last_Kill && pPlayer->m_Last_Kill+Server()->TickSpeed() * g_Config.m_SvKillDelay > Server()->Tick())
|
||||
if(p->m_Last_Kill && p->m_Last_Kill+Server()->TickSpeed() * g_Config.m_SvKillDelay > Server()->Tick())
|
||||
return;
|
||||
|
||||
pPlayer->m_Last_Kill = Server()->Tick();
|
||||
pPlayer->KillCharacter(WEAPON_SELF);
|
||||
pPlayer->m_RespawnTick = Server()->Tick()+Server()->TickSpeed() * g_Config.m_SvSuicidePenalty;
|
||||
p->m_Last_Kill = Server()->Tick();
|
||||
p->KillCharacter(WEAPON_SELF);
|
||||
p->m_RespawnTick = Server()->Tick()+Server()->TickSpeed() * g_Config.m_SvSuicidePenalty;
|
||||
}
|
||||
}
|
||||
void CGameContext::ConTuneParam(IConsole::IResult *pResult, void *pUserData, int ClientId)
|
||||
|
|
|
@ -113,7 +113,7 @@ class CGameContext : public IGameServer
|
|||
static void ConCredits(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConInfo(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConHelp(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConFlags(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConSettings(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConRules(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConKill(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
static void ConTogglePause(IConsole::IResult *pResult, void *pUserData, int ClientId);
|
||||
|
|
|
@ -92,8 +92,6 @@ public:
|
|||
|
||||
bool m_IsUsingDDRaceClient;
|
||||
|
||||
bool m_ColorSet; // Set if player changed color at least once
|
||||
|
||||
int m_Starttime;
|
||||
int m_Refreshtime;
|
||||
int m_DDRaceState;
|
||||
|
|
|
@ -66,6 +66,41 @@ bool CSqlScore::Connect()
|
|||
dbg_msg("SQL", "ERROR: SQL connection failed");
|
||||
return false;
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
// ...
|
||||
dbg_msg("SQL", "1 %s",ex.what());
|
||||
|
||||
} catch (const std::string& ex) {
|
||||
// ...
|
||||
dbg_msg("SQL", "2 %s",ex.c_str());
|
||||
}
|
||||
catch( int )
|
||||
{
|
||||
dbg_msg("SQL", "3 %s");
|
||||
}
|
||||
catch( float )
|
||||
{
|
||||
dbg_msg("SQL", "4 %s");
|
||||
}
|
||||
|
||||
catch( char[] )
|
||||
{
|
||||
dbg_msg("SQL", "5 %s");
|
||||
}
|
||||
|
||||
catch( char )
|
||||
{
|
||||
dbg_msg("SQL", "6 %s");
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
char aBuf[256];
|
||||
//str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
|
||||
dbg_msg("SQL", "Error");
|
||||
|
||||
dbg_msg("SQL", "ERROR: SQL connection failed");
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -490,4 +525,4 @@ void CSqlScore::NormalizeMapname(char *pString) {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* CSqlScore Class by Sushi Tee*/
|
||||
#if defined(CONF_SQL)
|
||||
#ifndef GAME_SERVER_SQLSCORE_H
|
||||
#define GAME_SERVER_SQLSCORE_H
|
||||
|
||||
|
@ -64,7 +63,12 @@ struct CSqlScoreData
|
|||
{
|
||||
CSqlScore *m_pSqlData;
|
||||
int m_ClientID;
|
||||
#if defined(CONF_FAMILY_WINDOWS)
|
||||
char m_aName[16];
|
||||
#else
|
||||
char m_aName[MAX_NAME_LENGTH];
|
||||
#endif
|
||||
|
||||
float m_Time;
|
||||
float m_aCpCurrent[NUM_CHECKPOINTS];
|
||||
int m_Num;
|
||||
|
@ -73,4 +77,3 @@ struct CSqlScoreData
|
|||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -63,7 +63,7 @@ MACRO_CONFIG_INT(SvScorelimit, sv_scorelimit, 20, 0, 1000, CFGFLAG_SERVER, "Scor
|
|||
MACRO_CONFIG_INT(SvTimelimit, sv_timelimit, 0, 0, 1000, CFGFLAG_SERVER, "Time limit in minutes (0 disables)")
|
||||
MACRO_CONFIG_STR(SvGametype, sv_gametype, 32, "dm", CFGFLAG_SERVER, "Game type (dm, tdm, ctf)")*/
|
||||
MACRO_CONFIG_INT(SvTournamentMode, sv_tournament_mode, 0, 0, 1, CFGFLAG_SERVER, "Tournament mode. When enabled, players joins the server as spectator", 3)
|
||||
//MACRO_CONFIG_INT(SvSpamprotection, sv_spamprotection, 1, 0, 1, CFGFLAG_SERVER, "Spam protection")
|
||||
MACRO_CONFIG_INT(SvSpamprotection, sv_spamprotection, 1, 0, 1, CFGFLAG_SERVER, "Spam protection",3)
|
||||
|
||||
MACRO_CONFIG_INT(SvSpectatorSlots, sv_spectator_slots, 0, 0, MAX_CLIENTS, CFGFLAG_SERVER, "Number of slots to reserve for spectators", 3)
|
||||
//MACRO_CONFIG_INT(SvTeambalanceTime, sv_teambalance_time, 1, 0, 1000, CFGFLAG_SERVER, "How many minutes to wait before autobalancing teams")
|
||||
|
|
Loading…
Reference in a new issue