diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index e4cd94c8..9aad0a66 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -1766,6 +1766,11 @@ unsigned int CPlayer::GetLanguageId() return m_LangId; } +void CPlayer::SetLanguageId(unsigned int id) +{ + m_LangId = id; +} + int CPlayer::GetUserId() { if (m_UserId == -1) diff --git a/core/PlayerManager.h b/core/PlayerManager.h index 452cf559..ce31287c 100644 --- a/core/PlayerManager.h +++ b/core/PlayerManager.h @@ -82,6 +82,7 @@ public: bool IsInKickQueue(); IPlayerInfo *GetPlayerInfo(); unsigned int GetLanguageId(); + void SetLanguageId(unsigned int id); int GetUserId(); bool RunAdminCacheChecks(); void NotifyPostAdminChecks(); diff --git a/core/smn_lang.cpp b/core/smn_lang.cpp index 29aa2038..9b4a60f9 100644 --- a/core/smn_lang.cpp +++ b/core/smn_lang.cpp @@ -113,7 +113,7 @@ static cell_t sm_SetClientLanguage(IPluginContext *pContext, const cell_t *param return pContext->ThrowNativeError("Invalid client index %d", params[1]); } - player->m_LangId = params[2]; + player->SetLanguageId(params[2]); return 1; } diff --git a/extensions/sdktools/voice.cpp b/extensions/sdktools/voice.cpp index 7b4cbdb7..423c1199 100644 --- a/extensions/sdktools/voice.cpp +++ b/extensions/sdktools/voice.cpp @@ -53,7 +53,6 @@ enum ListenOverride size_t g_VoiceFlags[65]; size_t g_VoiceHookCount = 0; -int g_ClientOverrides[65]; ListenOverride g_VoiceMap[65][65]; bool g_ClientMutes[65][65]; @@ -65,10 +64,10 @@ SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *); #endif -bool DecHookCount(int amount = 1); -bool DecHookCount(int amount) +bool DecHookCount() { - g_VoiceHookCount -= amount; + g_VoiceHookCount--; + if (g_VoiceHookCount == 0) { SH_REMOVE_HOOK_MEMFUNC(IVoiceServer, SetClientListening, voiceserver, &g_SdkTools, &SDKTools::OnSetClientListening, false); @@ -89,7 +88,6 @@ void IncHookCount() void SDKTools::VoiceInit() { memset(g_VoiceMap, 0, sizeof(g_VoiceMap)); - memset(g_ClientOverrides, 0, sizeof(g_ClientOverrides)); memset(g_ClientMutes, 0, sizeof(g_ClientMutes)); SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, serverClients, this, &SDKTools::OnClientCommand, true); @@ -130,6 +128,11 @@ bool SDKTools::OnSetClientListening(int iReceiver, int iSender, bool bListen) RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, bListen, &IVoiceServer::SetClientListening, (iReceiver, iSender, false)); } + if (g_VoiceFlags[iSender] & SPEAK_MUTED) + { + RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, bListen, &IVoiceServer::SetClientListening, (iReceiver, iSender, false)); + } + if (g_VoiceMap[iReceiver][iSender] == Listen_No) { RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, bListen, &IVoiceServer::SetClientListening, (iReceiver, iSender, false)); @@ -139,11 +142,6 @@ bool SDKTools::OnSetClientListening(int iReceiver, int iSender, bool bListen) RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, bListen, &IVoiceServer::SetClientListening, (iReceiver, iSender, true)); } - if (g_VoiceFlags[iSender] & SPEAK_MUTED) - { - RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, bListen, &IVoiceServer::SetClientListening, (iReceiver, iSender, false)); - } - if ((g_VoiceFlags[iSender] & SPEAK_ALL) || (g_VoiceFlags[iReceiver] & SPEAK_LISTENALL)) { RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, bListen, &IVoiceServer::SetClientListening, (iReceiver, iSender, true)); @@ -193,6 +191,7 @@ void SDKTools::OnClientDisconnecting(int client) } g_ClientMutes[i][client] = false; + g_ClientMutes[client][i] = false; if (g_VoiceMap[i][client] != Listen_Default) { @@ -202,22 +201,19 @@ void SDKTools::OnClientDisconnecting(int client) break; } } - } - - /* Reset this client's mutes */ - memset(&g_ClientMutes[client], 0, sizeof(bool) * 65); - - /* Reset other clients who send to this client */ - if (g_ClientOverrides[client] > 0) - { - DecHookCount(g_ClientOverrides[client]); - g_ClientOverrides[client] = 0; - memset(&g_VoiceMap[client], false, sizeof(ListenOverride) * 65); + if (g_VoiceMap[client][i] != Listen_Default) + { + g_VoiceMap[client][i] = Listen_Default; + if (DecHookCount()) + { + break; + } + } } if (g_VoiceFlags[client]) { - g_VoiceFlags[client] = 0; + g_VoiceFlags[client] = SPEAK_NORMAL; DecHookCount(); } } @@ -294,13 +290,11 @@ static cell_t SetClientListening(IPluginContext *pContext, const cell_t *params) if (g_VoiceMap[r][s] == Listen_Default && params[3] != Listen_Default) { g_VoiceMap[r][s] = (ListenOverride) params[3]; - g_ClientOverrides[r]++; IncHookCount(); } else if (g_VoiceMap[r][s] != Listen_Default && params[3] == Listen_Default) { g_VoiceMap[r][s] = (ListenOverride) params[3]; - g_ClientOverrides[r]--; DecHookCount(); } else diff --git a/tools/buildbot/symstore.pl b/tools/buildbot/symstore.pl index c16c3355..f7003d6d 100755 --- a/tools/buildbot/symstore.pl +++ b/tools/buildbot/symstore.pl @@ -10,13 +10,8 @@ require 'helpers.pm'; chdir('..'); chdir('..'); -our $SSH = 'ssh -i ../../smpvkey'; - open(PDBLOG, '../OUTPUT/pdblog.txt') or die "Could not open pdblog.txt: $!\n"; -#Sync us up with the main symbol store -rsync('sourcemod@alliedmods.net:~/public_html/symbols/', '..\\..\\symstore'); - #Get version info my ($version); $version = Build::ProductVersion(Build::PathFormat('product.version')); @@ -41,14 +36,14 @@ while () $line = $_; $line =~ s/\.pdb/\*/; chomp $line; - Build::Command("symstore add /r /f \"..\\OUTPUT\\$line\" /s ..\\..\\symstore /t \"SourceMod\" /v \"$version\" /c \"$build_type\""); + Build::Command("symstore add /r /f \"..\\OUTPUT\\$line\" /s \"S:\\sourcemod\" /t \"SourceMod\" /v \"$version\" /c \"$build_type\""); } close(PDBLOG); #Lowercase DLLs. Sigh. my (@files); -opendir(DIR, "..\\..\\symstore"); +opendir(DIR, "S:\\sourcemod"); @files = readdir(DIR); closedir(DIR); @@ -57,23 +52,14 @@ for ($i = 0; $i <= $#files; $i++) { $file = $files[$i]; next unless ($file =~ /\.dll$/); - next unless (-d "..\\..\\symstore\\$file"); - opendir(DIR, "..\\..\\symstore\\$file"); + next unless (-d "S:\\sourcemod\\$file"); + opendir(DIR, "S:\\sourcemod\\$file"); @subdirs = readdir(DIR); closedir(DIR); for ($j = 0; $j <= $#subdirs; $j++) { next unless ($subdirs[$j] =~ /[A-Z]/); - Build::Command("rename ..\\..\\symstore\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j])); + Build::Command("rename S:\\sourcemod\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j])); } } -#Now that we're done, rsync back. -rsync('../../symstore/', 'sourcemod@alliedmods.net:~/public_html/symbols'); - -sub rsync -{ - my ($from, $to) = (@_); - - Build::Command('rsync -av --delete -e="' . $SSH . '" ' . $from . ' ' . $to); -}