Commit Graph

5457 Commits (241ea62d0ff61aaf5ac9bf220b08695c8f4bcfea)
 

Author SHA1 Message Date
Sven Eberhardt d3aa2c60ec Experimental pluto's OCTier: Not quite working yet. 2013-09-07 20:26:10 +02:00
Sven Eberhardt 96d2639688 Fix documentation for GetContact() script function behavior if no CNAT value is given.
It stated all directions were checked, but that is not true.
2013-09-05 22:52:46 +02:00
Nicolas Hake 7e260aa9de Remove C4ControlScript::fInternal
fInternal basically acted as a reverse "evil bit" as in RFC 3514: when
set, the engine would not do any checks on the script contained in the
control packet, nor log the script (visibly in game; the packet log
would of course contain the packet). A malicious game client thus would
be able to inject arbitrary script without people (immediately) noticing
anything was amiss.

As of this patch, only the host is able to execute arbitrary scripts,
and those will be shown in the message board for all players to see.
This privilege can be irrevocably disabled in network games by any
client by using the "/nodebug" message board command.

Closes #936.
2013-09-04 20:18:06 +02:00
Nicolas Hake 9b82abb8a0 Use control packet for mouse drag/drop and hover
This removes some more pre-assembled C4Script code going across the
network unchecked.

Part of #936.
2013-09-04 19:58:57 +02:00
Nicolas Hake ef9f79d815 Fix GTK build 2013-09-04 19:57:26 +02:00
Nicolas Hake 7e70554a04 Use control packet for more editor mode actions
Actions changed include dropping definitions, (de-)selecting objects,
player elimination. This removes some more pre-assembled C4Script code
going across the network unchecked.

Part of #936.
2013-09-04 17:51:55 +02:00
Nicolas Hake 059dd0e45a Use control packet for player control initialization
This removes some more pre-assembled C4Script code going across the
network unchecked.

Part of #936.
2013-09-04 15:45:00 +02:00
Nicolas Hake 5b25b75370 Script executed on behalf of a script debugger is not engine-internal
While fInternal-flagged script controls may be useful for debuggers to
evaluate watch expressions because they don't get shown ingame, they
also bypass all checks the engine does and as such are a nightmare in
network play.

Part of #936.
2013-09-04 14:55:54 +02:00
Martin Plicht fb4117307b mac: Fix Screen::rcBounds <> window size discrepancy + fullscreen windows still fill screen with less than fullscreen resolution in settings 2013-09-02 23:10:32 +02:00
Martin Plicht 8e387dd05a mac: Make Screenshot (of whole map) in main menu 2013-09-02 23:09:48 +02:00
Nicolas Hake 9604753e93 Player self-management: Use dedicated control packets
Instead of sending pre-composed C4Script code across the network, make
player self-management (surrendering, team changes etc.) send a
dedicated control packet. This means less network traffic, and also a
smaller attack vector for malicions C4Script injection.

Part of #936.
2013-09-02 22:22:29 +02:00
Sven Eberhardt 0351eb2cdb Coal dig free ratio decreased (so you get more coal).
Coal is the most used resource in many scenarios (used both as fuel and for metal) and you run out quite frequently. Let's hope this helps.
2013-09-02 20:48:14 +02:00
Nicolas Hake f2dba4a6b3 MsgBoard commands: Handle and assemble on clients
MsgBoard commands used to be evaluated on the issuing client. Malicious
clients would be able to insert arbitrary C4Script code to be executed
instead of the scenario-defined command; other clients would not be able
to tell the difference.

Instead, we now only send the command identifier, issuing player and
command parameter. This is still not perfect because clients can
insert any player they want, but it's better than before.

Part of #936.
2013-09-02 20:47:03 +02:00
Sven Eberhardt ae2f1e4c00 AcidGoldMine: Clonks and bread can be bought at flagpole. 2013-09-02 20:26:10 +02:00
Nicolas Hake f920e853e0 MsgBoard replies: Remove detour via C4Aul
Instead of having message board replies synced via script calls, send a
dedicated control packet.

Part of #936.
2013-09-02 20:19:37 +02:00
Nicolas Hake 7345a6ba0f Merge branch 'issue973' 2013-09-02 18:16:21 +02:00
Sven Eberhardt 60a32b1f14 Added player control assignment trigger mode "ClearRecentKeys": If assignment is triggered, clears all recently pressed keys prior to and including trigger key.
Useful for spell combos, where one spell combo might end the same way another combo starts.

Also corrected docs for OverrideAssignments (it's just a flag; not a trigger mode).
2013-09-02 17:27:15 +02:00
Nicolas Hake 625a9f47d9 #973: Make FindObject et al. handle object context instead of Find_*
When people write obj->FindObject(Find_Distance(10)), they expect the
engine to use the distance from obj instead of the distance from the
current object (or from 0,0 if called from outside of object context).

Making the engine handle coordinate offseting at calls to FindObject
(and similar functions) instead of having the C4FO wrappers do it solves
this problem.

Compatibility impact: Code that creates their own criteria structure
instead of using the provided Find_* functions will have to be adapted
if they use any of the location-based criteria.
2013-09-01 00:46:04 +02:00
Nicolas Hake 7829631f66 Add test case for #973 2013-09-01 00:35:15 +02:00
Nicolas Hake 68e023651a Add very rudimentary C4Script testing framework 2013-09-01 00:32:14 +02:00
Nicolas Hake 58a39e972f Improve C4Object const correctness 2013-08-31 23:23:35 +02:00
Maikel de Vries 682f927fa5 Make butterflies appear with different colors 2013-08-13 21:40:52 +02:00
Maikel de Vries b4a2133f66 Make seaweed Library_Plant for placement function 2013-08-13 21:16:46 +02:00
Sven Eberhardt ba84fc7c4b Fix internal marker for FindObject searches and CrossCheck using shapes.
Before, the marker would be reset in every frame, but object markers and main counter weren't reset consistently at the same time. This could cause some objects to be not found if their markers were set after the object marker reset but before the main marker counter reset.
2013-08-10 23:21:26 +02:00
Nicolas Hake 9ceb69236b Remove unused Base64 codec 2013-08-04 18:10:10 +02:00
Martin Plicht 41926866cc mac: Remove mouse-warping silliness (it doesn't work with tablets and I'm stupid D:) 2013-07-05 23:14:16 +02:00
Sven Eberhardt 12bce5ba4f Fix loading from child groups when the mother needs to re-set its file pointer.
Fixes a bug with loading the shader file from scenario local Graphics.ocg on network clients. I think I also heard a few more sounds after the fix, so maybe they used random access into child groups too.
2013-07-04 23:18:52 +02:00
Sven Eberhardt 324a1f03c0 Fix LandscapeRender ReInit when loading scenario sections.
The LandscapeRender Init() proc loads graphics from the main graphics group, which is already closed when a section is loaded. So just keep the renderer around on landscape recreation now.
2013-07-03 22:28:50 +02:00
Sven Eberhardt d607dbb39d MineRescue: Fix adjusted flagpole radius to be used correctly in construction site connectivity preview. 2013-07-02 21:19:14 +02:00
Sven Eberhardt 2da1dcc741 Make AdjustMoveToTarget more robust concerning large values.
Before, e.g. SetCommand("MoveTo", nil, 0,9999999) could freeze the engine for some time.
2013-07-02 21:18:16 +02:00
Sven Eberhardt 49c16723a9 Change Random() on negative values to always return zero.
Before, it would return huge, positive values (e.g. Random(-20) could produce 47384782) which leads to all kinds of trouble in script (like #968)
2013-07-02 21:16:59 +02:00
Julius Michaelis 69c5d12f4c Fix C4ChatDlg::ToggleChat: Do not close the network connection. 2013-06-30 19:43:54 +02:00
Pyrit 63dc51044b Set grass plane to -1.
Grass isn't covered by clouds anymore.
2013-06-24 21:41:15 +02:00
Caesar c90b1e985c Play correct chop animation for trees in front of Clonks 2013-06-24 13:17:51 +02:00
Sven Eberhardt a020cfc867 Fix construction preview of non-flagpole objects 2013-06-22 22:18:31 +02:00
Sven Eberhardt 58a0bf1c24 Flagpole construction: Show arrows pointing to neighboured flags that would be connected if the flagpole were built there.
Allows the player to build his base more efficiently.
2013-06-22 20:01:51 +02:00
Sven Eberhardt 27f8647a55 Clonk can consume bubbles while swimming to regain breath. 2013-06-10 19:53:56 +02:00
Tobias Zwick ddd2db94e0 remove debug log and messages 2013-06-04 20:11:09 +02:00
Tobias Zwick e30d5b9ec5 final fixes and refactorings for the pump 2013-06-04 20:10:51 +02:00
Tobias Zwick 416d49db99 adapt pump to use CanInsertMaterial to determine pump height 2013-06-04 20:09:09 +02:00
Tobias Zwick 67e00d8a98 reintroduce position parameter in (Can)InsertMaterial 2013-06-04 20:07:43 +02:00
Tobias Zwick b403bb6357 Merge branch 'master' into pumpfix 2013-06-04 18:46:04 +02:00
Tobias Zwick f6d64e46f8 fix querying InsertMaterial for bodies of water that stretch to the edge of the landscape 2013-06-02 17:59:13 +02:00
David Dormagen fec0870133 fixed a message of the pipe to use the correct string-table-entry 2013-05-31 22:35:16 +02:00
David Dormagen 81629cd691 the pump now behaves correctly in regards to the power usage 2013-05-31 22:34:17 +02:00
Martin Plicht 405453aed3 Merge branch 'debugrecoption' 2013-05-31 14:39:16 +02:00
Tobias Zwick c4c781631f Merge branch 'master' into pumpfix 2013-05-30 22:18:23 +02:00
Tobias Zwick 7eb0fee45d fix scancodes convert on windows for non-fullscreen 2013-05-30 22:15:30 +02:00
Tobias Zwick 43a3119bbf buildfix 2013-05-30 22:11:56 +02:00
Tobias Zwick 131ec86b98 refactor pump done. Remaining problem: power system (usage) 2013-05-30 22:11:39 +02:00