I haven't done any testing with fcgijacl yet. Let me have a look today
and I'll see what is going on.
Also, I (think) I've finished a demo program called 'contacts.jacl'
for the CSV stuff. It is a simple web-based program for storing and
retrieving names and addresses.
Regards,
Stuart
Regards,
Stuart
I had forgotten to use the special FastCGI replacements for the stdio
functions with fcgijacl.
Let me know if you still have any problems with it, I'm keen to get
this working properly.
Regards,
Stuart
On Nov 14, 10:39 am, Stuart Allen <stuartallen1...@gmail.com> wrote:
> Okay, looks like this is fixed. I was closing a NULL file pointer.
> I'll look through the rest of the code to see if I do it anywhere
> else.
>
> Regards,
> Stuart
>
> On 14 November 2011 09:45, Stuart Allen <stuartallen1...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hi Thomas
>
> > I haven't done any testing with fcgijacl yet. Let me have a look today
> > and I'll see what is going on.
>
> > Also, I (think) I've finished a demo program called 'contacts.jacl'
> > for the CSV stuff. It is a simple web-based program for storing and
> > retrieving names and addresses.
>
> > Regards,
> > Stuart
>
> > On 14 November 2011 09:18, Thomas Schwarz <schwarz.tho...@gmail.com> wrote:
> >> Hi Stuart,
>
> >> I started to experiment somewhat with the new csv support. And using the
> >> fcgijacl version I always get a segmentation fault when trying to use the
> >> "append" command, calling the csv_fwrite function from the libcsv.
> >> Strangely if I use the cgijacl version with its own webserver then it
> >> works...
> >> Do you have an idea, where the problem with calling libcsv from fcgijacl
> >> might come from?
>
> >> (Working on Linux.)
>
> >> Thanks!
> >> Thomas
>
> >> On Mon, Nov 7, 2011 at 12:47 AM, Stuart Allen <stuartallen1...@gmail.com>
Those commands were removed intentionally. The trouble with them is
that as soon as the details of objects can be modified with commands
like that their current state must be saved which gets horribly
inefficient, particular when a game is run on the web and the game is
saved after every move.
If you are looking at getting similar functionality more efficiently I
would be inclined to have an option similar to the 'long' property
where you can specify 'function' as the value and then have the text
generated by code rather than being static. This will give you dynamic
descriptions without the overhead of saving all the static text, even
though it never changes.
Stuart
a little question about the CSV feature: (I already managed to use it
in my game, yeah!)
How would you handle it if you wanted each player to get his own data
file for something like his contacts for example?
Instead of "iterate data" would you say "iterate $user_id" or how
would you solve this? Because otherwise all users would all use the
same data file.
Thanks!
Thomas
Yes, that should work. I've also been doing things like
string messages
setstring message "messg-" $user_id
iterate messages
...
enditerate
That was you can have separate data for each user and more than one
file for each user.
Take care,
Stuart
I just noticed I had the code in the interpreter a bit wrong for using
variables to build the filename so you are going to have to do an svn
update and recompile to get that code I posted to work.
Regards,
Stuart
I have a problem with the iterate command as it seems.
The following code only displays
"ask_about_life: NOT LANGUAGE_DE"
from the first if/else construct. Nothing else.
The second conditional
>if player hasnt LANGUAGE_DE<
seems to evaluate to false or never to be reached because the line
write "ask_about_life: before if hasnt^"
even is not executed!?
The function seems to terminate before this.
May the "if else" in the "iterate" loop be a problem?
Here is the code:
integer wisdomselect 0
integer wisdomindex 0
{ask_about_life : ask_about_livings
if player has LANGUAGE_DE
write "ask_about_life: LANGUAGE_DE^"
else
write "ask_about_life: NOT LANGUAGE_DE^"
endif
if player has LANGUAGE_DE
write "Simon sagt: ~"
write " simonwisdomde = " simonwisdomde "^"
set max_rand = numsimonwisdomde
set wisdomselect = random
write " wisdomselect = " wisdomselect " Text = "
set wisdomindex = 0
iterate simonwisdomde
set wisdomindex + 1
if wisdomindex = wisdomselect
write field[0]
endif
enditerate
return
endif
write "ask_about_life: before if hasnt^"
if player hasnt LANGUAGE_DE
write "Simon says: ~"
write " simonwisdomen = " simonwisdomen "^"
set max_rand = numsimonwisdomen
set wisdomselect = random
write " wisdomselect = " wisdomselect " Text = "
set wisdomindex = 0
iterate simonwisdomen
set wisdomindex + 1
if wisdomindex = wisdomselect
write field[0]
endif
enditerate
endif
write "~^"
}
Thanks for help!
Regards
Thomas
On Nov 7, 12:47 am, Stuart Allen <stuartallen1...@gmail.com> wrote:
This should be fixed now, it was a bug with having an iterate
statement inside an if statement that wasn't true. Let me know if it
gives you any more trouble.
Regards,
Stuart
another question about the CSV feature. I want to store bigger sized
text content in a CSV file. I try to use a CSV file for storing for
example message board messages or help system texts. I noticed that my
texts get shortened when using the append command after typing them
into a textarea input box and submitting them as url/post parameters.
Is the problem the size of JACL strings or the size of URL parameters?
Or both?
Would it be sufficient to change the value size in the string_type to
for example 1024 instead of 256? I think not, because there are
several other variables, buffers, etc. involved handling strings and
so on...? It will be quite an effort to get bigger field sizes
working, right?
Regards
Thomas
On Nov 7, 12:47 am, Stuart Allen <stuartallen1...@gmail.com> wrote:
There are some restrictions around the length of a URL (and the get
parameters included with it). You can read a bit about that here:
http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url
Using a POST form will get you around this restriction, but
unfortunately the test web server doesn't currently support POST
requests. I'm not sure how hard that would be to add, but without it
you would need to use FastCGI for all your testing or test with GET
and short parameters then turn on POST when you deploy.
It wouldn't be particularly hard to change the maximum length of a
JACL string from 256 to 1024 bytes. If you do a 'grep 255 *.c' you'll
see less than a screen's worth of output and even then not all hits
relate to the string length. The main reason I tried to keep them
small is that the strings are persisted at the end of each move, but
in this day and age writing out a few extra kilobytes of data isn't a
big deal.
So the upshot is you could change the length to 1024 pretty easily in
your multiplayer version, but I'll have a think about upsizing the
trunk version too.
Regards,
Stuart
Let me know how you get on with the string length change.
How did you go about supporting POST requests? Is there much involved
in getting this to work? Also, do you experience the occassional
crashes with webjacl that I get? I have a friend lined up to help me
debug that soon.
Regards,
Stuart