|
johnt Newbie
Joined: 23 Oct 2015 Posts: 1
|
Posted: Fri Oct 23, 2015 9:52 am
Adding C# |
Can someone give me a rundown of how to get C# added to the scripting languages for CMUD?
Thanks in advance! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri Oct 23, 2015 11:16 am |
It should just be a matter of having the C# libraries installed on your system.
Then it should appear in the languages dropdown list of a given setting. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sat Oct 24, 2015 5:27 am |
C# is not a scripting language, it's a full programming language. It can't be embedded in other environments, only to create standalone executable binaries.
|
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Sat Oct 24, 2015 4:47 pm |
I make extensive use of C# as an scripting extension. Once you understand that CMUD is both a server and a client you can take advantage of this feature. The way I communicate between zscript with C# is via COM using json to pass data back and forth.
The place to start is here.
Here you will find the front end of a C# application that communicates with CMUD.
Here is the script to connect:
Code: |
$connStr = "sqlServer.Agent"
;;
#VAR comsrv %comcreate( $connStr)
|
The variable comsrv now can be used in calls to the C# application: #call @comsrv.<methodname>(parameters)... Where methodname is any method in your application which is declared public. |
|
_________________ Sic itur ad astra. |
|
|
|
|
|