Page 1 of 1

C++ and C# scripts... I don't get it

PostPosted: Sun Jul 27, 2003 12:01 pm
by dVizard
Well, I am writing a small game in C++, and I will need scripting support in future, but the last thing I want to do is to port the whole thing to C#, because, uhm, C# sucks. BUT C# has CodeDom. Now I have seen your emu uses C# for scripts but is written in C++ and I have looked at the code a bit, but I don't understand how it's done. Could you please explain this to me?
Apparently the scripts seem to be able to use the commands specified in ScriptInterface.h/cpp (or am I completely wrong? ) but neither do I see any reference to this in ScriptMgr nor do I understand how a (compiled) script dll included in the c++ project can access functions from this project...

PostPosted: Sun Jul 27, 2003 5:31 pm
by Corillian
The reason the scripts have access to classes and data within the emulator is because all classes that are exposed to the scripts are written in managed C++ inside of gameserver.dll. When the scripts get compiled they use gameserver.dll as a reference assembly. .NET takes care of the rest =)

PostPosted: Mon Jul 28, 2003 8:23 am
by dVizard
Does this already work in C++6 or do I need C++ .NET to do this?

PostPosted: Mon Jul 28, 2003 2:25 pm
by Smallhorse
You need VS.NET ... because only VS.NET supports managed extensions to C++.