Re: [warzone2100-dev] [Warzone2100-commits] [Warzone2100/warzone2100] 845d42: Add a 'Need more resources' indicator in the power...

2012-02-16 Thread Christian Ohm
On Thursday, 16 February 2012 at  8:42, Per Inge Mathisen wrote:
 A script should not get a warning for every event it does not
 implement. If you want to warn about misnamed timers, this function
 needs an additional bool parameter that is not set for events. If you
 want to warn about misnamed events, then we could check for functions
 named event*() but not in the set of defined events on load (could be
 a job for lint, but not sure if that is the right tool for the job
 anymore).

It looks to me that change adds a warning if we call any undefined
function. I noticed this behaviour already when I used a wrong function
name, and it took a bit to find the problem, since the game just
silently ignored that line. If the script calls a function that doesn't
exist, why would we ever not want to know about that? So far, the
debuggability of javascript seems not much better than that of wzscript,
maybe integrating a QScriptEngineDebugger would help there.

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [warzone2100-dev] [Warzone2100-commits] [Warzone2100/warzone2100] 845d42: Add a 'Need more resources' indicator in the power...

2012-02-16 Thread Per Inge Mathisen
On Thu, Feb 16, 2012 at 2:49 PM, Christian Ohm chr@gmx.net wrote:
 It looks to me that change adds a warning if we call any undefined
 function. I noticed this behaviour already when I used a wrong function
 name, and it took a bit to find the problem, since the game just
 silently ignored that line. If the script calls a function that doesn't
 exist, why would we ever not want to know about that?

Because we have lots of events being called (and more being added all
the time) that not every script should be forced to implement just to
make the warnings disappear.

 So far, the
 debuggability of javascript seems not much better than that of wzscript,
 maybe integrating a QScriptEngineDebugger would help there.

When wzscript triggered a crash or assertion, you would not know from
which line or even file the error came from. Now you get a nice
backtrace. That is the difference between being able to debug and not.

 -  Per

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [warzone2100-dev] [Warzone2100-commits] [Warzone2100/warzone2100] 845d42: Add a 'Need more resources' indicator in the power...

2012-02-16 Thread buginator
On Thu, Feb 16, 2012 at 9:23 AM, Per Inge Mathisen  wrote:
 A script should not get a warning for every event it does not
 implement. If you want to warn about misnamed timers, this function
 needs an additional bool parameter that is not set for events. If you
 want to warn about misnamed events, then we could check for functions
 named event*() but not in the set of defined events on load (could be
 a job for lint, but not sure if that is the right tool for the job
 anymore).

 On Thu, Feb 16, 2012 at 2:49 PM, Christian Ohm  wrote:
 It looks to me that change adds a warning if we call any undefined
 function. I noticed this behaviour already when I used a wrong function
 name, and it took a bit to find the problem, since the game just
 silently ignored that line. If the script calls a function that doesn't
 exist, why would we ever not want to know about that?

 Because we have lots of events being called (and more being added all
 the time) that not every script should be forced to implement just to
 make the warnings disappear.

Eh ? You are inviting bugs then, as can be seen by 001ef35faf1.
The codebase is still firing off events and if it isn't in the script
then it should be yelling that it can't find it, otherwise you open up
a can of worms, making pretty much all bug reports much, much harder
to see if the problem is in the codebase, or if it just happens to be
a script that didn't implement said missing function.
If the script writer wants to ignore said missing function, then
they can NOP the function in question.

We definitely should be warning/throwing out errors on all missing
triggers or events.

 So far, the
 debuggability of javascript seems not much better than that of wzscript,
 maybe integrating a QScriptEngineDebugger would help there.

 When wzscript triggered a crash or assertion, you would not know from
 which line or even file the error came from. Now you get a nice
 backtrace. That is the difference between being able to debug and not.


Wzscript itself has the same debugging capabilities as the current
JS scripts, spam printf's/asserts in your code.
The issue with WZscript was in the back end, and how the interpreter
was created with rudimentary recovery/error reporting.

In my fastplay conversion to JS--which did fully work, doing a 1:1
conversion from WZscript, I noticed how poor the debugging
capabilities we had with qtscript were, which is when I tried to get
QScriptEngineDebugger  working, but I quickly found out it had the
same limitations with the way we are using qt  handling the update
draw calls.

If we really want a good debugger, then, at this time the only option
I see is go with a external script engine (V8 along with the debugger
that is available for that--if we still want to stick with JS)  Oh, I
know that Qt will be using V8 soonish, but that still won't fix the
issue mentioned above.

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


[warzone2100-dev] [Warzone 2100 Trac] #3180: wz crashes when transfering map

2012-02-16 Thread Warzone 2100 Trac
#3180: wz crashes when transfering map
-+
Reporter:  effigy|   Type:  bug
  Status:  new   |   Priority:  normal
   Milestone:  unspecified   |  Component:  other
 Version:  unspecified   |   Keywords:
  Blocked By:|   Blocking:
Operating System:  All/Non-Specific  |
-+
 I've hosted this map a few times, but unless the joiner already had the
 map I crashed: http://addons.wz2100.net/map/behindyou

 wzlog:
 {{{
 --- Starting log ---
 info|10:26:58: [NETrecvNet] Player, (player 0) seems to have
 dropped/disconnected.
 info|10:32:16: [NETallowJoining] Player Macuser has joined, IP is:
 68.102.71.72
 info|10:32:24: [NETrecvNet] Player, (player 1) seems to have
 dropped/disconnected.
 info|10:32:24: [NETplayerDropped] sending NET_PLAYER_DROPPED for
 player 1
 info|10:32:31: [NETallowJoining] Player Macuser has joined, IP is:
 68.102.71.72
 error   |10:32:31: [recvMapFileRequested] Failed to open maps/4c-
 behindyou.wz for reading: File not found
 fatal   |10:32:31: [recvMapFileRequested] You have a map (maps/4c-
 behindyou.wz) that can't be located.

 Make sure it is in the correct directory and or format! (No map packs!)
 }}}

-- 
Ticket URL: http://developer.wz2100.net/ticket/3180
Warzone 2100 Trac http://developer.wz2100.net/
The Warzone 2100 Project
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev