Skip to content

Commit ec5ea8b

Browse files
committed
this should(tm) do the trick
1 parent eb7a42a commit ec5ea8b

File tree

6 files changed

+45
-20
lines changed

6 files changed

+45
-20
lines changed

EnoCore/Models/CheckerTask.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ public string GetTaskChainId()
5757
{
5858
return this.Method switch
5959
{
60-
CheckerTaskMethod.putflag => $"flag_{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
61-
CheckerTaskMethod.getflag => $"flag_{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
62-
CheckerTaskMethod.putnoise => $"noise_{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
63-
CheckerTaskMethod.getnoise => $"noise_{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
64-
CheckerTaskMethod.havoc => $"havoc_{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
60+
CheckerTaskMethod.putflag => $"flag_s{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
61+
CheckerTaskMethod.getflag => $"flag_s{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
62+
CheckerTaskMethod.putnoise => $"noise_s{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
63+
CheckerTaskMethod.getnoise => $"noise_s{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
64+
CheckerTaskMethod.havoc => $"havoc_s{this.ServiceId}_r{this.RelatedRoundId}_t{this.TeamId}_i{this.UniqueVariantId}",
6565
_ => throw new NotImplementedException(),
6666
};
6767
}

EnoCore/Models/CheckerTaskMessage.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public CheckerTaskMessage(
2626
this.TeamName = teamName ?? throw new ArgumentNullException(nameof(teamName));
2727
this.CurrentRoundId = currentRoundId ?? throw new ArgumentNullException(nameof(currentRoundId));
2828
this.RelatedRoundId = relatedRoundId ?? throw new ArgumentNullException(nameof(relatedRoundId));
29-
this.Flag = flag ?? throw new ArgumentNullException(nameof(flag));
29+
this.Flag = flag;
3030
this.VariantId = variantId ?? throw new ArgumentNullException(nameof(variantId));
3131
this.Timeout = timeout ?? throw new ArgumentNullException(nameof(timeout));
3232
this.RoundLength = roundLength ?? throw new ArgumentNullException(nameof(roundLength));
@@ -54,7 +54,6 @@ public CheckerTaskMessage(
5454
[NotNull]
5555
public long? RelatedRoundId { get; }
5656

57-
[NotNull]
5857
public string? Flag { get; }
5958

6059
[NotNull]
@@ -68,5 +67,10 @@ public CheckerTaskMessage(
6867

6968
[NotNull]
7069
public string? TaskChainId { get; }
70+
71+
public override string ToString()
72+
{
73+
return $"CheckerTaskMessage(TaskId={this.TaskId}, Method={this.Method}, Address={this.Address}, TeamId={this.TeamId}, TeamName={this.TeamName}, CurrentRoundId={this.CurrentRoundId}, RelatedRoundId={this.RelatedRoundId}, Flag={this.Flag}, VariantId={this.VariantId}, Timeout={this.Timeout}, RoundLength={this.RoundLength}, TaskChainId={this.TaskChainId})";
74+
}
7175
}
7276
}

EnoDatabase/Migrations/20210416170157_InitialMigrations.Designer.cs renamed to EnoDatabase/Migrations/20210422134349_InitialMigrations.Designer.cs

Lines changed: 14 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EnoDatabase/Migrations/20210416170157_InitialMigrations.cs renamed to EnoDatabase/Migrations/20210422134349_InitialMigrations.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
2828
StartTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
2929
MaxRunningTime = table.Column<int>(type: "integer", nullable: false),
3030
RoundLength = table.Column<long>(type: "bigint", nullable: false),
31-
TaskIndex = table.Column<long>(type: "bigint", nullable: false),
31+
UniqueVariantId = table.Column<long>(type: "bigint", nullable: false),
32+
VariantId = table.Column<long>(type: "bigint", nullable: false),
3233
CheckerResult = table.Column<int>(type: "integer", nullable: false),
3334
ErrorMessage = table.Column<string>(type: "text", nullable: true),
3435
CheckerTaskLaunchStatus = table.Column<int>(type: "integer", nullable: false)
@@ -80,7 +81,9 @@ protected override void Up(MigrationBuilder migrationBuilder)
8081
FlagsPerRound = table.Column<long>(type: "bigint", nullable: false),
8182
NoisesPerRound = table.Column<long>(type: "bigint", nullable: false),
8283
HavocsPerRound = table.Column<long>(type: "bigint", nullable: false),
83-
FlagStores = table.Column<long>(type: "bigint", nullable: false),
84+
FlagVariants = table.Column<long>(type: "bigint", nullable: false),
85+
NoiseVariants = table.Column<long>(type: "bigint", nullable: false),
86+
HavocVariants = table.Column<long>(type: "bigint", nullable: false),
8487
Active = table.Column<bool>(type: "boolean", nullable: false)
8588
},
8689
constraints: table =>

EnoDatabase/Migrations/EnoDatabaseContextModelSnapshot.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,19 @@ protected override void BuildModel(ModelBuilder modelBuilder)
7171
b.Property<DateTime>("StartTime")
7272
.HasColumnType("timestamp without time zone");
7373

74-
b.Property<long>("TaskIndex")
75-
.HasColumnType("bigint");
76-
7774
b.Property<long>("TeamId")
7875
.HasColumnType("bigint");
7976

8077
b.Property<string>("TeamName")
8178
.IsRequired()
8279
.HasColumnType("text");
8380

81+
b.Property<long>("UniqueVariantId")
82+
.HasColumnType("bigint");
83+
84+
b.Property<long>("VariantId")
85+
.HasColumnType("bigint");
86+
8487
b.HasKey("Id");
8588

8689
b.HasIndex("CheckerTaskLaunchStatus", "StartTime");
@@ -149,19 +152,25 @@ protected override void BuildModel(ModelBuilder modelBuilder)
149152
b.Property<bool>("Active")
150153
.HasColumnType("boolean");
151154

152-
b.Property<long>("FlagStores")
155+
b.Property<long>("FlagVariants")
153156
.HasColumnType("bigint");
154157

155158
b.Property<long>("FlagsPerRound")
156159
.HasColumnType("bigint");
157160

161+
b.Property<long>("HavocVariants")
162+
.HasColumnType("bigint");
163+
158164
b.Property<long>("HavocsPerRound")
159165
.HasColumnType("bigint");
160166

161167
b.Property<string>("Name")
162168
.IsRequired()
163169
.HasColumnType("text");
164170

171+
b.Property<long>("NoiseVariants")
172+
.HasColumnType("bigint");
173+
165174
b.Property<long>("NoisesPerRound")
166175
.HasColumnType("bigint");
167176

EnoLauncher/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ public async Task LaunchCheckerTask(CheckerTask task)
135135
task.Address,
136136
task.TeamId,
137137
task.TeamName,
138-
task.RelatedRoundId,
139138
task.CurrentRoundId,
139+
task.RelatedRoundId,
140140
task.Payload,
141-
task.UniqueVariantId,
141+
task.VariantId,
142142
task.MaxRunningTime,
143143
task.RoundLength,
144144
taskChainId),

0 commit comments

Comments
 (0)