diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 4f6f82a0066413bcc989c3d57d915c0add00b696..2deccfd3f763b320ea1358ee0fdeb3368c8a95dc 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
WarmupTime: Word;
SpawnInvul: Word;
ItemRespawnTime: Word;
WarmupTime: Word;
SpawnInvul: Word;
ItemRespawnTime: Word;
+ RulezTimeMultiplier: Word;
MaxLives: Byte;
Options: LongWord;
WAD: String;
MaxLives: Byte;
Options: LongWord;
WAD: String;
procedure g_Game_Announce_GoodShot(SpawnerUID: Word);
procedure g_Game_Announce_KillCombo(Param: Integer);
procedure g_Game_Announce_BodyKill(SpawnerUID: Word);
procedure g_Game_Announce_GoodShot(SpawnerUID: Word);
procedure g_Game_Announce_KillCombo(Param: Integer);
procedure g_Game_Announce_BodyKill(SpawnerUID: Word);
+procedure g_Game_Effect_Bubbles(fX, fY: Integer; count: Word; devX, devY: Byte; Silent: Boolean = False);
procedure g_Game_StartVote(Command, Initiator: string);
procedure g_Game_CheckVote;
procedure g_TakeScreenShot(Filename: string = '');
procedure g_Game_StartVote(Command, Initiator: string);
procedure g_Game_CheckVote;
procedure g_TakeScreenShot(Filename: string = '');
GAME_OPTION_TEAMABSORBDAMAGE = 1024;
GAME_OPTION_ALLOWDROPFLAG = 2048;
GAME_OPTION_THROWFLAG = 4096;
GAME_OPTION_TEAMABSORBDAMAGE = 1024;
GAME_OPTION_ALLOWDROPFLAG = 2048;
GAME_OPTION_THROWFLAG = 4096;
+ GAME_OPTION_RULEZRANDOM = 8192;
STATE_NONE = 0;
STATE_MENU = 1;
STATE_NONE = 0;
STATE_MENU = 1;
begin
if a.Spectator then Result := 1
else if b.Spectator then Result := -1
begin
if a.Spectator then Result := 1
else if b.Spectator then Result := -1
- else if a.Frags < b.Frags then Result := 1
- else if a.Frags > b.Frags then Result := -1
- else if a.Deaths < b.Deaths then Result := -1
- else if a.Deaths > b.Deaths then Result := 1
- else if a.Kills < b.Kills then Result := -1
- else Result := 1;
+ else if a.Assists < b.Assists then Result := 1
+ else if a.Assists > b.Assists then Result := -1
+ else if a.Frags < b.Frags then Result := 1
+ else if a.Frags > b.Frags then Result := -1
+ else if a.Deaths < b.Deaths then Result := -1
+ else if a.Deaths > b.Deaths then Result := 1
+ else if a.Kills < b.Kills then Result := -1
+ else Result := 1;
end;
procedure SortGameStat(var stat: TPlayerStatArray);
end;
procedure SortGameStat(var stat: TPlayerStatArray);
// saves a shitty CSV containing the game stats passed to it
procedure SaveGameStat(Stat: TEndCustomGameStat; Path: string);
// saves a shitty CSV containing the game stats passed to it
procedure SaveGameStat(Stat: TEndCustomGameStat; Path: string);
-var
+var
s: TextFile;
dir, fname, map, mode, etime: String;
I: Integer;
s: TextFile;
dir, fname, map, mode, etime: String;
I: Integer;
// if it's a coop game: monsters killed, monsters total, secrets found, secrets total
// otherwise nothing
if Stat.GameMode in [GM_TDM, GM_CTF] then
// if it's a coop game: monsters killed, monsters total, secrets found, secrets total
// otherwise nothing
if Stat.GameMode in [GM_TDM, GM_CTF] then
- WriteLn(s,
+ WriteLn(s,
Format('red_score,blue_score' + LineEnding + '%d,%d', [Stat.TeamStat[TEAM_RED].Score, Stat.TeamStat[TEAM_BLUE].Score]))
else if Stat.GameMode in [GM_COOP, GM_SINGLE] then
WriteLn(s,
Format('mon_killed,mon_total,secrets_found,secrets_total' + LineEnding + '%d,%d,%d,%d',[gCoopMonstersKilled, gTotalMonsters, gCoopSecretsFound, gSecretsCount]));
// lines 3-...: team, player name, frags, deaths
Format('red_score,blue_score' + LineEnding + '%d,%d', [Stat.TeamStat[TEAM_RED].Score, Stat.TeamStat[TEAM_BLUE].Score]))
else if Stat.GameMode in [GM_COOP, GM_SINGLE] then
WriteLn(s,
Format('mon_killed,mon_total,secrets_found,secrets_total' + LineEnding + '%d,%d,%d,%d',[gCoopMonstersKilled, gTotalMonsters, gCoopSecretsFound, gSecretsCount]));
// lines 3-...: team, player name, frags, deaths
- WriteLn(s, 'team,name,frags,deaths');
+ WriteLn(s, 'team,name,frags,assists,deaths');
for I := Low(Stat.PlayerStat) to High(Stat.PlayerStat) do
with Stat.PlayerStat[I] do
for I := Low(Stat.PlayerStat) to High(Stat.PlayerStat) do
with Stat.PlayerStat[I] do
- WriteLn(s, Format('%d,%s,%d,%d', [Team, dquoteStr(Name), Frags, Deaths]));
+ WriteLn(s, Format('%d,%s,%d,%d', [Team, dquoteStr(Name), Frags, Assists, Deaths]));
except
g_Console_Add(Format(_lc[I_CONSOLE_ERROR_WRITE], [fname]));
end;
except
g_Console_Add(Format(_lc[I_CONSOLE_ERROR_WRITE], [fname]));
end;
CloseFile(s);
end;
CloseFile(s);
end;
+procedure ClearDebugCvars();
+begin
+ g_debug_Sounds := False;
+ g_debug_Frames := False;
+ g_debug_WinMsgs := False;
+ g_debug_MonsterOff := False;
+ g_debug_BotAIOff := 0;
+ g_debug_HealthBar := False;
+ g_Debug_Player := False;
+end;
+
function g_Game_ModeToText(Mode: Byte): string;
begin
Result := '';
function g_Game_ModeToText(Mode: Byte): string;
begin
Result := '';
function g_Game_IsNet(): Boolean;
begin
Result := (gGameSettings.GameType in [GT_SERVER, GT_CLIENT]);
function g_Game_IsNet(): Boolean;
begin
Result := (gGameSettings.GameType in [GT_SERVER, GT_CLIENT]);
-
- if gGameSettings.GameType in [GT_SERVER, GT_CLIENT] then
- begin
- // set debug options to false to avoid cheaters
- g_debug_Sounds := False;
- g_debug_Frames := False;
- g_debug_WinMsgs := False;
- g_debug_MonsterOff := False;
- g_debug_BotAIOff := 0;
- g_debug_HealthBar := False;
- g_Debug_Player := False;
- Exit;
- end;
end;
function g_Game_IsServer(): Boolean;
end;
function g_Game_IsServer(): Boolean;
Num := a;
Name := gPlayers[a].Name;
Frags := gPlayers[a].Frags;
Num := a;
Name := gPlayers[a].Name;
Frags := gPlayers[a].Frags;
+ Assists := gPlayers[a].Assists;
Deaths := gPlayers[a].Death;
Kills := gPlayers[a].Kills;
Team := gPlayers[a].Team;
Deaths := gPlayers[a].Death;
Kills := gPlayers[a].Kills;
Team := gPlayers[a].Team;
e_TextureFontPrintEx(x+16, _y, s1, gStdFont, r, g, b, 1);
e_TextureFontPrintEx(x+w1+16, _y, IntToStr(gTeamStat[a].Score),
gStdFont, r, g, b, 1);
e_TextureFontPrintEx(x+16, _y, s1, gStdFont, r, g, b, 1);
e_TextureFontPrintEx(x+w1+16, _y, IntToStr(gTeamStat[a].Score),
gStdFont, r, g, b, 1);
+ e_TextureFontPrintEx(x+w1+w2, _y, _lc[I_GAME_FRAGS],
+ gStdFont, r, g, b, 1);
+ e_TextureFontPrintEx(x+w1+w2+72, _y, _lc[I_GAME_ASSISTS],
+ gStdFont, r, g, b, 1);
_y := _y+ch+(ch div 4);
e_DrawLine(1, x+16, _y, x+w-16, _y, r, g, b);
_y := _y+ch+(ch div 4);
e_DrawLine(1, x+16, _y, x+w-16, _y, r, g, b);
e_TextureFontPrintEx(x+w1+16, _y, Format(_lc[I_GAME_PING_MS], [Ping, Loss]), gStdFont, rr, gg, bb, 1);
// Ôðàãè
e_TextureFontPrintEx(x+w1+w2+16, _y, IntToStr(Frags), gStdFont, rr, gg, bb, 1);
e_TextureFontPrintEx(x+w1+16, _y, Format(_lc[I_GAME_PING_MS], [Ping, Loss]), gStdFont, rr, gg, bb, 1);
// Ôðàãè
e_TextureFontPrintEx(x+w1+w2+16, _y, IntToStr(Frags), gStdFont, rr, gg, bb, 1);
+ // Àññèñòû
+ e_TextureFontPrintEx(x+w1+w2+72, _y, IntToStr(Assists), gStdFont, rr, gg, bb, 1);
// Ñìåðòè
e_TextureFontPrintEx(x+w1+w2+w3+16, _y, IntToStr(Deaths), gStdFont, rr, gg, bb, 1);
_y := _y+ch;
// Ñìåðòè
e_TextureFontPrintEx(x+w1+w2+w3+16, _y, IntToStr(Deaths), gStdFont, rr, gg, bb, 1);
_y := _y+ch;
else
e_TextureFontPrintEx(x+16, _y, Name, gStdFont, rr, gg, bb, 1);
e_TextureFontPrintEx(x+w1+16, _y, IntToStr(Frags), gStdFont, rr, gg, bb, 1);
else
e_TextureFontPrintEx(x+16, _y, Name, gStdFont, rr, gg, bb, 1);
e_TextureFontPrintEx(x+w1+16, _y, IntToStr(Frags), gStdFont, rr, gg, bb, 1);
+ e_TextureFontPrintEx(x+w1+72, _y, IntToStr(Assists), gStdFont, rr, gg, bb, 1);
e_TextureFontPrintEx(x+w1+w2+16, _y, IntToStr(Deaths), gStdFont, rr, gg, bb, 1);
_y := _y+24;
end;
e_TextureFontPrintEx(x+w1+w2+16, _y, IntToStr(Deaths), gStdFont, rr, gg, bb, 1);
_y := _y+24;
end;
gGameSettings.Options := gGameSettings.Options + GAME_OPTION_BOTVSMONSTER;
gGameSettings.Options := gGameSettings.Options + GAME_OPTION_TEAMHITPROJECTILE;
gGameSettings.Options := gGameSettings.Options + GAME_OPTION_TEAMHITTRACE;
gGameSettings.Options := gGameSettings.Options + GAME_OPTION_BOTVSMONSTER;
gGameSettings.Options := gGameSettings.Options + GAME_OPTION_TEAMHITPROJECTILE;
gGameSettings.Options := gGameSettings.Options + GAME_OPTION_TEAMHITTRACE;
+ gGameSettings.Options := gGameSettings.Options + GAME_OPTION_RULEZRANDOM;
gSwitchGameMode := GM_SINGLE;
gLMSRespawn := LMS_RESPAWN_NONE;
gSwitchGameMode := GM_SINGLE;
gLMSRespawn := LMS_RESPAWN_NONE;
g_Game_ClearLoading();
g_Game_ClearLoading();
+ ClearDebugCvars();
+
// Íàñòðîéêè èãðû:
gGameSettings.GameType := GT_SERVER;
gGameSettings.GameMode := GameMode;
// Íàñòðîéêè èãðû:
gGameSettings.GameType := GT_SERVER;
gGameSettings.GameMode := GameMode;
g_Game_ClearLoading();
g_Game_ClearLoading();
+ ClearDebugCvars();
+
// Íàñòðîéêè èãðû:
gGameSettings.GameType := GT_CLIENT;
// Íàñòðîéêè èãðû:
gGameSettings.GameType := GT_CLIENT;
end;
end;
end;
end;
- g_Net_UnbanNonPermHosts();
+ g_Net_UnbanNonPerm();
end;
if gLastMap then
end;
if gLastMap then
if gGameSettings.GameMode = GM_COOP then
begin
gPlayers[i].Frags := 0;
if gGameSettings.GameMode = GM_COOP then
begin
gPlayers[i].Frags := 0;
+ gPlayers[i].Assists := 0;
gPlayers[i].RecallState;
end;
if (gPlayer1 = nil) and (gSpectLatchPID1 > 0) then
gPlayers[i].RecallState;
end;
if (gPlayer1 = nil) and (gSpectLatchPID1 > 0) then
a, b: Integer;
stat: TPlayerStatArray;
cmd: string;
a, b: Integer;
stat: TPlayerStatArray;
cmd: string;
+ it: PItem;
procedure ParseGameFlag(Flag: LongWord; OffMsg, OnMsg: TStrings_Locale; OnMapChange: Boolean = False);
var
procedure ParseGameFlag(Flag: LongWord; OffMsg, OnMsg: TStrings_Locale; OnMapChange: Boolean = False);
var
begin
ParseGameFlag(GAME_OPTION_TEAMHITPROJECTILE, I_MSG_FRIENDLY_PROJECT_TRACE_OFF, I_MSG_FRIENDLY_PROJECT_TRACE_ON);
end
begin
ParseGameFlag(GAME_OPTION_TEAMHITPROJECTILE, I_MSG_FRIENDLY_PROJECT_TRACE_OFF, I_MSG_FRIENDLY_PROJECT_TRACE_ON);
end
+ else if cmd = 'g_powerup_randomize_respawn' then
+ begin
+ ParseGameFlag(GAME_OPTION_RULEZRANDOM, I_MSG_RULEZ_RANDOM_OFF, I_MSG_RULEZ_RANDOM_ON);
+ end
else if cmd = 'g_weaponstay' then
begin
ParseGameFlag(GAME_OPTION_WEAPONSTAY, I_MSG_WEAPONSTAY_OFF, I_MSG_WEAPONSTAY_ON);
else if cmd = 'g_weaponstay' then
begin
ParseGameFlag(GAME_OPTION_WEAPONSTAY, I_MSG_WEAPONSTAY_OFF, I_MSG_WEAPONSTAY_ON);
g_Console_Add(Format('%s %d', [cmd, Integer(gsItemRespawnTime)]));
if g_Game_IsServer then g_Console_Add(_lc[I_MSG_ONMAPCHANGE]);
end
g_Console_Add(Format('%s %d', [cmd, Integer(gsItemRespawnTime)]));
if g_Game_IsServer then g_Console_Add(_lc[I_MSG_ONMAPCHANGE]);
end
+ else if cmd = 'g_powerup_time_multiplier' then
+ begin
+ if Length(P) > 1 then
+ begin
+ gsRulezTimeMultiplier := nclamp(StrToIntDef(P[1], gsRulezTimeMultiplier), 0, $FFFF);
+ if g_Game_IsServer then
+ begin
+ gGameSettings.RulezTimeMultiplier := gsRulezTimeMultiplier;
+ if g_Game_IsNet then MH_SEND_GameSettings;
+ end;
+ end;
+
+ g_Console_Add(Format('%s %d', [cmd, Integer(gsRulezTimeMultiplier)]));
+ if g_Game_IsServer then g_Console_Add(_lc[I_MSG_ONMAPCHANGE]);
+ end
else if cmd = 'sv_intertime' then
begin
if (Length(P) > 1) then
else if cmd = 'sv_intertime' then
begin
if (Length(P) > 1) then
begin
a := StrToIntDef(p[1], 0);
g_Force_Model_Set(a);
begin
a := StrToIntDef(p[1], 0);
g_Force_Model_Set(a);
+ if (g_Force_Model_Get() <> 0) and (gPlayers <> nil) then
+ begin
+ for a := Low(gPlayers) to High(gPlayers) do
+ begin
+ if (gPlayers[a] <> nil) then
+ begin
+ if (gPlayers[a].UID = gPlayer1.UID) then
+ continue
+ else if (gPlayer2 <> nil) and (gPlayers[a].UID = gPlayer2.UID) then
+ continue;
+ gPlayers[a].setModel(g_Forced_Model_GetName());
+ end;
+ end
+ end
+ else if (g_Force_Model_Get() = 0) and (gPlayers <> nil) then
+ begin
+ for a := Low(gPlayers) to High(gPlayers) do
+ begin
+ if (gPlayers[a] <> nil) then
+ begin
+ if (gPlayers[a].UID = gPlayer1.UID) then
+ continue
+ else if (gPlayer2 <> nil) and (gPlayers[a].UID = gPlayer2.UID) then
+ continue;
+ gPlayers[a].setModel(gPlayers[a].FActualModelName);
+ end;
+ end
+ end
end
end
else if cmd = 'g_force_model_name' then
end
end
else if cmd = 'g_force_model_name' then
begin
cmd := b_Text_Unformat(P[1]);
g_Forced_Model_SetName(cmd);
begin
cmd := b_Text_Unformat(P[1]);
g_Forced_Model_SetName(cmd);
- if (gGameSettings.GameType <> GT_SINGLE) and (g_Force_Model_Get() <> 0) and (gPlayers <> nil) then
+ if (g_Force_Model_Get() <> 0) and (gPlayers <> nil) then
begin
for a := Low(gPlayers) to High(gPlayers) do
begin
begin
for a := Low(gPlayers) to High(gPlayers) do
begin
// if someone has a higher score, set it to that instead
gsScoreLimit := max(gsScoreLimit, b);
gGameSettings.ScoreLimit := gsScoreLimit;
// if someone has a higher score, set it to that instead
gsScoreLimit := max(gsScoreLimit, b);
gGameSettings.ScoreLimit := gsScoreLimit;
-
+
if g_Game_IsNet then MH_SEND_GameSettings;
end;
end;
if g_Game_IsNet then MH_SEND_GameSettings;
end;
end;
'p1_priority_kastet':
begin
if (Length(P) = 2) then
'p1_priority_kastet':
begin
if (Length(P) = 2) then
- gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
end;
'p2_priority_kastet':
begin
if (Length(P) = 2) then
end;
'p2_priority_kastet':
begin
if (Length(P) = 2) then
- gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
- end;
+ gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ end;
'p1_priority_saw':
begin
if (Length(P) = 2) then
'p1_priority_saw':
begin
if (Length(P) = 2) then
'p1_priority_pistol':
begin
if (Length(P) = 2) then
'p1_priority_pistol':
begin
if (Length(P) = 2) then
- gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
end;
'p2_priority_pistol':
begin
if (Length(P) = 2) then
end;
'p2_priority_pistol':
begin
if (Length(P) = 2) then
- gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
- end;
+ gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ end;
'p1_priority_shotgun1':
begin
if (Length(P) = 2) then
'p1_priority_shotgun1':
begin
if (Length(P) = 2) then
begin
if (Length(P) = 2) then
gPlayer2Settings.WeaponPreferences[WEAPON_FLAMETHROWER] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
begin
if (Length(P) = 2) then
gPlayer2Settings.WeaponPreferences[WEAPON_FLAMETHROWER] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
- end;
+ end;
'p1_priority_berserk':
begin
if (Length(P) = 2) then
'p1_priority_berserk':
begin
if (Length(P) = 2) then
- gPlayer1Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ gPlayer1Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
end;
'p2_priority_berserk':
begin
if (Length(P) = 2) then
end;
'p2_priority_berserk':
begin
if (Length(P) = 2) then
- gPlayer2Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
- end;
+ gPlayer2Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ end;
end;
end;
end;
end;
nm: Boolean;
listen: LongWord;
found: Boolean;
nm: Boolean;
listen: LongWord;
found: Boolean;
+ t: Byte;
begin
// Îáùèå êîìàíäû:
cmd := LowerCase(P[0]);
begin
// Îáùèå êîìàíäû:
cmd := LowerCase(P[0]);
if (pl <> nil) then
begin
s := g_Net_ClientName_ByID(pl^.ID);
if (pl <> nil) then
begin
s := g_Net_ClientName_ByID(pl^.ID);
- enet_peer_disconnect(pl^.Peer, NET_DISC_KICK);
+ g_Net_Host_Kick(pl^.ID, NET_DISC_KICK);
g_Console_Add(Format(_lc[I_PLAYER_KICK], [s]));
MH_SEND_GameEvent(NET_EV_PLAYER_KICK, 0, s);
g_Net_Slist_ServerPlayerLeaves();
g_Console_Add(Format(_lc[I_PLAYER_KICK], [s]));
MH_SEND_GameEvent(NET_EV_PLAYER_KICK, 0, s);
g_Net_Slist_ServerPlayerLeaves();
if NetClients[a].Used and (NetClients[a].Peer <> nil) then
begin
s := g_Net_ClientName_ByID(NetClients[a].ID);
if NetClients[a].Used and (NetClients[a].Peer <> nil) then
begin
s := g_Net_ClientName_ByID(NetClients[a].ID);
- enet_peer_disconnect(NetClients[a].Peer, NET_DISC_KICK);
+ g_Net_Host_Kick(NetClients[a].ID, NET_DISC_KICK);
g_Console_Add(Format(_lc[I_PLAYER_KICK], [s]));
MH_SEND_GameEvent(NET_EV_PLAYER_KICK, 0, s);
g_Net_Slist_ServerPlayerLeaves();
g_Console_Add(Format(_lc[I_PLAYER_KICK], [s]));
MH_SEND_GameEvent(NET_EV_PLAYER_KICK, 0, s);
g_Net_Slist_ServerPlayerLeaves();
if (pl <> nil) and pl^.Used and (pl^.Peer <> nil) then
begin
s := g_Net_ClientName_ByID(pl^.ID);
if (pl <> nil) and pl^.Used and (pl^.Peer <> nil) then
begin
s := g_Net_ClientName_ByID(pl^.ID);
- enet_peer_disconnect(pl^.Peer, NET_DISC_KICK);
+ g_Net_Host_Kick(pl^.ID, NET_DISC_KICK);
g_Console_Add(Format(_lc[I_PLAYER_KICK], [s]));
MH_SEND_GameEvent(NET_EV_PLAYER_KICK, 0, s);
g_Net_Slist_ServerPlayerLeaves();
g_Console_Add(Format(_lc[I_PLAYER_KICK], [s]));
MH_SEND_GameEvent(NET_EV_PLAYER_KICK, 0, s);
g_Net_Slist_ServerPlayerLeaves();
pl := g_Net_Client_ByName(P[1]);
if (pl <> nil) then
pl := g_Net_Client_ByName(P[1]);
if (pl <> nil) then
- begin
- s := g_Net_ClientName_ByID(pl^.ID);
- g_Net_BanHost(pl^.Peer^.address.host, False);
- enet_peer_disconnect(pl^.Peer, NET_DISC_TEMPBAN);
- g_Console_Add(Format(_lc[I_PLAYER_BAN], [s]));
- MH_SEND_GameEvent(NET_EV_PLAYER_BAN, 0, s);
- g_Net_Slist_ServerPlayerLeaves();
- end else
+ g_Net_Host_Ban(pl, False)
+ else
g_Console_Add(Format(_lc[I_NET_ERR_NAME404], [P[1]]));
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
g_Console_Add(Format(_lc[I_NET_ERR_NAME404], [P[1]]));
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
a := StrToIntDef(P[1], 0);
if (NetClients <> nil) and (a <= High(NetClients)) then
if NetClients[a].Used and (NetClients[a].Peer <> nil) then
a := StrToIntDef(P[1], 0);
if (NetClients <> nil) and (a <= High(NetClients)) then
if NetClients[a].Used and (NetClients[a].Peer <> nil) then
- begin
- s := g_Net_ClientName_ByID(NetClients[a].ID);
- g_Net_BanHost(NetClients[a].Peer^.address.host, False);
- enet_peer_disconnect(NetClients[a].Peer, NET_DISC_TEMPBAN);
- g_Console_Add(Format(_lc[I_PLAYER_BAN], [s]));
- MH_SEND_GameEvent(NET_EV_PLAYER_BAN, 0, s);
- g_Net_Slist_ServerPlayerLeaves();
- end;
+ g_Net_Host_Ban(pl, False);
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
end
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
end
a := StrToIntDef(P[1], 0);
pl := g_Net_Client_ByPlayer(a);
if (pl <> nil) and pl^.Used and (pl^.Peer <> nil) then
a := StrToIntDef(P[1], 0);
pl := g_Net_Client_ByPlayer(a);
if (pl <> nil) and pl^.Used and (pl^.Peer <> nil) then
- begin
- s := g_Net_ClientName_ByID(pl^.ID);
- g_Net_BanHost(pl^.Peer^.address.host, False);
- enet_peer_disconnect(pl^.Peer, NET_DISC_TEMPBAN);
- g_Console_Add(Format(_lc[I_PLAYER_BAN], [s]));
- MH_SEND_GameEvent(NET_EV_PLAYER_BAN, 0, s);
- g_Net_Slist_ServerPlayerLeaves();
- end;
+ g_Net_Host_Ban(pl, False);
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
end
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
end
pl := g_Net_Client_ByName(P[1]);
if (pl <> nil) then
pl := g_Net_Client_ByName(P[1]);
if (pl <> nil) then
- begin
- s := g_Net_ClientName_ByID(pl^.ID);
- g_Net_BanHost(pl^.Peer^.address.host);
- enet_peer_disconnect(pl^.Peer, NET_DISC_BAN);
- g_Net_SaveBanList();
- g_Console_Add(Format(_lc[I_PLAYER_BAN], [s]));
- MH_SEND_GameEvent(NET_EV_PLAYER_BAN, 0, s);
- g_Net_Slist_ServerPlayerLeaves();
- end else
+ g_Net_Host_Ban(pl, True)
+ else
g_Console_Add(Format(_lc[I_NET_ERR_NAME404], [P[1]]));
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
g_Console_Add(Format(_lc[I_NET_ERR_NAME404], [P[1]]));
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
a := StrToIntDef(P[1], 0);
if (NetClients <> nil) and (a <= High(NetClients)) then
if NetClients[a].Used and (NetClients[a].Peer <> nil) then
a := StrToIntDef(P[1], 0);
if (NetClients <> nil) and (a <= High(NetClients)) then
if NetClients[a].Used and (NetClients[a].Peer <> nil) then
- begin
- s := g_Net_ClientName_ByID(NetClients[a].ID);
- g_Net_BanHost(NetClients[a].Peer^.address.host);
- enet_peer_disconnect(NetClients[a].Peer, NET_DISC_BAN);
- g_Net_SaveBanList();
- g_Console_Add(Format(_lc[I_PLAYER_BAN], [s]));
- MH_SEND_GameEvent(NET_EV_PLAYER_BAN, 0, s);
- g_Net_Slist_ServerPlayerLeaves();
- end;
+ g_Net_Host_Ban(@NetClients[a], True);
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
end
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
end
a := StrToIntDef(P[1], 0);
pl := g_Net_Client_ByPlayer(a);
if (pl <> nil) and pl^.Used and (pl^.Peer <> nil) then
a := StrToIntDef(P[1], 0);
pl := g_Net_Client_ByPlayer(a);
if (pl <> nil) and pl^.Used and (pl^.Peer <> nil) then
- begin
- s := g_Net_ClientName_ByID(pl^.ID);
- g_Net_BanHost(pl^.Peer^.address.host);
- enet_peer_disconnect(pl^.Peer, NET_DISC_BAN);
- g_Net_SaveBanList();
- g_Console_Add(Format(_lc[I_PLAYER_BAN], [s]));
- MH_SEND_GameEvent(NET_EV_PLAYER_BAN, 0, s);
- g_Net_Slist_ServerPlayerLeaves();
- end;
+ g_Net_Host_Ban(pl, True);
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
end
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
end
Exit;
end;
Exit;
end;
- g_Net_BanHost(P[1]);
+ g_Net_BanAddress(P[1]);
g_Net_SaveBanList();
g_Console_Add(Format(_lc[I_PLAYER_BAN], [P[1]]));
end else
g_Net_SaveBanList();
g_Console_Add(Format(_lc[I_PLAYER_BAN], [P[1]]));
end else
Exit;
end;
Exit;
end;
- if g_Net_UnbanHost(P[1]) then
+ if g_Net_UnbanAddress(P[1]) then
begin
g_Console_Add(Format(_lc[I_MSG_UNBAN_OK], [P[1]]));
g_Net_SaveBanList();
begin
g_Console_Add(Format(_lc[I_MSG_UNBAN_OK], [P[1]]));
g_Net_SaveBanList();
else if (cmd = 'addbot') or
(cmd = 'bot_add') then
begin
else if (cmd = 'addbot') or
(cmd = 'bot_add') then
begin
- if Length(P) > 2 then
- g_Bot_Add(TEAM_NONE, StrToIntDef(P[1], 2), StrToIntDef(P[2], 100))
- else if Length(P) > 1 then
- g_Bot_Add(TEAM_NONE, StrToIntDef(P[1], 2))
+ case Length(P) of
+ 1: g_Bot_Add(TEAM_NONE, 2);
+ 2: g_Bot_Add(TEAM_NONE, StrToIntDef(P[1], 2));
else
else
- g_Bot_Add(TEAM_NONE, 2);
+ g_Bot_Add(TEAM_NONE, StrToIntDef(P[1], 2), StrToIntDef(P[2], 100));
+ end;
end
else if cmd = 'bot_addlist' then
begin
end
else if cmd = 'bot_addlist' then
begin
- if Length(P) > 1 then
- begin
- if Length(P) = 2 then
- g_Bot_AddList(TEAM_NONE, P[1], StrToIntDef(P[1], -1))
- else if Length(P) = 3 then
- g_Bot_AddList(TEAM_NONE, P[1], StrToIntDef(P[1], -1), StrToIntDef(P[2], 100))
+ case Length(P) of
+ 1: g_Bot_AddList(TEAM_NONE, '');
+ 2: g_Bot_AddList(TEAM_NONE, P[1], StrToIntDef(P[1], -1));
+ else
+ if P[2] = 'red' then
+ t := TEAM_RED
+ else if P[2] = 'blue' then
+ t := TEAM_BLUE
else
else
- g_Bot_AddList(IfThen(P[2] = 'red', TEAM_RED, TEAM_BLUE), P[1], StrToIntDef(P[1], -1));
+ t := TEAM_NONE;
+
+ if Length(P) = 3
+ then g_Bot_AddList(t, P[1], StrToIntDef(P[1], -1))
+ else g_Bot_AddList(t, P[1], StrToIntDef(P[1], -1), StrToIntDef(P[3], 100));
end;
end
else if cmd = 'bot_removeall' then
end;
end
else if cmd = 'bot_removeall' then
g_Console_Add(_lc[I_MSG_GM_UNAVAIL])
end
end
g_Console_Add(_lc[I_MSG_GM_UNAVAIL])
end
end
+ else if not e_IsValidResourceName(P[1]) then
+ begin
+ g_Console_Add('wad name must not be absolute or relative');
+ end
else
begin
if g_Game_IsServer and (gGameSettings.GameType <> GT_SINGLE) then
else
begin
if g_Game_IsServer and (gGameSettings.GameType <> GT_SINGLE) then
g_Console_Add(_lc[I_MSG_GM_UNAVAIL]);
end;
end
g_Console_Add(_lc[I_MSG_GM_UNAVAIL]);
end;
end
+ else if not e_IsValidResourceName(P[1]) then
+ begin
+ g_Console_Add('wad name must not be absolute or relative');
+ end
else
begin
nm := False;
else
begin
nm := False;
DateTimeToString(date, 'yyyy-mm-dd-hh-nn-ss', t);
Filename := 'screenshot-' + date;
end;
DateTimeToString(date, 'yyyy-mm-dd-hh-nn-ss', t);
Filename := 'screenshot-' + date;
end;
-
+
name := e_CatPath(dir, Filename + '.png');
s := createDiskFile(name);
try
name := e_CatPath(dir, Filename + '.png');
s := createDiskFile(name);
try
hahasnd[Random(3)].Play();
end;
hahasnd[Random(3)].Play();
end;
+procedure g_Game_Effect_Bubbles (fX, fY: Integer; count: Word; devX, devY: Byte; Silent: Boolean);
+begin
+ g_GFX_Bubbles(fX, fY, count, devX, devY);
+ if not Silent then if Random(2) = 0
+ then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', fX, fY)
+ else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', fX, fY);
+end;
+
procedure g_Game_StartVote(Command, Initiator: string);
var
Need: Integer;
procedure g_Game_StartVote(Command, Initiator: string);
var
Need: Integer;