Commit Graph

10372 Commits (5f1ad6a5d70c5681c12a2954037dfd67a322db0b)
 

Author SHA1 Message Date
Julius Michaelis 5f1ad6a5d7 Travis: fancy stuff
- gtest
 - colors
 - container based builds and GCC PCH (for a faster: "you failed")
2017-02-21 17:13:18 +01:00
Sven Eberhardt 65db84d07e Add attack path to AI and EnemySpawn 2017-02-20 22:25:28 -05:00
Sven Eberhardt 9abb0bc200 Fix drawing of editor shape delegate polylines with settings StartFromObject=true and Relative=false 2017-02-20 22:25:28 -05:00
Sven Eberhardt 1ee26ae0a6 Fix variable shadowing in Clonk::SetScaleRotation 2017-02-20 22:25:27 -05:00
Julius Michaelis 9d6a407214 Re-enable Travis CI 2017-02-21 02:02:32 +01:00
Sven Eberhardt 198d11427d Fix crash on script error outside function [Knueppel-crash] 2017-02-20 18:45:11 -05:00
Sven Eberhardt ca19504c40 Fix AttackMode initialization in derived AIs 2017-02-20 18:06:21 -05:00
Maikel de Vries b58fc5e848 fix defense goal achievements 2017-02-20 21:09:14 +01:00
Sven Eberhardt e3eec21271 Editor: Add arrow drawing option to polyline delegate 2017-02-20 14:05:24 -05:00
Sven Eberhardt 294b679961 Editor: Add StartFromCenter option to polyline delegate 2017-02-20 13:39:46 -05:00
Sven Eberhardt cc0371bdf5 Add PIF_NoScenarioSave option to script players 2017-02-20 13:39:11 -05:00
Sven Eberhardt 99a65008cd Add enemy spawn object
This object can be placed in the editor to spawn enemy AI clonks.
2017-02-19 20:36:41 -05:00
Sven Eberhardt 6579798907 Add editor enum option to force value serialization on foreign values 2017-02-19 20:36:40 -05:00
Sven Eberhardt 69b0fd4f1a Do not call InitializePlayers after script player join if no human players joined 2017-02-19 20:36:40 -05:00
Nicolas Hake 76b9d68126 C4ValueTest: Use custom formatter instead of a custom macro
We can just make GTest use a custom formatter to write a value to the
console instead of using a custom macro to wrap everything in a
std::string.
2017-02-19 18:40:19 +01:00
Nicolas Hake bbf9e1ee50 C4Value tests: Work around MSVC 2015 preprocessor bug
MSVC 2015 doesn't support raw strings that contain the sequence \"
(U+005C REVERSE SOLIDUS, U+0022 QUOTATION MARK) and fails to compile
with error C2017.
2017-02-19 18:38:39 +01:00
Lukas Werling fc418a219e Fix use-after-free in C4ValueTest 2017-02-19 18:29:34 +01:00
Lukas Werling cb29e31643 HotIce: Remove non-network InitializePlayers() workaround
See a7bbda4ca
2017-02-19 15:34:58 +01:00
Nicolas Hake 168824a603 Win32: Use _vsprintf_p instead of v(a)s(n)printf (#1892)
This makes it possible to use positional parameters in format strings on
all platforms.
2017-02-19 12:57:27 +01:00
Maikel de Vries 45676eaa8b defense goal: put a short break after a wave that ends when all opponents are killed 2017-02-19 11:29:18 +01:00
Maikel de Vries 50f6b2266a fix possible script error in no friendly fire rule 2017-02-19 11:28:35 +01:00
Sven Eberhardt a7bbda4ca1 Fix order of InitializePlayer(s) callbacks in non-network games with teams enabled [Luchs] 2017-02-18 18:26:21 -05:00
Lukas Werling 6999dc39e1 HotIce: Collect scenario settings for statistics 2017-02-18 23:13:05 +01:00
Lukas Werling 16591ffe53 HotIce: Fix initial player spawn
InitializePlayer() semantics differ in online and local games. In a
local game, InitializePlayers() is called before InitializePlayer(plr);
in an online game it's the other way around.

This also improves handling of players joining at runtime. Those
previously started at random positions.

Close GH-32
2017-02-18 23:07:34 +01:00
Lukas Werling a4492dd828 Fix double escaping of Statistics JSON
As newlines are already escaped in the JSON, this is safe.
2017-02-18 19:08:15 +01:00
Lukas Werling 87ee44964c Send script-defined statistics to the masterserver
After GameOver(), the global function CollectStatistics() is called
which in turn calls CollectStats() on all definitions and the Scenario.
The results are collected into a proplist and sent to the masterserver
as JSON.

The intended purpose is to collect statistics like weapon kill counts
and evaluate them across all online games to improve balancing.
2017-02-17 23:29:16 +01:00
Lukas Werling ee0b1c2599 Implement JSON serialization for C4Value 2017-02-17 23:29:01 +01:00
Lukas Werling a44bd69b2f Fix find_path for GMock on Arch Linux
The path is /usr/src/gmock/gmock-all.cc there.
2017-02-17 20:21:47 +01:00
Nicolas Hake 5006a7409e Aul tests: Increment subtest counter per script execution
GTest usually only increments its part count per EXPECT_* call, which we
don't use in diagnostics tests, so all compilation failures would show
as part number 0.
2017-02-16 19:32:47 +01:00
Nicolas Hake 15f5eefc3f Diagnostics tests: Pull common code into a macro
Instead of declaring an error handler every time we run a subtest, we'll
just use a class member that we clear when we leave the scope of the
subtest.
The macro is a bit ugly but solves the issue with redeclaring the scope
guard.
2017-02-16 19:32:46 +01:00
Nicolas Hake c07e0768d6 Aul tests: Split DiagnosticsTest.Warnings into individual parts
We'll test every diagnostic we want to issue in a separate test case so
they get grouped more nicely.
2017-02-16 19:32:45 +01:00
Nicolas Hake c67d188d91 Aul tests: Check for warning ID instead of message 2017-02-16 19:32:44 +01:00
Nicolas Hake b4127439ac Tests: Move aul diagnostics test to a separate file 2017-02-16 19:32:43 +01:00
Nicolas Hake 78bbbc917b Fallback to sane settings when compiling scripts without ScriptHost
Compilation without an associated ScriptHost happens in a call to eval,
in which case we'll fall back to the default warning settings (because
we don't have a location which we could get settings from).

Fixes #1891.
2017-02-16 19:32:42 +01:00
Lukas Werling 181f7ab471 Prefer public/stable IPv6 source addresses
We don't benefit at all from privacy addresses as we're publishing all
local addresses in any case. By preferring stable addresses, we can
avoid reconnection issues after the preferred address changes.

This API is defined in RFC5014, but apparently only implemented in
Linux.
2017-02-14 21:44:05 +01:00
Sven Eberhardt da4f49d7ca Add AI attack mode (weapon) to editor properties 2017-02-14 01:36:12 -05:00
Maikel de Vries 60f3e206cc fix variable shadowing in some scripts 2017-02-13 19:04:27 +01:00
Nicolas Hake 1594acd3ed Aul: Warn if a function parameter shadows a local variable
Yeah. Aul looks up function parameters before local variables when
trying to resolve an identifier. Usually this doesn't matter, but you'll
notice it if you have a local variable and a parameter with the same
name, because the variable should be initialized to nil yet you get the
value of the parameter.
2017-02-13 17:20:03 +01:00
Nicolas Hake 1595bf56a5 Aul test: Write correct output for BoolLit 2017-02-13 15:24:17 +01:00
Nicolas Hake 2b5d34f420 Aul: Remove unnecessary virtual dtor from Script node
The dtor (which didn't even do anything) broke testing on g++ and clang,
because they correctly delete some ctors if the dtor is declared.
2017-02-13 15:23:51 +01:00
Nicolas Hake 30c5bb5f8d Aul: Allow the user to selectively enable/disable warnings
This commit introduces a new Aul directive "#warning", which can be used
to enable or disable warnings for a particular piece of code.

"#warning enable" enables all warnings.
"#warning disable" disables all warnings.
"#warning enable empty_parameter_in_call" selectively enables one
specific warning while not affecting any other.

All warnings that used to be controlled by Developer.ExtraWarnings
remain disabled by default.
2017-02-13 15:07:50 +01:00
Nicolas Hake 23bf3c4f0a Aul: Don't explicitly prepend "ERROR" to runtime errors
Since the error handler would itself prepend "ERROR", runtime errors
used to be written as "ERROR: ERROR: <whatever>".
2017-02-13 15:07:50 +01:00
Nicolas Hake a026bda561 Aul: Let error handler count warnings and prepend severity
Instead of explicitly writing to the log, let C4AulParse and
C4ScriptHost warnings go to the error handler to do with as it sees fit.
2017-02-13 15:07:50 +01:00
Nicolas Hake 5f520c6326 C4AulCompiler: Don't double-count compile time warnings 2017-02-13 15:07:50 +01:00
Sven Eberhardt 2b888fd136 Enlarge initial client connection dialogue to accommodate long ipv6 addresses 2017-02-12 11:48:55 -05:00
Maikel de Vries 60e0417dd2 defense enemy: refactor code for better overloading 2017-02-10 17:57:33 +01:00
Sven Eberhardt ef5626774d Add another default scenario template 2017-02-05 16:08:30 -05:00
Sven Eberhardt 22306bd266 Editor: Add templates for new scenarios 2017-02-05 16:08:29 -05:00
Sven Eberhardt 2f44b48e7d Fix German string table entry for map size in new scenario dialogue 2017-02-05 16:08:29 -05:00
Nicolas Hake 7284d65685 Remove unintentional semicolon after if()
Also changed some other instances of the if(); pattern to use an empty
block in order to suppress the new warning.
2017-02-05 14:22:09 +01:00