Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (TipmyPip, AndrewAMD, Quad, aliswee, degenerate_762), 970 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 15 of 24 1 2 13 14 15 16 17 23 24
Re: MySQL dll [Re: Michael_Schwarz] #41757
10/05/06 06:00
10/05/06 06:00
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
still doesnt work. i even tried another server and it still doesnt work, so i don't think it's my webserver..

do i have to activate something in 3dgs to use the mysql o_O? I also tried to start it as -sv -cl, but still nothing :<


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Re: MySQL dll [Re: Captain_Kiyaku] #41758
10/05/06 09:37
10/05/06 09:37
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Well i tried to connect to localhost (installed XAMPP) and this works. but if i use my IP, i can't connect to me either :<


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Re: MySQL dll [Re: Captain_Kiyaku] #41759
10/05/06 22:03
10/05/06 22:03
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
@ Kihaku:

Tried to test the mysql dll and it works. Sounds like you make little mistake with the MySQL server, router, firewall setup to accept outside connections. Not all webhosts allow you to connect from anywhere else then localhost.

Do your outside mysql database testing here --> Freesql.org

A lot of webhosts add a prefix to database names and usersnames, so then username becomes prefix_username. Remember if your behind a firewall and or router, you must allow access and port forward from there too.

Dusty

Code:
plugindir = ".";

//--------------------------------------------------------------------
// DLL-declarations
//--------------------------------------------------------------------
dllfunction mySQL_Connectdb(w,x,y,z); // declaration of a DLL function
dllfunction mySQL_Closedb();
dllfunction mySQL_ExecQuery(string);
dllfunction mySQL_GetVal(x,y);
dllfunction mySQL_GetStr(string,x,y);
dllfunction mySQL_RowNumber();
dllfunction mySQL_IsConnected();

string output_text = [255]; //max 255 chars

text combatskills_txt
{
pos_x = 20;
pos_y = 20;
string = output_text;
flags = visible;
}

function main()
{
// database,host,user,password
mySQL_Connectdb("dbname","www.freesql.org","dbuser","dbpass");
if(!mySQL_IsConnected())
{
beep;
exit;
}
str_cpy(output_text, "Connected!");
while(1)
{
wait(1);
}
}




smile
MySQL dll - MD5 or SHA encryption [Re: D3D] #41760
10/08/06 22:20
10/08/06 22:20
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
I have a question about encryption. Do you have to add MD5 somewhere in the c-script if you send the password from the inkey to the mysql database server and the password on the server uses MD5 of SHA? Could anyone explain this?


Code:
function userlogin()
{
mySQL_Connectdb("gsa6db","mydomain","gsa6","xs4all");
if(!mySQL_IsConnected())
{
beep;
exit; // Connection failed, exit to Windows.
}

inkey(username);
inkey(password);

str_cat(query, "select * from Players WHERE username='");
str_cat(query, username);
str_cat(query, "' AND password='");
str_cat(query, password);
str_cat(query, "';");

if(mySQL_ExecQuery(query)&&mySQL_RowNumber()==1){
// do something

}else{
exit; // No entry or false, exit to Windows.
}



Dusty


smile
Re: MySQL dll - MD5 or SHA encryption [Re: D3D] #41761
10/08/06 22:59
10/08/06 22:59
Joined: Sep 2005
Posts: 514
USA
Gho5tFac3K1llah Offline
Developer
Gho5tFac3K1llah  Offline
Developer

Joined: Sep 2005
Posts: 514
USA
For the column of the table that has the password, you can set its type to MD5 or SHA and it converts what you put in it to the MD5 or SHA hash.

Re: MySQL dll - MD5 or SHA encryption [Re: Gho5tFac3K1llah] #41762
10/08/06 23:04
10/08/06 23:04
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Do you mean change the value next to password to md5 inside phpmyadmin? So I don't have to make changes in the c-script? Just enter the password trough inkey and send it to the mysql database server, the server knows how to convert?

Dusty


smile
Re: MySQL dll - MD5 or SHA encryption [Re: D3D] #41763
10/08/06 23:40
10/08/06 23:40
Joined: Sep 2005
Posts: 514
USA
Gho5tFac3K1llah Offline
Developer
Gho5tFac3K1llah  Offline
Developer

Joined: Sep 2005
Posts: 514
USA
yes

Re: MySQL dll - MD5 and SHA encryption working! [Re: Gho5tFac3K1llah] #41764
10/09/06 13:09
10/09/06 13:09
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Hmm I have tried both MD5 and SHA, but they didn't worked. The only time it did was when I used plain passwords in the mysql database. I tested this both on mysql 4.1.21-standard and 5.01-community database server with the same result.

In PHP you have to script like this: $password = md5(password), but not in c-script? Anyone using encrypted password could show me a example or give a little hint for fixing?

DB COLLATION = Latin_swedish_ci
STORAGE ENGINE = MyISAM
pack_keys = DEFAULT
__________________________________________________________________________

TEST1 MD5

FIELD | TYPE | LENGTH | COLLATION | NULL

Username VARCHAR 16 Latin_swedish_ci Not NULL
Password VARCHAR 32 Latin_swedish_ci Not NULL

MD5
FIELD: Password
TYPE: VARCHAR
FUNCTION: MD5
LENGTH: 32
COLLATIE: Latin_swedish_ci
NULL: Not NULL

TEST2 SHA

FIELD | TYPE | LENGTH | COLLATION | NULL

Username VARCHAR 16 Latin_swedish_ci Not NULL
Password VARCHAR 40 Latin_swedish_ci Not NULL

SHA
FIELD: Password
TYPE: VARCHAR
FUNCTION: SHA
LENGTH: 40
COLLATIE: Latin_swedish_ci
NULL: Not NULL


Dusty


smile
Re: MySQL dll - MD5 and SHA encryption working! [Re: D3D] #41765
10/09/06 19:03
10/09/06 19:03
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Looks like MD5 encryption is working if I change the code to:

Code:
str_cat(query, "select * from Players WHERE gsa6user='");
str_cat(query, username);
str_cat(query, "' AND gsa6password=MD5('");
str_cat(query, password);
str_cat(query, "');");



Are you sure that encryption works straight away and I not need to change this in the c-script?

Dusty


smile
Re: MySQL dll - MD5 and SHA encryption working! [Re: D3D] #41766
10/09/06 20:29
10/09/06 20:29
Joined: Sep 2005
Posts: 514
USA
Gho5tFac3K1llah Offline
Developer
Gho5tFac3K1llah  Offline
Developer

Joined: Sep 2005
Posts: 514
USA
yes, it should work.

Page 15 of 24 1 2 13 14 15 16 17 23 24

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1