【传奇服务器爱好者】-IGE引擎M2-Plug-In-zPlugOfEngine
创始人
2025-01-17 14:32:49
0

文章目录

    • 插件开发-zPlugOfEngine

插件开发-zPlugOfEngine

提示:初始化DLL
const
PlugName = ‘网络引擎功能插件 (2016/8/18)’;
LoadPlus = ‘正在加载网络引擎功能插件’;
nFindObj = 5;
nPlugHandle = 6;
type
TMsgProc = procedure(Msg: PChar; nMsgLen: Integer; nMode: Integer); stdcall;
TFindProc = function(sProcName: PChar; nNameLen: Integer): Pointer; stdcall;
TFindObj = function(sObjName: PChar; nNameLen: Integer): TObject; stdcall;
TSetProc = function(ProcAddr: Pointer; ProcName: PChar; nNameLen: Integer): Boolean; stdcall;
TGetFunAddr = function(nIndex: Integer): Pointer; stdcall;
function Init(AppHandle: HWnd; MsgProc: TMsgProc; FindProc: TFindProc; SetProc: TSetProc; GetFunAddr: TGetFunAddr): PChar; stdcall;
//var
//FindObj: TFindObj;
begin
PlugHandle := 0;
MsgProc(LoadPlus, length(LoadPlus), 0);
//FindObj := TFindObj(GetFunAddr(nFindObj));
PlugHandle := PInteger(GetFunAddr(nPlugHandle))^;
InitPlug();
Result := PlugName;
end;

procedure UnInit();
begin
UnInitPlug();
end;

procedure Config(); stdcall;
begin
FrmFunctionConfig := TFrmFunctionConfig.Create(nil);
FrmFunctionConfig.Open();
FrmFunctionConfig.Free;
end;

exports
Init, UnInit, Config;

提示:包含引擎的开发API包
在这里插入图片描述
提示:插件设置界面
在这里插入图片描述procedure TFrmFunctionConfig.Open();
var
I: Integer;
StdItem: _LPTOSTDITEM;
List: Classes.TList;
begin
boOpened := False;
boModValued := False;
ButtonUserCommandDel.Enabled := False;
ButtonUserCommandChg.Enabled := False;
ButtonDisallowDel.Enabled := False;
ButtonMsgFilterDel.Enabled := False;
ButtonMsgFilterChg.Enabled := False;
ListBoxitemList.Items.Clear;
ListBoxUserCommand.Items.Clear;
List := Classes.TList(TUserEngine_GetStdItemList);
for I := 0 to List.Count - 1 do begin
StdItem := List.Items[I];
ListBoxitemList.Items.AddObject(StdItem.szName, TObject(StdItem));
end;
RefLoadMsgFilterList();
RefLoadDisallowStdItems();
ListBoxUserCommand.Items.Clear;
ListBoxUserCommand.Items.AddStrings(g_UserCmdList);
boOpened := True;
FunctionConfigControl.ActivePageIndex := 0;
ShowModal;
end;

procedure TFrmFunctionConfig.ListBoxUserCommandClick(Sender: TObject);
var
nItemIndex: Integer;
begin
try
nItemIndex := ListBoxUserCommand.ItemIndex;
EditCommandName.Text := ListBoxUserCommand.Items.Strings[nItemIndex];
SpinEditCommandIdx.Value := Integer(ListBoxUserCommand.Items.Objects[nItemIndex]);
ButtonUserCommandDel.Enabled := True;
ButtonUserCommandChg.Enabled := True;
except
EditCommandName.Text := ‘’;
SpinEditCommandIdx.Value := 0;
ButtonUserCommandDel.Enabled := False;
ButtonUserCommandChg.Enabled := False;
end;
end;

function TFrmFunctionConfig.InCommandListOfIndex(nIndex: Integer): Boolean;
var
I: Integer;
begin
Result := False;
for I := 0 to ListBoxUserCommand.Items.Count - 1 do begin
if nIndex = Integer(ListBoxUserCommand.Items.Objects[I]) then begin
Result := True;
Break;
end;
end;
end;

function TFrmFunctionConfig.InCommandListOfName(sCommandName: string): Boolean;
var
I: Integer;
begin
Result := False;
for I := 0 to ListBoxUserCommand.Items.Count - 1 do begin
if CompareText(sCommandName, ListBoxUserCommand.Items.Strings[I]) = 0 then begin
Result := True;
Break;
end;
end;
end;

procedure TFrmFunctionConfig.ButtonUserCommandAddClick(Sender: TObject);
var
sCommandName: string;
nCommandIndex: Integer;
begin
sCommandName := Trim(EditCommandName.Text);
nCommandIndex := SpinEditCommandIdx.Value;
if sCommandName = ‘’ then begin
Application.MessageBox(‘请输入命令!!!’, ‘提示信息’, MB_ICONQUESTION);
Exit;
end;
if InCommandListOfName(sCommandName) then begin
Application.MessageBox(‘输入的命令已经存在,请选择其他命令!!!’, ‘提示信息’, MB_ICONQUESTION);
Exit;
end;
if InCommandListOfIndex(nCommandIndex) then begin
Application.MessageBox(‘输入的命令编号已经存在,请选择其他命令编号!!!’, ‘提示信息’, MB_ICONQUESTION);
Exit;
end;
ListBoxUserCommand.Items.AddObject(sCommandName, TObject(nCommandIndex));
end;

procedure TFrmFunctionConfig.ButtonUserCommandDelClick(Sender: TObject);
begin
if Application.MessageBox(‘是否确认删除此命令?’, ‘确认信息’, MB_YESNO + MB_ICONQUESTION) = mrYes then begin
try
ListBoxUserCommand.DeleteSelected;
except
end;
end;
end;

procedure TFrmFunctionConfig.ButtonUserCommandChgClick(Sender: TObject);
var
sCommandName: string;
nCommandIndex: Integer;
I, nItemIndex: Integer;
begin
sCommandName := Trim(EditCommandName.Text);
nCommandIndex := SpinEditCommandIdx.Value;
if sCommandName = ‘’ then begin
Application.MessageBox(‘请输入命令!!!’, ‘提示信息’, MB_ICONQUESTION);
Exit;
end;
if InCommandListOfName(sCommandName) then begin
Application.MessageBox(‘你要修改的命令已经存在,请选择其他命令!!!’, ‘提示信息’, MB_ICONQUESTION);
Exit;
end;
if InCommandListOfIndex(nCommandIndex) then begin
Application.MessageBox(‘你要修改的命令编号已经存在,请选择其他命令编号!!!’, ‘提示信息’, MB_ICONQUESTION);
Exit;
end;
nItemIndex := ListBoxUserCommand.ItemIndex;
try
ListBoxUserCommand.Items.Strings[nItemIndex] := sCommandName;
ListBoxUserCommand.Items.Objects[nItemIndex] := TObject(nCommandIndex);
Application.MessageBox(‘修改完成!!!’, ‘提示信息’, MB_ICONQUESTION);
except
Application.MessageBox(‘修改失败!!!’, ‘提示信息’, MB_ICONQUESTION);
end;
end;

procedure TFrmFunctionConfig.ButtonUserCommandSaveClick(Sender: TObject);
var
sFileName: string;
I: Integer;
sCommandName: string;
nCommandIndex: Integer;
SaveList: Classes.TStringList;
begin
ButtonUserCommandSave.Enabled := False;
sFileName := ‘.\UserCmd.txt’;
SaveList := Classes.TStringList.Create;
SaveList.Add(‘;引擎插件配置文件’);
SaveList.Add(‘;命令名称’#9’对应编号’);
for I := 0 to ListBoxUserCommand.Items.Count - 1 do begin
sCommandName := ListBoxUserCommand.Items.Strings[I];
nCommandIndex := Integer(ListBoxUserCommand.Items.Objects[I]);
SaveList.Add(sCommandName + #9 + IntToStr(nCommandIndex));
end;
SaveList.SaveToFile(sFileName);
SaveList.Free;
Application.MessageBox(‘保存完成!!!’, ‘提示信息’, MB_ICONQUESTION);
ButtonUserCommandSave.Enabled := True;
end;

procedure TFrmFunctionConfig.ButtonLoadUserCommandListClick(
Sender: TObject);
begin
ButtonLoadUserCommandList.Enabled := False;
LoadUserCmdList();
ListBoxUserCommand.Items.Clear;
ListBoxUserCommand.Items.AddStrings(g_UserCmdList);
Application.MessageBox(‘重新加载自定义命令列表完成!!!’, ‘提示信息’, MB_ICONQUESTION);
ButtonLoadUserCommandList.Enabled := True;
end;

function TFrmFunctionConfig.InListBoxitemList(sItemName: string): Boolean;
var
I: Integer;
ListItem: TListItem;
begin
Result := False;
ListViewDisallow.Items.BeginUpdate;
try
for I := 0 to ListView

相关内容

热门资讯

透视免费!wepoker手机版... 透视免费!wepoker手机版透视脚本,(wepoker)切实有挂(透视)有挂(有挂插件)1)wep...
透视讲解!pokemomo辅助... 透视讲解!pokemomo辅助软件,约局吧德州有挂吗,靠谱教程(有挂教程)约局吧德州有挂吗是一种具有...
透视苹果版!德普之星透视辅助,... 透视苹果版!德普之星透视辅助, (德扑之心)一贯真的是有挂(透视)透视辅助(有挂辅助)亲,关键说明,...
透视辅助器!wepoker代打... 透视辅助器!wepoker代打辅助,(WEPOKER)一直有挂(透视)买脚本靠谱(有挂方法)1、完成...
辅助透视!约局吧是否有挂,po... 辅助透视!约局吧是否有挂,pokemmo手机版脚本免费,必赢方法(有挂详情)1、不需要AI权限,帮助...
透视安装!德扑圈有透视吗, (... 透视安装!德扑圈有透视吗, (德扑之心)一直是真的有挂(透视)辅助器(有挂细节);1、在德扑圈有透视...
透视辅助器!wejoker手机... 透视辅助器!wejoker手机版透视脚本,(wepoker)其实真的有挂(透视)破解工具(有挂揭秘)...
透视脚本!pokemmo脚本最... 透视脚本!pokemmo脚本最新版,约局吧德州可以透视吗,切实教程(有挂工具)1)约局吧德州可以透视...
透视黑科技!德普辅助软件, (... 透视黑科技!德普辅助软件, (德扑之心)一直是有挂(透视)私人局辅助免费(有挂黑科技)1)德普辅助软...
透视脚本!wepoker俱乐部... 透视脚本!wepoker俱乐部辅助,(wepoker)总是是有挂(透视)-h5下载(有挂解密)一、w...