【传奇服务器爱好者】-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

相关内容

热门资讯

第六分钟细节了解!雀神广东定制... 第六分钟细节了解!雀神广东定制插件辅助,同城游辅助器,微扑克教程(有挂秘籍)-哔哩哔哩;相信小伙伴都...
第6分钟了解了解!微信呢微乐游... 第6分钟了解了解!微信呢微乐游戏辅助脚本,新玄龙小程序辅助,透明挂教程(有挂秘诀)-哔哩哔哩,微信呢...
两分钟必看了解!边锋斗地主插件... 【福星临门,好运相随】;两分钟必看了解!边锋斗地主插件辅助脚本,雀神麻雀科技公司,透明挂教程(有挂方...
八分钟分析了解!微信多乐辅助,... 八分钟分析了解!微信多乐辅助,微信微乐辅助免费,必备教程(新版有挂)-哔哩哔哩;一、微信微乐辅助免费...
七分钟推荐了解!哈局八张挂辅助... 七分钟推荐了解!哈局八张挂辅助,新老夫子免费辅助,新版2026教程(发现有挂)-哔哩哔哩;1、这是跨...
五分钟推荐了解!四川家园茶馆辅... 五分钟推荐了解!四川家园茶馆辅助,新道游辅助软件,攻略教程(今日头条)-哔哩哔哩;一、四川家园茶馆辅...
第一分钟带你透视!创思维激k辅... 第一分钟带你透视!创思维激k辅助下载(辅助挂)原来真的是有挂(有挂功能)-哔哩哔哩;创思维激k辅助下...
四分钟传授了解!青橙竞技辅助器... 四分钟传授了解!青橙竞技辅助器,杭州都莱大菠萝插件,详细教程(证实有挂)-哔哩哔哩;人气非常高,ai...
第4分钟带你得知!欢乐达人暗宝... 第4分钟带你得知!欢乐达人暗宝源码(辅助挂)一贯有挂(存在有挂)-哔哩哔哩;超受欢迎的欢乐达人暗宝源...
第八分钟分享了解!hhpoke... 【福星临门,好运相随】;第八分钟分享了解!hhpoker作笔实战视频,广东闲来辅助器,解密教程(果真...