소스 검색

Signed-off-by: lqq <lqq@wswin.cn>

lqq 9 년 전
부모
커밋
6955a6d9d9

+ 2 - 1
Client/Lxtalk.dpr

@@ -156,7 +156,8 @@ uses
   SettingService in 'Services\SettingService.pas',
   TalkPersonalView in 'Views\TalkPersonalView.pas' {TalkPersonalForm},
   BaseIDView in 'Views\BaseIDView.pas' {BaseIDViewForm},
-  MainUIHandler in 'Views\MainUIHandler.pas';
+  MainUIHandler in 'Views\MainUIHandler.pas',
+  BasePacket in 'Protocols\BasePacket.pas';
 
 {$R *.res}
 {$R uac.res}

+ 2 - 1
Client/Lxtalk.dproj

@@ -187,7 +187,8 @@
     <DCCReference Include="Processor\FriendsProcessor.pas" />
     <DCCReference Include="Processor\TeamsProcessor.pas" />
     <DCCReference Include="Processor\UsersProcessor.pas" />
-    <DCCReference Include="Protocols\Publisher.pas" />
+    <DCCReference Include="Protocols\BasePacket.pas" />
+    <DCCReference Include="Protocols\WebTabsPacket.pas" />
     <DCCReference Include="QRCodeFrm.pas">
       <Form>QRCodeForm</Form>
     </DCCReference>

+ 1 - 0
Client/Processor/BranchsProcessor.pas

@@ -9,6 +9,7 @@ type
   TBranchUsersProcessor = class
   public
     class procedure Processor(AJo: ISuperObject);
+
   end;
 
   

+ 136 - 0
Client/Protocols/BasePacket.pas

@@ -0,0 +1,136 @@
+unit BasePacket;
+
+interface
+
+uses
+  SysUtils, Classes;
+
+type
+  TByte = array of Byte;
+  TBasePacket = class
+  private
+    FBuffer: array of byte;
+  public
+    class function MajorProto: Byte; virtual;
+    class function MinorProto: Byte; virtual;
+    class function UnPack(const Data: Array of Byte): TBasePacket; virtual;
+    function Pack(var buffer: TByte): Boolean; virtual;
+    function Dispose: Boolean; virtual;
+    function GetLength: Cardinal;
+  end;
+
+  TBasePacketClass = TBasePacket;
+
+  TPacketManager = class(TInterfacedObject)
+  private
+    FClasses: TList;
+
+    function IndexOf(const AMajor, AMinor: Byte): Integer;
+
+  public
+    constructor Create;
+    destructor Destroy; override;
+    class function Current: TPacketManager;
+
+    function GetPacket(const AMajor, AMinor: Byte): TBasePacket;
+
+    procedure RegisterClass(AClass: TBasePacketClass);
+  end;
+
+implementation
+
+uses
+  LoggerImport, InterfaceLogger;
+
+var
+  APacketManager: TPacketManager;
+
+{ TBasePacket }
+
+function TBasePacket.Dispose: Boolean;
+begin
+
+end;
+
+function TBasePacket.GetLength: Cardinal;
+begin
+  Result := Length(FBuffer);
+end;
+
+class function TBasePacket.MajorProto: Byte;
+begin
+  Result := $00;
+end;
+
+class function TBasePacket.MinorProto: Byte;
+begin
+  Result := $00;
+end;
+
+function TBasePacket.Pack(var buffer: TByte): Boolean;
+begin
+  Buffer := TByte(FBuffer);
+end;
+
+class function TBasePacket.UnPack(const Data: array of Byte): TBasePacket;
+begin
+
+end;
+
+{ TPacketManager }
+
+constructor TPacketManager.Create;
+begin
+  FClasses := TList.Create;
+end;
+
+class function TPacketManager.Current: TPacketManager;
+begin
+  if APacketManager = nil then
+    APacketManager := TPacketManager.Create;
+  Result := APacketManager;
+end;
+
+destructor TPacketManager.Destroy;
+begin
+  FreeAndNil(FClasses);
+  inherited;
+end;
+
+function TPacketManager.GetPacket(const AMajor, AMinor: Byte): TBasePacket;
+var
+  i: Integer;
+begin
+  i := IndexOf(AMajor, AMinor);
+  if i < 0 then
+    LoggerImport.Error(Format('接收到不能正常解析的数据包!Major:%d Minor: %d',[AMajor, AMinor]), 'TPacketManager.GetPacket');
+  Result :=  TBasePacket(FClasses[i]);
+end;
+
+function TPacketManager.IndexOf(const AMajor, AMinor: Byte): Integer;
+var
+  i: Integer;
+begin
+  Result := -1;
+  for I := 0 to FClasses.Count - 1 do
+    if (TBasePacketClass(FClasses[i]).MajorProto = AMajor) and (TBasePacketClass(FClasses[i]).MajorProto = AMajor) then
+    begin
+      Result := i;
+      Break;
+    end;
+end;
+
+procedure TPacketManager.RegisterClass(AClass: TBasePacketClass);
+var
+  i: Integer;
+begin
+  i := IndexOf(AClass.MajorProto, AClass.MinorProto);
+  if i >= 0 then
+    raise Exception.CreateFmt('Major:%d Minor:%d已经被%s注册!', [AClass.MajorProto, AClass.MinorProto, TClass(FClasses[i]).ClassName]);
+
+  i := FClasses.IndexOf(AClass);
+  if i < 0 then
+    FClasses.Add(AClass);
+end;
+
+end.

+ 0 - 16
Client/Protocols/Publisher.pas

@@ -1,16 +0,0 @@
-unit Publisher;
-
-interface
-
-//type
-//  TPublisher = class
-//  private
-//
-//  public
-//    class function Current: TPublisher;
-//
-//  end;
-
-implementation
-
-end.

+ 109 - 0
Client/Protocols/WebTabsPacket.pas

@@ -0,0 +1,109 @@
+unit WebTabsPacket;
+
+interface
+
+uses
+  BasePacket, RealICQModel;
+
+type
+  TWebTabsPacket = class(TBasePacket)
+  private
+    FWebTabRecords: array of TWebTabRecord;
+  public
+    class function MajorProto: Byte; override;
+    class function UnPack(const Data: Array of Byte): TBasePacket; override;
+    function Pack(var buffer: TByte): Boolean; override;
+    function Dispose: Boolean; override;
+  end;
+
+implementation
+
+{ TWebTabsPacket }
+
+function TWebTabsPacket.Dispose: Boolean;
+begin
+
+end;
+
+class function TWebTabsPacket.MajorProto: Byte;
+begin
+  Result := $28;
+end;
+
+function TWebTabsPacket.Pack(var buffer: TByte): Boolean;
+begin
+
+end;
+
+class function TWebTabsPacket.UnPack(const Data: array of Byte): TBasePacket;
+var
+  nIndex, iLoop, jLoop: Integer;
+  WebTabCount: Byte;
+  WebTabs: String;
+
+  WebTabList: TStringList;
+  WebTabRecord: TWebTabRecord;
+begin
+  nIndex := 0;
+
+  //取 (3)标签数量                    1byte
+  CopyMemory(@WebTabCount, @Data[nIndex], 1);
+  Inc(nIndex, 1);
+
+  //取 (4)消息内容                    动态长度
+  SetLength(WebTabs, Length(Data) - nIndex);
+  CopyMemory(PChar(WebTabs), @Data[nIndex], Length(Data) - nIndex);
+  //Inc(nIndex, Length(Data) - nIndex);
+
+  WebTabList := SplitString(WebTabs, Chr(10));
+  try
+    SetLength(WebTabRecords, WebTabCount);
+    jLoop := 0;
+    for iLoop := 0 to WebTabCount - 1 do
+    begin
+      WebTabRecord := TWebTabRecord.Create;
+      
+      WebTabRecord.ID := WebTabList.Strings[jLoop];
+      Inc(jLoop);
+      
+      WebTabRecord.Name := WebTabList.Strings[jLoop];
+      Inc(jLoop);
+
+      WebTabRecord.Icon := WebTabList.Strings[jLoop];
+      Inc(jLoop);
+
+      WebTabRecord.Method := WebTabList.Strings[jLoop];
+      Inc(jLoop);
+
+      WebTabRecord.PostFields := WebTabList.Strings[jLoop];
+      Inc(jLoop);
+
+      WebTabRecord.URL := WebTabList.Strings[jLoop];
+      
+      Inc(jLoop);
+
+      WebTabRecord.MustShow := WebTabList.Strings[jLoop] = '1';
+      Inc(jLoop);
+
+      WebTabRecord.Content := WebTabList.Strings[jLoop];
+      Inc(jLoop);
+
+      SendDownloadFileRequest(WebTabRecord.Icon);
+
+      WebTabRecords[iLoop] := WebTabRecord;
+    end;
+  finally
+    FreeAndNil(WebTabList);
+  end;
+
+  if WebTabCount > 0 then
+  begin
+    CallServerDBProcedure('GetWebTabAcounts', '');
+
+    Sleep(200);
+  end;
+
+  DoGetWebTabs(WebTabCount, WebTabRecords);
+end;
+
+end.

+ 103 - 69
Client/SMSFrm.dfm

@@ -2,8 +2,8 @@ object SMSForm: TSMSForm
   Left = 0
   Top = 0
   Caption = #25163#26426#30701#20449
-  ClientHeight = 440
-  ClientWidth = 623
+  ClientHeight = 547
+  ClientWidth = 621
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
@@ -59,26 +59,30 @@ object SMSForm: TSMSForm
   object pnlClient: TPanel
     Left = 0
     Top = 25
-    Width = 623
-    Height = 415
+    Width = 621
+    Height = 522
     Align = alClient
     BevelOuter = bvNone
     Constraints.MinHeight = 315
     Constraints.MinWidth = 520
     TabOrder = 0
+    ExplicitWidth = 623
+    ExplicitHeight = 415
     object pnlTalkingArea: TPanel
       Left = 0
       Top = 61
-      Width = 385
-      Height = 354
+      Width = 383
+      Height = 461
       Align = alClient
       BevelOuter = bvNone
       Constraints.MinWidth = 300
       TabOrder = 0
+      ExplicitWidth = 385
+      ExplicitHeight = 354
       object Splitter1: TSplitter
         Left = 0
-        Top = 236
-        Width = 385
+        Top = 343
+        Width = 383
         Height = 5
         Cursor = crVSplit
         Align = alBottom
@@ -88,21 +92,23 @@ object SMSForm: TSMSForm
       end
       object pnlInputer: TPanel
         Left = 0
-        Top = 241
-        Width = 385
+        Top = 348
+        Width = 383
         Height = 113
         Align = alBottom
         BevelOuter = bvNone
         Constraints.MinHeight = 108
         ParentColor = True
         TabOrder = 0
+        ExplicitTop = 241
+        ExplicitWidth = 385
         DesignSize = (
-          385
+          383
           113)
         object ImgInputerBottomMiddle: TImage
           Left = 14
           Top = 84
-          Width = 358
+          Width = 356
           Height = 24
           Anchors = [akLeft, akRight, akBottom]
           Picture.Data = {
@@ -160,7 +166,7 @@ object SMSForm: TSMSForm
           Transparent = True
         end
         object ImgInputerTopRight: TImage
-          Left = 372
+          Left = 370
           Top = 1
           Width = 7
           Height = 24
@@ -194,7 +200,7 @@ object SMSForm: TSMSForm
         object ImgInputerTopMiddle: TImage
           Left = 13
           Top = 1
-          Width = 359
+          Width = 357
           Height = 24
           Anchors = [akLeft, akTop, akRight]
           Picture.Data = {
@@ -225,7 +231,7 @@ object SMSForm: TSMSForm
         object ShpInputerClient: TShape
           Left = 6
           Top = 24
-          Width = 373
+          Width = 371
           Height = 62
           Anchors = [akLeft, akTop, akRight, akBottom]
           Pen.Color = 10513231
@@ -261,7 +267,7 @@ object SMSForm: TSMSForm
           Transparent = True
         end
         object ImgInputerBottomRight: TImage
-          Left = 371
+          Left = 369
           Top = 86
           Width = 8
           Height = 22
@@ -293,7 +299,7 @@ object SMSForm: TSMSForm
         object lblState: TLabel
           Left = 13
           Top = 90
-          Width = 360
+          Width = 358
           Height = 12
           Anchors = [akLeft, akRight, akBottom]
           AutoSize = False
@@ -313,7 +319,7 @@ object SMSForm: TSMSForm
         object lblSMSState: TLabel
           Left = 13
           Top = 8
-          Width = 360
+          Width = 358
           Height = 12
           Anchors = [akLeft, akTop, akRight]
           AutoSize = False
@@ -333,7 +339,7 @@ object SMSForm: TSMSForm
         object pnlInputeBack: TPanel
           Left = 7
           Top = 25
-          Width = 371
+          Width = 369
           Height = 60
           Anchors = [akLeft, akTop, akRight, akBottom]
           BevelOuter = bvNone
@@ -343,8 +349,9 @@ object SMSForm: TSMSForm
           Padding.Right = 1
           Padding.Bottom = 1
           TabOrder = 0
+          ExplicitWidth = 371
           object pnlSendButtonBack: TPanel
-            Left = 311
+            Left = 309
             Top = 1
             Width = 59
             Height = 58
@@ -355,6 +362,7 @@ object SMSForm: TSMSForm
             Padding.Left = 1
             ParentBackground = False
             TabOrder = 0
+            ExplicitLeft = 311
             object btSend: TRealICQButton
               Left = 1
               Top = 0
@@ -1060,7 +1068,7 @@ object SMSForm: TSMSForm
           object RichEdInputer: TRealICQRichEdit
             Left = 1
             Top = 1
-            Width = 310
+            Width = 308
             Height = 58
             Align = alClient
             AutoURLDetect = False
@@ -1079,27 +1087,30 @@ object SMSForm: TSMSForm
             TabOrder = 1
             OnChange = RichEdInputerChange
             OnMouseDown = RichEdInputerMouseDown
+            ExplicitWidth = 310
           end
         end
       end
       object pnlDisplayer: TPanel
         Left = 0
         Top = 0
-        Width = 385
-        Height = 236
+        Width = 383
+        Height = 343
         Align = alClient
         BevelOuter = bvNone
         Constraints.MinHeight = 108
         ParentColor = True
         TabOrder = 1
         OnResize = pnlDisplayerResize
+        ExplicitWidth = 385
+        ExplicitHeight = 236
         DesignSize = (
-          385
-          236)
+          383
+          343)
         object ShpDisplayerTopMiddle: TShape
           Left = 13
           Top = 6
-          Width = 359
+          Width = 357
           Height = 26
           Anchors = [akLeft, akTop, akRight]
           Brush.Color = 16445931
@@ -1109,8 +1120,8 @@ object SMSForm: TSMSForm
         object ShpDisplayerClient: TShape
           Left = 6
           Top = 31
-          Width = 373
-          Height = 204
+          Width = 371
+          Height = 311
           Anchors = [akLeft, akTop, akRight, akBottom]
           Pen.Color = 10513231
           ExplicitWidth = 441
@@ -1148,7 +1159,7 @@ object SMSForm: TSMSForm
           Transparent = True
         end
         object ImgDisplayerTopRight: TImage
-          Left = 371
+          Left = 369
           Top = 6
           Width = 8
           Height = 26
@@ -1183,7 +1194,7 @@ object SMSForm: TSMSForm
         object lblDest: TLabel
           Left = 13
           Top = 13
-          Width = 360
+          Width = 358
           Height = 12
           Anchors = [akLeft, akTop, akRight]
           AutoSize = False
@@ -1208,18 +1219,20 @@ object SMSForm: TSMSForm
         object pnlForWebBrowser: TPanel
           Left = 8
           Top = 33
-          Width = 369
-          Height = 200
+          Width = 367
+          Height = 307
           Anchors = [akLeft, akTop, akRight, akBottom]
           BevelOuter = bvNone
           Color = clWhite
           ParentBackground = False
           TabOrder = 0
+          ExplicitWidth = 369
+          ExplicitHeight = 200
           object WebBrowser: TWebBrowser
             Left = 0
             Top = 25
-            Width = 369
-            Height = 175
+            Width = 367
+            Height = 282
             Align = alClient
             TabOrder = 0
             OnBeforeNavigate2 = WebBrowserBeforeNavigate2
@@ -1228,7 +1241,7 @@ object SMSForm: TSMSForm
             ExplicitWidth = 437
             ExplicitHeight = 172
             ControlData = {
-              4C00000023260000161200000000000000000000000000000000000000000000
+              4C000000EE250000251D00000000000000000000000000000000000000000000
               000000004C000000000000000000000001000000E0D057007335CF11AE690800
               2B2E126208000000000000004C0000000114020000000000C000000000000046
               8000000000000000000000000000000000000000000000000000000000000000
@@ -1237,7 +1250,7 @@ object SMSForm: TSMSForm
           object pnlHint: TPanel
             Left = 0
             Top = 0
-            Width = 369
+            Width = 367
             Height = 25
             Align = alTop
             BevelOuter = bvNone
@@ -1245,13 +1258,14 @@ object SMSForm: TSMSForm
             ParentColor = True
             TabOrder = 2
             Visible = False
+            ExplicitWidth = 369
             DesignSize = (
-              369
+              367
               25)
             object ShpHint: TShape
               Left = 0
               Top = 0
-              Width = 369
+              Width = 367
               Height = 24
               Align = alClient
               Brush.Color = 14811135
@@ -1302,7 +1316,7 @@ object SMSForm: TSMSForm
             object LblHint: TLabel
               Left = 24
               Top = 5
-              Width = 339
+              Width = 337
               Height = 12
               Anchors = [akLeft, akTop, akRight]
               AutoSize = False
@@ -1323,13 +1337,15 @@ object SMSForm: TSMSForm
           object pnlForHideWebBrowser: TPanel
             Left = 0
             Top = 25
-            Width = 369
-            Height = 175
+            Width = 367
+            Height = 282
             Align = alClient
             BevelOuter = bvNone
             Color = clWhite
             ParentBackground = False
             TabOrder = 1
+            ExplicitWidth = 369
+            ExplicitHeight = 175
           end
         end
       end
@@ -1337,7 +1353,7 @@ object SMSForm: TSMSForm
     object pnlToolBar: TPanel
       Left = 0
       Top = 0
-      Width = 623
+      Width = 621
       Height = 35
       Align = alTop
       BevelOuter = bvNone
@@ -1345,10 +1361,11 @@ object SMSForm: TSMSForm
       Padding.Right = 1
       ParentColor = True
       TabOrder = 1
+      ExplicitWidth = 623
       object Shape1: TShape
         Left = 1
         Top = 34
-        Width = 621
+        Width = 619
         Height = 1
         Align = alBottom
         Pen.Color = 12303291
@@ -1359,16 +1376,17 @@ object SMSForm: TSMSForm
       object pnlForActionToolBar: TPanel
         Left = 1
         Top = 0
-        Width = 621
+        Width = 619
         Height = 34
         Align = alClient
         BevelOuter = bvNone
         ParentColor = True
         TabOrder = 0
+        ExplicitWidth = 621
         object imgToolbarBack: TImage
           Left = 0
           Top = 0
-          Width = 621
+          Width = 619
           Height = 34
           Align = alClient
           Picture.Data = {
@@ -1817,42 +1835,46 @@ object SMSForm: TSMSForm
       end
     end
     object pnlUsers: TPanel
-      Left = 385
+      Left = 383
       Top = 61
       Width = 238
-      Height = 354
+      Height = 461
       Align = alRight
       BevelOuter = bvNone
       Padding.Top = 5
       Padding.Right = 3
       TabOrder = 2
+      ExplicitLeft = 385
+      ExplicitHeight = 354
       object pnlTeamMembers: TPanel
         Left = 0
         Top = 5
         Width = 235
-        Height = 349
+        Height = 456
         Align = alClient
         BevelOuter = bvNone
         ParentColor = True
         TabOrder = 0
+        ExplicitHeight = 349
         DesignSize = (
           235
-          349)
+          456)
         object rndTeamMembers: TRealICQRoundBorderPanel
           Left = 0
           Top = 1
           Width = 232
-          Height = 343
+          Height = 450
           Anchors = [akLeft, akTop, akRight, akBottom]
           BorderColor = 10513231
           BackColor = clWhite
           RoundValue = 14
+          ExplicitHeight = 343
           DesignSize = (
             232
-            343)
+            450)
           object lblTeamMemberCount: TLabel
             Left = 6
-            Top = 327
+            Top = 434
             Width = 66
             Height = 12
             Anchors = [akLeft, akBottom]
@@ -1870,23 +1892,25 @@ object SMSForm: TSMSForm
             Left = 4
             Top = 4
             Width = 224
-            Height = 319
+            Height = 426
             Anchors = [akLeft, akTop, akRight, akBottom]
             BorderColor = 12555645
             BackColor = clWhite
             RoundValue = 6
+            ExplicitHeight = 319
             DesignSize = (
               224
-              319)
+              426)
             object pnlTeamMemberContainer: TPanel
               Left = 2
               Top = 2
               Width = 220
-              Height = 315
+              Height = 422
               Anchors = [akLeft, akTop, akRight, akBottom]
               BevelOuter = bvNone
               Color = clWhite
               TabOrder = 0
+              ExplicitHeight = 315
             end
           end
         end
@@ -1895,15 +1919,16 @@ object SMSForm: TSMSForm
     object pnlMobile: TPanel
       Left = 0
       Top = 35
-      Width = 623
+      Width = 621
       Height = 26
       Align = alTop
       BevelOuter = bvNone
       ParentBackground = False
       ParentColor = True
       TabOrder = 3
+      ExplicitWidth = 623
       DesignSize = (
-        623
+        621
         26)
       object Label1: TLabel
         Left = 8
@@ -1915,15 +1940,16 @@ object SMSForm: TSMSForm
       object spMobileBorder: TShape
         Left = 68
         Top = 4
-        Width = 550
+        Width = 548
         Height = 22
         Anchors = [akLeft, akTop, akRight]
         Pen.Color = clSilver
+        ExplicitWidth = 550
       end
       object edMobiles: TEdit
         Left = 73
         Top = 8
-        Width = 541
+        Width = 539
         Height = 14
         Anchors = [akLeft, akTop, akRight]
         BorderStyle = bsNone
@@ -1937,24 +1963,26 @@ object SMSForm: TSMSForm
         TabOrder = 0
         OnChange = edMobilesChange
         OnKeyPress = edMobilesKeyPress
+        ExplicitWidth = 541
       end
     end
   end
   object pnlMenu: TPanel
     Left = 0
     Top = 0
-    Width = 623
+    Width = 621
     Height = 25
     Align = alTop
     BevelOuter = bvNone
     TabOrder = 1
+    ExplicitWidth = 623
     DesignSize = (
-      623
+      621
       25)
     object shpMenuBottomLine: TShape
       Left = -1
       Top = 23
-      Width = 627
+      Width = 625
       Height = 3
       Anchors = [akLeft, akTop, akRight]
       Pen.Color = 12303291
@@ -1963,28 +1991,30 @@ object SMSForm: TSMSForm
     object Panel3: TPanel
       Left = 0
       Top = 0
-      Width = 623
+      Width = 621
       Height = 23
       Align = alTop
       BevelOuter = bvNone
       ParentColor = True
       TabOrder = 0
+      ExplicitWidth = 623
       object pnlForActionMainMenuBar: TPanel
         Left = 0
         Top = 0
-        Width = 623
+        Width = 621
         Height = 23
         Align = alClient
         BevelOuter = bvNone
         ParentColor = True
         TabOrder = 0
+        ExplicitWidth = 623
         DesignSize = (
-          623
+          621
           23)
         object ActionMainMenuBar: TActionMainMenuBar
           Left = 0
           Top = 0
-          Width = 623
+          Width = 621
           Height = 23
           UseSystemFont = False
           ActionManager = ActionManager1
@@ -2002,9 +2032,10 @@ object SMSForm: TSMSForm
           ParentColor = True
           PersistentHotKeys = True
           Spacing = 0
+          ExplicitWidth = 623
         end
         object cbCustomSendDateTime: TCheckBox
-          Left = 357
+          Left = 355
           Top = 3
           Width = 70
           Height = 17
@@ -2012,9 +2043,10 @@ object SMSForm: TSMSForm
           Caption = #23450#26102#21457#36865
           TabOrder = 1
           OnClick = cbCustomSendDateTimeClick
+          ExplicitLeft = 357
         end
         object DatePickerStart: TDateTimePicker
-          Left = 429
+          Left = 427
           Top = 1
           Width = 115
           Height = 21
@@ -2031,9 +2063,10 @@ object SMSForm: TSMSForm
           ParseInput = True
           ParentFont = False
           TabOrder = 2
+          ExplicitLeft = 429
         end
         object TimePickerStart: TDateTimePicker
-          Left = 546
+          Left = 544
           Top = 1
           Width = 76
           Height = 21
@@ -2045,6 +2078,7 @@ object SMSForm: TSMSForm
           Kind = dtkTime
           ParseInput = True
           TabOrder = 3
+          ExplicitLeft = 546
         end
       end
     end

+ 11 - 1
Client/WebApps/SettingWebApp.pas

@@ -26,7 +26,8 @@ type
 implementation
 
 uses
-  UsersService, RealICQModel, SettingService, Forms, Dialogs, MainFrm;
+  UsersService, RealICQModel, SettingService, Forms, Dialogs, MainFrm, ConfigImport,
+  InterfaceConfig;
 
 { TSettingController }
 
@@ -52,6 +53,7 @@ begin
   AJo := SO('{}');
   AJo.O['user'] := AJoUser;
   AJo.O['sys'] := TSettingService.Current.GetSettingGroup(sgSystem);
+  AJo.O['net'] := SO(TConfigImport.GetNetConfig.ToJsonStr);
   SendToRenderer('Init', AJo.AsString);
 end;
 
@@ -101,6 +103,14 @@ begin
   begin
     TSettingService.Current.SetSettingGroup(AJoSettingGroup, sgHotkey);
   end;
+
+  AJoSettingGroup := AJo.O['net'];
+  if AJoSettingGroup <> nil then
+  begin
+    TConfigImport.GetNetConfig.SetIP(AJoSettingGroup.S['ip']);
+    TConfigImport.GetNetConfig.SetPort(AJoSettingGroup.I['port']);
+    TConfigImport.GetNetConfig.Save;
+  end;
 end;
 
 function TSettingController._Register(params, callback: string): Boolean;

+ 2 - 2
Config/Config.dpr

@@ -24,7 +24,7 @@ uses
   HotKeyConfig in 'HotKeyConfig.pas',
   FaceConfig in 'FaceConfig.pas',
   FontConfig in 'FontConfig.pas',
-  ServerConfig in 'ServerConfig.pas',
+  NetConfig in 'NetConfig.pas',
   ClientConfig in 'ClientConfig.pas',
   GroupConfig in 'GroupConfig.pas',
   GroupShareConfig in 'GroupShareConfig.pas',
@@ -71,7 +71,7 @@ begin
   BeanFactory.RegisterBean(CONFIG_HOTKEY, THotkeyConfig, True);
   BeanFactory.RegisterBean(CONFIG_FACE, TFaceConfig, True);
   BeanFactory.RegisterBean(CONFIG_OFFLINEFILE, TOfflineFileConfig, True);
-  BeanFactory.RegisterBean(CONFIG_SERVER, TServerConfig, True);
+  BeanFactory.RegisterBean(CONFIG_NET, TNetConfig, True);
   BeanFactory.RegisterBean(CONFIG_UIVIEW, TUIViewConfig, True);
   BeanFactory.RegisterBean(CONFIG_CA, TCaConfig, True);
   BeanFactory.RegisterBean(CONFIG_BEHAVIOR, TBehaviorConfig, True);

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 3
Config/Config.dproj


+ 9 - 9
Config/ServerConfig.pas

@@ -1,4 +1,4 @@
-unit ServerConfig;
+unit NetConfig;
 
 interface
 
@@ -6,7 +6,7 @@ uses
   BaseConfig, InterfaceConfig;
 
 type
-  TServerConfig = class(TBaseConfig, IServerConfig)
+  TNetConfig = class(TBaseConfig, INetConfig)
   private
 
   public
@@ -22,31 +22,31 @@ type
 
 implementation
 
-{ TServerConfig }
+{ TNetConfig }
 
-constructor TServerConfig.Create;
+constructor TNetConfig.Create;
 begin
   ConfigType := ctPublic;
-  FileName := 'server.json';
+  FileName := 'net.json';
   inherited;     
 end;
 
-function TServerConfig.GetIP: string;
+function TNetConfig.GetIP: string;
 begin
   Result := Data.S['ip'];
 end;
 
-function TServerConfig.GetPort: Integer;
+function TNetConfig.GetPort: Integer;
 begin
   Result := Data.I['port'];
 end;
 
-procedure TServerConfig.SetIP(const Value: string);
+procedure TNetConfig.SetIP(const Value: string);
 begin
   Data.S['ip'] := Value;
 end;
 
-procedure TServerConfig.SetPort(const Value: Integer);
+procedure TNetConfig.SetPort(const Value: Integer);
 begin
   Data.I['port'] := Value;
 end;

+ 5 - 5
Interfaces/ConfigImport.pas

@@ -16,7 +16,7 @@ type
     class function GetHotKeyConfig: IHotKeyConfig;
     class function GetFaceConfig: IFaceConfig;
     class function GetOfflineFileConfig: IOfflineFileConfig;
-    class function GetServerConfig: IServerConfig;
+    class function GetNetConfig: INetConfig;
     class function GetUIViewConfig: IUIViewConfig;
     class function GetCaConfig: ICaConfig;
     class function GetTestConfig: ITestConfig;
@@ -33,7 +33,7 @@ const
   CONFIG_HOTKEY: string = 'hotkeyConfig';
   CONFIG_FACE: string = 'faceConfig';
   CONFIG_OFFLINEFILE: string = 'offlineFileConfig';
-  CONFIG_SERVER: string = 'serverConfig';
+  CONFIG_NET: string = 'netConfig';
   CONFIG_UIVIEW: string = 'uiViewConfig';
   CONFIG_BEHAVIOR: string = 'behaviorConfig';
 
@@ -134,13 +134,13 @@ begin
   end;
 end;
 
-class function TConfigImport.GetServerConfig: IServerConfig;
+class function TConfigImport.GetNetConfig: INetConfig;
 begin
   try
-    Result := (TMyBeanFactoryTools.getBean(CONFIG_SERVER) as IServerConfig);
+    Result := (TMyBeanFactoryTools.getBean(CONFIG_NET) as INetConfig);
   except
     on E: Exception do
-      Error(E.Message, 'GetServerConfig');
+      Error(E.Message, 'GetNetConfig');
   end;
 end;
 

+ 1 - 1
Interfaces/InterfaceConfig.pas

@@ -45,7 +45,7 @@ type
     procedure SetFont(const Value: string);
   end;
 
-  IServerConfig = interface(IBaseConfig)
+  INetConfig = interface(IBaseConfig)
     ['{7556EFD0-1066-495E-ADF6-B1A51C7E1B01}']
     function GetIP: string;
     function GetPort: Integer;

+ 1 - 1
ZWT/XML/DefaultConfig.xml

@@ -4,7 +4,7 @@
 	<UIMainColor Value="15392442"/>
 	<MainFormLeft Value="871"/>
 	<MainFormTop Value="166"/>
-	<MainFormWidth Value="-300"/>
+	<MainFormWidth Value="258"/>
 	<MainFormHeight Value="666"/>
 	<TalkingFormLeft Value="1691"/>
 	<TalkingFormTop Value="549"/>

BIN
ZWT/cache/data_0


BIN
ZWT/cache/data_1


BIN
ZWT/cache/data_2


BIN
ZWT/cache/data_3