Kod: Tümünü seç
procedure TfrmMain.SpeedHackTimerTimer(Sender: TObject);
var
gcount, timer: longword;
ahour, amin, asec, amsec: word;
begin
DecodeTime (Time, ahour, amin, asec, amsec);
timer := ahour * 1000 * 60 * 60 + amin * 1000 * 60 + asec * 1000 + amsec;
gcount := GetTickCount;
if g_dwSHGetTime > 0 then begin
if abs((gcount - g_dwSHGetTime) - (timer - g_dwSHTimerTime)) > 70 then begin
Inc (g_nSHFakeCount);
end else
g_nSHFakeCount := 0;
if g_nSHFakeCount > 4 then begin
FrmDlg.DMessageDlg ('Terminate the program. CODE=10001\' +
'Please contact game master.',
[mbOk]);
FrmMain.Close;
end;
if g_boCheckSpeedHackDisplay then begin
DScreen.AddSysMsg ('->' + IntToStr(gcount - g_dwSHGetTime) + ' - ' +
IntToStr(timer - g_dwSHTimerTime) + ' = ' +
IntToStr(abs((gcount - g_dwSHGetTime) - (timer - g_dwSHTimerTime))) + ' (' +
IntToStr(g_nSHFakeCount) + ')');
end;
end;
g_dwSHGetTime := gcount;
g_dwSHTimerTime := timer;
end;
procedure TfrmMain.CheckSpeedHack (rtime: Longword);
var
cltime, svtime: integer;
str: string;
begin
if g_dwFirstServerTime > 0 then begin
if (GetTickCount - g_dwFirstClientTime) > 1 * 60 * 60 * 1000 then begin //1矫埃 付促 檬扁拳
g_dwFirstServerTime := rtime; //檬扁拳
g_dwFirstClientTime := GetTickCount;
//ServerTimeGap := rtime - int64(GetTickCount);
end;
cltime := GetTickCount - g_dwFirstClientTime;
svtime := rtime - g_dwFirstServerTime + 3000;
if cltime > svtime then begin
Inc (g_nTimeFakeDetectCount);
if g_nTimeFakeDetectCount > 6 then begin
//矫埃炼累...
str := 'Bad';
//SendSpeedHackUser;
FrmDlg.DMessageDlg ('Terminate the program. CODE=10000\' +
'Connection is bad or system is unstable.\' +
'Please contact game master.',
[mbOk]);
FrmMain.Close;
end;
end else begin
str := 'Good';
g_nTimeFakeDetectCount := 0;
end;
if g_boCheckSpeedHackDisplay then begin
DScreen.AddSysMsg (IntToStr(svtime) + ' - ' +
IntToStr(cltime) + ' = ' +
IntToStr(svtime-cltime) +
' ' + str);
end;
end else begin
g_dwFirstServerTime := rtime;
g_dwFirstClientTime := GetTickCount;
//ServerTimeGap := int64(GetTickCount) - longword(msg.Recog);
end;
end;
yardımcı olursanız sevinirim.