SA-MP S[D]K -
KingHual - 11.12.2014
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.
Re: SA-MP S[D]K -
iZN - 11.12.2014
Interesting way of naming "S[D]K". Very well done.
Re: SA-MP S[D]K -
Khanz - 11.12.2014
Looks great!
Waiting for the LISP SDK!
Re: SA-MP S[D]K -
Kaperstone - 12.12.2014
What about support for functions/callbacks from other plugins ?
Re: SA-MP S[D]K -
KingHual - 12.12.2014
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.
Re: SA-MP S[D]K -
GM_KoDi - 12.12.2014
Very Nice
Re: SA-MP S[D]K -
KingHual - 12.12.2014
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).
Re: SA-MP S[D]K -
Dystans - 12.12.2014
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.
Re: SA-MP S[D]K -
KingHual - 12.12.2014
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.
Re: SA-MP S[D]K -
Arastair - 12.12.2014
Quote:
Originally Posted by iZN
Interesting way of naming "S[D]K". Very well done.
|
Lol good point
Re: SA-MP S[D]K -
KingHual - 13.12.2014
Added
Linux (and any Posix, GNU system) support - the SDK is now cross-compatible.
Added an example
Unix makefile.
Re: SA-MP S[D]K -
Khanz - 13.12.2014
Thanks for adding ganoo support.
Re: SA-MP S[D]K -
Pottus - 13.12.2014
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.
Re: SA-MP S[D]K -
KingHual - 13.12.2014
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)
Re: SA-MP S[D]K -
RaeF - 16.04.2015
Thanks for this!
Re: SA-MP S[D]K -
RaeF - 09.05.2015
There is any D plugin development guide?