public override string Arm(ServerBattle battle, Say e, string arguments = null) { if (string.IsNullOrEmpty(arguments)) { battle.Respond(e, "Pick a command to poll, e.g. !poll map tabula"); return null; } var parts = arguments.Split(new[] { ' ' }, 2); var commandName = parts[0] ?? ""; var commandArgs = parts.Length > 1 ? parts[1] : null; commandToRun = battle.GetCommandByName(commandName); if (commandToRun.GetRunPermissions(battle, e.User) >= RunPermission.Vote) { return commandToRun.Arm(battle, e, commandArgs); } battle.Respond(e, "You cannot poll this"); return null; }
public override string Arm(ServerBattle battle, Say e, string arguments = null) { if (string.IsNullOrEmpty(arguments)) { battle.Respond(e, "Pick a command to poll, e.g. !poll map tabula"); return(null); } var parts = arguments.Split(new[] { ' ' }, 2); var commandName = parts[0] ?? ""; var commandArgs = parts.Length > 1 ? parts[1] : null; commandToRun = battle.GetCommandByName(commandName); if (commandToRun.GetRunPermissions(battle, e.User) >= RunPermission.Vote && commandToRun.Access != AccessType.NoCheck) { return(commandToRun.Arm(battle, e, commandArgs)); } battle.Respond(e, "You cannot poll this"); return(null); }
public override string Arm(ServerBattle battle, Say e, string arguments = null) { if (string.IsNullOrEmpty(arguments)) { battle.Respond(e, "Pick a command to poll, e.g. !poll map tabula"); return(null); } var parts = arguments.Split(new[] { ' ' }, 2); var commandName = parts[0] ?? ""; var commandArgs = parts.Length > 1 ? parts[1] : null; commandToRun = battle.GetCommandByName(commandName); string reason; if (commandToRun.GetRunPermissions(battle, e.User, out reason) >= RunPermission.Vote && commandToRun.Access != AccessType.NoCheck && commandToRun.Access != AccessType.Admin && !(commandToRun.Access == AccessType.NotIngameNotAutohost && battle.IsAutohost)) { return(commandToRun.Arm(battle, e, commandArgs)); } battle.Respond(e, reason); return(null); }