Posts: 2,286
Threads: 18
Joined: Jun 2010
What is this?
This is an implementation of the SA-MP SDK for the systems programming language D (
http://dlang.org/). D's aim is safe memory operations, and it's one of my favourite languages right now.
The SDK is in an early stage, and only works on Windows right now (though, most of the SDK is implemented).
How do I use this?
If you're using Visual Studio, you can download Visual D (
https://rainers.github.io/visuald/vi...StartPage.html) and simply open the project provided below.
Is that all
Nope, there's an example and some tests in the
ExamplePlugin/dllmain.d file, and I'll be adding more information about it as I go.
Where do I download it?
There aren't any binaries (seeing as it's an SDK), but the source code is
on GitHub.
One more thing:
Please report any bugs you find using the GitHub issue tracker.
Posts: 2,368
Threads: 27
Joined: Jun 2010
Reputation:
0
Interesting way of naming "S[D]K". Very well done.
Posts: 1,696
Threads: 6
Joined: Dec 2008
Looks great!
Waiting for the LISP SDK!
Posts: 3,004
Threads: 12
Joined: May 2011
What about support for functions/callbacks from other plugins ?
Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by Kaperstone
What about support for functions/callbacks from other plugins ?
|
The SDK can take care of that - just like in the C SDK, there are Native/Callback functions.
Posts: 2,286
Threads: 18
Joined: Jun 2010
Pushed a new update:
Added exception handling
The functions now throw an AmxException that contains the error type, and error description as a string.
Most out values replaced by return values (you don't need to declare a variable before calling the functions).
Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by Dystans
While trying to compile, I get the following error:
Код:
Error: cannot pass dynamic arrays to extern© vararg functions
It shows up in this code:
pawn Код:
catch(AmxException e) { LogPrintf("Could not register natives with AMX: %s", e.getErrorString()); return e.getError(); }
Exactly:
Код:
LogPrintf("Could not register natives with AMX: %s", e.getErrorString());
How to fix it? I use Visual Studio 2013 Community Edition, I have VisualD and the compiler installed, and the only thing that worries me is this one error above.
|
Try changing "e.getErrorString()" to "e.getErrorString().ptr". I'll be adding a LogPrintf function that supports D arrays, but for now you have to pass a pointer. It's odd my compiler didn't notice that as yours did, though.
Posts: 2,286
Threads: 18
Joined: Jun 2010
Added
Linux (and any Posix, GNU system) support - the SDK is now cross-compatible.
Added an example
Unix makefile.
Posts: 1,696
Threads: 6
Joined: Dec 2008
Thanks for adding ganoo support.
Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
This should really be set as a sticky I would recommend taking the same approach as the SAMP development tutorial that is also a sticky but instead focus solely on D.
Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by Pottus
This should really be set as a sticky I would recommend taking the same approach as the SAMP development tutorial that is also a sticky but instead focus solely on D.
|
Yeah, I'll surely be making a D plugin development guide.
New update:
I replaced most of the code with object-oriented one to minimise the amount of functions the end-user has to call to initialize the plugin.
(
https://github.com/KingHual/SA-MP-S-.../dllmain.d#L73)
amxRegister now automatically appends NULL to the passed array, so the end-user doesn't need to have NULL as the last element of the array.
(
https://github.com/KingHual/SA-MP-S-...main.d#L64-L67)
Posts: 262
Threads: 26
Joined: Dec 2014
Reputation:
0
There is any D plugin development guide?