This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2010-10-02 06:00:55

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Posting messages to a server with Scratch

Here:

| line index string index2 index3 page max temp other url scores state letter |
url_ 'http://playfultest.x10.mx/magnie/test/scratch-score.php'.


page_ (HTTPSocket httpGet: url) contents.


scores := {} as: OrderedCollection.

max_ page lines size.
max_ max asNumber.

index3_ 0.
index3_ index3 asNumber.

max timesRepeat: [

index3_ index3 + 1.


other_ page lines at: index3.
other_ other asString.

temp_ other size.
temp_ temp asNumber.

index2_ 0.
string_ ''.
string_ string asString.
state_ 0.

temp timesRepeat: [
index2_ index2 + 1.

letter_ self letter: (index2) of: (other) .

letter = '<'
ifTrue: [
state_ 1.
].

state = 0
ifTrue: [
string_ string, letter.
].

letter = '>'
ifTrue: [
state_ 0.
].

].
string_ string asString.
scores add: string.
].
^ scores.


You can now reach me on Twitter @johnnydean1_

Offline

 

#27 2010-10-02 09:16:08

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Posting messages to a server with Scratch

Well, I could make pages on the web-page. But I've never done that before.  hmm  Mind using the code I gave you guys and make pages out of that?

Offline

 

#28 2010-10-06 15:36:57

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Posting messages to a server with Scratch

Okay, for you guys with the want for encryption and decryption, I've been messing an Encoder "tutorial" or "example" ( http://www.tonymarston.net/php-mysql/encryption.html ) and I've been reading through the coding ( Encryption File and the actual encryption file here ), and I think that the way you really want to do it would be a very large amount of work to implement for Scratch/Panther and not to mention it would be extremely slow.  hmm  So you could make a login system and have the columns [id - username - password - score - trusted]. "id" would be used for web page purposes ( not important ) username and password are probably obvious. Score... obvious... and then "trusted", that would be used to clean out cheaters. It basically means "banned". This way you also won't get, like I have for my other code multiple of the same user with multiple scores. It would clean the spammed scores and other things. I could easily make a registration system and make a Panther Project to Login to the site from a web-page. The security risk for passwords... is large. Passwords will be hashed... the problem is the web page.

Code:

http://example.com/magnie/scores-add.php?user=Example&pass=Example&score=54539

The problem is the password in the URL, and also typing it in Panther would be another risk. But otherwise, using random passwords that you shouldn't plan to use on other websites would be good. I like to use "awdsx" as a random password for my little games. Simple to remember, and random... sorta.  tongue  So... that's all I really have on Encrypting scores and other stuff. So unless you get a Panther project that you can't edit the code from... then you won't be able to encrypt any scores to any real secure extent.

Last edited by Magnie (2010-10-06 15:39:48)

Offline

 

#29 2010-10-08 14:03:42

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Posting messages to a server with Scratch

So you need HTTP_POST for more security. And if you look at the start of this thread, what was I asking for help with?


/* No comment */

Offline

 

#30 2010-10-08 14:45:56

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Posting messages to a server with Scratch

Well... I don't know much about Smalltalk and Squeak. So I can't help you. ...

Offline

 

Board footer