📄 other.pas
字号:
unit Other;
interface
uses
Windows;
function UpperCase(const S: string): string;
function StrLen(const Str: PChar): Cardinal; assembler;
function StrCopy(Dest: PChar; const Source: PChar): PChar;
function StrPas(const Str: PChar): string;
function Inttostr(const Int: integer): string;
function GetServerName(Logo: string; Y: integer): string;
function GetServerPlace(Y: integer): string;
function myGetComputerName: string;
implementation
function UpperCase(const S: string): string;
var
Ch: Char;
L: Integer;
Source, Dest: PChar;
begin
L := Length(S);
SetLength(Result, L);
Source := Pointer(S);
Dest := Pointer(Result);
while L <> 0 do
begin
Ch := Source^;
if (Ch >= 'a') and (Ch <= 'z') then
Dec(Ch, 32);
Dest^ := Ch;
Inc(Source);
Inc(Dest);
Dec(L);
end;
end;
function StrLen(const Str: PChar): Cardinal; assembler;
asm
MOV EDX,EDI
MOV EDI,EAX
MOV ECX,0FFFFFFFFH
XOR AL,AL
REPNE SCASB
MOV EAX,0FFFFFFFEH
SUB EAX,ECX
MOV EDI,EDX
end;
function StrCopy(Dest: PChar; const Source: PChar): PChar;
asm
PUSH EDI
PUSH ESI
MOV ESI,EAX
MOV EDI,EDX
MOV ECX,0FFFFFFFFH
XOR AL,AL
REPNE SCASB
NOT ECX
MOV EDI,ESI
MOV ESI,EDX
MOV EDX,ECX
MOV EAX,EDI
SHR ECX,2
REP MOVSD
MOV ECX,EDX
AND ECX,3
REP MOVSB
POP ESI
POP EDI
end;
function StrPas(const Str: PChar): string;
begin
Result := Str;
end;
function Inttostr(const Int: integer): string;
var
d, m: integer;
begin
m := int;
Result := '';
while m <> 0 do
begin
d := m mod 10;
m := m div 10;
Result := chr(d + 48) + Result;
end;
end;
function myGetComputerName: string;
var
pcComputer: PChar;
dwCSize: DWORD;
begin
dwCSize := MAX_COMPUTERNAME_LENGTH + 1;
GetMem(pcComputer, dwCSize);
try
if GetComputerName(pcComputer, dwCSize) then
Result := pcComputer;
finally
FreeMem(pcComputer);
end;
end;
function GetServerPlace(Y: integer): string;
var
s2, s3, s4, s6, s8, RES: string;
begin
case Y of
268..308: s2 := '1/2,';
310..350: s2 := '2/2,';
end;
case Y of
247..287: s3 := '1/3,';
289..329: s3 := '2/3,';
331..371: s3 := '3/3,';
end;
case Y of
226..266: s4 := '1/4,';
268..308: s4 := '2/4,';
310..350: s4 := '3/4,';
352..392: s4 := '4/4,';
end;
case Y of
184..224: s6 := '1/6,';
226..266: s6 := '2/6,';
268..308: s6 := '3/6,';
310..350: s6 := '4/6,';
352..392: s6 := '5/6,';
394..434: s6 := '6/6,';
end;
case Y of
141..182: s8 := '1/8,';
184..224: s8 := '2/8,';
226..266: s8 := '3/8,';
268..308: s8 := '4/8,';
310..350: s8 := '5/8,';
352..392: s8 := '6/8,';
394..434: s8 := '7/8,';
436..476: s8 := '8/8,';
end;
RES := s2 + s3 + s4 + s6 + s8;
if copy(RES, Length(RES), 1) = ',' then
delete(RES, Length(RES), 1);
if RES = '' then
Result := '【未知】'
else
Result := '【' + RES + '】';
end;
function GetServerName(Logo: string; Y: integer): string;
begin
if (Logo = '传 奇 一 区') or (Logo = '传奇九区(一区转档)') then
begin
if (y > 141) and (y < 183) then
result := '雷霆(上海)'
else if (y > 183) and (y < 225) then
result := '光芒(上海)'
else if (y > 225) and (y < 267) then
result := '烈焰(上海)'
else if (y > 267) and (y < 309) then
result := '疾风(北京)'
else if (y > 309) and (y < 351) then
result := '新浪(北京)'
else if (y > 351) and (y < 393) then
result := '流云(广州)'
else if (y > 393) and (y < 435) then
result := '联通(南京)'
else if (y > 435) and (y < 477) then
result := '蜀山(广州)'
else
result := '未知';
end
else if (Logo = '传 奇 二 区') or (Logo = '传奇十区(二区转档)') then
begin
if (y > 141) and (y < 183) then
result := '雷霆(上海)'
else if (y > 183) and (y < 225) then
result := '光芒(上海)'
else if (y > 225) and (y < 267) then
result := '烈焰(上海)'
else if (y > 267) and (y < 309) then
result := '雷霆二(上海)'
else if (y > 309) and (y < 351) then
result := '渝州(重庆)'
else if (y > 351) and (y < 393) then
result := '峨嵋(成都)'
else if (y > 393) and (y < 435) then
result := '海鼎(新浪)'
else if (y > 435) and (y < 477) then
result := '网通(上海)'
else
result := '未知';
end
else if (Logo = '传 奇 三 区') or (Logo = '传奇八区(三区转档)') or (Logo =
'英雄之门(三区转档)') then
begin
if (y > 141) and (y < 183) then
result := '飞鸿(杭州)'
else if (y > 183) and (y < 225) then
result := '新月(广东)'
else if (y > 225) and (y < 267) then
result := '雄狮(流云)'
else if (y > 267) and (y < 309) then
result := '天府(新浪)'
else if (y > 309) and (y < 351) then
result := '天堂(成都)'
else if (y > 351) and (y < 393) then
result := '雷霆二(上海)'
else if (y > 393) and (y < 435) then
result := '光芒二(上海)'
else if (y > 435) and (y < 477) then
result := '烈焰二(上海)'
else
result := '未知';
end
else if (Logo = '天空·传奇(四区)') or (Logo = '王者大陆(四区转档)') then
begin
if (y > 141) and (y < 183) then
result := '归谷(上海)'
else if (y > 183) and (y < 225) then
result := '天涯(上海)'
else if (y > 225) and (y < 267) then
result := '清风(上海)'
else if (y > 267) and (y < 309) then
result := '落霞(上海)'
else if (y > 309) and (y < 351) then
result := '归谷二(上海)'
else if (y > 351) and (y < 393) then
result := '天涯二(上海)'
else if (y > 393) and (y < 435) then
result := '清风二(上海)'
else if (y > 435) and (y < 477) then
result := '落霞二(上海)'
else
result := '未知';
end
else if (Logo = '传 奇 五 区') or (Logo = '传奇四十区(五区转档)') then
begin
if (y > 141) and (y < 183) then
result := '浩然(上海)'
else if (y > 183) and (y < 225) then
result := '天地(上海)'
else if (y > 225) and (y < 267) then
result := '正气(上海)'
else if (y > 267) and (y < 309) then
result := '长存(上海)'
else if (y > 309) and (y < 351) then
result := '浩然二(上海)'
else if (y > 351) and (y < 393) then
result := '天地二(上海)'
else if (y > 393) and (y < 435) then
result := '正气二(上海)'
else if (y > 435) and (y < 477) then
result := '长存二(上海)'
else
result := '未知';
end
else if Logo = '传 奇 六 区' then
begin
if (y > 141) and (y < 183) then
result := '三峡(联通)'
else if (y > 183) and (y < 225) then
result := '青城(成都)'
else if (y > 225) and (y < 267) then
result := '滇池(昆明)'
else if (y > 267) and (y < 309) then
result := '长白(东北)'
else if (y > 309) and (y < 351) then
result := '三峡二(联通)'
else if (y > 351) and (y < 393) then
result := '青城二(成都)'
else if (y > 393) and (y < 435) then
result := '滇池二(昆明)'
else if (y > 435) and (y < 477) then
result := '长白二(东北)'
else
result := '未知';
end
else if Logo = '传 奇 七 区' then
begin
if (y > 141) and (y < 183) then
result := '奇迹(上海)'
else if (y > 183) and (y < 225) then
result := '长宽(武汉)'
else if (y > 225) and (y < 267) then
result := '流星(上海)'
else if (y > 267) and (y < 309) then
result := '皓月(上海)'
else if (y > 309) and (y < 351) then
result := '奇迹二(上海)'
else if (y > 351) and (y < 393) then
result := '皓月二(上海)'
else if (y > 393) and (y < 435) then
result := '长宽二(上海)'
else if (y > 435) and (y < 477) then
result := '流星二(上海)'
else
result := '未知';
end
else if Logo = '经典之国(11区)' then
begin
if (y > 141) and (y < 183) then
result := '西游(上海)'
else if (y > 183) and (y < 225) then
result := '三国(上海)'
else if (y > 225) and (y < 267) then
result := '水浒(上海)'
else if (y > 267) and (y < 309) then
result := '红楼(上海)'
else if (y > 309) and (y < 351) then
result := '封神(上海)'
else if (y > 351) and (y < 393) then
result := '聊斋(上海)'
else if (y > 393) and (y < 435) then
result := '春秋(上海)'
else if (y > 435) and (y < 477) then
result := '战国(上海)'
else
result := '未知';
end
else if Logo = '西部圣域(12区)' then
begin
if (y > 141) and (y < 183) then
result := '华山(天府)'
else if (y > 183) and (y < 225) then
result := '雪域(天府)'
else if (y > 225) and (y < 267) then
result := '敦煌(天府)'
else if (y > 267) and (y < 309) then
result := '九寨(天府)'
else if (y > 309) and (y < 351) then
result := '天山(敦煌转档)'
else if (y > 351) and (y < 393) then
result := '版纳(天府)'
else if (y > 393) and (y < 435) then
result := '剑门(天府)'
else if (y > 435) and (y < 477) then
result := '嘉峪(九寨转档)'
else
result := '未知';
end
else if Logo = '移动天下(15区)' then
begin
if (y > 246) and (y < 288) then
result := '华夏(移动)'
else if (y > 288) and (y < 330) then
result := '神州(移动)'
else if (y > 330) and (y < 372) then
result := '四海(移动)'
else
result := '未知';
end
else if Logo = '侠骨丹心(16区)' then
begin
if (y > 267) and (y < 309) then
result := '楚天(联通)'
else if (y > 309) and (y < 351) then
result := '秦岭(联通)'
else
result := '未知';
end
else if Logo = '风云专区(17区)' then
begin
if (y > 225) and (y < 267) then
result := '奔腾(光通)'
else if (y > 267) and (y < 309) then
result := '海清(光通)'
else if (y > 309) and (y < 351) then
result := '天河(NEW!光通)'
else if (y > 351) and (y < 393) then
result := '白云山(NEW!光通)'
else
result := '未知';
end
else if Logo = '赤月·广电星空(18区)' then
begin
if (y > 225) and (y < 267) then
result := '辟地(新版)'
else if (y > 267) and (y < 309) then
result := '开天(新版)'
else if (y > 309) and (y < 351) then
result := '霸业(新版)'
else if (y > 351) and (y < 393) then
result := '辉煌(新版)'
else
result := '未知';
end
else if Logo = '西部圣域II(19区)' then
begin
if (y > 225) and (y < 267) then
result := '昆仑(天府)'
else if (y > 267) and (y < 309) then
result := '龙门(天府)'
else if (y > 309) and (y < 351) then
result := '苍山(天府)'
else if (y > 351) and (y < 393) then
result := '古城(天府)'
else
result := '未知';
end
else if Logo = '光明世界(20区)' then
begin
if (y > 225) and (y < 267) then
result := '晴空'
else if (y > 267) and (y < 309) then
result := '碧波'
else if (y > 309) and (y < 351) then
result := '青山'
else if (y > 351) and (y < 393) then
result := '绿野'
else
result := '未知';
end
else if Logo = '江山如画(21区)' then
begin
if (y > 225) and (y < 267) then
result := '秋水'
else if (y > 267) and (y < 309) then
result := '长天'
else if (y > 309) and (y < 351) then
result := '沧海'
else if (y > 351) and (y < 393) then
result := '桑田'
else
result := '未知';
end
else if Logo = '网通宽带(22区)' then
begin
if (y > 225) and (y < 267) then
result := '雾都'
else if (y > 267) and (y < 309) then
result := '紫金'
else if (y > 309) and (y < 351) then
result := '赤焰'
else if (y > 351) and (y < 393) then
result := '红日'
else
result := '未知';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -