Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
dad1a19
Now we're cooking
N1Ran Jan 27, 2019
617f8a4
Voting updated with reset for admins
N1Ran Feb 2, 2019
93e01e5
This is the percentage limiter for voting system...derp
N1Ran Feb 2, 2019
c2cd494
funsies
N1Ran Feb 3, 2019
b21be2d
?
N1Ran Feb 3, 2019
fedea70
voting module updated
N1Ran Feb 6, 2019
1591f95
voting module updated
N1Ran Feb 7, 2019
8347c1f
voting module updated.
N1Ran Feb 7, 2019
77dc054
Merge branch 'Patron' into ToPatron
N1Ran Feb 9, 2019
aeb591a
GPS Marker for grids list command
N1Ran Feb 9, 2019
b9239dc
some faction functions
N1Ran Feb 9, 2019
514ea6e
List players online
N1Ran Feb 9, 2019
1ba4878
Faction functions
N1Ran Feb 10, 2019
a33e369
New method to calculate vote
N1Ran Feb 10, 2019
6592cbe
new method to calculate votes
N1Ran Feb 10, 2019
86af0de
twe
N1Ran Feb 10, 2019
72d72e0
tweak
N1Ran Feb 10, 2019
b44e4df
Booyah
N1Ran Feb 11, 2019
0160488
Added command to list players online with admin command (useful for d…
N1Ran Feb 11, 2019
e8a59a6
Added GPS marker option to Grids list command
N1Ran Feb 11, 2019
5cb7f03
added faction list and faction remove option to faction command
N1Ran Feb 11, 2019
a528dc1
Resolving conflict before uploading
N1Ran Feb 11, 2019
7271434
Rex's faction removal merged
N1Ran Feb 11, 2019
cb3d6c7
updated with patrol Torch
N1Ran Feb 11, 2019
3c4d312
comma makes a major difference
N1Ran Feb 13, 2019
e602ea5
Resolve
N1Ran Feb 14, 2019
57f4262
Merger
N1Ran Feb 14, 2019
cecb2de
New Faction feation
N1Ran Feb 15, 2019
3115e8d
AutoCommands revamp in progress
N1Ran Feb 16, 2019
9722ca0
Yet another fix for the damned voting module
N1Ran Feb 17, 2019
3a71685
AutoCommands major tweaks and another go at fixing the damned voting …
N1Ran Feb 17, 2019
0e8019e
Let's get those new goodies loaded and decrease conflicts
N1Ran Feb 17, 2019
3a6acc4
meh
N1Ran Feb 17, 2019
7c7442b
Remove Old method and added OnStart Trigger to AutoCommands
N1Ran Feb 18, 2019
2958523
Run on Start trigger added
N1Ran Feb 18, 2019
ffc03e6
updated
N1Ran Feb 18, 2019
326820a
Here are the commit addressing the review.
N1Ran Feb 20, 2019
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Resolving conflict before uploading
  • Loading branch information
N1Ran committed Feb 11, 2019
commit a528dc1b4a1403eaaa42697415614ed4e6e6f085
24 changes: 8 additions & 16 deletions Essentials/Commands/VotingModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public void VoteReset()
//vote countdown
private IEnumerable VoteCountdown(TimeSpan time)
{
var command = EssentialsPlugin.Instance.Config.AutoCommands.FirstOrDefault(c => c.Name.Equals(voteInProgress));


for (var i = time.TotalSeconds; i >= 0; i--)
Expand All @@ -217,6 +218,7 @@ private IEnumerable VoteCountdown(TimeSpan time)
.SendMessageAsSelf($"Vote for {voteInProgress} cancelled");
voteResult = Status.voteCancel;
VoteEnd();

yield break;
}

Expand All @@ -236,9 +238,8 @@ private IEnumerable VoteCountdown(TimeSpan time)
}
else
{
var command = EssentialsPlugin.Instance.Config.AutoCommands.FirstOrDefault(c => c.Name.Equals(voteInProgress));

if (VoteCount(_voteReg.Count) >= command.Percentage)
var _votePercent = 100 * (_voteReg.Count / MySession.Static.Players.GetOnlinePlayerCount());
if (_votePercent >= command.Percentage)
{
Context.Torch.CurrentSession.Managers.GetManager<IChatManagerClient>()
.SendMessageAsSelf($"Vote for {voteInProgress} is successful");
Expand All @@ -251,26 +252,17 @@ private IEnumerable VoteCountdown(TimeSpan time)
.SendMessageAsSelf($"Vote for {voteInProgress} failed");
voteResult = Status.voteFail;
}
voteResultPercentage = VoteCount(_voteReg.Count);
voteResultPercentage = _votePercent;
VoteEnd();

yield break;
}
}
}

//creating calculation method for reasons

public double VoteCount(double votecount)
{
double playercount = MySession.Static.Players.GetOnlinePlayerCount();
double result = Math.Round(100 * (votecount / playercount));
return result;

}



public void VoteEnd()
{

//Make sure it's all good for next round
VoteStatus = Status.voteStandby;
voteInProgress = null;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.