Review /review from properties tab in gui.

This commit is contained in:
UnknownShadow200 2016-06-18 16:07:17 +10:00
parent 12c522c58e
commit b581b39acd
4 changed files with 5 additions and 267 deletions

View File

@ -70,8 +70,9 @@ namespace MCGalaxy.Commands {
bool opsOn = false;
Player[] players = PlayerInfo.Online.Items;
LevelPermission nextPerm = (LevelPermission)CommandOtherPerms.GetPerm(this, 2);
foreach (Player pl in players) {
if (pl.group.Permission >= Server.reviewnext && Entities.CanSee(p, pl)) {
if (pl.group.Permission >= nextPerm && Entities.CanSee(p, pl)) {
opsOn = true; break;
}
}
@ -87,8 +88,8 @@ namespace MCGalaxy.Commands {
Player.Message(p, msg);
string start = pos > 0 ? "There are now &c" + (pos + 1) + " %Speople" : "There is now &c1 %Sperson";
Chat.GlobalMessageMinPerms(p.color + p.name + " %Sentered the review queue", Server.reviewnext);
Chat.GlobalMessageMinPerms(start + " waiting for a &creview!", Server.reviewnext);
Chat.GlobalMessageMinPerms(p.color + p.name + " %Sentered the review queue", nextPerm);
Chat.GlobalMessageMinPerms(start + " waiting for a &creview!", nextPerm);
p.NextReviewTime = DateTime.UtcNow.AddSeconds(Server.reviewcooldown);
Player.RaisePlayerAction(p, PlayerAction.Review, null, true);
}

View File

@ -375,21 +375,6 @@ namespace MCGalaxy.Gui
this.gbReviewOptions = new System.Windows.Forms.GroupBox();
this.nudCooldownTime = new System.Windows.Forms.NumericUpDown();
this.label84 = new System.Windows.Forms.Label();
this.gbReviewActions = new System.Windows.Forms.GroupBox();
this.button4 = new System.Windows.Forms.Button();
this.gbReviewPerms = new System.Windows.Forms.GroupBox();
this.label83 = new System.Windows.Forms.Label();
this.label82 = new System.Windows.Forms.Label();
this.label81 = new System.Windows.Forms.Label();
this.label80 = new System.Windows.Forms.Label();
this.cmbGotoNext = new System.Windows.Forms.ComboBox();
this.cmbClearQueue = new System.Windows.Forms.ComboBox();
this.cmbLeaveQueue = new System.Windows.Forms.ComboBox();
this.cmbEnterQueue = new System.Windows.Forms.ComboBox();
this.cmbViewQueue = new System.Windows.Forms.ComboBox();
this.label79 = new System.Windows.Forms.Label();
this.gbReviewQueue = new System.Windows.Forms.GroupBox();
this.listBox1 = new System.Windows.Forms.ListBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.chat_gbTab = new System.Windows.Forms.GroupBox();
this.chat_cbTabBots = new System.Windows.Forms.CheckBox();
@ -476,9 +461,6 @@ namespace MCGalaxy.Gui
this.pageReview.SuspendLayout();
this.gbReviewOptions.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudCooldownTime)).BeginInit();
this.gbReviewActions.SuspendLayout();
this.gbReviewPerms.SuspendLayout();
this.gbReviewQueue.SuspendLayout();
this.chat_gbTab.SuspendLayout();
this.SuspendLayout();
//
@ -3064,7 +3046,6 @@ namespace MCGalaxy.Gui
this.tabControl.SelectedIndex = 0;
this.tabControl.Size = new System.Drawing.Size(506, 547);
this.tabControl.TabIndex = 1;
this.tabControl.Click += new System.EventHandler(this.tabControl_Click);
//
// pageGames
//
@ -4125,9 +4106,6 @@ namespace MCGalaxy.Gui
//
this.pageReview.BackColor = System.Drawing.Color.Transparent;
this.pageReview.Controls.Add(this.gbReviewOptions);
this.pageReview.Controls.Add(this.gbReviewActions);
this.pageReview.Controls.Add(this.gbReviewPerms);
this.pageReview.Controls.Add(this.gbReviewQueue);
this.pageReview.Location = new System.Drawing.Point(4, 22);
this.pageReview.Name = "pageReview";
this.pageReview.Padding = new System.Windows.Forms.Padding(3);
@ -4172,148 +4150,6 @@ namespace MCGalaxy.Gui
this.label84.TabIndex = 0;
this.label84.Text = "Cooldown time";
//
// gbReviewActions
//
this.gbReviewActions.Controls.Add(this.button4);
this.gbReviewActions.Location = new System.Drawing.Point(154, 175);
this.gbReviewActions.Name = "gbReviewActions";
this.gbReviewActions.Size = new System.Drawing.Size(328, 53);
this.gbReviewActions.TabIndex = 3;
this.gbReviewActions.TabStop = false;
this.gbReviewActions.Text = "Actions";
//
// button4
//
this.button4.Location = new System.Drawing.Point(7, 21);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(315, 23);
this.button4.TabIndex = 0;
this.button4.Text = "Clear queue";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// gbReviewPerms
//
this.gbReviewPerms.Controls.Add(this.label83);
this.gbReviewPerms.Controls.Add(this.label82);
this.gbReviewPerms.Controls.Add(this.label81);
this.gbReviewPerms.Controls.Add(this.label80);
this.gbReviewPerms.Controls.Add(this.cmbGotoNext);
this.gbReviewPerms.Controls.Add(this.cmbClearQueue);
this.gbReviewPerms.Controls.Add(this.cmbLeaveQueue);
this.gbReviewPerms.Controls.Add(this.cmbEnterQueue);
this.gbReviewPerms.Controls.Add(this.cmbViewQueue);
this.gbReviewPerms.Controls.Add(this.label79);
this.gbReviewPerms.Location = new System.Drawing.Point(154, 7);
this.gbReviewPerms.Name = "gbReviewPerms";
this.gbReviewPerms.Size = new System.Drawing.Size(328, 161);
this.gbReviewPerms.TabIndex = 2;
this.gbReviewPerms.TabStop = false;
this.gbReviewPerms.Text = "Permissions";
//
// label83
//
this.label83.AutoSize = true;
this.label83.Location = new System.Drawing.Point(6, 131);
this.label83.Name = "label83";
this.label83.Size = new System.Drawing.Size(53, 13);
this.label83.TabIndex = 9;
this.label83.Text = "Goto next";
//
// label82
//
this.label82.AutoSize = true;
this.label82.Location = new System.Drawing.Point(6, 103);
this.label82.Name = "label82";
this.label82.Size = new System.Drawing.Size(64, 13);
this.label82.TabIndex = 8;
this.label82.Text = "Clear queue";
//
// label81
//
this.label81.AutoSize = true;
this.label81.Location = new System.Drawing.Point(6, 75);
this.label81.Name = "label81";
this.label81.Size = new System.Drawing.Size(67, 13);
this.label81.TabIndex = 7;
this.label81.Text = "Leave queue";
//
// label80
//
this.label80.AutoSize = true;
this.label80.Location = new System.Drawing.Point(6, 47);
this.label80.Name = "label80";
this.label80.Size = new System.Drawing.Size(64, 13);
this.label80.TabIndex = 6;
this.label80.Text = "Enter queue";
//
// cmbGotoNext
//
this.cmbGotoNext.FormattingEnabled = true;
this.cmbGotoNext.Location = new System.Drawing.Point(178, 131);
this.cmbGotoNext.Name = "cmbGotoNext";
this.cmbGotoNext.Size = new System.Drawing.Size(144, 21);
this.cmbGotoNext.TabIndex = 5;
//
// cmbClearQueue
//
this.cmbClearQueue.FormattingEnabled = true;
this.cmbClearQueue.Location = new System.Drawing.Point(178, 103);
this.cmbClearQueue.Name = "cmbClearQueue";
this.cmbClearQueue.Size = new System.Drawing.Size(144, 21);
this.cmbClearQueue.TabIndex = 4;
//
// cmbLeaveQueue
//
this.cmbLeaveQueue.FormattingEnabled = true;
this.cmbLeaveQueue.Location = new System.Drawing.Point(178, 75);
this.cmbLeaveQueue.Name = "cmbLeaveQueue";
this.cmbLeaveQueue.Size = new System.Drawing.Size(144, 21);
this.cmbLeaveQueue.TabIndex = 3;
//
// cmbEnterQueue
//
this.cmbEnterQueue.FormattingEnabled = true;
this.cmbEnterQueue.Location = new System.Drawing.Point(178, 47);
this.cmbEnterQueue.Name = "cmbEnterQueue";
this.cmbEnterQueue.Size = new System.Drawing.Size(144, 21);
this.cmbEnterQueue.TabIndex = 2;
//
// cmbViewQueue
//
this.cmbViewQueue.FormattingEnabled = true;
this.cmbViewQueue.Location = new System.Drawing.Point(178, 19);
this.cmbViewQueue.Name = "cmbViewQueue";
this.cmbViewQueue.Size = new System.Drawing.Size(144, 21);
this.cmbViewQueue.TabIndex = 1;
//
// label79
//
this.label79.AutoSize = true;
this.label79.Location = new System.Drawing.Point(6, 22);
this.label79.Name = "label79";
this.label79.Size = new System.Drawing.Size(62, 13);
this.label79.TabIndex = 0;
this.label79.Text = "View queue";
//
// gbReviewQueue
//
this.gbReviewQueue.Controls.Add(this.listBox1);
this.gbReviewQueue.Location = new System.Drawing.Point(6, 6);
this.gbReviewQueue.Name = "gbReviewQueue";
this.gbReviewQueue.Size = new System.Drawing.Size(141, 497);
this.gbReviewQueue.TabIndex = 1;
this.gbReviewQueue.TabStop = false;
this.gbReviewQueue.Text = "Review Queue";
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(6, 20);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(129, 459);
this.listBox1.TabIndex = 0;
//
// chat_gbTab
//
this.chat_gbTab.Controls.Add(this.chat_cbTabRank);
@ -4492,10 +4328,6 @@ namespace MCGalaxy.Gui
this.gbReviewOptions.ResumeLayout(false);
this.gbReviewOptions.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudCooldownTime)).EndInit();
this.gbReviewActions.ResumeLayout(false);
this.gbReviewPerms.ResumeLayout(false);
this.gbReviewPerms.PerformLayout();
this.gbReviewQueue.ResumeLayout(false);
this.chat_gbTab.ResumeLayout(false);
this.chat_gbTab.PerformLayout();
this.ResumeLayout(false);
@ -4769,21 +4601,6 @@ namespace MCGalaxy.Gui
private System.Windows.Forms.ComboBox cmbAFKKickPerm;
private System.Windows.Forms.CheckBox chkGuestLimitNotify;
private System.Windows.Forms.TabPage pageReview;
private System.Windows.Forms.GroupBox gbReviewQueue;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.GroupBox gbReviewPerms;
private System.Windows.Forms.Label label79;
private System.Windows.Forms.GroupBox gbReviewActions;
private System.Windows.Forms.Label label83;
private System.Windows.Forms.Label label82;
private System.Windows.Forms.Label label81;
private System.Windows.Forms.Label label80;
private System.Windows.Forms.ComboBox cmbGotoNext;
private System.Windows.Forms.ComboBox cmbClearQueue;
private System.Windows.Forms.ComboBox cmbLeaveQueue;
private System.Windows.Forms.ComboBox cmbEnterQueue;
private System.Windows.Forms.ComboBox cmbViewQueue;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.GroupBox gbReviewOptions;
private System.Windows.Forms.NumericUpDown nudCooldownTime;
private System.Windows.Forms.Label label84;

View File

@ -72,11 +72,6 @@ namespace MCGalaxy.Gui {
string verifyadminsperm = String.Empty;
string grieferstonerank = String.Empty;
string afkkickrank = String.Empty;
string viewqueuerank = String.Empty;
string enterqueuerank = String.Empty;
string leavequeuerank = String.Empty;
string clearqueuerank = String.Empty;
string gotonextrank = String.Empty;
string osmaprank = String.Empty;
foreach ( Group grp in Group.GroupList ) {
@ -88,11 +83,6 @@ namespace MCGalaxy.Gui {
lsCmbControlRank.Items.Add(grp.name);
cmbAFKKickPerm.Items.Add(grp.name);
cmbOsMap.Items.Add(grp.name);
cmbViewQueue.Items.Add(grp.name);
cmbEnterQueue.Items.Add(grp.name);
cmbLeaveQueue.Items.Add(grp.name);
cmbClearQueue.Items.Add(grp.name);
cmbGotoNext.Items.Add(grp.name);
if ( grp.Permission == Server.opchatperm )
opchatperm = grp.name;
@ -102,16 +92,6 @@ namespace MCGalaxy.Gui {
verifyadminsperm = grp.name;
if ( grp.Permission == Server.afkkickperm )
afkkickrank = grp.name;
if ( grp.Permission == Server.reviewenter )
enterqueuerank = grp.name;
if ( grp.Permission == Server.reviewleave )
leavequeuerank = grp.name;
if ( grp.Permission == Server.reviewview )
viewqueuerank = grp.name;
if ( grp.Permission == Server.reviewclear )
clearqueuerank = grp.name;
if ( grp.Permission == Server.reviewnext )
gotonextrank = grp.name;
if( grp.Permission == Server.osPerbuildDefault )
osmaprank = grp.name;
}
@ -129,11 +109,6 @@ namespace MCGalaxy.Gui {
cmbAdminChat.SelectedIndex = ( adminchatperm != String.Empty ? cmbAdminChat.Items.IndexOf(adminchatperm) : 1 );
cmbVerificationRank.SelectedIndex = ( verifyadminsperm != String.Empty ? cmbVerificationRank.Items.IndexOf(verifyadminsperm) : 1 );
cmbAFKKickPerm.SelectedIndex = ( afkkickrank != String.Empty ? cmbAFKKickPerm.Items.IndexOf(afkkickrank) : 1 );
cmbEnterQueue.SelectedIndex = ( enterqueuerank != String.Empty ? cmbEnterQueue.Items.IndexOf(enterqueuerank) : 1 );
cmbLeaveQueue.SelectedIndex = ( leavequeuerank != String.Empty ? cmbLeaveQueue.Items.IndexOf(leavequeuerank) : 1 );
cmbViewQueue.SelectedIndex = ( viewqueuerank != String.Empty ? cmbViewQueue.Items.IndexOf(viewqueuerank) : 1 );
cmbClearQueue.SelectedIndex = ( clearqueuerank != String.Empty ? cmbClearQueue.Items.IndexOf(clearqueuerank) : 1 );
cmbGotoNext.SelectedIndex = ( gotonextrank != String.Empty ? cmbGotoNext.Items.IndexOf(gotonextrank) : 1 );
cmbOsMap.SelectedIndex = ( osmaprank != String.Empty ? cmbOsMap.Items.IndexOf(osmaprank) : 1 );
//Load server stuff
@ -170,8 +145,6 @@ namespace MCGalaxy.Gui {
}
try { nudCooldownTime.Value = Server.reviewcooldown; }
catch { }
try { reviewlist_update(); }
catch ( Exception ex ) { Server.ErrorLog(ex); }
//Sigh. I wish there were SOME event to help me.
foreach(var command in Command.all.commands) {
@ -549,15 +522,6 @@ namespace MCGalaxy.Gui {
chkShowEmptyRanks.Checked = value.ToLower() == "true";
break;
case "view":
Server.reviewview = Level.PermissionFromName(value.ToLower());
break;
case "enter":
Server.reviewenter = Level.PermissionFromName(value.ToLower());
break;
case "leave":
Server.reviewleave = Level.PermissionFromName(value.ToLower());
break;
case "cooldown":
try {
Server.reviewcooldown = Convert.ToInt32(value.ToLower()) < 600 ? Convert.ToInt32(value.ToLower()) : 600;
@ -567,12 +531,6 @@ namespace MCGalaxy.Gui {
Server.s.Log("An error occurred reading the review cooldown value");
}
break;
case "clear":
Server.reviewclear = Level.PermissionFromName(value.ToLower());
break;
case "next":
Server.reviewnext = Level.PermissionFromName(value.ToLower());
break;
}
}
@ -705,12 +663,6 @@ namespace MCGalaxy.Gui {
Server.spamcountreset = (int)numCountReset.Value;
Server.LogNotes = cbLogNotes.Checked;
Server.showEmptyRanks = chkShowEmptyRanks.Checked;
Server.reviewview = Group.GroupList.Find(grp => grp.name == cmbViewQueue.SelectedItem.ToString()).Permission;
Server.reviewenter = Group.GroupList.Find(grp => grp.name == cmbEnterQueue.SelectedItem.ToString()).Permission;
Server.reviewleave = Group.GroupList.Find(grp => grp.name == cmbLeaveQueue.SelectedItem.ToString()).Permission;
Server.reviewclear = Group.GroupList.Find(grp => grp.name == cmbClearQueue.SelectedItem.ToString()).Permission;
Server.reviewnext = Group.GroupList.Find(grp => grp.name == cmbGotoNext.SelectedItem.ToString()).Permission;
Server.reviewcooldown = (int)nudCooldownTime.Value;
}
@ -1344,33 +1296,6 @@ txtBackupLocation.Text = folderDialog.SelectedPath;
}
}
private void tabControl_Click(object sender, EventArgs e) {
reviewlist_update();
}
public void reviewlist_update() {
int people = 1;
listBox1.Items.Clear();
listBox1.Items.Add("Players in queue:");
listBox1.Items.Add("----------");
foreach ( string playerinqueue in Server.reviewlist ) {
listBox1.Items.Add(people.ToString() + ". " + playerinqueue);
people++;
}
people--;
listBox1.Items.Add("----------");
listBox1.Items.Add(people + " player(s) in queue.");
}
private void button4_Click(object sender, EventArgs e) {
try {
Command.all.Find("review").Use(null, "clear");
MessageBox.Show("Review queue has been cleared!");
reviewlist_update();
}
catch ( Exception ex ) { Server.ErrorLog(ex); }
}
private void txtGrpMOTD_TextChanged(object sender, EventArgs e) {
if ( txtGrpMOTD.Text != null ) storedRanks[listRanks.SelectedIndex].MOTD = txtGrpMOTD.Text;
}

View File

@ -563,11 +563,6 @@ namespace MCGalaxy {
else
SendMessage("&cPlease complete admin verification with &a/pass [Password]!");
}
if (group.Permission >= Server.reviewnext && group.Permission >= Server.reviewview) {
int count = Server.reviewlist.Count;
if (count == 1) SendMessage("There is &a1 %Splayer waiting for a review.");
else if (count > 1) SendMessage("There are &a" + count + " %Splayers waiting for a review.");
}
try {
Waypoints.Load(this);
@ -594,7 +589,7 @@ namespace MCGalaxy {
}
void CheckReviewList() {
if (group.Permission < Server.reviewview || !group.CanExecute("review")) return;
if (group.Permission < Server.reviewview || !group.CanExecute("review")) return;
int count = Server.reviewlist.Count;
if (count == 0) return;