📄 zplugofengine.dpr
字号:
library zPlugOfEngine;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
Windows,
SysUtils,
Classes,
PlugMain in 'PlugMain.pas',
PlayUserCmd in 'PlayUserCmd.pas',
NpcScriptCmd in 'NpcScriptCmd.pas',
PlugShare in 'PlugShare.pas',
PlayUser in 'PlayUser.pas',
FunctionConfig in 'FunctionConfig.pas' {FrmFunctionConfig},
HUtil32 in 'HUtil32.pas',
EngineAPI in 'EngineAPI.pas',
EngineType in 'EngineType.pas';
{$R *.res}
const
PlugName = '飞尔世界引擎功能插件 (2007/06/21)';
LoadPlus = '加载飞尔世界引擎功能插件成功...';
UnLoadPlus = '卸载飞尔世界引擎功能插件成功...';
type
TMsgProc = procedure(Msg: PChar; nMsgLen: Integer; nMode: Integer); stdcall;
TFindProc = function(ProcName: PChar; nNameLen: Integer; nProcCode: Integer): Pointer; stdcall;
TSetProc = function(ProcAddr: Pointer; ProcName: PChar; nNameLen: Integer; nProcCode: Integer): Boolean; stdcall;
TFindObj = function(ObjName: PChar; nNameLen: Integer; nObjcCode: Integer): TObject; stdcall;
var
OutMessage: TMsgProc;
FindProcTable: TFindProc;
FindObjTable: TFindObj;
SetProcTable: TSetProc;
procedure MainOutMessasge(Msg: string; nMode: Integer);
begin
if Assigned(OutMessage) then begin
OutMessage(PChar(Msg), Length(Msg), nMode);
end;
end;
function GetProcAddr(sProcName: string; nProcCode: Integer): Pointer;
begin
Result := nil;
if Assigned(FindProcTable) then begin
Result := FindProcTable(PChar(sProcName), Length(sProcName), nProcCode);
end;
end;
function GetObjAddr(sObjName: string; nObjcCode: Integer): TObject;
begin
Result := nil;
if Assigned(FindObjTable) then begin
Result := FindObjTable(PChar(sObjName), Length(sObjName), nObjcCode);
end;
end;
function SetProcAddr(ProcAddr: Pointer; sProcName: string; nProcCode: Integer): Boolean;
begin
Result := False;
if Assigned(SetProcTable) then begin
Result := SetProcTable(ProcAddr, PChar(sProcName), Length(sProcName), nProcCode);
end;
end;
function Start(): Boolean; stdcall;
begin
Result := StartPlug;
end;
function Init(AppHandle: HWnd; MsgProc: TMsgProc; FindProc: TFindProc; SetProc: TSetProc; FindObj: TFindObj): PChar; stdcall;
begin
OutMessage := MsgProc;
FindProcTable := FindProc;
SetProcTable := SetProc;
InitPlug();
MainOutMessasge(LoadPlus, 0);
Result := PChar(PlugName);
end;
procedure UnInit(); stdcall;
begin
UnInitPlug();
MainOutMessasge(UnLoadPlus, 0);
end;
procedure Config(); stdcall;
begin
FrmFunctionConfig := TFrmFunctionConfig.Create(nil);
FrmFunctionConfig.Open();
FrmFunctionConfig.Free;
end;
exports
Init, UnInit, Start, Config;
begin
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -