Skip to content

Commit f448df0

Browse files
committed
Progress day: 19 Sept 2025
1 parent d4a4f19 commit f448df0

22 files changed

Lines changed: 472 additions & 259 deletions

Client/Client.dpr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ uses
7474
Optix.WinApiEx in '..\Shared\Optix.WinApiEx.pas',
7575
Optix.System.Helper in '..\Shared\Optix.System.Helper.pas',
7676
Optix.Shared.Types in '..\Shared\Optix.Shared.Types.pas',
77-
Optix.Actions.Process in 'Units\Actions\Optix.Actions.Process.pas',
7877
Optix.Func.LogNotifier in '..\Shared\Functions\Optix.Func.LogNotifier.pas',
7978
Optix.Func.Enum.FileSystem in '..\Shared\Functions\Optix.Func.Enum.FileSystem.pas',
8079
Optix.Shared.Classes in '..\Shared\Optix.Shared.Classes.pas',
@@ -84,11 +83,13 @@ uses
8483
Optix.Protocol.Worker.FileTransfer in 'Units\Threads\Optix.Protocol.Worker.FileTransfer.pas',
8584
Optix.Shared.Protocol.FileTransfer in '..\Shared\Optix.Shared.Protocol.FileTransfer.pas',
8685
Optix.Task.ProcessDump in '..\Shared\Tasks\Optix.Task.ProcessDump.pas',
87-
Optix.Task in '..\Shared\Tasks\Optix.Task.pas',
8886
Optix.Actions.ProcessHandler in 'Units\Actions\Optix.Actions.ProcessHandler.pas',
8987
Optix.Func.Shell in '..\Shared\Functions\Optix.Func.Shell.pas',
9088
Optix.Client.Entrypoint in 'Units\Optix.Client.Entrypoint.pas',
91-
Optix.Func.Commands.ActionResponse in '..\Shared\Functions\Optix.Func.Commands.ActionResponse.pas';
89+
Optix.Func.Commands.Base in '..\Shared\Functions\Optix.Func.Commands.Base.pas',
90+
Optix.ClassesRegistry in '..\Shared\Optix.ClassesRegistry.pas',
91+
Optix.Func.Commands.FileSystem in '..\Shared\Functions\Optix.Func.Commands.FileSystem.pas',
92+
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas';
9293

9394
begin
9495
IsMultiThread := True;

Client/Client.dproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@
137137
<DCCReference Include="..\Shared\Optix.WinApiEx.pas"/>
138138
<DCCReference Include="..\Shared\Optix.System.Helper.pas"/>
139139
<DCCReference Include="..\Shared\Optix.Shared.Types.pas"/>
140-
<DCCReference Include="Units\Actions\Optix.Actions.Process.pas"/>
141140
<DCCReference Include="..\Shared\Functions\Optix.Func.LogNotifier.pas"/>
142141
<DCCReference Include="..\Shared\Functions\Optix.Func.Enum.FileSystem.pas"/>
143142
<DCCReference Include="..\Shared\Optix.Shared.Classes.pas"/>
@@ -147,11 +146,13 @@
147146
<DCCReference Include="Units\Threads\Optix.Protocol.Worker.FileTransfer.pas"/>
148147
<DCCReference Include="..\Shared\Optix.Shared.Protocol.FileTransfer.pas"/>
149148
<DCCReference Include="..\Shared\Tasks\Optix.Task.ProcessDump.pas"/>
150-
<DCCReference Include="..\Shared\Tasks\Optix.Task.pas"/>
151149
<DCCReference Include="Units\Actions\Optix.Actions.ProcessHandler.pas"/>
152150
<DCCReference Include="..\Shared\Functions\Optix.Func.Shell.pas"/>
153151
<DCCReference Include="Units\Optix.Client.Entrypoint.pas"/>
154-
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.ActionResponse.pas"/>
152+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Base.pas"/>
153+
<DCCReference Include="..\Shared\Optix.ClassesRegistry.pas"/>
154+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.FileSystem.pas"/>
155+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Process.pas"/>
155156
<BuildConfiguration Include="Base">
156157
<Key>Base</Key>
157158
</BuildConfiguration>

Client/Client_OpenSSL.dpr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ uses
8080
Optix.WinApiEx in '..\Shared\Optix.WinApiEx.pas',
8181
Optix.System.Helper in '..\Shared\Optix.System.Helper.pas',
8282
Optix.Shared.Types in '..\Shared\Optix.Shared.Types.pas',
83-
Optix.Actions.Process in 'Units\Actions\Optix.Actions.Process.pas',
8483
Optix.Func.LogNotifier in '..\Shared\Functions\Optix.Func.LogNotifier.pas',
8584
Optix.Func.Enum.FileSystem in '..\Shared\Functions\Optix.Func.Enum.FileSystem.pas',
8685
Optix.Shared.Classes in '..\Shared\Optix.Shared.Classes.pas',
@@ -90,11 +89,13 @@ uses
9089
Optix.Protocol.Worker.FileTransfer in 'Units\Threads\Optix.Protocol.Worker.FileTransfer.pas',
9190
Optix.Shared.Protocol.FileTransfer in '..\Shared\Optix.Shared.Protocol.FileTransfer.pas',
9291
Optix.Task.ProcessDump in '..\Shared\Tasks\Optix.Task.ProcessDump.pas',
93-
Optix.Task in '..\Shared\Tasks\Optix.Task.pas',
9492
Optix.Actions.ProcessHandler in 'Units\Actions\Optix.Actions.ProcessHandler.pas',
9593
Optix.Func.Shell in '..\Shared\Functions\Optix.Func.Shell.pas',
9694
Optix.Client.Entrypoint in 'Units\Optix.Client.Entrypoint.pas',
97-
Optix.Func.Commands.ActionResponse in '..\Shared\Functions\Optix.Func.Commands.ActionResponse.pas';
95+
Optix.Func.Commands.Base in '..\Shared\Functions\Optix.Func.Commands.Base.pas',
96+
Optix.ClassesRegistry in '..\Shared\Optix.ClassesRegistry.pas',
97+
Optix.Func.Commands.FileSystem in '..\Shared\Functions\Optix.Func.Commands.FileSystem.pas',
98+
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas';
9899

99100
begin
100101
IsMultiThread := True;

Client/Client_OpenSSL.dproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
<DCCReference Include="..\Shared\Optix.WinApiEx.pas"/>
162162
<DCCReference Include="..\Shared\Optix.System.Helper.pas"/>
163163
<DCCReference Include="..\Shared\Optix.Shared.Types.pas"/>
164-
<DCCReference Include="Units\Actions\Optix.Actions.Process.pas"/>
165164
<DCCReference Include="..\Shared\Functions\Optix.Func.LogNotifier.pas"/>
166165
<DCCReference Include="..\Shared\Functions\Optix.Func.Enum.FileSystem.pas"/>
167166
<DCCReference Include="..\Shared\Optix.Shared.Classes.pas"/>
@@ -171,11 +170,13 @@
171170
<DCCReference Include="Units\Threads\Optix.Protocol.Worker.FileTransfer.pas"/>
172171
<DCCReference Include="..\Shared\Optix.Shared.Protocol.FileTransfer.pas"/>
173172
<DCCReference Include="..\Shared\Tasks\Optix.Task.ProcessDump.pas"/>
174-
<DCCReference Include="..\Shared\Tasks\Optix.Task.pas"/>
175173
<DCCReference Include="Units\Actions\Optix.Actions.ProcessHandler.pas"/>
176174
<DCCReference Include="..\Shared\Functions\Optix.Func.Shell.pas"/>
177175
<DCCReference Include="Units\Optix.Client.Entrypoint.pas"/>
178-
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.ActionResponse.pas"/>
176+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Base.pas"/>
177+
<DCCReference Include="..\Shared\Optix.ClassesRegistry.pas"/>
178+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.FileSystem.pas"/>
179+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Process.pas"/>
179180
<BuildConfiguration Include="Base">
180181
<Key>Base</Key>
181182
</BuildConfiguration>

Client/Units/Threads/Optix.Protocol.SessionHandler.pas

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ interface
5454
XSuperObject,
5555

5656
Optix.Protocol.Client.Handler, Optix.Protocol.Packet, Optix.Protocol.Preflight, Optix.Protocol.Worker.FileTransfer,
57-
Optix.Func.Commands, Optix.Task, Optix.Actions.ProcessHandler;
57+
Optix.Func.Commands, Optix.Func.Commands.Base, Optix.Actions.ProcessHandler;
5858
// ---------------------------------------------------------------------------------------------------------------------
5959

6060
type
@@ -121,13 +121,12 @@ implementation
121121

122122
// ---------------------------------------------------------------------------------------------------------------------
123123
uses
124-
System.SysUtils, System.StrUtils,
124+
System.SysUtils, System.StrUtils, System.Rtti,
125125

126126
Winapi.Windows,
127127

128-
Optix.Func.SessionInformation, Optix.Func.Enum.Process, Optix.Actions.Process, Optix.Func.LogNotifier,
129-
Optix.Func.Enum.FileSystem, Optix.Thread, Optix.Task.ProcessDump, Optix.Func.Shell,
130-
Optix.Func.Commands.ActionResponse;
128+
Optix.Func.SessionInformation, Optix.Func.Enum.Process, Optix.Func.LogNotifier, Optix.Func.Enum.FileSystem,
129+
Optix.Thread, Optix.Task.ProcessDump, Optix.Func.Shell, Optix.ClassesRegistry;
131130
// ---------------------------------------------------------------------------------------------------------------------
132131

133132
{ TOptixSessionHandlerThread.Initialize }
@@ -402,28 +401,42 @@ procedure TOptixSessionHandlerThread.PacketReceived(const ASerializedPacket : IS
402401
AWindowGUID := TGUID.Create(ASerializedPacket.S['WindowGUID']);
403402

404403
var AOptixPacket : TOptixPacket := nil;
405-
var AHandleMemory : Boolean := False;
404+
var AHandleMemory : Boolean := False; // TODO: Remove that when migration (Generic) finished
406405
try
407406
try
407+
AOptixPacket := TOptixPacket(TClassesRegistry.CreateInstance(AClassName, [TValue.From<ISuperObject>(ASerializedPacket)]));
408+
if Assigned(AOptixPacket) then begin
409+
// Optix Action Command (& Response)
410+
if AOptixPacket is TOptixCommandAction then begin
411+
TOptixCommandActionResponse(AOptixPacket).DoAction();
412+
413+
// For Action & Response
414+
if AOptixPacket is TOptixCommandActionResponse then begin
415+
AHandleMemory := True;
416+
417+
///
418+
AddPacket(AOptixPacket);
419+
end;
420+
// Optix Task Command
421+
end else if AOptixPacket is TOptixCommandTask then begin
422+
AHandleMemory := True;
423+
424+
var ATask := TOptixCommandTask(AOptixPacket).CreateTask(TOptixCommand(AOptixPacket));
425+
426+
RegisterAndStartNewTask(ATask);
427+
end;
428+
end;
429+
430+
Continuer l'implémentation "générique", y compris à l'intérieur des tasks, afin de rendre l'ensemble le plus
431+
générique possible, y compris coté serveur + l'implémenter sur le client GUI.
432+
408433
// ---------------------------------------------------------------------------------------------------------------
409434
if AClassName = TOptixCommandTerminate.ClassName then
410435
Terminate
411436
// ---------------------------------------------------------------------------------------------------------------
412437
else if AClassName = TOptixCommandRefreshProcess.ClassName then
413438
AddPacket(TProcessList.Create(AWindowGUID))
414439
// ---------------------------------------------------------------------------------------------------------------
415-
else if AClassName = TOptixCommandKillProcess.ClassName then begin
416-
AHandleMemory := True;
417-
///
418-
419-
AOptixPacket := TOptixCommandKillProcess.Create(ASerializedPacket);
420-
421-
TProcessActions.TerminateProcess(TOptixCommandKillProcess(AOptixPacket).ProcessId);
422-
423-
///
424-
AddPacket(AOptixPacket); // Callback
425-
end
426-
// ---------------------------------------------------------------------------------------------------------------
427440
else if AClassName = TOptixCommandRefreshDrives.ClassName then
428441
AddPacket(TDriveList.Create(AWindowGUID))
429442
// ---------------------------------------------------------------------------------------------------------------
@@ -439,15 +452,6 @@ procedure TOptixSessionHandlerThread.PacketReceived(const ASerializedPacket : IS
439452
else if AClassName = TOptixCommandUploadFile.ClassName then
440453
RegisterNewFileTransfer(TOptixCommandUploadFile.Create(ASerializedPacket))
441454
// ---------------------------------------------------------------------------------------------------------------
442-
else if AClassName = TOptixCommandProcessDump.ClassName then begin
443-
AHandleMemory := True;
444-
///
445-
446-
AOptixPacket := TOptixCommandProcessDump.Create(ASerializedPacket);
447-
448-
RegisterAndStartNewTask(TOptixProcessDumpTask.Create(TOptixCommandProcessDump(AOptixPacket)));
449-
end
450-
// ---------------------------------------------------------------------------------------------------------------
451455
else if AClassName = TOptixStartShellInstance.ClassName then begin
452456
AOptixPacket := TOptixStartShellInstance.Create(ASerializedPacket);
453457

@@ -472,17 +476,7 @@ procedure TOptixSessionHandlerThread.PacketReceived(const ASerializedPacket : IS
472476
StdinToShellInstance(TOptixStdinShellInstance(AOptixPacket));
473477
end
474478
// ---------------------------------------------------------------------------------------------------------------
475-
else if AClassName = TOptixRequestUploadedFileInformation.ClassName then begin
476-
Améliorer le protocole, rendre un certain nombre de choses plus génériques (ex. : RTTI / Registry / Class Factories)
477-
etc...
478-
479-
var AResponse := TOptixRequestUploadedFileInformation.Create(ASerializedPacket);
480-
481-
AResponse.DoAction();
482-
483-
///
484-
AddPacket(AResponse);
485-
end;
479+
486480
// ---------------------------------------------------------------------------------------------------------------
487481

488482
// ---------------------------------------------------------------------------------------------------------------

Server/OptixGate.dpr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ uses
7474
Optix.Protocol.Exceptions in '..\Shared\Optix.Protocol.Exceptions.pas',
7575
Optix.Shared.Protocol.FileTransfer in '..\Shared\Optix.Shared.Protocol.FileTransfer.pas',
7676
Optix.Task.ProcessDump in '..\Shared\Tasks\Optix.Task.ProcessDump.pas',
77-
Optix.Task in '..\Shared\Tasks\Optix.Task.pas',
7877
Optix.Func.Shell in '..\Shared\Functions\Optix.Func.Shell.pas',
7978
Optix.Protocol.Worker.FileTransfer in 'Units\Threads\Optix.Protocol.Worker.FileTransfer.pas',
8079
Optix.Protocol.Server in 'Units\Threads\Optix.Protocol.Server.pas',
@@ -100,7 +99,10 @@ uses
10099
uFormListen in 'Units\Forms\uFormListen.pas' {FormListen},
101100
uFormServers in 'Units\Forms\uFormServers.pas' {FormServers},
102101
Optix.Config.Servers in 'Units\Configs\Optix.Config.Servers.pas',
103-
Optix.Func.Commands.ActionResponse in '..\Shared\Functions\Optix.Func.Commands.ActionResponse.pas';
102+
Optix.Func.Commands.Base in '..\Shared\Functions\Optix.Func.Commands.Base.pas',
103+
Optix.ClassesRegistry in '..\Shared\Optix.ClassesRegistry.pas',
104+
Optix.Func.Commands.FileSystem in '..\Shared\Functions\Optix.Func.Commands.FileSystem.pas',
105+
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas';
104106

105107
{$R *.res}
106108
{$R data.res}
@@ -121,7 +123,6 @@ begin
121123
Application.CreateForm(TFormAbout, FormAbout);
122124
Application.CreateForm(TFormDebugThreads, FormDebugThreads);
123125
Application.CreateForm(TFormServers, FormServers);
124-
125126
///
126127
Application.Run;
127128
end.

Server/OptixGate.dproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@
173173
<DCCReference Include="..\Shared\Optix.Protocol.Exceptions.pas"/>
174174
<DCCReference Include="..\Shared\Optix.Shared.Protocol.FileTransfer.pas"/>
175175
<DCCReference Include="..\Shared\Tasks\Optix.Task.ProcessDump.pas"/>
176-
<DCCReference Include="..\Shared\Tasks\Optix.Task.pas"/>
177176
<DCCReference Include="..\Shared\Functions\Optix.Func.Shell.pas"/>
178177
<DCCReference Include="Units\Threads\Optix.Protocol.Worker.FileTransfer.pas"/>
179178
<DCCReference Include="Units\Threads\Optix.Protocol.Server.pas"/>
@@ -228,7 +227,10 @@
228227
<Form>FormServers</Form>
229228
</DCCReference>
230229
<DCCReference Include="Units\Configs\Optix.Config.Servers.pas"/>
231-
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.ActionResponse.pas"/>
230+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Base.pas"/>
231+
<DCCReference Include="..\Shared\Optix.ClassesRegistry.pas"/>
232+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.FileSystem.pas"/>
233+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Process.pas"/>
232234
<None Include="..\Shared\XSuperObject.inc"/>
233235
<BuildConfiguration Include="Base">
234236
<Key>Base</Key>

Server/OptixGate_OpenSSL.dpr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ uses
7474
Optix.Protocol.Exceptions in '..\Shared\Optix.Protocol.Exceptions.pas',
7575
Optix.Shared.Protocol.FileTransfer in '..\Shared\Optix.Shared.Protocol.FileTransfer.pas',
7676
Optix.Task.ProcessDump in '..\Shared\Tasks\Optix.Task.ProcessDump.pas',
77-
Optix.Task in '..\Shared\Tasks\Optix.Task.pas',
7877
Optix.Func.Shell in '..\Shared\Functions\Optix.Func.Shell.pas',
7978
Optix.OpenSSL.Headers in '..\Shared\OpenSSL\Optix.OpenSSL.Headers.pas',
8079
Optix.OpenSSL.Helper in '..\Shared\OpenSSL\Optix.OpenSSL.Helper.pas',
@@ -111,7 +110,10 @@ uses
111110
Optix.Config.TrustedCertificatesStore in 'Units\Configs\Optix.Config.TrustedCertificatesStore.pas',
112111
uFormServers in 'Units\Forms\uFormServers.pas' {FormServers},
113112
Optix.Config.Servers in 'Units\Configs\Optix.Config.Servers.pas',
114-
Optix.Func.Commands.ActionResponse in '..\Shared\Functions\Optix.Func.Commands.ActionResponse.pas';
113+
Optix.Func.Commands.Base in '..\Shared\Functions\Optix.Func.Commands.Base.pas',
114+
Optix.ClassesRegistry in '..\Shared\Optix.ClassesRegistry.pas',
115+
Optix.Func.Commands.FileSystem in '..\Shared\Functions\Optix.Func.Commands.FileSystem.pas',
116+
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas';
115117

116118
{$R *.res}
117119
{$R data.res}

Server/OptixGate_OpenSSL.dproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@
174174
<DCCReference Include="..\Shared\Optix.Protocol.Exceptions.pas"/>
175175
<DCCReference Include="..\Shared\Optix.Shared.Protocol.FileTransfer.pas"/>
176176
<DCCReference Include="..\Shared\Tasks\Optix.Task.ProcessDump.pas"/>
177-
<DCCReference Include="..\Shared\Tasks\Optix.Task.pas"/>
178177
<DCCReference Include="..\Shared\Functions\Optix.Func.Shell.pas"/>
179178
<DCCReference Include="..\Shared\OpenSSL\Optix.OpenSSL.Headers.pas"/>
180179
<DCCReference Include="..\Shared\OpenSSL\Optix.OpenSSL.Helper.pas"/>
@@ -248,7 +247,10 @@
248247
<FormType>dfm</FormType>
249248
</DCCReference>
250249
<DCCReference Include="Units\Configs\Optix.Config.Servers.pas"/>
251-
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.ActionResponse.pas"/>
250+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Base.pas"/>
251+
<DCCReference Include="..\Shared\Optix.ClassesRegistry.pas"/>
252+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.FileSystem.pas"/>
253+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Process.pas"/>
252254
<None Include="..\Shared\XSuperObject.inc"/>
253255
<BuildConfiguration Include="Base">
254256
<Key>Base</Key>

Server/Units/Forms/Control/__uBaseFormControl__.pas

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,20 @@
4545

4646
interface
4747

48-
uses VCL.Forms, VCL.Controls, System.Classes, Winapi.Messages, XSuperObject, Optix.Func.Commands, Generics.Collections;
48+
// ---------------------------------------------------------------------------------------------------------------------
49+
uses
50+
System.Classes,
51+
52+
Generics.Collections,
53+
54+
Winapi.Messages,
55+
56+
VCL.Forms, VCL.Controls,
57+
58+
XSuperObject,
59+
60+
Optix.Func.Commands.Base;
61+
// ---------------------------------------------------------------------------------------------------------------------
4962

5063
type
5164
TFormControlState = (
@@ -143,7 +156,14 @@ TBaseFormControlClass = class of TBaseFormControl;
143156

144157
implementation
145158

146-
uses System.SysUtils, Winapi.Windows, uFormMain, uControlFormTransfers;
159+
// ---------------------------------------------------------------------------------------------------------------------
160+
uses
161+
System.SysUtils,
162+
163+
Winapi.Windows,
164+
165+
uFormMain, uControlFormTransfers;
166+
// ---------------------------------------------------------------------------------------------------------------------
147167

148168
(* Local *)
149169

0 commit comments

Comments
 (0)