|
||
|
|||||||
| Other Cant find a category above, use this one! Core mods not listed above go here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Newbie
|
First, before I show you the tricky part there are some questions you should ask yourself:
In case you have answered one or more times with "no", leave this thread. Now. Also I do not recommend to do any core-changes you don't understand! I'm neither a teacher nor a debugger: If you have some strange problems with the following changes -> revert them or try to understand what the .NET-Compiler tries to tell you.... ![]() Sooo.... you are still with me? Excitingly reading how to use those cool new features like LINQ, anonymous classes, extensions, add-ins, ....?? Here is all the magic: First: Open ScriptCompiler.cs and search for this line: Code:
using ( CSharpCodeProvider provider = new CSharpCodeProvider() ) Code:
var providerOptions = new Dictionary<string, string>(); providerOptions.Add( "CompilerVersion", "v3.5" ); using ( CSharpCodeProvider provider = new CSharpCodeProvider( providerOptions ) ) Yep, thats all... have fun ![]() --Anheledir
__________________
|
|
|
|
|
|
#4 (permalink) | |
|
Newbie
|
Quote:
![]() You can obviously run RunUO 2.0 on .NET 3.5 'cause 3.5 doesn't have a new CRL. The .NET Core (CRL) is still on version 2.0. Then .NET 3.0 had a new version of C# and some new namespaces for WPF, WCF and WF, but it's only build around the 2.0 CRL. And now there is .NET 3.5 - and the biggest new feature is LINQ. But: It is using the 2.0 CRL, too. So... in case you have installed .NET 3.0 or 3.5 you must have .NET 2.0 also. Because of that there is no problem running RunUO with the new Framework. But in case you want to use some of the new features from .NET 3.0 or 3.5, you must tell the internal script-Compiler from RunUO to compile against those new namespaces. And thats exactly what my little patch is doing. Example 1: Without this patch and only .NET 2.0 you have to write the following: Code:
private bool _someProperty;
public bool SomeProperty {
get { return _someProperty; }
set { _someProperty = value; }
}
Code:
public bool SomeProperty { get; set; }
Example 2: Without this patch and only .NET 2.0 you have to write the following: Code:
Cloak c = new Cloak(); c.IsArcane = true; c.MaxArcaneCharges = 10; c.CurArcaneCharges = 10; Code:
var c = new Cloak(IsArcane = true, MaxArcaneCharges = 10, CurArcaneCharges = 10); ![]()
__________________
|
|
|
|
|
|
|
#5 (permalink) | |
|
Forum Expert
|
Quote:
|
|
|
|
|
|
|
#6 (permalink) | |
|
Newbie
|
Quote:
I do a Search but it dont show anything exxcept Not Found.
__________________
Kick a Dog I kick yer Azz, Save a Dog And you have made 2 friends for life! |
|
|
|
|
|
|
#7 (permalink) |
|
Forum Expert
Join Date: Jun 2004
Age: 47
Posts: 775
|
You must not have the full RunUO 2.0 with server sources or you're looking in the Scripts directory. ScriptCompiler.cs is in the Server directory where the RunUO source is.
__________________
If you PM me and ask me to write scripts for you I will add you to my ignore list. Please don't add me to your friends list, I have enough friends. Thx |
|
|
|
![]() |
| Bookmarks |
| Tags |
| .net 3.5, core, linq |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|