unsigned int numrows; user = get_ea_value(buff, len, "nuid"); pass = get_ea_value2(buff, len, "password"); printf("- Login %s pass: %s ip:%s\n", user, pass, ip); sprintf(query, "SELECT * FROM login WHERE `nuid`='%s' and `password`='%s' LIMIT 1", user, pass); mysql_query(conn, query); res_set = mysql_store_result(conn); numrows = mysql_num_rows( res_set ); if( numrows ) { row = mysql_fetch_row(res_set); printf("- Login %s ip:%s\n", row[1], ip); sprintf(query,"UPDATE login Set ip='%s' where nuid = '%s'", ip, row[1]); mysql_query(conn, query); sprintf(query,"UPDATE personanames Set ip='%s' where email= '%s'", ip, row[1]); mysql_query(conn, query); sprintf(query,"UPDATE stats Set ip='%s' where email= '%s'", ip, row[1]); mysql_query(conn, query); ##code go h if(ea_send(ssl_sock, sd, type, 0x80000000 | ++cnt, "TXN=%s\n" "lkey=%s\n" "nuid=%s\n" "displayName=%s\n" "profileId=%s\n" "userId=%s\n", txn, lkey, row[1], row[7], row[0], row[0]) < 0) goto quit; } else { printf("- Login failed on user %s\n", get_ea_value(buff, len, "nuid")); if(ea_send(ssl_sock, sd, type, 0x80000000 | ++cnt, "TXN=NuLogin\n" "localizedMessage=\"The password the use r specified is i ncorrect\"\n" "errorCode=122\n")< 0) goto quit; } unsigned int numrows; sprintf(query, "SELECT * FROM personanames WHERE `ip`='%s'", ip); mysql_query(conn, query); res_set = mysql_store_result(conn); numrows = mysql_num_rows( res_set ); unsigned int numrows; sprintf(query, "SELECT * FROM stats WHERE `ip`='%s'", ip); mysql_query(conn, query); res_set = mysql_store_result(conn); numrows = mysql_num_rows( res_set ); if( numrows ) { row = mysql_fetch_row(res_set); printf("- Get Stats\n"); if(ea_send(ssl_sock, sd, type, 0x80000000 | ++cnt, "stats.1.key=score\n" "stats.[]=3\n" "stats.2.value=%s\n" "TXN=GetStats\n" "stats.1.value=%s\n" "stats.2.key=time\n" "stats.0.value=%s\n" "stats.0.key=rank\n", row[2], row[3], row[4]) < 0) goto quit; }