xna-cncnet-client icon indicating copy to clipboard operation
xna-cncnet-client copied to clipboard

How do I build the Mental Omega client?

Open jwaffe75 opened this issue 3 years ago • 3 comments

BuildScripts/build.sh has a MO option, but it couldn't find any configurations for MO.

me@um20main:~/a_dev/xna-cncnet-client/BuildScripts$ bash build.sh MO
+ case $1 in
+ build SharpDX MORelease
+ platform=SharpDX
+ configuration=MORelease
+ xbuild ../DXClient.sln /t:Rebuild /p:Platform=SharpDX /p:Configuration=MORelease

>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<

XBuild Engine Version 14.0
Mono, Version 6.12.0.107
Copyright (C) 2005-2013 Various Mono authors

Build started 1/29/2021 7:55:40 PM.
__________________________________________________
/home/me/a_dev/xna-cncnet-client/DXClient.sln:  warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
Project "/home/me/a_dev/xna-cncnet-client/DXClient.sln" (Rebuild target(s)):
	Target ValidateSolutionConfiguration:
/home/me/a_dev/xna-cncnet-client/DXClient.sln: error : Invalid solution configuration and platform: "MORelease|SharpDX".
	Task "Error" execution -- FAILED
	Done building target "ValidateSolutionConfiguration" in project "/home/me/a_dev/xna-cncnet-client/DXClient.sln".-- FAILED
Done building project "/home/me/a_dev/xna-cncnet-client/DXClient.sln".-- FAILED

Build FAILED.

I went and checked in the project files and solution files and even grepped the whole tree for something like MORelease but I didn't find anything. The other games are in here though.

It looks like this is something specific to the master branch, the stable branch seems to have the configurations.

jwaffe75 avatar Jan 30 '21 00:01 jwaffe75

Hi. Please try AresRelease .

-    MO)
-        build SharpDX MORelease
-        build WindowsGL MORelease
-        build XNAFramework MORelease
+    Ares)
+        build SharpDX AresRelease
+        build WindowsGL AresRelease
+        build XNAFramework AresRelease

BuildScripts/build.sh matches an old version of DXClient.sln and you may need to modify it by yourself now.

https://github.com/CnCNet/xna-cncnet-client/blob/d4012ac23ce567485ecdce8b0a0fb03b18126689/DXClient.sln#L20-L36

The configuration AresRelease seems to first appeared in commit https://github.com/CnCNet/xna-cncnet-client/commit/a8cf7235cbc63172a0b38628fa487a2dc62ddb15 .

pzhlkj6612 avatar Jan 30 '21 02:01 pzhlkj6612

Thanks, it appears to compile successfully now.

There are other issues to resolve on Mono, unfortunately, so I can't say whether this build is functional or not.

Not to get too far off track in this issue report, but I'll put the details down here. It's not officially supported, but let me know if you think it would be worth making another issue for this.

Namely,

  • UserHasDirectoryAccessRights in PreStartup just seems to think I'm always running without admin rights, I definitely can write to the directory. I just wrote some code to disable this if the Mono runtime is being used https://github.com/CnCNet/xna-cncnet-client/blob/beaaa6b047bb1291bdde4dd9119f137e59cee80f/DXMainClient/PreStartup.cs#L167
  • And a much bigger problem (in scale), it seems that Mono struggles with \ in paths instead of /, and there's \\ all over the code in file paths (It seems to think these directories are missing, e.g., it will consider /home/me/something\ to be inaccessible. I'd recommend using Path.DirectorySeparatorChar or better yet Path.Combine for future code)

And I tried the mono route to get around a strange problem where Ping isn't successful on Wine (??).

That one is a bit baffling. Every server times out. It seems like everything works in Wine (the game, the client) except the IRC part, which means I can't join or host games in multiplayer. stdout:

002c:err:ole:CoGetContextToken apartment not initialised
0035:err:ole:CoGetClassObject class {94297043-bd82-4dfd-b0de-8177739c6d20} not registered
0035:err:ole:CoGetClassObject no class object {94297043-bd82-4dfd-b0de-8177739c6d20} could be created for context 0x1
0009:err:winsock:WSAIoctl -> SIO_ADDRESS_LIST_CHANGE request failed with status 0x2733
0009:err:winsock:WSAIoctl -> SIO_ADDRESS_LIST_CHANGE request failed with status 0x2733
0009:err:winsock:WSAIoctl -> SIO_ADDRESS_LIST_CHANGE request failed with status 0x2733
0009:err:winsock:WSAIoctl -> SIO_ADDRESS_LIST_CHANGE request failed with status 0x2733

jwaffe75 avatar Jan 30 '21 03:01 jwaffe75

and there's \ all over the code in file paths

We actually have gone all over the client and replaced all forward slashes with backslashes, not sure what are you talking about.

As @pzhlkj6612 pointed out, you should build an Ares-specific build of a client. The .sh script wasn't updated yet, feel free to submit a pull request to fix that.

With the latest client you should be able to run clientogl.exe via Mono. Just be sure to replace all forward slashes with backslashes in MO config. Also look in Red-Resurrection mod client files for configuration files that allow to launch wine-wrapped YR from the launcher.

Metadorius avatar Apr 14 '21 09:04 Metadorius

develop now fully supports Linux.

Metadorius avatar Sep 19 '22 18:09 Metadorius