Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[LATEST] Icarus Emulator [Java, Netty, MySQL, Plugins, Camera]

Status
Not open for further replies.
Joined
Aug 10, 2011
Messages
7,401
Reaction score
3,299
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Java > Python > C++
3 times.

For me its:

C++ > Java > Python

When properly written, C++ will outperform both languages. But then again, every problem or application has its own best solution. Only reason I would write something in Python is for like a web api or some other web stuff that requires calls. No big programs. If I need high performance I would go with C/C++.
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

For me its:

C++ > Java > Python

When properly written, C++ will outperform both languages. But then again, every problem or application has its own best solution. Only reason I would write something in Python is for like a web api or some other web stuff that requires calls. No big programs. If I need high performance I would go with C/C++.

Oh, you misinterpreted my intention of the arrows, the arrows was language changes I've done in chronological order.

I was not saying Java is better than Python and Python is better then C++

Nonetheless I agree with you.
 
Joined
Aug 10, 2011
Messages
7,401
Reaction score
3,299
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Quackster:

Is your source code anywhere publicly available? I would love to see all the memory leaks you're creating! (No jk, just want to give some feedback)

Also, why Visual C++??? I mean out of everything you could've picked you pick THAT.

PS: Avoid this-> all together in C++. Except when you're having ambiousity (Or however you write it) or have to pass a pointer to a function. Its cluttering and the majority of the C++ community avoids this as much as possible. Use naming conventions.

Also you have atleast 2 memory leaks in your Request class.

Also you read a short but return it as an int. Int is platform depended and may not always be equally sized as a short. (My suggestion don't use int at all but use long (Or even better use int<bitsize>_t eg int32_t)

I don't think you have to cast the chars to unsigned char in readShort. (1: They keep their bit pattern anyways, 2: you already read from an char*)

I wish you luck, because you will need it.

Your contrived benchmarks don't mean much; if Python can be used by companies like Dropbox and Instagram, what makes your habbo emulator so special?

Also, Quackster, if you were using modern python techniques it would probably be more pleasant to use.

Because the reason they picked python for it is because they can easily without too much hassle make it distributed. Something which is also possible in C++ but is a bit more difficult to implement and maintain.

Its also the reason why a lot of these services (reddit, paypal, google) moved from Java to Python. The JMS is just slower and it was easier to move to Python.
 
Last edited:
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Quackster:

Is your source code anywhere publicly available? I would love to see all the memory leaks you're creating! (No jk, just want to give some feedback)

Source isn't available, yet.

Also, why Visual C++??? I mean out of everything you could've picked you pick THAT.

I'm using Visual Studio because that was the first thing I had. Moving to CLion later if I can figure out how to fix a problem where stopping the debug doesn't actually close the process.

There's nothing wrong with Visual Studio, so don't push your opinion on to me.

PS: Avoid this-> all together in C++. Except when you're having ambiousity (Or however you write it) or have to pass a pointer to a function. Its cluttering and the majority of the C++ community avoids this as much as possible. Use naming conventions.

No.

Also you have atleast 2 memory leaks in your Request class.

No. I don't. I tested this over and over again and I don't.

Also you read a short but return it as an int. Int is platform depended and may not always be equally sized as a short. (My suggestion don't use int at all but use long (Or even better use int<bitsize>_t eg int32_t)

Shouldn't be a problem because I'm converting shorts to integers, not the other way around.

I don't think you have to cast the chars to unsigned char in readShort. (1: They keep their bit pattern anyways, 2: you already read from an char*)

I do, otherwise the outcomes are different.

I wish you luck, because you will need it.

You're the one who needs luck around here, you seem to assume that I didn't put things the way I did for a reason.
 
Last edited:

pel

Skilled Illusionist
Joined
Jan 27, 2012
Messages
382
Reaction score
343
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Right, but this is the second time I've changed languages, third time I've started over. How is that hard to understand?

Why its hard to understand that after 3 comes 4? He wrote "... 3rd time. Whats next?" and its obvious 4.
 
Joined
Aug 10, 2011
Messages
7,401
Reaction score
3,299
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Source isn't available, yet.



I'm using Visual Studio because that was the first thing I had. Moving to CLion later if I can figure out how to fix a problem where stopping the debug doesn't actually close the process.

There's nothing wrong with Visual Studio, so don't push your opinion on to me.



No.



No. I don't. I tested this over and over again and I don't.



Shouldn't be a problem because I'm converting shorts to integers, not the other way around.



I do, otherwise the outcomes are different.



You're the one who needs luck around here, you seem to assume that I didn't put things the way I did for a reason.

Clion and Visual C++? Goodluck with that because CLion uses CMake and visual C++ has its own buildtools.

Memory leak 1 is in your constructor, you take a char* but you will never delete it.

Memory leak 2 is in your read string method. You return a char* but you will never delete it. If you call new you have to delete it at some point.

I assume you didnt run your program using Valgrind or something.

Should upload the sources to github or send me a copy through PM. I want to help you with feedback Alex, not shoot you down.
 
Junior Spellweaver
Joined
May 21, 2011
Messages
154
Reaction score
47
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

According to The General "Memory leak 2" return a smart pointer instead of a raw one. And maybe delete the "full_message" in the deconstructor?

After all good luck with your C++ server! :)
 
Joined
Aug 10, 2011
Messages
7,401
Reaction score
3,299
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

According to The General "Memory leak 2" return a smart pointer instead of a raw one. And maybe delete the "full_message" in the deconstructor?

After all good luck with your C++ server! :)

The fact that this is already in one class makes me worry what other inventive things he will eventually code...
 
Junior Spellweaver
Joined
May 21, 2011
Messages
154
Reaction score
47
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Btw checkout Boost.Asio. It's awesome and it supports cross-platform networking.
 
Last edited:
Joined
Jun 23, 2010
Messages
2,318
Reaction score
2,195
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

*tik tik tik tik* ... (when will it go boem?)

GswqHS8 - [LATEST] Icarus Emulator [Java, Netty, MySQL, Plugins, Camera] - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Custom Title Activated
Loyal Member
Joined
May 23, 2011
Messages
1,607
Reaction score
588
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Because the reason they picked python for it is because they can easily without too much hassle make it distributed. Something which is also possible in C++ but is a bit more difficult to implement and maintain.

Its also the reason why a lot of these services (reddit, paypal, google) moved from Java to Python. The JMS is just slower and it was easier to move to Python.
What..? I didn't mention C++, or Java. You need to learn basic literacy.
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

*tik tik tik tik* ... (when will it go boem?)

GswqHS8 - [LATEST] Icarus Emulator [Java, Netty, MySQL, Plugins, Camera] - RaGEZONE Forums

Fixed.



Clion and Visual C++? Goodluck with that because CLion uses CMake and visual C++ has its own buildtools.

Did you even read what I said? Dude.. c'mon I said I'm moving to CLion and Cgywin32 if I can figure out an issue I'm having where if I cancel the debug, the actual process isn't closed.

Memory leak 1 is in your constructor, you take a char* but you will never delete it.

Actually, since that array was never created with "new" it's been automatically memory allocated, instead of being dynamically allocated (like pointers are) so when the object goes out of the scope, it will be deleted automatically.

Memory leak 2 is in your read string method. You return a char* but you will never delete it. If you call new you have to delete it at some point.

Using std::string now without any "new" keyword, so once it goes out of the scope it will be automatically freed. :):
 

Attachments

You must be registered for see attachments list
Software Engineer
Loyal Member
Joined
Feb 19, 2008
Messages
1,055
Reaction score
492
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

I noticed my links were messed up, here you go fam:



If I wanted to use C++ I'll use C++, there's no "should've". Sorry. :(:

Oh right, thank you sir. :)

Provided Quackster doesn't update the repo or delete the old commits assuming this current version is the very last anyone wanting to directly download the code can do so here:


Edit:

On another note, check out D sometime:


It was started by someone who wrote C++ compilers for years, decided, screw this, C++ has too many limitations because of forced backward compatibility to C (a C++ compiler should be able to compile a C program in other words). He added in nice things like Garbage Collection (optional / modifiable), and it's fully compiled. Look into it when you get sick of C++. Go is only good for the out of the box standard libraries, D is good for OO programming, and other stuff. D is evolving nicely now that it's matured. You can install it with a Visual Studio plugin too.
 
Joined
Aug 10, 2011
Messages
7,401
Reaction score
3,299
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Fixed.

Did you even read what I said? Dude.. c'mon I said I'm moving to CLion and Cgywin32 if I can figure out an issue I'm having where if I cancel the debug, the actual process isn't closed.

Actually, since that array was never created with "new" it's been automatically memory allocated, instead of being dynamically allocated (like pointers are) so when the object goes out of the scope, it will be deleted automatically.

Using std::string now without any "new" keyword, so once it goes out of the scope it will be automatically freed. :):

You did not mention Cygwin, which is only a set of linux like tools for windows and provides a linux like API. Also Cygwin isn't really needed, MingW should suffice. (As you only need the GCC compiler).

I don't think you've got any clue what you're doing and probably just following some tutorials on the internet....

Also CLion uses CMake so you need that too.
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

You did not mention Cygwin, which is only a set of linux like tools for windows and provides a linux like API. Also Cygwin isn't really needed, MingW should suffice. (As you only need the GCC compiler).

I don't think you've got any clue what you're doing and probably just following some tutorials on the internet....

Also CLion uses CMake so you need that too.

What else did you think i was going to use if I wanted to make my C++ program cross-compatible and develop it on Windows?

No. MingW _does not_ suffice.

You're free to think whatever you want, but you're the one who assumed that just because you can see a pointer being created, you believe it wasn't being deleted.

I know what CLion uses and doesn't use, stop telling me this.
 
Status
Not open for further replies.
Back
Top