BASIC

Author Topic: Runner [Done]  (Read 10729 times)

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: Runner [Done]
« Reply #15 on: 2010-Dec-01 »
I'm guessing 'Nobody' is a reserved word?  Or a default/reserved user name.
I Googled 'Nobody' in reference to SQL, but of course that's a difficult search.
I saw one reference to 'Nobody, Nouser, ..." so I wonder if 'Nouser' is a problem too.

Without knowing how you are using the 'name_entered$' in your SQL statement, it would just be a bunch of guessing.  Are you creating a dynamic SQL statement such as:
"insert into HIGH_SCORES values('" + name_entered$ + "', '" + password$ + "' . . . .

And is the column for the name just a regular string type, or a special user name type? (I don't know what database you are using, and really only have experience with Oracle).
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Gregory Atlas

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Zeewolf
Re: Runner [Done]
« Reply #16 on: 2010-Dec-01 »
I'm guessing 'Nobody' is a reserved word?  Or a default/reserved user name.
I Googled 'Nobody' in reference to SQL, but of course that's a difficult search.
I saw one reference to 'Nobody, Nouser, ..." so I wonder if 'Nouser' is a problem too.

Without knowing how you are using the 'name_entered$' in your SQL statement, it would just be a bunch of guessing.  Are you creating a dynamic SQL statement such as:
"insert into HIGH_SCORES values('" + name_entered$ + "', '" + password$ + "' . . . .

And is the column for the name just a regular string type, or a special user name type? (I don't know what database you are using, and really only have experience with Oracle).

I build a linux server in glbasic for the highscore, its managing the SQL entries, it has nothing to do with the SQL.
Cause it wont get any informations, the game will crash before it can send any informations to the server.

I upload a screenshot now so you can see what happens on the Windows 7.

Nobody - crashes the game
Nouser - crashes the game too

The error of Windows 7 says i should go here to see why it happens: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0407

That´s very interesting now.

[attachment deleted by admin]
« Last Edit: 2010-Dec-01 by Gregory Atlas »
.... Homepage ....

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: Runner [Done]
« Reply #17 on: 2010-Dec-01 »
Interesting.
So the pattern is either words beginning with 'No', or words that are 6 characters long (ha, or both!).
Or it could still be only specific words for some reason.

It could be specific words depending on how you use the string variable I guess.
ie. You don't use it for the file's owner do you?  (I'm really stretching here perhaps)
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Gregory Atlas

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Zeewolf
Re: Runner [Done]
« Reply #18 on: 2010-Dec-01 »
Something strange was happening, i compiled the game again after i added some SUB for an Error Screen if you cannot send the info to the server, just a screen with drawsprite. Now it works with Nobody and Nouser.... o.o

Forgot to mention i had the Debug Mode on.
« Last Edit: 2010-Dec-01 by Gregory Atlas »
.... Homepage ....

Offline Gregory Atlas

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Zeewolf
Re: Runner [Done]
« Reply #19 on: 2010-Dec-01 »
After an hour of testing what causes the crashing i found out what it is.....  :S

Code: GLBasic [Select]
////
GLOBAL playername$ = ""

playername$ = "Nobody"
LOCAL hex$
GLOBAL msg$

hex$ = "123456789123456789,"+playername$+","+score
msg$ = ENCRYPT$("test", hex$) // After that its crashing, but only if you type 6 Letters into the Highscore. Typed: Nobody
////
----------------------------------------------------------------------------------
Code: GLBasic [Select]
////
GLOBAL playername$ = ""

playername$ = "Nobody"
LOCAL hex$
GLOBAL msg$

hex$ = "123456789123456789,"+playername$+","+score+",4" // Adding +",4"
msg$ = ENCRYPT$("test", hex$) // After that its crashing, but only if you type 4 Letters into the Highscore. Typed: 1234
////

It seems like a bit nonsense to me if i add more fake letters to the Variable...  :blink:
I added now: ","+score+",......"
Seems like it works now without crashing.  =D
« Last Edit: 2010-Dec-02 by Gregory Atlas »
.... Homepage ....

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: Runner [Done]
« Reply #20 on: 2010-Dec-02 »
Quote
So the pattern is either words beginning with 'No', or words that are 6 characters long

So, it seems that the ENCRYPT$ command has a bug that can't accept a certain number of characters.

[Edit]
I'm guessing that you could simplify your code like this:

Code: GLBasic [Select]
"123456789123456789,......,"+playername$+","+score
« Last Edit: 2010-Dec-02 by Slydog »
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Gregory Atlas

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Zeewolf
Re: Runner [Done]
« Reply #21 on: 2010-Dec-02 »
Quote
So the pattern is either words beginning with 'No', or words that are 6 characters long

So, it seems that the ENCRYPT$ command has a bug that can't accept a certain number of characters.

[Edit]
I'm guessing that you could simplify your code like this:

Code: GLBasic [Select]
"123456789123456789,......,"+playername$+","+score

Tried that and if i type now a 7 letter Word, it crashes. Used the word 'Tornado'
I will try now something else....
« Last Edit: 2010-Dec-02 by Gregory Atlas »
.... Homepage ....

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: Runner [Done]
« Reply #22 on: 2010-Dec-02 »
Very strange.
What about putting about 10 more characters near the beginning of the string?
Or maybe in needs to end with a non-numeric string?
try '+ ","' again?
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Gregory Atlas

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Zeewolf
Re: Runner [Done]
« Reply #23 on: 2010-Dec-03 »
Very strange. 
What about putting about 10 more characters near the beginning of the string?
Or maybe in needs to end with a non-numeric string?
try '+ ","' again?

I did that already above. :)
I will continue on researching this problem.   ;/
I have a theory already about it, but i need to prove it first.
.... Homepage ....

MrTAToad

  • Guest
Re: Runner [Done]
« Reply #24 on: 2010-Dec-03 »
That is odd - but if you find a bug in ENCRYPT$, let Gernot know :)

Offline Gregory Atlas

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Zeewolf
Re: Runner [Done]
« Reply #25 on: 2010-Dec-03 »
That is odd - but if you find a bug in ENCRYPT$, let Gernot know :)
Already sended an E-Mail days ago. But he is busy i suppose :) lets just wait. As long the game works everything else is fine for me. Just something random i found out. My TODO List is getting smaller, soon i make a new update.
.... Homepage ....

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10714
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Runner [Done]
« Reply #26 on: 2010-Dec-03 »
I have no mail aboutan enc bug. I am sick (ill) since wednesday, already. Got a bad flu.

Offline Gregory Atlas

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Zeewolf
Re: Runner [Done]
« Reply #27 on: 2010-Dec-03 »
First get better Kitty, relax. :)
The E-Mail i wrote you contained parts of this forum entry, i wonder why i didnt recieved an "error: e-mail wasnt sended" or something.
.... Homepage ....

Offline Gregory Atlas

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Zeewolf
Re: Runner [Done]
« Reply #28 on: 2010-Dec-03 »
Fixed it... i hope.... found out what the problem was, i hope this is it.

before:
Code: GLBasic [Select]
rv% = SOCK_TCPSEND(sock_cl%, msg$)
Code: GLBasic [Select]
rv% = SOCK_CLOSE(sock_cl%)

% <-- was the troublemaker it seems.

changed it to:
Code: GLBasic [Select]
rv% = SOCK_TCPSEND(sock_cl, msg$)
Code: GLBasic [Select]
rv% = SOCK_CLOSE(sock_cl)

I can type now Nobody without crashing.

Now i need to test it on a Windows XP Computer still.
It would be an irony if its not working there.
« Last Edit: 2010-Dec-03 by Gregory Atlas »
.... Homepage ....

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: Runner [Done]
« Reply #29 on: 2010-Dec-03 »
In the help file it indicates that those functions are expecting integers, so that's strange.
Your 'sock_cl' variable was declared as integer right?
If so, then leaving the '%' if fine as you really don't need them after the variable is declared.
But, great debugging!
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]