Page 1 of 1

Server Errors

Posted: Tue Jun 25, 2013 12:09 am
by SirWobbyTheFirst
Hey guys, I decided this would be the best place to inform you as I have found a few problems with the server, ones that are making it increasingly frustrating to work with, some are down to bugs in the code and could easily be fixed by someone knowledgeable with C and C++ and others are just downright out of align with the desktop engine.

1) Start Session doesn't work on the Windows build, trying to execute the command just generates an error as if the command doesn't exist. Works fine on Mac and Linux builds.
2) The database drivers don't work on the Mac build, trying to execute any DB command generates an invalid database type error. Works fine on Windows and Linux builds.
3) The engine seems to hate an If Else statement, for example in my login pages backend I have the following code:

Code: Select all

If SmIsUserLoggedOn() = True Then
   // Redirect to home page.
Else If tDisableLogon = True Then
   // Notify the user, logon is disabled.
Else If The Keys Of $_GET <> Empty Then
   If "au" Is Among The Lines Of The Keys Of $_GET Then
      If "i" Is Not Among The Lines Of The Keys Of $_GET Or $_GET["i"] Is Not A Number Then
         // Notify the user, user ID is invalid.
      End If
   End If
End If
The engine throws out an "if-then: error in statement" message for line 7 which corresponds to the "// Notify the user, logon is disabled" line which simply places a message in a variable to be outputted later on. If I delete the MySQL record for the user ID 1 and thus make an account unactivated, the script executes successfully and creates the record but if I specify the same ID again, it is supposed to spit out a message I made stating the account has been activated but instead, throws a hissy fit and dumps that error instead.

This is an example of one of those cases where the Server engine is vastly different to the desktop engine and it is really annoying, because I would like to make use of LiveCode as my website backend but I can't because of these issues. I'm already having to run a Ubuntu VM in the background to get the Start Session command and MySQL DB drivers to work in the first place. If anyone could shed some light on this and possibly fix these problems, I would turn for you.

Re: Server Errors

Posted: Tue Jun 25, 2013 12:31 am
by monte
Not sure about #1 ot #3 but #2 should be resolved. Have you tried dp2?

Re: Server Errors

Posted: Tue Jun 25, 2013 7:54 am
by SirWobbyTheFirst
I've only tried DP1 which didn't work, but I will give DP2 a go later on today. And report my findings.

Re: Server Errors

Posted: Tue Jun 25, 2013 1:01 pm
by LCMark
@mitchpitkin92:
I've taken a quick look at the issues...

(1) I tried a very simple script using LiveCode server on Windows (using start session) and it seems to work fine (it creates the session index and session file in the default session save path which is the temp dir). What error are you seeing?

(2) This was an issue with the build scripts for Mac server's revDB - it wasn't building with the correct flags meaning it looks in the wrong place for externals/drivers. I've just applied a fix for 6.1 that should resolve this issue.

(3) I can't reproduce this problem with a simple if/elseif structured as you have. The error suggests one of the real lines of code you have in the 'Notify the user, logon is disabled' clause is causing an error but not pushing an error message on the error stack. (i.e. The problem is something in the code in the elseif clauses rather than the construct itself). Can you elaborate on the actual code that is being executed there?