Hi all. I've installed mono and the .net core runtime from a tutorial and am using gnome desktop for ubuntu 20.04. When I run the make file I get the same error for two lines in server/utility.cs.

C#:
Feature `default literal' cannot be used because it is not part of the C# 7.0 language specification

Did I do something wrong when setting everything up?
 
I have the same problem.
Can anyone please help me solve it?

This issue is a combination of the following.
* ServUO Pub 57
* Ubuntu 20.04 and 18.04
* AWS EC2

Bash:
make
mcs -target:library -out:`pwd`/Ultima.dll -r:System.Drawing.dll -nowarn:0618,0219,0414,1635 -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:`pwd`/Ultima/*.cs
mcs -win32icon:`pwd`/Server/servuo.ico -r:`pwd`/Ultima.dll,System.Drawing.dll -nowarn:0618,0219,0414,1635 -target:exe -out:`pwd`/ServUO.exe -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:`pwd`/Server/*.cs
/opt/ServUO/Server/Utility.cs(869,11): error CS1644: Feature `default literal' cannot be used because it is not part of the C# 7.0 language specification
/opt/ServUO/Server/Utility.cs(909,11): error CS1644: Feature `default literal' cannot be used because it is not part of the C# 7.0 language specification
Compilation failed: 2 error(s), 0 warnings
Makefile:35: recipe for target 'ServUO.exe' failed
make: *** [ServUO.exe] Error 1


I've edited Makefile as follows.
But I got an error and could not solve the problem.

Makefile --- Original:
${EXENAME}.exe: Ultima.dll Server/*.cs
    ${MCS} -win32icon:${SRVPATH}/servuo.ico -r:${CURPATH}/Ultima.dll,${REFS} -nowarn:${NOWARNS} -target:exe -out:${CURPATH}/${EXENAME}.exe -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:${SRVPATH}/*.cs

Makefile --- Compiler version specified :
${EXENAME}.exe: Ultima.dll Server/*.cs
    ${MCS} -langversion:latest -win32icon:${SRVPATH}/servuo.ico -r:${CURPATH}/Ultima.dll,${REFS} -nowarn:${NOWARNS} -target:exe -out:${CURPATH}/${EXENAME}.exe -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:${SRVPATH}/*.cs

Bash:
make
mcs -langversion:7.1 -win32icon:`pwd`/Server/servuo.ico -r:`pwd`/Ultima.dll,System.Drawing.dll -nowarn:0618,0219,0414,1635 -target:exe -out:`pwd`/ServUO.exe -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:`pwd`/Server/*.cs
/opt/ServUO/Server/Utility.cs(864,57): error CS0702: A constraint cannot be special class `System.Enum'
/opt/ServUO/Server/Utility.cs(872,79): error CS0702: A constraint cannot be special class `System.Enum'
Compilation failed: 2 error(s), 0 warnings
Makefile:35: recipe for target 'ServUO.exe' failed
make: *** [ServUO.exe] Error 1
 
Voxpire, your fix fixed the utility.cs error

Now I'm getting this error. Do you have any idea?

C#:
[root@melih ServUO]# make
mcs -target:library -out:`pwd`/Ultima.dll -r:System.Drawing.dll -nowarn:0618,0219,0414,1635 -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:`pwd`/Ultima/*.cs
mcs -win32icon:`pwd`/Server/servuo.ico -r:`pwd`/Ultima.dll,System.Drawing.dll -nowarn:0618,0219,0414,1635 -target:exe -out:`pwd`/ServUO.exe -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:`pwd`/Server/*.cs
error CS5001: Program `ServUO.exe' does not contain a static `Main' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings
make: *** [ServUO.exe] Error 1
 
Code in Makefile is

C#:
Ultima.dll: Ultima/*.cs
    ${MCS} -target:library -out:${CURPATH}/Ultima.dll -r:${REFS} -nowarn:${NOWARNS} -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:${SDKPATH}/*.cs

${EXENAME}.exe: Ultima.dll Server/*.cs
    ${MCS} -win32icon:${SRVPATH}/servuo.ico -r:${CURPATH}/Ultima.dll,${REFS} -nowarn:${NOWARNS} -target:exe -out:${CURPATH}/${EXENAME}.exe -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:${SRVPATH}/*.cs

${EXENAME}.sh: ${EXENAME}.exe
    echo "#!/bin/sh" > ${CURPATH}/${EXENAME}.sh
    echo "mono ${CURPATH}/${EXENAME}.exe" >> ${CURPATH}/${EXENAME}.sh
    chmod a+x ${CURPATH}/${EXENAME}.sh
    sed -i.bak -e 's/<!--//g; s/-->//g' ${EXENAME}.exe.config
 
I did a new clean server creation with Debian10 but still getting the same error.. Does anyone have solution?
 
Oh this is not your fault,

general steps:
Code:
How To Run ServUO on Debian 10.6

- download image of debian 10.6
- install debian 10.6
- get ServUO from the repository
- extract ServUO
- get the uo client files on your server
- edit the condif "Datapath.cfg" to point to your client files
-- make sure to remove the '#'' in front of "CustomPath"
- install mono, for that go to the mono-project.com site and follow their instructions
-- recommended is to go with mono-complete
- install libz, for Debian this would look like "apt install zlib1g-dev"
- open the terminal inside your ServUO folder.
- type "make"

now there is one issue in the code, with the c# version and mono.
/Scripts/Services/Reports/Rendering/HLSColor.cs
this is how it should be handled, for mono.
C#:
#if MONO
        public struct HLSColor
#else
        public readonly struct HLSColor
#endif
        {

also the makefile was not updated to reflect the massive change that was now pushed.

replace your makefile with this, and it will run

Makefile:
MCS=mcs
EXENAME=ServUO
CURPATH=`pwd`
SCRPATH=${CURPATH}/Scripts
SRVPATH=${CURPATH}/Server
APPPATH=${CURPATH}/Application
ICOPATH=${CURPATH}/Application
REFS=System.Drawing.dll,System.Web.dll,System.Data.dll,System.IO.Compression.FileSystem.dll
NOWARNS=0618,0219,0414,1635

PHONY : default build clean run

default: run

debug:
    ${MCS} -target:library -out:${CURPATH}/Server.dll -r:${REFS} -nowarn:${NOWARNS} -d:DEBUG -d:MONO -d:ServUO -d:NEWTIMERS -nologo -debug -unsafe -recurse:${SRVPATH}/*.cs
    ${MCS} -target:library -out:${CURPATH}/Scripts.dll -r:${CURPATH}/Server.dll,${REFS} -nowarn:${NOWARNS} -d:MONO -d:DEBUG -d:ServUO -d:NEWTIMERS -nologo -debug -unsafe -recurse:${SCRPATH}/*.cs
    ${MCS} -win32icon:${ICOPATH}/servuo.ico -r:${CURPATH}/Server.dll,${CURPATH}/Scripts.dll,${REFS} -nowarn:${NOWARNS} -target:exe -out:${CURPATH}/${EXENAME}.exe -d:DEBUG -d:MONO -d:ServUO -d:NEWTIMERS -nologo -debug -unsafe -recurse:${APPPATH}/*.cs
    ${CURPATH}/${EXENAME}.sh
run: build
    ${CURPATH}/${EXENAME}.sh

build: ${EXENAME}.sh

clean:
    rm -f ${EXENAME}.sh
    rm -f ${EXENAME}.exe
    rm -f ${EXENAME}.exe.mdb
    rm -f Ultima.dll
    rm -f Ultima.dll.mdb
    rm -f *.bin


Server.dll: Server/*.cs
    ${MCS} -target:library -out:${CURPATH}/Server.dll -r:${REFS} -nowarn:${NOWARNS} -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:${SRVPATH}/*.cs

Scripts.dll: Server.dll Scripts/
    ${MCS} -target:library -out:${CURPATH}/Scripts.dll -r:${CURPATH}/Server.dll,${REFS} -nowarn:${NOWARNS} -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:${SCRPATH}/*.cs

${EXENAME}.exe: Server.dll Scripts.dll Application/*.cs
    ${MCS} -win32icon:${ICOPATH}/servuo.ico -r:${CURPATH}/Server.dll,${CURPATH}/Scripts.dll,${REFS} -nowarn:${NOWARNS} -target:exe -out:${CURPATH}/${EXENAME}.exe -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:./Application/*.cs

${EXENAME}.sh: ${EXENAME}.exe
    echo "#!/bin/sh" > ${CURPATH}/${EXENAME}.sh
    echo "mono ${CURPATH}/${EXENAME}.exe" >> ${CURPATH}/${EXENAME}.sh
    chmod a+x ${CURPATH}/${EXENAME}.sh
 
Are you using the fresh repo? With all 46 lines of the makefile I wrote there?
Also indentation is important
 
I got an sneaking suspicion that it is because servuo replaces tabs.
 

Attachments

  • Makefile.zip
    700 bytes · Views: 22
This worked thank you PyrO. Now gettin these errors :) I think i'm very problematic

C#:
[root@melih ServUO]# make
mcs -target:library -out:`pwd`/Server.dll -r:System.Drawing.dll,System.Web.dll,System.Data.dll,System.IO.Compression.FileSystem.dll -nowarn:0618,0219,0414,1635 -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:`pwd`/Server/*.cs
/srv/ServUO/Server/SpawnArea.cs(202,5): error CS0246: The type or namespace name `Ultima' could not be found. Are you missing an assembly reference?
/srv/ServUO/Server/SpawnArea.cs(207,13): error CS0103: The name `Ultima' does not exist in the current context
/srv/ServUO/Server/SpawnArea.cs(207,6): error CS0841: A local variable `umap' cannot be used before it is declared
/srv/ServUO/Server/SpawnArea.cs(210,13): error CS0103: The name `Ultima' does not exist in the current context
/srv/ServUO/Server/SpawnArea.cs(210,6): error CS0841: A local variable `umap' cannot be used before it is declared
/srv/ServUO/Server/SpawnArea.cs(213,13): error CS0103: The name `Ultima' does not exist in the current context
/srv/ServUO/Server/SpawnArea.cs(213,6): error CS0841: A local variable `umap' cannot be used before it is declared
/srv/ServUO/Server/SpawnArea.cs(216,13): error CS0103: The name `Ultima' does not exist in the current context
/srv/ServUO/Server/SpawnArea.cs(216,6): error CS0841: A local variable `umap' cannot be used before it is declared
/srv/ServUO/Server/SpawnArea.cs(219,13): error CS0103: The name `Ultima' does not exist in the current context
/srv/ServUO/Server/SpawnArea.cs(219,6): error CS0841: A local variable `umap' cannot be used before it is declared
/srv/ServUO/Server/SpawnArea.cs(222,13): error CS0103: The name `Ultima' does not exist in the current context
/srv/ServUO/Server/SpawnArea.cs(222,6): error CS0841: A local variable `umap' cannot be used before it is declared
/srv/ServUO/Server/SpawnArea.cs(232,5): error CS0841: A local variable `umap' cannot be used before it is declared
/srv/ServUO/Server/Item.cs(1005,12): error CS0103: The name `Ultima' does not exist in the current context
/srv/ServUO/Server/Item.cs(1017,4): error CS0103: The name `Ultima' does not exist in the current context
Compilation failed: 16 error(s), 0 warnings
make: *** [Server.dll] Error 1
 
Well this comes from like a mix of your server state.
Those files look for the Ultima code, coming from the Ultima.dll.

This is no longer the case, since it was changed recently. The Ultima script files do not exist in the repository.
You should get a clean one.
 
Made a fresh install and it worked

Thanks for your all support and help @PyrO & @Voxpire :p

C#:
ServUO - [https://www.servuo.com] Version 0.0, Build 0.0 - Build on 1/1/2000 12:00:00 AM UTC - Release
Core: Running with arguments: -noconsole
Core: Optimizing for 1 64-bit processor
Core: Unix environment detected
Core: Compiled for MONO and running on 6.12.0.100 (tarball Sat Sep 19 08:38:24 UTC 2020)
RandomImpl: SimpleRandom (Software)
Core: Loading config...
Scripts: Verifying...
Finished (6066 items, 1304 mobiles, 0 customs) (0.93 seconds)
DataPath: /srv/ServUO/Muls
Regions: Loading...done
World: Loading...
...done (0 items, 0 mobiles) (0.03 seconds)
[Honesty]: Generating...
[Honesty]: Creating 1,000 lost items...done (2.47 seconds)
[Honesty]: Generation completed in 2.47 seconds.
Restricting enhanced client version to 67.0.59.0 SA. Action to be taken: Kick
This server has no accounts.
Do you want to create the owner account now? (y/n)y
 
Back