обновление
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
backup
|
||||||
|
lib
|
||||||
|
UserData
|
||||||
|
Hytale_Launcher.exe
|
||||||
64
project1.lps
64
project1.lps
@@ -10,7 +10,7 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<WindowIndex Value="-1"/>
|
<WindowIndex Value="-1"/>
|
||||||
<UsageCount Value="42"/>
|
<UsageCount Value="47"/>
|
||||||
</Unit>
|
</Unit>
|
||||||
<Unit>
|
<Unit>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
@@ -20,9 +20,9 @@
|
|||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="Unit1"/>
|
<UnitName Value="Unit1"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<TopLine Value="129"/>
|
<TopLine Value="156"/>
|
||||||
<CursorPos X="9" Y="146"/>
|
<CursorPos X="3" Y="164"/>
|
||||||
<UsageCount Value="42"/>
|
<UsageCount Value="47"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit>
|
</Unit>
|
||||||
@@ -35,34 +35,6 @@
|
|||||||
</Unit>
|
</Unit>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory HistoryIndex="29">
|
<JumpHistory HistoryIndex="29">
|
||||||
<Position>
|
|
||||||
<Filename Value="unit1.pas"/>
|
|
||||||
<Caret Line="168" Column="3" TopLine="148"/>
|
|
||||||
</Position>
|
|
||||||
<Position>
|
|
||||||
<Filename Value="unit1.pas"/>
|
|
||||||
<Caret Line="161" TopLine="146"/>
|
|
||||||
</Position>
|
|
||||||
<Position>
|
|
||||||
<Filename Value="unit1.pas"/>
|
|
||||||
<Caret Line="171" Column="18" TopLine="147"/>
|
|
||||||
</Position>
|
|
||||||
<Position>
|
|
||||||
<Filename Value="unit1.pas"/>
|
|
||||||
<Caret Line="170" Column="18" TopLine="16"/>
|
|
||||||
</Position>
|
|
||||||
<Position>
|
|
||||||
<Filename Value="unit1.pas"/>
|
|
||||||
<Caret Line="26" Column="70" TopLine="10"/>
|
|
||||||
</Position>
|
|
||||||
<Position>
|
|
||||||
<Filename Value="unit1.pas"/>
|
|
||||||
<Caret Line="27" Column="48" TopLine="12"/>
|
|
||||||
</Position>
|
|
||||||
<Position>
|
|
||||||
<Filename Value="unit1.pas"/>
|
|
||||||
<Caret Line="27" Column="48" TopLine="12"/>
|
|
||||||
</Position>
|
|
||||||
<Position>
|
<Position>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="26" Column="70" TopLine="11"/>
|
<Caret Line="26" Column="70" TopLine="11"/>
|
||||||
@@ -155,6 +127,34 @@
|
|||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="138" TopLine="125"/>
|
<Caret Line="138" TopLine="125"/>
|
||||||
</Position>
|
</Position>
|
||||||
|
<Position>
|
||||||
|
<Filename Value="unit1.pas"/>
|
||||||
|
<Caret Line="146" Column="3" TopLine="135"/>
|
||||||
|
</Position>
|
||||||
|
<Position>
|
||||||
|
<Filename Value="unit1.pas"/>
|
||||||
|
<Caret Line="44" Column="8" TopLine="29"/>
|
||||||
|
</Position>
|
||||||
|
<Position>
|
||||||
|
<Filename Value="unit1.pas"/>
|
||||||
|
<Caret Line="103" Column="30" TopLine="78"/>
|
||||||
|
</Position>
|
||||||
|
<Position>
|
||||||
|
<Filename Value="unit1.pas"/>
|
||||||
|
<Caret Line="168" Column="7" TopLine="146"/>
|
||||||
|
</Position>
|
||||||
|
<Position>
|
||||||
|
<Filename Value="unit1.pas"/>
|
||||||
|
<Caret Line="150" Column="6" TopLine="134"/>
|
||||||
|
</Position>
|
||||||
|
<Position>
|
||||||
|
<Filename Value="unit1.pas"/>
|
||||||
|
<Caret Line="156" TopLine="138"/>
|
||||||
|
</Position>
|
||||||
|
<Position>
|
||||||
|
<Filename Value="unit1.pas"/>
|
||||||
|
<Caret Line="161" Column="21" TopLine="140"/>
|
||||||
|
</Position>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
<RunParams>
|
<RunParams>
|
||||||
<FormatVersion Value="2"/>
|
<FormatVersion Value="2"/>
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ object Form1: TForm1
|
|||||||
ClientHeight = 426
|
ClientHeight = 426
|
||||||
ClientWidth = 758
|
ClientWidth = 758
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '4.2.0.0'
|
|
||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
object Image1: TImage
|
object Image1: TImage
|
||||||
Left = 0
|
Left = 0
|
||||||
|
|||||||
114
unit1.pas
114
unit1.pas
@@ -5,7 +5,8 @@ unit Unit1;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
|
||||||
|
Process;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@@ -31,13 +32,17 @@ type
|
|||||||
|
|
||||||
var
|
var
|
||||||
Form1: TForm1;
|
Form1: TForm1;
|
||||||
|
APath: String;
|
||||||
PLAYER_UUID: String;
|
PLAYER_UUID: String;
|
||||||
PLAYER_NAME: String;
|
PLAYER_NAME: String;
|
||||||
PX, PY: Integer;
|
PX, PY: Integer;
|
||||||
MouseIsDown: Boolean;
|
MouseIsDown: Boolean;
|
||||||
|
|
||||||
const
|
const
|
||||||
Hytale_Dir = '.\package\game\latest\Client\';
|
Hytale_Dir = 'package\game\latest\Client\';
|
||||||
//JAVA_EXE = '.\package\jre\latest\bin\java.exe';
|
app_dir = 'package\game\latest';
|
||||||
|
java_exec = 'package\jre\latest\bin\java.exe';
|
||||||
|
user_dir = 'UserData';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@@ -59,11 +64,11 @@ end;
|
|||||||
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
begin
|
begin
|
||||||
if Button = mbLeft then
|
if Button = mbLeft then
|
||||||
begin
|
begin
|
||||||
MouseIsDown := True;
|
MouseIsDown := True;
|
||||||
PX := X;
|
PX := X;
|
||||||
PY := Y;
|
PY := Y;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
|
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
|
||||||
@@ -85,23 +90,23 @@ var
|
|||||||
FileContent: string;
|
FileContent: string;
|
||||||
tmp_uuid: string;
|
tmp_uuid: string;
|
||||||
begin
|
begin
|
||||||
if not FileExists(Hytale_Dir+'uuid.txt') then
|
if not FileExists(APath+user_dir+'\uuid.txt') then
|
||||||
begin
|
begin
|
||||||
tmp_uuid:= GenerateUniqueID();
|
tmp_uuid:= GenerateUniqueID();
|
||||||
AssignFile(f, Hytale_Dir+'uuid.txt');
|
AssignFile(f, APath+user_dir+'\uuid.txt');
|
||||||
Rewrite(f);
|
Rewrite(f);
|
||||||
Write(f, AnsiLowerCase(tmp_uuid));
|
Write(f, AnsiLowerCase(tmp_uuid));
|
||||||
CloseFile(f);
|
CloseFile(f);
|
||||||
PLAYER_UUID:=AnsiLowerCase(tmp_uuid);
|
PLAYER_UUID:=AnsiLowerCase(tmp_uuid);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
AssignFile(f, Hytale_Dir+'uuid.txt');
|
AssignFile(f, APath+user_dir+'\uuid.txt');
|
||||||
Reset(f);
|
Reset(f);
|
||||||
Read(f, FileContent);
|
Read(f, FileContent);
|
||||||
CloseFile(f);
|
CloseFile(f);
|
||||||
PLAYER_UUID:=FileContent;
|
PLAYER_UUID:=FileContent;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.SetPlayerName();
|
procedure TForm1.SetPlayerName();
|
||||||
@@ -109,15 +114,15 @@ var
|
|||||||
f: TextFile;
|
f: TextFile;
|
||||||
FileContent: string;
|
FileContent: string;
|
||||||
begin
|
begin
|
||||||
if FileExists(Hytale_Dir+'username.txt') then
|
if FileExists(APath+user_dir+'\username.txt') then
|
||||||
begin
|
begin
|
||||||
AssignFile(f,Hytale_Dir+'username.txt');
|
AssignFile(f,APath+user_dir+'\username.txt');
|
||||||
Reset(f);
|
Reset(f);
|
||||||
Read(f, FileContent);
|
Read(f, FileContent);
|
||||||
CloseFile(f);
|
CloseFile(f);
|
||||||
player_name_edit.Text:=FileContent;
|
player_name_edit.Text:=FileContent;
|
||||||
PLAYER_NAME:=FileContent;
|
PLAYER_NAME:=FileContent;
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
@@ -125,25 +130,38 @@ end;
|
|||||||
{ TForm1 }
|
{ TForm1 }
|
||||||
|
|
||||||
procedure TForm1.start_btnClick(Sender: TObject);
|
procedure TForm1.start_btnClick(Sender: TObject);
|
||||||
|
|
||||||
var
|
var
|
||||||
f: TextFile;
|
f: TextFile;
|
||||||
Parameters: string;
|
Process: TProcess;
|
||||||
APath, JAVA_EXE: String;
|
|
||||||
begin
|
|
||||||
APath:= ExtractFilePath(Application.ExeName);
|
|
||||||
JAVA_EXE:= APath+'package\jre\latest\bin\java.exe';
|
|
||||||
APath:= APath+'package\game\latest\';
|
|
||||||
|
|
||||||
AssignFile(f, Hytale_Dir+'username.txt');
|
Parameters: string;
|
||||||
|
begin
|
||||||
|
AssignFile(f, APath+user_dir+'\username.txt');
|
||||||
Rewrite(f);
|
Rewrite(f);
|
||||||
Write(f, player_name_edit.Text);
|
Write(f, player_name_edit.Text);
|
||||||
CloseFile(f);
|
CloseFile(f);
|
||||||
|
|
||||||
Parameters:= '--app-dir '+APath+' --java-exec '+JAVA_EXE+' --auth-mode offline --uuid '+PLAYER_UUID+' --name '+PLAYER_NAME;
|
Process:= TProcess.Create(nil);
|
||||||
//ShowMessage(Parameters);
|
Process.Executable:= 'HytaleClient.exe';
|
||||||
ExecuteProcess(APath+'Client\HytaleClient.exe', Parameters);
|
|
||||||
Close;
|
Parameters:= '--app-dir "'+APath+app_dir+'" --java-exec "'+APath+java_exec+'" --user-dir "'+APath+user_dir+'" --auth-mode offline --uuid '+PLAYER_UUID+' --name '+PLAYER_NAME;
|
||||||
|
|
||||||
|
Process.Parameters.Add(Parameters);
|
||||||
|
|
||||||
|
//ShowMessage(APath+Hytale_Dir+'HytaleClient.exe '+Parameters);
|
||||||
|
|
||||||
|
if not FileExists(APath+Hytale_Dir+'HytaleClient.exe') then
|
||||||
|
begin
|
||||||
|
ShowMessage('HytaleClient.exe не найден');
|
||||||
|
Close;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
ChDir(APath+Hytale_Dir);
|
||||||
|
//ExecuteProcess('HytaleClient.exe', Parameters);
|
||||||
|
Process.Execute;
|
||||||
|
Close;
|
||||||
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.exit_btnClick(Sender: TObject);
|
procedure TForm1.exit_btnClick(Sender: TObject);
|
||||||
@@ -152,8 +170,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.FormShow(Sender: TObject);
|
procedure TForm1.FormShow(Sender: TObject);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
APath:= ExtractFilePath(Application.ExeName);
|
||||||
|
ForceDirectories(ExtractFilePath(APath+user_dir));
|
||||||
|
|
||||||
SetPlayerName();
|
SetPlayerName();
|
||||||
GenerateID();
|
GenerateID();
|
||||||
end;
|
end;
|
||||||
|
|||||||
Reference in New Issue
Block a user