About C++

Started by Blood Sucker, Jun 18, 2017, 07:20 PM

Previous topic - Next topic

Blood Sucker

Can I script a server with C++?
If yes where can I find the plugins and can I make the server with two programming languages? (Squirrel and C++)
I hope I didn't break any rules by posting this ;D :D

EK.IceFlake

You don't use a plugin to script in C++. Your plugin is your script itself.
Here is an example of that and here are details on how to do something similar.

Keep in mind though that using C++ has a lot of disadvantages. One major one would be no error handling. You mess up and the server crashes. There's no nice error message like you get in Squirrel detailing the error and the location where it occurred.

Stormeus

Your server is not necessarily going to be better off using C++ unless you need access to low-level system interfaces or have extremely tight performance constraints. Even if you think you need to use C++, I think it's generally better to use the Java plugin since it's still versatile enough for things like multi-threading without having to deal with debugging segfaults and memory leaks when something is wrong.

Personally, the only reason I would script a server in C/C++ is for testing new server versions under development with added API calls, only because it's faster to iterate on that than it is to have to modify another scripting plugin and test that.

Blood Sucker

WoOoW the biggest two nerds in VC-MP answered xD
Ty for your support guys :D

ysc3839

Yes.
Plugin API header.