Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 May 2000
Offline Last Active Jan 07 2015 07:10 PM

#5132845 I don't get c++11.

Posted by on 19 February 2014 - 09:04 PM

c++11 to me was largely a quality of life improvement. Some other features that haven't been mentioned:


Non-static data member initialization - Being able to declare the default value of a member variable at declaration ( where it should have been ) instead of some constructor somewhere else. ( My personal favorite )

Delegating / Inheriting constructors - How many times have you had to write an init() because of multiple constructors.

constexpr - Kind of like a type safe macro's.



#5120604 Change network adapter settings Win32 API?

Posted by on 01 January 2014 - 08:38 PM

I had to implement configuration of network interfaces for a remotely managed system. I found shelling to netsh to be the most complete and reliable way to do this. The win32 API is incomplete, hacking the registry is a gambit, and WMI has quirks ( for example, if an interface did not have a cable plugged in WMI could not change its settings ).



#4755634 A few conceptual questions (regarding servers)

Posted by on 06 January 2011 - 03:29 AM

Original post by Litz
Understood everything, thank you very much.

What I was doing was basically have a database server (made by me) connect to a database (using MySQL), and saving whatever was important, so I ended up doing everything there. I'll keep that server for the sole purpose of querying the database and sending the results back to the Login/World server now, and keep the actual logic on those servers.

You shouldn't have a service that your services connect to for the sole purpose of being an intermediary to the database. Just have each service ( be it login, world server, NPC AI server, etc. ) connect directly to the database using the native database api.

Database engine vendors ( i.e. MySQL, MSSQL, Oracle, etc. ) spend millions of man hours working on caching algorithms, data integrity, query optimizations, etc. Don't defeat that work by trying to write your own cache in front of the database. Odds are pretty good that whatever you write will not be as good as what the database engine itself can do.

Having your services connect to the database directly is also less work in the long run. Instead of having to write code in the service, that sends a special command to the db front end, which has special code to convert this command into SQL, which then gets the result and has to handle buffering it back to the caller, which then has to interpret and use it; you just issue the SQL command directly from the requesting service and handle the result. This also simplifies debugging as you have simplified the system, making it much easier to trace. You've also made it easier to maintain since you no longer have to change two services to make one change.

The web analogy of your design is a web page that makes a request to another web page on the same host to get data from the database.

On a side note:

Since this is a learning exercise you might want to look into virtualization. With virtualization you can use one piece of hardware to run multiple separate servers. There is no reason your services can't all run on the same host, I just bring this up as a learning tool to make it feel like you have a server cluster. To get your feet wet Virtualbox is quite good. If you have a dedicated system you can use, VMWare ESXi 4.x is also quite good. If you don't have spare hardware, but still want server style virtualization VMWare Server is also pretty good. All of these are free. I plug this as I do this at work to simulate systems ( at low load ) as it is just as easy / cheaper than having physical hardware.