Forum Discussion
YungBlood
15 years agoStreaming Star
First, I can't say anything about java or asp... I don't like java, and I know nothing about asp. Since you are asking about those languages, I assume you know them. I can tell you the theory behind one of my projects that use a registration code.
I have a database with 2 tables dealing with the reg code. One table is my user table. The other is a temp table. In the roku settings config, I call a script on my server. The script generates random codes until it finds one that is not in either table. The script then places the code in my temp table, along with an expiration time. The script also sends the code back to roku. Roku displays the code to the user, and tells them to enter the code into their profile on the web site. Roku keeps checking the site to see if that code has been entered. Once the user enters it, roku will recognize it, and welcome the user.
When the user enters a code into their profile, the server checks the temp database. If the code is in there, it takes it out, and places the code into the users record. If the code is not in the temp database, it gets rejected. The server scripts also clean out any temp codes that are older than their expiration time. If roku finds that the code has expired, it tells the user it can get a new code.
All my server scripts return simple text, no xml. On roku, I use roUrlTransfer GetToString(). For simplicity, I pass all the values through the address like this: http.seturl("http://www.someserver.com/roku/testreg.cgi?reg=" + code + "&key=" + pass) Then when I call http.gettostring() I get back "true" or "false". So it's easy for roku to handle, and there's no extra code on the server.
Obviously, you need to make sure that the scripts roku calls are secure if you are doing this across the internet. That can be dealt with by ssl or other handshake methods.
Although I can't release my code, I can write out the basics in pseudo code if it would help.
I have a database with 2 tables dealing with the reg code. One table is my user table. The other is a temp table. In the roku settings config, I call a script on my server. The script generates random codes until it finds one that is not in either table. The script then places the code in my temp table, along with an expiration time. The script also sends the code back to roku. Roku displays the code to the user, and tells them to enter the code into their profile on the web site. Roku keeps checking the site to see if that code has been entered. Once the user enters it, roku will recognize it, and welcome the user.
When the user enters a code into their profile, the server checks the temp database. If the code is in there, it takes it out, and places the code into the users record. If the code is not in the temp database, it gets rejected. The server scripts also clean out any temp codes that are older than their expiration time. If roku finds that the code has expired, it tells the user it can get a new code.
All my server scripts return simple text, no xml. On roku, I use roUrlTransfer GetToString(). For simplicity, I pass all the values through the address like this: http.seturl("http://www.someserver.com/roku/testreg.cgi?reg=" + code + "&key=" + pass) Then when I call http.gettostring() I get back "true" or "false". So it's easy for roku to handle, and there's no extra code on the server.
Obviously, you need to make sure that the scripts roku calls are secure if you are doing this across the internet. That can be dealt with by ssl or other handshake methods.
Although I can't release my code, I can write out the basics in pseudo code if it would help.