v.8.4.0 - full audiosystem rewrite again
8th time rewriting it... + Make audio manager be an array - one entry for each possible client. + Added global audio manager for setting everyone's music at once and ticking all audio managers that are set to tick. This does not apply to clients who are experiencing "an event". + Made audio managers check if their clients are valid - if not, stop the manager immediately. + Use g_indexBGM for setting global bgm indexes. + Automatically set and update music for each client that joins the server + Automatically set and update music for each client when the game mode changes + Made /song command immediately reflect the current playing song + Changed how instant stopping works, unnecessary but yknow, tests??? + Added a timer to delay music startup on plugin reload - Removed old timer system used for playing music to new clients in favor of event based system.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
//Sync client stats when they leave
|
||||
public void OnClientDisconnect(int client) {
|
||||
//Database Ass_Database = Get_Ass_Database();
|
||||
AudioManager[client].Client = -1;
|
||||
PrintToServer("[AudioManager @ %i] Client %N disconnected, shutting down gracefully!", client, client);
|
||||
int steamID = GetSteamAccountID(client);
|
||||
if (steamID) {
|
||||
iDmgHealingTotal -= EmnityManager[client].iDamage;
|
||||
@@ -19,6 +21,7 @@ public Action EventSpawn(Event Spawn_Event, const char[] Spawn_Name, bool Spawn_
|
||||
int client = GetClientOfUserId(Spawn_Event.GetInt("userid"));
|
||||
if (IsValidClient(client)) {
|
||||
int class = Spawn_Event.GetInt("class");
|
||||
if (class) AudioManager[client].OnClientRespawned();
|
||||
int steamID = GetSteamAccountID(client);
|
||||
if (!Ass_Database || !steamID || !class) return Plugin_Handled;
|
||||
char strClass[32];
|
||||
|
Reference in New Issue
Block a user