传奇一条龙,复古传奇,GM基地,传奇服务端

 找回密码
 立即注册

QQ登录

只需一步,快速开始

网友自助信息发布区,请自行甄别

查看: 776|回复: 1

传奇3登录器delphi源码+生成配置器代码开源

[复制链接]

624

帖子

2131

钻石

1354

积分

管理员

Rank: 9Rank: 9Rank: 9

在线时间
109 小时
发表于 2018-12-3 00:06:02 | 显示全部楼层 |阅读模式
传奇3登录器delphi源码+生成配置器代码开源


unit Unit_Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, SUIMainMenu, SUIButton, StdCtrls, SUIComboBox,
  SUIImagePanel, SUIGroupBox, jpeg, ExtCtrls, SUIForm, ComCtrls,
  SUIStatusBar, GIFImage, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdTelnet, OleCtrls, IniFiles,Unit_MyPro, SUIDlg,ShellApi,
  ScktComp, SysTray, SUIPopupMenu,TLHelp32, SHDocVw;
const
  CM_RESTORE=WM_USER+$1000;
  APPNAME='91gonet传奇3登陆器2.0商业';
type
  TFrmMain = class(TForm)
    suiForm1: TsuiForm;
    Panel1: TPanel;
    Image1: TImage;
    suiGroupBox1: TsuiGroupBox;
    Com_ServerList: TsuiComboBox;
    suiMainMenu1: TsuiMainMenu;
    Label_ServerStat: TLabel;
    Label2: TLabel;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    N6: TMenuItem;
    N7: TMenuItem;
    N8: TMenuItem;
    N9: TMenuItem;
    N10: TMenuItem;
    N11: TMenuItem;
    N12: TMenuItem;
    N14: TMenuItem;
    N15: TMenuItem;
    N16: TMenuItem;
    suiStatusBar1: TsuiStatusBar;
    Check_Win: TsuiCheckBox;
    Image_Open: TImage;
    IdTelnet1: TIdTelnet;
    Image_Close: TImage;
    WebBrowser1: TWebBrowser;
    suiMessageDialog1: TsuiMessageDialog;
    SysTray1: TSysTray;
    suiPopupMenu1: TsuiPopupMenu;
    N17: TMenuItem;
    N18: TMenuItem;
    OpenDialog1: TOpenDialog;
    CSocket: TClientSocket;
    Time_SetWg: TTimer;
    Timer2: TTimer;
    Timer_SetMir3: TTimer;
    suiImageButton1: TsuiImageButton;
    suiImageButton2: TsuiImageButton;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Show_Message(text:String;Icon:TsuiIconType);
    procedure Com_ServerListEnter(Sender: TObject);
    procedure Com_ServerListChange(Sender: TObject);
    procedure N2Click(Sender: TObject);
    procedure N3Click(Sender: TObject);
    procedure N4Click(Sender: TObject);
    procedure N6Click(Sender: TObject);
    procedure N7Click(Sender: TObject);
    procedure N9Click(Sender: TObject);
    procedure N10Click(Sender: TObject);
    procedure N11Click(Sender: TObject);
    procedure N14Click(Sender: TObject);
    procedure WMSysCommand(var Message: TWMSysCommand);message WM_SYSCOMMAND;
    procedure N18Click(Sender: TObject);
    procedure N17Click(Sender: TObject);
    procedure N16Click(Sender: TObject);
    procedure CSocketError(Sender: TObject; Socket: TCustomWinSocket;
      ErrorEvent: TErrorEvent; var ErrorCode: Integer);
    procedure CSocketRead(Sender: TObject; Socket: TCustomWinSocket);
    procedure Time_SetWgTimer(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
    procedure Timer_SetMir3Timer(Sender: TObject);
    procedure suiImageButton2Click(Sender: TObject);
    procedure suiImageButton1Click(Sender: TObject);
    procedure SysTray1IconDblClick(Sender: TObject);//响应WM_SYSCOMMAND消息  private
    { Private declarations }
  public
    procedure CreateParams(var Params:TCreateParams);override;
    procedure RestoreReaues(var message:TMessage);message CM_RESTORE;
    function DecodeMessagePacket(data:String):integer;
    { Public declarations }
  end;

var
  FrmMain: TFrmMain;
  VerCode:int64;
  WgName:String;
  NoticeMemo,CmlistMemo:TMemoryStream;
implementation

uses Unit_AddNewId, Unit_FindID, Unit_EditPass, Unit_FindChar,
  Unit_FindStorage, Unit_LevelIdx, Unit_About, Unit_RcFile, Unit_Msg;


{$R *.dfm}
procedure SetWg(WgName:String);
var
  S:String;
  Found:boolean;
  HProcess,HSnapshot:THandle;
  lpNumberOfBytesWritten: DWORD;
  appe:TProcessEntry32;
function ModuleEnum(processid:Dword):boolean;
var
  ModuleList :Thandle;
  pm :TMODULEENTRY32;
  foundModule:boolean;
begin
  Result:=True;
  ModuleList:=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,processID);
  pm.dwSize:=sizeof(TMODULEENTRY32);
  foundModule:=module32first(ModuleList,pm);
  while integer(foundModule)<>0 do
  begin
    if pos(UpperCase(pm.szModule),UpperCase(WgName))>0 then
    begin
      Result:=False;
      exit;
    end;
    foundModule:=Module32Next(ModuleList,pm);
  end;
  closehandle(ModuleList);
end; // ModuleEnum
begin
  HSnapshot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  appe.dwSize:= SizeOf(appe);
  found:= Process32First(HSnapshot, appe);
  while Integer(found) <> 0 do
  begin
    s:=ExtractFileName(appe.szExeFile);
    if (UpperCase(s)=UpperCase(ExtractFileName(Mir3ExeName))) or (UpperCase(s)=UpperCase('mir3.exe')) then
       if not ModuleEnum(appe.th32ProcessID) then
       begin
         HProcess:=OpenProcess(PROCESS_ALL_ACCESS,true,appe.th32ProcessID);
         TerminateProcess(HProcess,0);
         FrmMain.Show_Message('请勿使用恶意外挂!',suiWarning);
         FrmMain.Time_SetWg.Enabled:=False;
       end;
    Found:=Process32Next(HSnapshot,appe);
  end;
  CloseHandle(HSnapshot);
end;



procedure TFrmMain.FormCreate(Sender: TObject);
var
  IniFile:Tinifile;
  i,ServerCount:integer;
  Tmp_Server:PServerInfo;
begin
  Time_SetWg.Enabled:=True;
  NoticeMemo:=TMemoryStream.Create;
  CmlistMemo:=TMemoryStream.Create;
  VerCode:=0;
  Select_idx:=-1;
  ServerS:=TList.Create;
  Updates:=TList.Create;
  AppPath:=ExtractFilePath(Application.ExeName);
  IniFile:=TIniFile.Create(AppPath+'Client.Ini');
  Mir3ExeName:=IniFile.ReadString('Main','Mir3Exe','');
  ServerCount:=IniFile.ReadInteger('Server','ServerCount',0)+1;
  Pic_Memo:=TMemoryStream.Create;
  ReadFileInfo(ExeTitle,ExeVer,ExeType,ServerS,Updates,NoticeMemo,CmlistMemo);
  Pic_Memo.Position:=0;
  Image1.Picture.Graphic.LoadFromStream(Pic_Memo);
  Pic_memo.Free;
  SysTray1.Hint:=ExeTitle;
  Application.Title:=ExeTitle;
  suiForm1.Caption:=ExeTitle;
  SetForm_Style(suiForm1,ExeType);
  for i := 1 to ServerCount-1 do
  begin
    New(Tmp_Server);
    Tmp_Server.ServerName:=IniFile.ReadString('Server'+IntToStr(i),'ServerName','');
    Tmp_Server.ServerIp:=IniFile.ReadString('Server'+IntToStr(i),'ServerIp','');
    Tmp_Server.ServerPort:=IniFile.ReadInteger('Server'+IntToStr(i),'ServerPort',7000);
    Tmp_Server.ServerUrl:=IniFile.ReadString('Server'+IntToStr(i),'ServerUrl','http://bbs.91go.net');
    ServerS.Add(Tmp_Server);
  end;
  IniFile.Free;
end;

procedure TFrmMain.FormClose(Sender: TObject; var Action: TCloseAction);
var
  IniFile:TIniFile;
  i:integer;
  S:String;
  Found:boolean;
  HProcess,HSnapshot:THandle;
  lpNumberOfBytesWritten: DWORD;
  appe:TProcessEntry32;
begin
  HSnapshot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  appe.dwSize:= SizeOf(appe);
  found:= Process32First(HSnapshot, appe);
  while Integer(found) <> 0 do
  begin
    s:=ExtractFileName(appe.szExeFile);
    if (UpperCase(s)=UpperCase(ExtractFileName(Mir3ExeName))) or (UpperCase(s)=UpperCase('mir3.exe')) then
    begin
      HProcess:=OpenProcess(PROCESS_ALL_ACCESS,true,appe.th32ProcessID);
      TerminateProcess(HProcess,0);
    end;
    Found:=Process32Next(HSnapshot,appe);
  end;
  CloseHandle(HSnapshot);
  IniFile:=TIniFile.Create(AppPath+'Client.Ini');
  IniFile.WriteString('Main','Mir3Exe',Mir3ExeName);
  IniFile.WriteInteger('Server','ServerCount',ServerS.Count-1);
  IniFile.WriteInteger('Wg','WgCount',ServerS.Count-1);
  for i:=1 to ServerS.Count-1 do
  begin
    IniFile.WriteString('Server'+IntToStr(i),'ServerName',PServerInfo(Servers).ServerName);
    IniFile.WriteString('Server'+IntToStr(i),'ServerIp',PServerInfo(Servers).ServerIp);
    IniFile.WriteInteger('Server'+IntToStr(i),'ServerPort',PServerInfo(Servers).ServerPort);
    IniFile.WriteString('Server'+IntToStr(i),'ServerUrl',PServerInfo(Servers).ServerUrl);
  end;
  IniFile.Free;
  inifile:=TIniFile.create(ExtractFilePath(Mir3ExeName)+'Mir3.ini');
  inifile.WriteString('Initial','ServerAddr','127.0.0.1');
  IniFile.Free;
  ServerS.Free;
  Updates.Free;
  NoticeMemo.Free;
  CmlistMemo.Free;
end;

procedure TFrmMain.Show_Message(text:String;Icon:TsuiIconType);
begin
  suiMessageDialog1.Caption:='提示信息';
  suiMessageDialog1.Text:=text;
  suiMessageDialog1.IconType:=Icon;
  suiMessageDialog1.ShowModal;
end;


procedure TFrmMain.Com_ServerListEnter(Sender: TObject);
var
  i:integer;
begin
  Com_ServerList.Items.Clear;
  for i := 0 to ServerS.Count-1 do
  begin
    if i=0 then Com_ServerList.Items.Add(Trim(PServerInfo(ServerS).ServerCaption))
    else Com_ServerList.Items.Add(Trim(PServerInfo(ServerS).ServerName));
  end;
end;

procedure TFrmMain.Com_ServerListChange(Sender: TObject);
var
  SerVerIp:string;
begin
  if Com_ServerList.ItemIndex<0 then exit;
  WebBrowser1.Navigate(PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerUrl);
  WebBrowser1.Align:=alClient;
  if PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerIp<>'' then
    SerVerIp:=PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerIp
  else
    HostToIP(PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerUrl,SerVerIp);
  CSocket.Active:=False;
  CSocket.Address:=SerVerIp;
  CSocket.Port:=PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerPort;
  try
    CSocket.Active:=True;
    Image_Open.Visible:=True;
    Image_Close.Visible:=False;
    Label_ServerStat.Font.Color:=clGreen;
    Label_ServerStat.Caption:='服务器状态正常。';
  except
    Image_Open.Visible:=False;
    Image_Close.Visible:=True;
    Label_ServerStat.Font.Color:=clRed;
    Label_ServerStat.Caption:='服务器关闭。';
  end;
  CSocket.Close;
end;

procedure TFrmMain.N2Click(Sender: TObject);
begin
  if Com_ServerList.ItemIndex<0 then exit;
  Reg_SvrIp:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrIp;
  Reg_SvrPort:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrPort;
  if Trim(Reg_SvrIp)='' then
  begin
    if (Reg_SvrPort<>0)  then HostToIP(PServerInfo(ServerS[Com_ServerList.ItemIndex]).ServerUrl,Reg_SvrIp)
    else
    begin
      Show_Message('无法找到注册服务器!',suiWarning);
      exit;
    end ;
  end;
  Frm_AddNewId.ShowModal;
end;



procedure TFrmMain.N3Click(Sender: TObject);
begin
  if Com_ServerList.ItemIndex<0 then exit;
  Reg_SvrIp:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrIp;
  Reg_SvrPort:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrPort;
  if Trim(Reg_SvrIp)='' then
  begin
    if (Reg_SvrPort<>0)  then HostToIP(PServerInfo(ServerS[Com_ServerList.ItemIndex]).ServerUrl,Reg_SvrIp)
    else
    begin
      Show_Message('无法找到注册服务器!',suiWarning);
      exit;
    end ;
  end;
  Frm_FindID.ShowModal;
end;

procedure TFrmMain.N4Click(Sender: TObject);
begin
  if Com_ServerList.ItemIndex<0 then exit;
  Reg_SvrIp:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrIp;
  Reg_SvrPort:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrPort;
  if Trim(Reg_SvrIp)='' then
  begin
    if (Reg_SvrPort<>0)  then HostToIP(PServerInfo(ServerS[Com_ServerList.ItemIndex]).ServerUrl,Reg_SvrIp)
    else
    begin
      Show_Message('无法找到注册服务器!',suiWarning);
      exit;
    end ;
  end;
  Frm_EditPass.ShowModal;
end;

procedure TFrmMain.N6Click(Sender: TObject);
begin
  if Com_ServerList.ItemIndex<0 then exit;
  Reg_SvrIp:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrIp;
  Reg_SvrPort:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrPort;
  if Trim(Reg_SvrIp)='' then
  begin
    if (Reg_SvrPort<>0)  then HostToIP(PServerInfo(ServerS[Com_ServerList.ItemIndex]).ServerUrl,Reg_SvrIp)
    else
    begin
      Show_Message('无法找到注册服务器!',suiWarning);
      exit;
    end ;
  end;
  Frm_FindChar.ShowModal;
end;

procedure TFrmMain.N7Click(Sender: TObject);
begin
  if Com_ServerList.ItemIndex<0 then exit;
  Reg_SvrIp:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrIp;
  Reg_SvrPort:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrPort;
  if Trim(Reg_SvrIp)='' then
  begin
    if (Reg_SvrPort<>0)  then HostToIP(PServerInfo(ServerS[Com_ServerList.ItemIndex]).ServerUrl,Reg_SvrIp)
    else
    begin
      Show_Message('无法找到注册服务器!',suiWarning);
      exit;
    end ;
  end;
  Frm_FindStorage.ShowModal;
end;

procedure TFrmMain.N9Click(Sender: TObject);
begin
  if Com_ServerList.ItemIndex<0 then exit;
  Reg_SvrPort:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrPort;
  ServerUrl:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).ServerUrl;
  Select_idx:=0;
  if (ServerUrl<>'') and (Reg_SvrPort<>0) then Frm_LevelIdx.ShowModal
  else
  begin
    Show_Message('无法找到注册服务器!',suiWarning);
    exit;
  end;
end;

procedure TFrmMain.N10Click(Sender: TObject);
begin
  if Com_ServerList.ItemIndex<0 then exit;
  Reg_SvrPort:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrPort;
  ServerUrl:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).ServerUrl;
  Select_idx:=1;
  if (ServerUrl<>'') and (Reg_SvrPort<>0) then Frm_LevelIdx.ShowModal
  else
  begin
    Show_Message('无法找到注册服务器!',suiWarning);
    exit;
  end;
end;

procedure TFrmMain.N11Click(Sender: TObject);
begin
  if Com_ServerList.ItemIndex<0 then exit;
  Reg_SvrPort:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrPort;
  ServerUrl:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).ServerUrl;
  Select_idx:=2;
  if (ServerUrl<>'') and (Reg_SvrPort<>0) then Frm_LevelIdx.ShowModal
  else
  begin
    Show_Message('无法找到注册服务器!',suiWarning);
    exit;
  end;
end;

procedure TFrmMain.N14Click(Sender: TObject);
begin
  Show_Message('此功能尚未开放!',suiInformation);
end;

procedure TFrmMain.WMSysCommand(var Message: TWMSysCommand);
begin
  Inherited;//调用先前的处理函数
  if (Message.CmdType and $FFF0 = SC_MINIMIZE) then FrmMain.Visible:=False;
end;
procedure TFrmMain.N18Click(Sender: TObject);
var
  S:String;
  Found:boolean;
  HProcess,HSnapshot:THandle;
  lpNumberOfBytesWritten: DWORD;
  appe:TProcessEntry32;
  iniFile:TiniFile;
begin
  HSnapshot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  appe.dwSize:= SizeOf(appe);
  found:= Process32First(HSnapshot, appe);
  while Integer(found) <> 0 do
  begin
    s:=ExtractFileName(appe.szExeFile);
    if (UpperCase(s)=UpperCase(ExtractFileName(Mir3ExeName))) or (UpperCase(s)=UpperCase('mir3.exe')) then
    begin
      HProcess:=OpenProcess(PROCESS_ALL_ACCESS,true,appe.th32ProcessID);
      TerminateProcess(HProcess,0);
    end;
    Found:=Process32Next(HSnapshot,appe);
  end;
  CloseHandle(HSnapshot);
  inifile:=TIniFile.create(ExtractFilePath(Mir3ExeName)+'Mir3.ini');
  inifile.WriteString('Initial','ServerAddr','127.0.0.1');
  IniFile.Free;
  Application.Terminate;
end;

procedure TFrmMain.N17Click(Sender: TObject);
begin
  FrmMain.Visible:=True;
end;

procedure TFrmMain.CreateParams(var Params:TCreateParams);
begin
//设置窗体类名
  Inherited CreateParams(Params);
  Params.WinClassName:=APPNAME;
end;

procedure TFrmMain.RestoreReaues(var message:TMessage);
begin
  Application.BringToFront;
  if IsIconic(Application.Handle) then
  begin
   Application.Restore;
  end
else
begin
  Application.BringToFront;
end;
  FrmMain.Visible:=True;
end;




procedure TFrmMain.N16Click(Sender: TObject);
begin
  Frm_About.ShowModal;
end;

procedure TFrmMain.CSocketError(Sender: TObject; Socket: TCustomWinSocket;
  ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin
  suiStatusBar1.Panels[0].Text:='无法与游戏服务器连接';
  CSocket.Active:=False;
  VerCode:=0;
  ErrorCode:=0;
end;

procedure TFrmMain.CSocketRead(Sender: TObject; Socket: TCustomWinSocket);
var
  Str,data:string;
begin
  suiStatusBar1.Panels[0].Text:='连接成功。';
  str:=Socket.ReceiveText;
  str:=ArrestStringEx(str,'#','!',data);
  DecodeMessagePacket(data);
end;

function TFrmMain.DecodeMessagePacket(data:String):integer;
var
  head, body: String;
  msg:TDefaultMessage;
  fq:T_SFindQuiz;
  fp:T_SFindPass;
  Eiinfo:TEiInfo;
  Path,ExeName:String;
begin
  Result:=0;
  head := Copy (data, 1, DEFBLOCKSIZE);
  body := Copy (data, DEFBLOCKSIZE+1, Length(data)-DEFBLOCKSIZE);
  msg  := DecodeMessage (head);
  path:=ExtractFilePath(Mir3ExeName);
  ExeName:=ExtractFileName(Mir3ExeName);
  if Check_Win.Checked then
  begin
    ShellExecute(Handle,'open',Pchar(ExeName),'-u -c -m',Pchar(path),SW_SHOW);
  end
  else ShellExecute(Handle,'open',Pchar(ExeName),'-u -c',Pchar(path),SW_SHOW) ;
  if msg.Comm=SM_GetMirServer_Succed then//查找版本号成功
  begin
    if msg.param=0 then
    begin
      suiStatusBar1.Panels[0].Text:='封脱机、封外挂。';
      DecodeBuffer(body,@EiInfo,Sizeof(TEiInfo));
      VerCode:=Eiinfo.ServerCode xor SM_GetMirServer_Succed;
      WgName:=Eiinfo.WgName;
      Timer_SetMir3.Enabled:=True;
      Time_SetWg.Enabled:=True;
    end;
    if msg.param=1 then
    begin
      suiStatusBar1.Panels[0].Text:='封脱机。';
      DecodeBuffer(body,@EiInfo,Sizeof(TEiInfo));
      VerCode:=Eiinfo.ServerCode xor SM_GetMirServer_Succed;
      WgName:='';
      Timer_SetMir3.Enabled:=True;
      Time_SetWg.Enabled:=False;
    end;
    if msg.param=2 then
    begin
      suiStatusBar1.Panels[0].Text:='封外挂,不封脱机';
      DecodeBuffer(body,@EiInfo,Sizeof(TEiInfo));
      VerCode:=Eiinfo.ServerCode xor SM_GetMirServer_Succed;
      WgName:=Eiinfo.WgName;
      Sleep(500);
      VerCode:=20030704;
      Timer_SetMir3.Enabled:=True;
      Time_SetWg.Enabled:=True;
    end;
    if msg.param=3 then
    begin
      suiStatusBar1.Panels[0].Text:='不封外挂,不封脱机';
      DecodeBuffer(body,@EiInfo,Sizeof(TEiInfo));
      VerCode:=Eiinfo.ServerCode xor SM_GetMirServer_Succed;
      Sleep(500);
      VerCode:=20030704;
      WgName:='';
      Timer_SetMir3.Enabled:=True;
      Time_SetWg.Enabled:=False;
    end;
  end;
  if msg.Comm=SM_GetMirServer_Fail then//查找版本号失败
  begin
    suiStatusBar1.Panels[0].Text:='接收版本号失败。';
    VerCode:=0;
    VerCode:=20030704;
    WgName:='';
    Timer_SetMir3.Enabled:=True;
  end;
end;


procedure TFrmMain.Time_SetWgTimer(Sender: TObject);
begin
  SetWg(WgName);
end;

procedure TFrmMain.Timer2Timer(Sender: TObject);
var
  msg:TDefaultMessage;
begin
  msg:=MakeDefaultMsg(CM_GetMirServer,0);
  SendSocket(CSocket.Socket,EncodeMessage(msg));
  Timer2.Enabled:=False;
end;

procedure TFrmMain.Timer_SetMir3Timer(Sender: TObject);
var
  h:hwnd;
begin
  h:=FindWindow('WH GEngine',nil);
  if h>0 then
  begin
    Sleep(500);
    SetMir3(VerCode);
//    if not SetMir3(VerCode) then suiStatusBar1.Panels[0].Text:='暂不支持该客户端,请到本站下载。' else suiStatusBar1.Panels[0].Text:='正常游戏';
    Timer_SetMir3.Enabled:=False;
  end;
end;

procedure TFrmMain.suiImageButton2Click(Sender: TObject);
var
  iniFile:TIniFile;
  Tmp_Ip:string;
  Msg:TDefaultMessage;
  h:hwnd;
  path:String;
begin
  if Com_ServerList.ItemIndex<0 then Exit;
  if Mir3ExeName='' then
  begin
    OpenDialog1.Filter:='*.exe|*.exe';
    if OpenDialog1.Execute then Mir3ExeName:=OpenDialog1.FileName;
  end;
  path:=ExtractFilePath(Mir3ExeName);
  NoticeMemo.SaveToFile(Path+'notice.ntc');
  CmlistMemo.SaveToFile(Path+'Cmlist.dat');
  inifile:=TIniFile.create(path+'Mir3.ini');
  if PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerIp<>'' then
    inifile.WriteString('Initial','ServerAddr',PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerIp)
  else
  begin
    HostToIP(PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerUrl,Tmp_Ip);
    inifile.WriteString('Initial','ServerAddr',Tmp_Ip)
  end;
  inifile.WriteInteger('Initial','Param1',PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerPort);
  inifile.WriteInteger('Server','ServerCount',1);
  inifile.WriteString('Server','server1caption',PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerCaption);
  inifile.WriteString('Server','server1name',PServerInfo(Servers[Com_ServerList.ItemIndex]).ServerName);
  iniFile.Free;
  FrmMain.Visible:=False;
  h:=FindWindow('WH GEngine',nil);
  if h>0 then CloseHwnd(h);
  Reg_SvrIp:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrIp;
  Reg_SvrPort:=PServerInfo(ServerS[Com_ServerList.ItemIndex]).RegSvrPort;
  if (Reg_SvrPort<>0) and (Trim(Reg_SvrIp)='') then HostToIP(PServerInfo(ServerS[Com_ServerList.ItemIndex]).ServerUrl,Reg_SvrIp);
  CSocket.Active:=False;
  CSocket.Address:=Reg_SvrIp;
  CSocket.Port:=Reg_SvrPort;
  Try
    CSocket.Active:=True;
    suiStatusBar1.Panels[0].Text:='正在查询验证码';
  except end;
  Timer2.Enabled:=True;
end;

procedure TFrmMain.suiImageButton1Click(Sender: TObject);
begin
  N2.Click;
end;

procedure TFrmMain.SysTray1IconDblClick(Sender: TObject);
begin
  FrmMain.Visible:=True;
end;

end.

游客,如果您要查看本帖隐藏内容请回复


回复

使用道具 举报

17

帖子

52

钻石

18

积分

初级GM

Rank: 1

在线时间
1 小时
发表于 2020-3-20 18:13:30 | 显示全部楼层
看看,光通登录器代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|85ji.com Inc.最大的GM论坛交流基地 ( 粤ICP备11015868号-18 ) 传奇私服 Array7.2 版权所有 © 八五论坛 Comsenz Inc.

快速回复 快速发帖 返回顶部 返回列表