Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: New version : VTDbManager for Asphyre

  1. #1

    New version : VTDbManager for Asphyre

    VTDbManager v2.0 (now for Asphyre) released.
    It is free advanced manager for VTDb files with ability of compilation VTDb files from XML-definition "make files", usable to change your graphics and quick recompile to your VTDb.

    Visit http://jansoft.aquasoft.cz,
    please send bugs and comments.
    Thanks Jansoft

  2. #2

    New version : VTDbManager for Asphyre

    High Jansoft,

    the manager looks great and is a little more comfortable than the one included in Asphyre. Good work.

    I have a question concerning LZcompression.
    Is it possible to add a password somehow so that it is not possible to view my vtdb just by opening it in vtdb-manager?
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  3. #3

    New version : VTDbManager for Asphyre

    aaa - little mistake : password is not yet supported because of not-existing Encode/decode plugin for encryption.
    Maybe Lifepower will create some ?
    Or am I wrong and this can be done by another way ?

  4. #4

    New version : VTDbManager for Asphyre

    That's exactly the question...
    I was wondering if I can encrypt my data, so that it is a little more protected from being manipulated, because I want to store highscores and such stuff in VTDB, too...
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  5. #5

    New version : VTDbManager for Asphyre

    yes, you can.
    Write-down your own TEncodePlugin for encode/decode.
    Than use it in your application (probably compiled into your code).

    For VTDbManager you must have dll, which will export some functions (see sources of Asphyre, it is clear) and say to VTDBMan, that you want to use it (from cmd line or xml).

    Little problem is, that VTdbManager now doesn't support sending parameters to plugins, so your password must be always same.

    In future version i'll add this.

  6. #6

    New version : VTDbManager for Asphyre

    Ok, thanks for info...

    I will take a look at it when I really need it, got other things that have to work first.
    Maybe someone has finished an encryption-dll till then
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  7. #7

    New version : VTDbManager for Asphyre

    I forgot to include the VTDb Plugin SDK with the current release. There is an example of VTDb plugin and some documentation. I'll try to include it next time (in few days)....
    And thanks for VTDbManager!

  8. #8

    New version : VTDbManager for Asphyre

    New Release 2.1 with better plugins support now released .

    I use simple plugin definition for support passwords

    [pascal]
    library PwdPlugin;

    uses
    AsphyreDef,
    encodeplugins,
    Classes;

    {$R *.res}
    var password:string;

    function proc_encode(Source, Dest: Pointer; SourceSize, DestSize: Longword):Integer;
    begin
    Result:=SourceSize;
    if Result>DestSize then Result:=DestSize;
    Move(source^,Dest^,Result);
    end;

    function proc_decode(Source, Dest: Pointer; SourceSize, DestSize: Longword):Integer;
    begin
    Result:=SourceSize;
    if Result>DestSize then Result:=DestSize;
    Move(source^,Dest^,Result);
    end;

    function proc_params(Source, Dest: Pointer; SourceSize, DestSize: Longword):Integer;
    begin
    password:=PChar(Source);
    Result:=errNone;
    end;

    function proc_reset(Source, Dest: Pointer; SourceSize, DestSize: Longword):Integer;
    begin
    password:='';
    Result:=errNone;
    end;

    function PluginEnum(EnumFunc: TEnumFunc; MiscParam: Longword): Integer; stdcall;export;
    begin
    Result:=errUnknownError;
    if not EnumFunc(attribName, 0,'Password test plugin',MiscParam) then Exit;
    if not EnumFunc(attribID, 0,'PwdPlugin',MiscParam) then Exit;
    if not EnumFunc(attribVersion,$100,'',MiscParam) then Exit;
    if not EnumFunc(attribMinVersion,0,'',MiscParam) then Exit;
    if not EnumFunc(attribFlags,flagEncode,'Crypt data block',MiscParam) then Exit;
    if not EnumFunc(attribFlags,flagDecode,'Uncrypt data block',MiscParam) then Exit;
    if not EnumFunc(attribFlags,flagParams,'Set password',MiscParam) then Exit;
    if not EnumFunc(attribFlags,flagReset+99,'MySecureProc',M iscParam) then Exit;
    Result:=0;
    end;

    function PluginExec(Source, Dest: Pointer; SourceSize, DestSize, Flags: Longword): Integer; stdcall;export;
    begin
    case Flags of
    flagEncode : Result:=proc_encode(Source,Dest,SourceSize,DestSiz e);
    flagDecode : Result:=proc_decode(Source,Dest,SourceSize,DestSiz e);
    flagParams : Result:=proc_params(Source,Dest,SourceSize,DestSiz e);
    flagReset : Result:=proc_reset(Source,Dest,SourceSize,DestSize );
    else
    Result := errFlags;
    end;
    end;

    exports
    PluginEnum,
    PluginExec;
    end.
    [/pascal]

    Is it right way ?

  9. #9

    New version : VTDbManager for Asphyre

    I've tried to upload, my connection is garbled, so here's a simple plugin example:


    [pascal]library SEncode;

    //---------------------------------------------------------------------------
    uses
    SysUtils, Classes, AsphyreDef, EncodePlugins;

    {$R *.res}

    //---------------------------------------------------------------------------
    const
    PluginVersion = $100; // current version of the plugin
    PluginMinVersion = $100; // lowest compatible version of previous plugins
    // PluginMinVersion determines which previous versions of the plugin can
    // be decoded by current version of plugin. If it has the same value
    // as PluginVersion, then this plugin can only decode its own encodings.

    //---------------------------------------------------------------------------
    var
    AttrVersion : ShortString = 'Version 1.0'#0;
    AttrMinVersion: ShortString = 'Compatible with version 1.0 and higher'#0;
    AttrName : ShortString = 'Simple encode algorythm'#0;
    AttrID : ShortString = 'MyEncode8'#0;
    AttrFlags : array[flagEncode..flagDecode] of ShortString = ('Encode Data'#0,
    'Decode Data'#0);

    //---------------------------------------------------------------------------
    procedure DoEncode(Source, Dest: Pointer; SourceSize, DestSize: Cardinal);
    var
    i: Integer;
    InB, OutB: PByte;
    begin
    InB:= Source;
    OutB:= Dest;
    for i:= 0 to SourceSize - 1 do
    begin
    OutB^:= InB^;
    Inc(OutB^);
    Inc(InB);
    Inc(OutB);
    end;
    end;

    //---------------------------------------------------------------------------
    procedure DoDecode(Source, Dest: Pointer; SourceSize, DestSize: Cardinal);
    var
    i: Integer;
    InB, OutB: PByte;
    begin
    InB:= Source;
    OutB:= Dest;
    for i:= 0 to SourceSize - 1 do
    begin
    OutB^:= InB^;
    Dec(OutB^);
    Inc(InB);
    Inc(OutB);
    end;
    end;

    //---------------------------------------------------------------------------
    function PluginExec(Source, Dest: Pointer; SourceSize,
    DestSize, Flags: Longword): Integer; stdcall;
    begin
    Result:= errFlags;

    case Flags of
    // compress the data
    flagEncode:
    begin
    DoEncode(Source, Dest, SourceSize, DestSize);
    Result:= SourceSize;
    end;

    // decompress the data
    flagDecode:
    begin
    DoDecode(Source, Dest, SourceSize, DestSize);
    Result:= SourceSize;
    end;

    // plugin parameters
    flagParams:
    begin
    // change Result to >= 0, if successful
    Result:= errFlags;
    end;

    // reset plugin
    flagReset:
    begin
    // change Result to >= 0, if successful
    Result:= errFlags;
    end;
    end; // case Flags of
    end;

    //---------------------------------------------------------------------------
    function PluginEnum(EnumFunc: TEnumFunc; MiscParam: Longword): Integer; stdcall;
    var
    KeepGoing: Boolean;
    cFlag: Longword;
    begin
    // number of successful calls
    Result:= 0;

    // plugin name
    KeepGoing:= EnumFunc(AttribName, 0, @AttrName[1], MiscParam);
    if (not KeepGoing) then Exit else Inc(Result);

    // plugin id
    KeepGoing:= EnumFunc(AttribID, 0, @AttrID[1], MiscParam);
    if (not KeepGoing) then Exit else Inc(Result);

    // plugin version
    KeepGoing:= EnumFunc(AttribVersion, PluginVersion, @AttrVersion[1], MiscParam);
    if (not KeepGoing) then Exit else Inc(Result);

    // plugin minimal version
    KeepGoing:= EnumFunc(attribMinVersion, PluginMinVersion, @AttrMinVersion[1], MiscParam);
    if (not KeepGoing) then Exit else Inc(Result);

    // encode flags
    for cFlag:= flagEncode to flagParams do
    begin
    KeepGoing:= EnumFunc(attribFlags, cFlag, @AttrFlags[cFlag][1], MiscParam);
    if (not KeepGoing) then Exit else Inc(Result);
    end;
    end;

    //---------------------------------------------------------------------------
    exports
    PluginExec,
    PluginEnum;

    //---------------------------------------------------------------------------
    // Plugin Initialization
    //---------------------------------------------------------------------------
    begin
    end.[/pascal]

  10. #10

    New version : VTDbManager for Asphyre

    Yes, but can you provide example with usage of parameter ?

    I need some "fixed" or "recommended" way of using parameters to implement it in VTDbManager (I know, that it cannot be 100% general, but if developer uses recomended way, he can use VTDbManager for setting param)
    Now, VTDBMan shows all flags in plugin and if one of them is fsParam (or something like this), it displays editbox and user can set parameter of plugin usage. Parameter is then passed as PChar(editbox.text).

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •