internal void HandleVote(VoteResult result) { Player p = result.caller; #if DEBUG Console.WriteLine("Webserver returns: " + result.result); #endif switch (result.result) { case "0": Say(result.caller, m_StringLocalizer["not_yet_voted", result.service.Name], MsgColor, m_Configuration["MessageFailedIconUrl"]); break; case "1": if (result.giveItemDirectly) { OnPlayerVoted?.Invoke(result.caller, result.apidefinition); new VotifierWebclient().DownloadStringAsync(new Uri(string.Format(result.apidefinition.ReportSuccess, result.service.APIKey, result.caller.channel.owner.playerID.steamID.m_SteamID.ToString()))); return; } else { Say(result.caller, m_StringLocalizer["vote_pending_message", result.service.Name], MsgColor, m_Configuration["MessageFailedIconUrl"]); return; } case "2": Say(result.caller, m_StringLocalizer["vote_due_message", result.service.Name], MsgColor, m_Configuration["MessageFailedIconUrl"]); break; } }
public void RpcVote(PlayerBehaviour playerVoted) { GameManager.Instance.Vote(this, playerVoted); OnPlayerVoted?.Invoke(playerVoted); }
public void PlayerVoted(string vote) => OnPlayerVoted?.Invoke(PlayerId, vote);