public VotemanagerEntryPoint() { API.onClientEventTrigger += eventReceived; API.onPlayerFinishedDownload += playerJoin; API.onResourceStop += () => { if (CurrentVote != null) { CurrentVote.Dispose(); } }; API.onResourceStart += () => { foreach (var p in API.getAllPlayers()) { API.setEntitySyncedData(p, "VOTEMANAGER_PLAYER_JOINED", true); } }; cr.CrossReference = API; }
/// <summary> /// Called by <see cref="Vote"/> objects when voting ends. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An <see cref="EventArgs"/> object containing the event data.</param> private static void VoteEnded(object sender, EventArgs e) { CurrentVote.Dispose(); CurrentVote = null; VoteInProgress = false; }