cyberjunk / meridian59-dotnet

New 3D client and tools for Meridian 59
GNU General Public License v3.0
34 stars 36 forks source link

Preprocessor Macros #274

Closed NHuebner1983 closed 6 years ago

NHuebner1983 commented 6 years ago

Hey there :)

Where do I specify in VC 2017 Preprocessor Macros?

This would be OPENMERIDIAN / VANILLA.

Thanks for the updates!

cyberjunk commented 6 years ago

Come on, use Google, this is a somewhat generic question.... :-) Next best hit with a good explanation:

https://stackoverflow.com/questions/33385730/where-is-the-place-to-add-c-preprocessor-directives-in-visual-studio-2015-ente

NHuebner1983 commented 6 years ago

I did use Google, I honestly had no idea what I was looking for.

Thanks for getting back to me!

cyberjunk commented 6 years ago

Ok, no problem. Here's the image from the link, just to be sure:

In this example you would change that line to like "OPENMERIDIAN;WIN32;_DEBUG.....". You gotta do this for all configurations (debug/x86, debug/x64, ... and so on).

And you will notice that it has worked because the code of the files will switch (e.g. parts become greyed out that weren't before, while other get active).

NHuebner1983 commented 6 years ago

Ok so I looked there but what do I actually do?

I've never set a preprocessor macro before.

Here's the build string:

WIN32;NDEBUG;BOOST_ALL_NO_LIB;BOOST_THREAD_BUILD_LIB;BOOST_THREAD_VERSION=4;OGRE_NONCLIENT_BUILD;FREEIMAGE_LIB;CEGUI_STATIC;PCRE_STATIC;DLLNAME="$(ProjectName)";%(PreprocessorDefinitions)

image

NHuebner1983 commented 6 years ago

Do I add VANILLA=1 in the build string?

NHuebner1983 commented 6 years ago

or something like MACRO=VANILLA ? :D

NHuebner1983 commented 6 years ago

or do I just put in the string VANILLA;

cyberjunk commented 6 years ago

Please read my answer above, it's clear about that:

In this example you would change that line to like "OPENMERIDIAN;WIN32;_DEBUG.....".

NHuebner1983 commented 6 years ago

<3 thanks bye

cyberjunk commented 6 years ago

PS: OgreClient is not the only project you have to set the preprocessor macro for. At least the C# library project "Meridian59" also needs it.

NHuebner1983 commented 6 years ago

Yeh it looks like I got the VANILLA set in the right places, like you said code would ungrey.

After I did that, I started getting a feed of errors preventing x86 Debug from starting Ogre Client.

I added VANILLA to the Meridian x86 and Ogre Client x86 debug.

If you know offhand what it might be, that would be great - before I spend hours figuring it out :D

1>------ Build started: Project: Meridian59, Configuration: Debug x86 ------ 1>D:\M59-Ogre-Latest\Meridian59\Data\DataController.cs(1211,35,1211,46): error CS1061: 'string' does not contain a definition for 'BuildString' and no extension method 'BuildString' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) 1>D:\M59-Ogre-Latest\Meridian59\Data\DataController.cs(1445,72,1445,83): error CS1503: Argument 1: cannot convert from 'Meridian59.Data.Models.ObjectFlags[]' to 'Meridian59.Data.Models.ObjectFlags' 1>D:\M59-Ogre-Latest\Meridian59\Data\DataController.cs(1482,40,1482,51): error CS1503: Argument 1: cannot convert from 'Meridian59.Data.Models.ObjectFlags[]' to 'Meridian59.Data.Models.ObjectFlags' 1>D:\M59-Ogre-Latest\Meridian59\Common\Config.cs(494,47,494,53): error CS0117: 'ConnectionInfo' does not contain a definition for 'CON112' 1>D:\M59-Ogre-Latest\Meridian59\Common\Config.cs(496,47,496,53): error CS0117: 'ConnectionInfo' does not contain a definition for 'CON200' 1>D:\M59-Ogre-Latest\Meridian59\Protocol\GameMessages\GameMode\ChangeObjectFlagsMessage.cs(76,40,76,57): error CS0117: 'MessageTypeGameMode' does not contain a definition for 'ChangeObjectFlags' 1>D:\M59-Ogre-Latest\Meridian59\Protocol\GameMessages\GameMode\NewUdpTransmissionMessage.cs(27,40,27,58): error CS0117: 'MessageTypeGameMode' does not contain a definition for 'NewUdpTransmission' 1>D:\M59-Ogre-Latest\Meridian59\Protocol\GameMessages\GameMode\SetClientUdpOffMessage.cs(27,40,27,55): error CS0117: 'MessageTypeGameMode' does not contain a definition for 'SetClientUdpOff' 1>D:\M59-Ogre-Latest\Meridian59\Protocol\GameMessages\GameMode\MovementSpeedPercentMessage.cs(66,40,66,60): error CS0117: 'MessageTypeGameMode' does not contain a definition for 'MovementSpeedPercent' 1>D:\M59-Ogre-Latest\Meridian59\Protocol\GameMessages\GameMode\RoomContentsFlagsMessage.cs(112,40,112,57): error CS0117: 'MessageTypeGameMode' does not contain a definition for 'RoomContentsFlags' 2>------ Build started: Project: Meridian59.Ogre.Client, Configuration: Debug Win32 ------ 2>UIOnlinePlayers.cpp 2>UIOptions.cpp 2>UIPlayerDetails.cpp 2>UIRoomObjects.cpp 2>UIStatusBar.cpp 2>UIWelcome.cpp 2>d:\m59-ogre-latest\meridian59.ogre.client\uiplayerdetails.cpp(108): error C2440: 'initializing': cannot convert from 'Meridian59::Data::Models::ServerString ^' to 'CLRString ^' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiplayerdetails.cpp(108): note: No user-defined-conversion operator available, or 2>d:\m59-ogre-latest\meridian59.ogre.client\uiplayerdetails.cpp(108): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 2>d:\m59-ogre-latest\meridian59.ogre.client\uionlineplayers.cpp(68): error C2065: 'player': undeclared identifier 2>d:\m59-ogre-latest\meridian59.ogre.client\uionlineplayers.cpp(68): error C2227: left of '->Flags' must point to class/struct/union/generic type 2>d:\m59-ogre-latest\meridian59.ogre.client\uionlineplayers.cpp(68): note: type is 'unknown-type' 2>d:\m59-ogre-latest\meridian59.ogre.client\uionlineplayers.cpp(68): error C2227: left of '->Player' must point to class/struct/union/generic type 2>d:\m59-ogre-latest\meridian59.ogre.client\uionlineplayers.cpp(69): error C2065: 'wndName': undeclared identifier 2>d:\m59-ogre-latest\meridian59.ogre.client\uionlineplayers.cpp(69): error C2227: left of '->setTooltipText' must point to class/struct/union/generic type 2>d:\m59-ogre-latest\meridian59.ogre.client\uionlineplayers.cpp(69): note: type is 'unknown-type' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiwelcome.cpp(178): error C2039: 'SendUserCommandSafetyMessage': is not a member of 'Meridian59::Ogre::OgreClient' 2>d:\m59-ogre-latest\meridian59.ogre.client\ogreclient.h(71): note: see declaration of 'Meridian59::Ogre::OgreClient' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiwelcome.cpp(221): error C2039: 'SendUserCommandSafetyMessage': is not a member of 'Meridian59::Ogre::OgreClient' 2>d:\m59-ogre-latest\meridian59.ogre.client\ogreclient.h(71): note: see declaration of 'Meridian59::Ogre::OgreClient' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiwelcome.cpp(307): error C2039: 'SendUserCommandSafetyMessage': is not a member of 'Meridian59::Ogre::OgreClient' 2>d:\m59-ogre-latest\meridian59.ogre.client\ogreclient.h(71): note: see declaration of 'Meridian59::Ogre::OgreClient' 2>d:\m59-ogre-latest\meridian59.ogre.client\uistatusbar.cpp(228): error C2039: 'SendUserCommandSafetyMessage': is not a member of 'Meridian59::Ogre::OgreClient' 2>d:\m59-ogre-latest\meridian59.ogre.client\ogreclient.h(71): note: see declaration of 'Meridian59::Ogre::OgreClient' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiroomobjects.cpp(350): error C2664: 'Meridian59::Data::Models::ObjectFlags::ObjectFlags(const Meridian59::Data::Models::ObjectFlags %)': cannot convert argument 1 from 'int' to 'unsigned char %' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiroomobjects.cpp(362): error C2664: 'Meridian59::Data::Models::ObjectFlags::ObjectFlags(const Meridian59::Data::Models::ObjectFlags %)': cannot convert argument 1 from 'int' to 'unsigned char %' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiroomobjects.cpp(374): error C2664: 'Meridian59::Data::Models::ObjectFlags::ObjectFlags(const Meridian59::Data::Models::ObjectFlags %)': cannot convert argument 1 from 'int' to 'unsigned char %' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiroomobjects.cpp(386): error C2664: 'Meridian59::Data::Models::ObjectFlags::ObjectFlags(const Meridian59::Data::Models::ObjectFlags %)': cannot convert argument 1 from 'int' to 'unsigned char %' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiroomobjects.cpp(398): error C2664: 'Meridian59::Data::Models::ObjectFlags::ObjectFlags(const Meridian59::Data::Models::ObjectFlags %)': cannot convert argument 1 from 'int' to 'unsigned char %' 2>d:\m59-ogre-latest\meridian59.ogre.client\uiroomobjects.cpp(431): error C2664: 'Meridian59::Data::Models::ObjectFlags::ObjectFlags(const Meridian59::Data::Models::ObjectFlags %)': cannot convert argument 1 from 'int' to 'unsigned char %' 2>d:\m59-ogre-latest\meridian59.ogre.client\uioptions.cpp(2656): error C2039: 'SendUserCommandSafetyMessage': is not a member of 'Meridian59::Ogre::OgreClient' 2>d:\m59-ogre-latest\meridian59.ogre.client\ogreclient.h(71): note: see declaration of 'Meridian59::Ogre::OgreClient' 2>Done building project "Meridian59.Ogre.Client.vcxproj" -- FAILED. ========== Build: 0 succeeded, 2 failed, 1 up-to-date, 0 skipped ==========

NHuebner1983 commented 6 years ago

Just so you know, it was working before the VANILLA flags - everything was building fine.

cyberjunk commented 6 years ago

I can confirm that VANILLA and OPENMERIDIAN variants currently don't compile. I will try to see if I can fix that in the near future, but I'm in the middle of another change right now so it has to wait a bit (most of the errors are easy to fix). Yet these preprocessor flags are your best option to get compatibility with VANILLA or OPENMERIDIAN, because things have changed too much on 105/112 and a client built without the accrording flag will likely not even be able to connect to vanilla or openmeridian servers.

NHuebner1983 commented 6 years ago

As you know 101/102 finally published to Steam so there are people coming in and there is no Ogre Client that works yet. I was hoping to get Ogre up.

Also since you're back at fixing things, I installed a "Change Password" screen on the 115 Ogre Client, with a GUI and a button on the UI if you wanted it I could point you to the files so it saves you some time.

Thanks for your help :)

cyberjunk commented 6 years ago

As you know 101/102 finally published to Steam so there are people coming in and there is no Ogre Client that works yet. I was hoping to get Ogre up.

I don't think that Zaphod or Mayhem want players to use OgreClient on 101, but I might be wrong. Yet I strongly advise you to contact them first and discuss the topic with them.

There is a reason why the starting page states compatibility as MINIMAL with VANILLA servers. You will not get a nicely working version out of it by just setting VANILLA, it will only barely work.

There will be lot of weird things going on, like an empty fourth bar next to vigor (no XP info), things like an empty tab for quests (no quests info), you might run into movement issues (because classic only allows a very very low update rate) and I can continue the list of issues or drawbacks that will make OgreClient not work nicely on 101. Also the update mechanism of OgreClient is completely incompatible with the ancient solutions used in vanilla and even openmeridian.

So just that you are warned....

NHuebner1983 commented 6 years ago

I'm expecting the worst. I'm not planning on releasing a working Ogre Client for 101/102. This is just for educational purposes.

I can also help repair Vanilla issues and contribute back to you if you want.

I also have months of bug fixes to the original non-Vanilla Ogre Client (I am SilenceM59) I changed my Github for work purposes. So I could probably help with some pull requests if you agree with some of the bugs I have fixed.

As far as Mayhem and them are concerned, how would they know I am using the Ogre Client? Isn't the Meridian59 engine designed to act like a normal 2D client but with Ogre on top?

NHuebner1983 commented 6 years ago

As far as I know, based on my updates 5 to 6 months ago, I fixed nearly all of the bugs in the Ogre Client to make it compatible with 115.

cyberjunk commented 6 years ago

I have fixed all VANILLA related build errors, setting the preprocessor flag VANILLA on the projects Meridian59, Meridian59.Admin and Meridian59.Ogre.Client should now compile without errors.

The OgreClient exe starts but I haven't connected to 101/102 and I would recommend not to do so. Just build your own VANILLA server for testing...


I can also help repair Vanilla issues and contribute back to you if you want.

There is a zillion of technical fixes and improvements in the 105/112 branches. The problem is rather backporting them all to VANILLA which by now has become like an impossible task and from what I understood in the past, 101 is not supposed to change much at all.

I actively contribute to the 105/112 codebase since from a technical perspective it's clearly the most advanced/promising one regarding implementing nice new features for Ogre.


As far as Mayhem and them are concerned, how would they know I am using the Ogre Client? Isn't the Meridian59 engine designed to act like a normal 2D client but with Ogre on top?

Yes, they will know. Clients send identifications and OgreClient can be detected unless you make it look like classic on purpose (not gonna tell you how).

Again: You better first discuss your idea with the authorities of 101/102 and see if they're interested at all to have players use Ogre on that servers - I would expect not.

NHuebner1983 commented 6 years ago

Thanks for letting me know how to get Vanilla working :)

Any reason why it would be bad to use Ogre vs the Classic Client? All of the hacking techniques are detectable by their server, so as long as nothing like that is detected it should be fine right?

Also why wouldn't you tell me how to mask it, would you get in trouble or something?

I appreciate you getting back to me - Glad to see you are working on the client again.

cyberjunk commented 6 years ago

Any reason why it would be bad to use Ogre vs the Classic Client? All of the hacking techniques are detectable by their server, so as long as nothing like that is detected it should be fine right?

Not sure what kind of 101 codebase you're talking about :-)

But the 101/102 codebase I know still allows a lot of cheating such as speedhacking (run as fast as you want), wallhacking (walk or attack through every wall), teleporting (teleport to every place in the map) and quite a few more. All of them actually being fixed on 105/112, mostly by myself, but requiring partially A LOT of changes to the server codebase. Honestly, I would never actively PvP on VANILLA servers or even OPENMERIDIAN ones, but there are other things to consider than this and I'm definitely not saying they are bad...

Also why wouldn't you tell me how to mask it, would you get in trouble or something?

Because I respect Zaphod and if he doesn't want OgreClient on his server, I will not tell people how to still do it undetected...