Solved Compiling Fougerite

Viproz

Moderator
Moderator
Aug 12, 2014
39
9
8
France
Hello !

I was looking a bit into the sources of Fougerite to learn a bit (I don't really know C# yet so reading is always good :)) and so I tried to compile it but I'm getting errors in Visual Studio 2013 :

Code:
 - Erreur    1    'StructureMaster._structureComponents' est inaccessible en raison de son niveau de protection    C:\Users\Windaube\Programation\Fougerite-master\Fougerite\Fougerite\World.cs    343    42    Fougerite
- Erreur    2    'Metabolism' ne contient pas une définition pour 'coreTemperature' et aucune méthode d'extension 'coreTemperature' acceptant un premier argument de type 'Metabolism' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?)    C:\Users\Windaube\Programation\Fougerite-master\Fougerite\Fougerite\Player.cs    310    75    Fougerite
 - Erreur    3    'RustProto.User' ne contient pas une définition pour 'displayname_' et aucune méthode d'extension 'displayname_' acceptant un premier argument de type 'RustProto.User' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?)    C:\Users\Windaube\Programation\Fougerite-master\Fougerite\Fougerite\Player.cs    342    52    Fougerite
 - Erreur    4    'RustProto.User' ne contient pas une définition pour 'displayname_' et aucune méthode d'extension 'displayname_' acceptant un premier argument de type 'RustProto.User' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?)    C:\Users\Windaube\Programation\Fougerite-master\Fougerite\Fougerite\Player.cs    346    45    Fougerite
 - Erreur    5    'RustProto.User' ne contient pas une définition pour 'displayname_' et aucune méthode d'extension 'displayname_' acceptant un premier argument de type 'RustProto.User' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?)    C:\Users\Windaube\Programation\Fougerite-master\Fougerite\Fougerite\Player.cs    347    71    Fougerite
 - Erreur    6    'StructureMaster._structureComponents' est inaccessible en raison de son niveau de protection    C:\Users\Windaube\Programation\Fougerite-master\Fougerite\Fougerite\Entity.cs    68    98    Fougerite
 - Erreur    7    'ResourceGivePair' ne contient pas une définition pour '_resourceItemDatablock' et aucune méthode d'extension '_resourceItemDatablock' acceptant un premier argument de type 'ResourceGivePair' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?)    C:\Users\Windaube\Programation\Fougerite-master\Fougerite\Fougerite\Hooks.cs    392    20    Fougerite
Sorry it's in french (VS don't want to install a language pack I don't know why) but basically :
- StructureMaster._structureComponents is private
- Does not contains a matching method accepting a first parameter of type 'RustProto.User'
- Same
- Same
- Same as first
- Method not found for given args

So do you know what am I doing wrong ? Maybe using VS 2013 Express ?

Thanks in advance for helping :)

PS : I compiled and ran the patcher before trying to compile Fougerite
 

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
unityengine uses mono (open .net), I would recommend to use xamarin studio instead of VS'13.

"- StructureMaster._structureComponents is private"
you need to use the patched Assembly-csharp.dll to compile fougerite

"- Does not contains a matching method accepting a first parameter of type 'RustProto.User'"
probably you are missing a reference to a dll file?!
 

Viproz

Moderator
Moderator
Aug 12, 2014
39
9
8
France
Okay the patcher got me once, I was entering the -1 after launching the program and it said that all was good, made a pull request to be able to do that : https://github.com/fougerite/Fougerite/pull/56

For xamarin I can't find a version that does not include all the stuff for android and co, I don't use C# for android and I don't want to download big and useless files for me...

Now when I run it, there is a lot of warnings but no error but it says that the build failed :
http://pastebin.com/pXiAPJNU

I gess code contract is the wrong thing, I downloaded it from here : http://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970
and I'm using the one in there : C:\Program Files (x86)\Microsoft\Contracts\PublicAssemblies\v3.5\Microsoft.Contracts.dll

Should I take it from another place ?
 

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
xamarin studio is ~90 mb installed (mono is 420 mb tho)

for contracts, I'm using this:
https://github.com/fougerite/mono-contracts/releases

with xamarin I need to run ccrefgen and ccrewrite manually (since contracts is for 4.0 by default, and we compile for 3.5), I don't if that's the case with VS too

I use them like this:
Code:
ccrefgen.exe /out:..\Fougerite\bin\Fougerite.Contracts.dll ..\Fougerite\bin\Fougerite.dll

ccrewrite.exe -allowRewritten -keepOriginalFiles -libpaths \Users\balu\Desktop\Developement\RustServer\Server1\rust_server_Data\Managed -assembly ..\Fougerite\bin\Fougerite.dll
it will create a new fougerite.dll and Fougerite.Contracts.dll (I never used this one tho)

after that I need the Microsoft.Contracts.dll from the above repo, and the new fougerite.dll
 

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
Thanks just installed monodevelop http://monodevelop.com/download (xamarin for desktop only if I understood correctly) and everything works, I was able to compile and run my first Fougerite plugin ! :)
You are welcome!
Monodevelop is now xamarin studio, it will prompt you with an update, which will update it to xamarin studio, if you accept it. There is nothing wrong about xamarin, really. But you don't have to update if you don't want.
Note: I installed and set mono as the default runtime and I always compile my fougerite projects for mono / .net 3.5 and I never use msbuild:
http://i.imgur.com/uNdIs5T.png

(also: monodevelop is available for linux, but compiling it from source is not easy, I'd recommend to search for a binary version)
 

Viproz

Moderator
Moderator
Aug 12, 2014
39
9
8
France
You are welcome!
Monodevelop is now xamarin studio, it will prompt you with an update, which will update it to xamarin studio, if you accept it. There is nothing wrong about xamarin, really. But you don't have to update if you don't want.
Note: I installed and set mono as the default runtime and I always compile my fougerite projects for mono / .net 3.5 and I never use msbuild:
http://i.imgur.com/uNdIs5T.png

(also: monodevelop is available for linux, but compiling it from source is not easy, I'd recommend to search for a binary version)
The only thing I have again the xamarin given here : http://xamarin.com/download is that to install it you need to install the Android SDK IOS and Java ;)
For the plugins, I figured about the 3.5 by looking in the others plugins but didn't know about the msbuild stuff, I'll change that right now :)

I tried it before launching windows on my debian (I'm on wheezy so there is a package in the repo) but it gave me some errors and I couldn't find how to solve it on internet so I exited, I'll retry tomorrow (it's 00:35 AM here)
 

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
The only thing I have again the xamarin given here : http://xamarin.com/download is that to install it you need to install the Android SDK IOS and Java ;)
For the plugins, I figured about the 3.5 by looking in the others plugins but didn't know about the msbuild stuff, I'll change that right now :)

I tried it before launching windows on my debian (I'm on wheezy so there is a package in the repo) but it gave me some errors and I couldn't find how to solve it on internet so I exited, I'll retry tomorrow (it's 00:35 AM here)
We are in the same timezone then. I got the binaries from a suse autobuild thing, I can try to fetch the link from the browsing history, or upload the deb packages somewhere :)

I also had issues with the one in the repo (linux mint here)
 

Viproz

Moderator
Moderator
Aug 12, 2014
39
9
8
France
Thanks that seems to work really well, just need to find a way to run the server on linux now :)