Login Server for leechers

Newbie Spellweaver
Joined
Aug 29, 2008
Messages
5
Reaction score
0
Well, I have been working on this, start learning C++ in teh past few weeks,

This what I have made so far:


Code:
#include <iostream>
#include <MySQL>
#include <string>

using namespace std;

string query;     //query
string acctname;  // acccount name
string acctpass;  // pass for the account
string email;     // email for account (check)

int main () {

		cout << "Initializing MySQL...\n";   //still have to work on this

		MYSQL mysql; 

	//Initiatilize

	if (mysql_init(&mysql)) {

		cout << "Initialize successful!\n";

	}
	
	else {

		cout << "Initialize failed!\n";

		return 0;

	}

	//Connect (still doenst work YET)

		cout << "\nConnecting to database...\n";

	if (mysql_real_connect(&mysql,"127.0.0.1","root","passhere","dbname",0,0,0)) {

		cout << "Connected to database.\n";

	}

	else {

		cout << "Connection failed!\n";
                return 0;

	}

		query = "INSERT INTO accounts (acctname,acctpass,email) VALUES ('";

		cout <<"\nAccount Name:\n";  // acc in DB
		cin >> acctname;             // name of acc that gets stored
		cout << "\nAccount Password:\n"; // AccName
		cin >> acctpass;                  //Pass needed CharServer acces
		cout << "\nEmail:\n";
		cin >> email;                    // email

		query.append(acctname);
		query.append("','");
		query.append(acctpass);
		query.append("','");
		query.append(email);
		query.append("')");

		cout << "\n[SQL CODE] - \" " << query << " \" \n";

		mysql_query(&mysql,query.c_str());

while (true) {

}

}

Well, here it is.
I know its not done yet, but im still beginning

I will make it a executeble and usable and working login server tomorrow.
But its late here, gonna sleep bye.

Leech as much as u want I dont care. I know how it is to be a Nub. I was leecher first to, I started to learn C++ to help al those leechers.
Yes u may think: WTF HELPING LEECHERS!?, well come people cant create stuff so lets help em :D


-ZiRioN
 
Yea boi!! I am learning C++ now, and this will give me a push on making something on my own.
I hope you dont mind if i use some of your code ?

Cheers, Much love.
Good Luck.
 
you wanna make a login server?

you got a long road ahead if you cannot figure out sockets and winsock.

Also don't use cout. its so deprecated. use printf out use a Log class.

I can give you a little push in getting some socket classes going but then you are on your own.
 
I wanna learn C++, but it looks so complicated, and Im 14 years old, so I dont think I can learn yet xD

Hey im 14 too, and I learned it too so anyone can do it :8:

but actually, C++ isnt really that hard, u should learn the basic structurers of a program.

I got the Login working now.
Almost done with the Char server.
I dont think I will go on with world, dephends how much spare time I will have.

and Jeffijoe(or anyone else) if u need some help PM me so I can add u on msn.

-ZiRioN-
 
Back