Skip to content

Commit b7e0e2a

Browse files
nikita-petkoGitHub Enterprise
authored andcommitted
Update work queues.
Add deprecation notice for RbxDiscordUsersClient.
1 parent f824e8c commit b7e0e2a

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

Shared/MFDLabs.GridTasks/WorkQueues/RenderingWorkQueue.cs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ private static void ProcessItem(SocketTaskRequest item)
222222

223223
if (contentArray.Length == 0)
224224
{
225+
#if FEATURE_RBXDISCORDUSERS_CLIENT
225226
isAuthorCheck = true;
226227

227228
var nullableUserId = message.Author.GetRobloxId();
@@ -238,6 +239,10 @@ private static void ProcessItem(SocketTaskRequest item)
238239
}
239240

240241
userId = nullableUserId.Value;
242+
#else
243+
message.Reply("Calling the render command like this is deprecated until further notice. Please see https://github.com/mfdlabs/grid-bot-support/discussions/13.");
244+
return;
245+
#endif
241246
}
242247

243248
string username = null;
@@ -249,6 +254,7 @@ private static void ProcessItem(SocketTaskRequest item)
249254

250255
if (message.MentionedUsers.Count > 0)
251256
{
257+
#if FEATURE_RBXDISCORDUSERS_CLIENT
252258
var user = message.MentionedUsers.ElementAt(0);
253259
// we have mentioned a user.
254260
var nullableUserId = user.GetRobloxId();
@@ -265,6 +271,10 @@ private static void ProcessItem(SocketTaskRequest item)
265271
}
266272

267273
userId = nullableUserId.Value;
274+
#else
275+
message.Reply("Calling the render command like this is deprecated until further notice. Please see https://github.com/mfdlabs/grid-bot-support/discussions/13.");
276+
return;
277+
#endif
268278
}
269279
else
270280
{
@@ -346,13 +356,13 @@ private static void ProcessItem(SocketTaskRequest item)
346356
}
347357

348358
Logger.Singleton.Info(
349-
"Trying to render the character for the user '{0}' with the place '{1}', " +
350-
"and the dimensions of {2}x{3}",
351-
userId,
352-
global::MFDLabs.Grid.Bot.Properties.Settings.Default.RenderPlaceID,
353-
global::MFDLabs.Grid.Bot.Properties.Settings.Default.RenderSizeX,
354-
global::MFDLabs.Grid.Bot.Properties.Settings.Default.RenderSizeY
355-
);
359+
"Trying to render the character for the user '{0}' with the place '{1}', " +
360+
"and the dimensions of {2}x{3}",
361+
userId,
362+
global::MFDLabs.Grid.Bot.Properties.Settings.Default.RenderPlaceID,
363+
global::MFDLabs.Grid.Bot.Properties.Settings.Default.RenderSizeX,
364+
global::MFDLabs.Grid.Bot.Properties.Settings.Default.RenderSizeY
365+
);
356366

357367
// get a stream and temp filename
358368
var (stream, fileName) = GridServerCommandUtility.RenderUser(

Shared/MFDLabs.GridTasks/WorkQueues/RenderingWorkQueueV2.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using MFDLabs.Reflection.Extensions;
2222
using MFDLabs.ErrorHandling.Extensions;
2323
using MFDLabs.Grid.Bot.PerformanceMonitors;
24+
using System.ServiceModel.Channels;
2425

2526
namespace MFDLabs.Grid.Bot.WorkQueues
2627
{
@@ -231,6 +232,8 @@ ref bool failure
231232

232233
case "discord_user":
233234

235+
#if FEATURE_RBXDISCORDUSERS_CLIENT
236+
234237
var userRef = (IUser)subCommand.GetOptionValue("user");
235238
if (userRef == null)
236239
{
@@ -259,8 +262,15 @@ ref bool failure
259262

260263
break;
261264

265+
#else
266+
item.RespondEphemeralPing("Calling the render command like this is deprecated until further notice. Please see https://github.com/mfdlabs/grid-bot-support/discussions/13.");
267+
break;
268+
#endif
269+
262270
case "self":
263271

272+
#if FEATURE_RBXDISCORDUSERS_CLIENT
273+
264274
var nullableUserIdFromAuthor = item.User.GetRobloxId();
265275

266276
if (!nullableUserIdFromAuthor.HasValue)
@@ -277,6 +287,11 @@ ref bool failure
277287
userId = nullableUserIdFromAuthor.Value;
278288

279289
break;
290+
291+
#else
292+
item.RespondEphemeralPing("Calling the render command like this is deprecated until further notice. Please see https://github.com/mfdlabs/grid-bot-support/discussions/13.");
293+
break;
294+
#endif
280295
}
281296

282297
return userId;

0 commit comments

Comments
 (0)