Homebrew Homebrew Development

  • Thread starter Thread starter aliak11
  • Start date Start date
  • Views Views 1,475,135
  • Replies Replies 6,048
  • Likes Likes 54
Out of curiosity, can you somehow use SQL databases with ctrulib? I'd like to make an online leaderboard for the Snake game I've coded
ctrulib exposes sockets, so you can do almost any networked communication you want: send files to local printer, VoIP communication, HTTP, FTP, VNC, RDP, etc.

You just have to implement the protocol used. SQL databases all have pretty complicated protocols, and I wouldn't recommend putting that in your homebrew, it's unnecessary and would bloat your homebrew filesize. Just expose database access using some web API, like a simple PHP script you can query.
 
ctrulib exposes sockets, so you can do almost any networked communication you want: send files to local printer, VoIP communication, HTTP, FTP, VNC, RDP, etc.

You just have to implement the protocol used. SQL databases all have pretty complicated protocols, and I wouldn't recommend putting that in your homebrew, it's unnecessary and would bloat your homebrew filesize. Just expose database access using some web API, like a simple PHP script you can query.
This, I'd personally have an online server (maybe something RESTful, idk) which takes input for a name and a score and have the server end handle adding the values into a SQL table, and also a webpage to GET and display those high scores. Plus it'd be more secure that way, since you wouldn't have your credentials sitting in your 3dsx.
 
  • Like
Reactions: MopSec
This, I'd personally have an online server (maybe something RESTful, idk) which takes input for a name and a score and have the server end handle adding the values into a SQL table, and also a webpage to GET and display those high scores. Plus it'd be more secure that way, since you wouldn't have your credentials sitting in your 3dsx.
Well...then I guess I'll have to learn to code in PHP and look for a free server :dry:
 
This, I'd personally have an online server (maybe something RESTful, idk) which takes input for a name and a score and have the server end handle adding the values into a SQL table, and also a webpage to GET and display those high scores. Plus it'd be more secure that way, since you wouldn't have your credentials sitting in your 3dsx.
I've been doubting to make something like this but a lot of people advised me to not do it because of server costs, and that it isn't worth the effort since not a lot of people would use it.

I've been giving this a lot of thought though, and you can't use this in an open source application.
I've also thought of a way to identify a 3DS, this way people could create user accounts, only get access to update their own stats, friendlist, ....
 
I've been doubting to make something like this but a lot of people advised me to not do it because of server costs, and that it isn't worth the effort since not a lot of people would use it.

I've been giving this a lot of thought though, and you can't use this in an open source application.
I've also thought of a way to identify a 3DS, this way people could create user accounts, only get access to update their own stats, friendlist, ....
You should, despite the server costs.
 
My problem is that I know how to write a php script which interacts with a SQL database but what I don't know is how to make a C++ code interact with the PHP script. Like, for example, how would you let the user choose a username and then add it to the database? I mean you can't simply pass a variable or anything to a "website"....right?
 
My problem is that I know how to write a php script which interacts with a SQL database but what I don't know is how to make a C++ code interact with the PHP script. Like, for example, how would you let the user choose a username and then add it to the database? I mean you can't simply pass a variable or anything to a "website"....right?
Well, you can request the webpage, placing all the fields in the url as GET requests.
 
My problem is that I know how to write a php script which interacts with a SQL database but what I don't know is how to make a C++ code interact with the PHP script. Like, for example, how would you let the user choose a username and then add it to the database? I mean you can't simply pass a variable or anything to a "website"....right?

you may want to take a look at SOAP spec
 
My problem is that I know how to write a php script which interacts with a SQL database but what I don't know is how to make a C++ code interact with the PHP script. Like, for example, how would you let the user choose a username and then add it to the database? I mean you can't simply pass a variable or anything to a "website"....right?
Users pass variables to websites all the time. Right now on gbatemp, I'm submitting this comment form which is POSTing in several values to: https://gbatemp.net/threads/homebrew-development.360646/add-reply

Go read some tutorials on basic web dev with databases.
 
You must be talking about HTTP:C which I've never used. I guess luckily I have HTTP implemented with TCP sockets.

Socketing is also broken for big homebrews ( https://github.com/smealum/ctrulib/issues/171 ) and if you try to call it on big homebrews you'll get also other bad side-effects like random crashes using GPU, crash on homebrew exiting and similar.
 
I've been doubting to make something like this but a lot of people advised me to not do it because of server costs, and that it isn't worth the effort since not a lot of people would use it.

I've been giving this a lot of thought though, and you can't use this in an open source application.
I've also thought of a way to identify a 3DS, this way people could create user accounts, only get access to update their own stats, friendlist, ....
I can host small pages for you as well. But they wouldn't have a nice domain, more something like "myurl.com/homebrew/Tjessx".
 

Site & Scene News

Popular threads in this forum