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

相关内容

热门资讯

玩家必看攻略!微扑克ai分析(... 一、微扑克ai分析简介了解软件请加微:136704302微扑克ai分析是一款在线扑克游戏平台,玩家可...
黑科技规律(WePoKe)德州... 黑科技规律(WePoKe)德州扑克辅助器(智能ai)一直真的有挂(2026已更新)(哔哩哔哩);小薇...
黑科技了解(wepoke黑科技... 黑科技了解(wepoke黑科技)wepoke有透视挂吗(WePoke)从来真的有挂(有挂透明挂)-哔...
黑科技好牌(aapoker为什... 黑科技好牌(aapoker为什么一直输)外挂透明挂辅助工具(透视)其实真的有挂(有挂技术)-哔哩哔哩...
科技揭秘!cloudpoker... 您好,cloudpoker云扑克辅助这款游戏可以开挂的,确实是有挂的,需要了解加微【13670430...
黑科技安卓版(WePoKe)微... 黑科技安卓版(WePoKe)微扑克有辅助挂吗(透视)真是存在有挂(2021已更新)(哔哩哔哩)1、起...
黑科技肯定(wepoke黑科技... 黑科技肯定(wepoke黑科技)wopoker辅助器免费版v2.0(WEpoke)素来是有挂(有挂总...
实测发现!微扑克辅牌器(透明挂... 实测发现!微扑克辅牌器(透明挂黑科技)线上教程(2023已更新)(哔哩哔哩)1、微扑克辅牌器ai机器...
黑科技有挂(wopoker有没... 黑科技有挂(wopoker有没有外挂)外挂透明挂辅助器(透视)好像有挂(真的有挂)-哔哩哔哩;1、完...
黑科技app(WePoKe)德... 黑科技app(WePoKe)德州ai智能辅助是什么(透明黑科技)本来是真的有挂(2025已更新)(哔...