[TEST] C++ conversion

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

[TEST] C++ conversion

Post by o11c »

In order to have a codebase that I can hack in, I need to get rid of the nasty C code that makes up tmwa.

I renamed the files and fixed all the compiler errors while keeping behavior changes to a minimum.

There is now a test server this on caliban.homeip.net:6904

There is no new content on this server, it is just to confirm that it doesn't break anything that worked before (I have already unbroken one bug in my code and worked around one compiler bug)

---

If building this yourself, you may need to install/upgrade new packages (the 32-bit version of g++ instead of just gcc, version 4.4 or later. You may also build with clang by passing CXX=clang++ to the 'make' command; the required version is not exactly known but believed to be at least 2.9 (note that apple-branded clang has two version numbers, you want the one corresponding to LLVM))

In addition, I would also like feedback regarding which version of gcc or clang you are using - particularly, whether anyone other than Frost is still using gcc 4.4; and how many people besides Platinum still use gcc 4.5

Edit: the code is on the 'cxx' branch of the server repository
Former programmer for the TMWA server.
User avatar
Jenalya
TMW Adviser
TMW Adviser
Posts: 717
Joined: 22 Sep 2010, 19:28

Re: [TEST] C++ conversion

Post by Jenalya »

o11c wrote: In addition, I would also like feedback regarding which version of gcc or clang you are using - particularly, whether anyone other than Frost is still using gcc 4.4; and how many people besides Platinum still use gcc 4.5

Code: Select all

gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
User avatar
tux9th
TMW Adviser
TMW Adviser
Posts: 428
Joined: 09 Mar 2012, 20:21
Location: -67.067433,54.433587

Re: [TEST] C++ conversion

Post by tux9th »

Code: Select all

$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Ubuntu 12.04
User avatar
Kandiman
Novice
Novice
Posts: 130
Joined: 13 Sep 2010, 00:34
Location: A world of pure imagination

Re: [TEST] C++ conversion

Post by Kandiman »

> gcc --version
gcc (Debian 4.4.5-8) 4.4.5
Debian Squeeze
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: [TEST] C++ conversion

Post by o11c »

are you guys actually testing, too?
Former programmer for the TMWA server.
baedamichi
Novice
Novice
Posts: 52
Joined: 05 Sep 2011, 23:30

Re: [TEST] C++ conversion

Post by baedamichi »

Hi,

I tested the "converted" server a bit, so far everything seems to work normally.

Tried all of the everyday stuff, like talking to NPCs, fighting, walking, using the bank, buying from NPC shops and such.

Anything specific you'd like me to test?

Regards,

Baeda
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: [TEST] C++ conversion

Post by o11c »

baedamichi wrote:Anything specific you'd like me to test?
Not really - I'm not *expecting* anything to go wrong. Though before making this thread I did fix one unexpected problem that only occurs with old GCC, not with 4.6 or newer.

You might not have thought to test creating/deleting accounts and characters, both in-game and via ladmin.
Former programmer for the TMWA server.
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: [TEST] C++ conversion

Post by o11c »

As there have been no reports of trouble I pushed this to master.

I will keep the cxx branch open for future work.

I will disable my instance on the test server and restart the main one.
Former programmer for the TMWA server.
4144
Knight
Knight
Posts: 965
Joined: 03 Aug 2009, 11:57

Re: [TEST] C++ conversion

Post by 4144 »

what features you removed from server?
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: [TEST] C++ conversion

Post by o11c »

4144 wrote:what features you removed from server?
In this conversion I did my best not to change anything. Pruning, refactoring, and addition will come later.
Former programmer for the TMWA server.
User avatar
v0id
Novice
Novice
Posts: 196
Joined: 15 Sep 2009, 21:31
Location: Désolé, je ne loue pas.

Re: [TEST] C++ conversion

Post by v0id »

o11c, I didn't understand well if, among other things, you intended to get rid of all compiler warnings or not ?. If it's the case, i get a bunch of them (gcc 4.7.0). If it isnt expected, i ll throw them here.

Also, I'm quite concerned about all these changes: for example the scripting language is rather picky (like areatimers that dont work if the event string is too long......).

So I fear it might break things especially in cases where scripts are complex.
What do you think ?
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: [TEST] C++ conversion

Post by o11c »

v0id wrote:o11c, I didn't understand well if, among other things, you intended to get rid of all compiler warnings or not ?. If it's the case, i get a bunch of them (gcc 4.7.0). If it isnt expected, i ll throw them here.

Also, I'm quite concerned about all these changes: for example the scripting language is rather picky (like areatimers that dont work if the event string is too long......).

So I fear it might break things especially in cases where scripts are complex.
What do you think ?
I didn't eliminate *all* the warnings, just the errors and a few of the (arbitrarily selected) "worst" warnings.

Nothing should've changed about limits of the scripting engine. In future I will eliminate all length limits except the ones that must be sent to the client.
Former programmer for the TMWA server.
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: [TEST] C++ conversion

Post by o11c »

V0id reports an issue with getarraysize on string arrays.
Former programmer for the TMWA server.
User avatar
baseballboy
Knight
Knight
Posts: 502
Joined: 04 Jan 2009, 20:04
Location: USA, North Carolina

Re: [TEST] C++ conversion

Post by baseballboy »

Slackware 13.37.0
gcc 4.5.2
BaseBaIIBoy - 99, Zalika - 95, Mou. - 86, baseballboy - 83, Abacus - 82, Laticia - 76

<o11c> More boobs please.
User avatar
Jenalya
TMW Adviser
TMW Adviser
Posts: 717
Joined: 22 Sep 2010, 19:28

Re: [TEST] C++ conversion

Post by Jenalya »

Why does it need to be build with 32-bit?
Post Reply