Commit Graph

49 Commits (d7659713dc107cae02e41718751524eadaaebfc3)

Author SHA1 Message Date
Lukas Werling c94b4cc3b0 Remove ResolveAddress()
As setting a default port is a common operation, add a helper function
for this.
2017-01-09 20:35:44 +01:00
Nicolas Hake 102047f537 Implement IPv6 support to C4NetIO 2017-01-09 20:34:43 +01:00
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
Nicolas Hake 0537df5f23 C4Object: Move C4Def.h dep out of header
C4Def is only ever used as a pointer inside C4Object.h, so we don't need
to include C4Def.h from it.
2016-04-03 13:24:26 +02:00
Günther Brammer 168ac8bb40 Remove pointer to start of variables from function context
It pointed always to Pars + Func->GetParCount(). The only users were
VARN_CONTEXT, which can be replaced with PARN_CONTEXT that way, and
FOREACH_NEXT, where the parser can do the math and simply give a number
relative to the current stack position, like regular variable usages do.
2016-02-02 02:57:48 +01:00
Günther Brammer 6f98fb2e66 Remove C4AulScript class
It isn't needed to hold engine functions anymore, because those are just
put into C4PropLists.
2016-02-02 02:57:47 +01:00
Günther Brammer 16ef28e05f Drop unused C4VERSIONBUILDNAME and C4ENGINEINFO
This was used to name snapshot releases of the Network2 branch, and has
seen almost no use since.

C4ENGINEINFO(LONG) was a duplicate of C4ENGINENAME and C4ENGINECAPTION.
2015-12-29 15:47:55 +01:00
Nicolas Hake 5562b09dc4 Remove a lot of disabled legacy code, round 2
Maybe at some point we'll be rid of all the commented-out code that
nobody has looked at in years.
2015-03-25 20:02:53 +01:00
Günther Brammer 5bcedb5bbf Remove some redundant #includes 2015-01-25 18:53:48 +01:00
Günther Brammer b7a022852e Revert "Move C4Aul code into separate subdirectory"
The distinction between the "aul" and "non-aul" parts of
the script engine are mostly historical accident, and the
current organization of the source code does not use
sub-subdirectories. I'd like to keep it that way.

This reverts commit 69ba06b8d0.
2014-05-12 02:24:19 +02:00
Nicolas Hake 69ba06b8d0 Move C4Aul code into separate subdirectory 2014-05-11 16:17:48 +02:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Martin Plicht 608f23ece6 debugger: C4AulDebug: Do not call Execute on each DebugStep call 2013-10-16 13:43:02 +02:00
Martin Plicht 0fd9ebc2ed debugger: Ignore active breakpoints when no peer connected 2013-10-14 07:12:44 +02:00
Martin Plicht 91f8d32d69 debugger: Make it work again (some issues remaining, setting breakpoints on included scripts is questionable and listener socket setup sometimes hangs..) 2013-10-13 23:03:25 +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 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
Günther Brammer 42608c5209 Remove C4DirectExecScript, use an existing scripthost for the eval function
Since the scripthost isn't used to store the bytecode anymore,
Parse_Expression doesn't modify it anymore. So there is no need for a
temporary one.
2013-01-23 21:36:21 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer af62ab7931 Move script bytecode from C4ScriptHost into C4AulScriptFunc
This makes functions independent of their "Code Owner"s, which removes the
necessity to maintain that connection and carefully reset functions when
their scripthost is cleared.
2012-10-21 18:14:32 +02:00
Günther Brammer bd371e38c1 Make the child pointers of the scriptengine C4AulScript*s again
The rope will create a C4AulScript for the rope engine functions instead of
putting them into the global scope, and we might want to put C4Object-only
functions into a separate C4AulScript some day, too.
2012-06-07 21:07:31 +02:00
Günther Brammer 62bc721a65 Make the child pointers of the scriptengine C4ScriptHost*s
This only tightens up the types a bit.
2012-05-15 19:32:58 +02:00
Günther Brammer a10ebdfabe Remove unused C4AulContext
The C4AulScriptContext is now an implementation detail of C4AulExec.
Also consolidate the C4Object * Obj and C4PropList * Def members to just
C4PropList * Obj and convert that to C4Object * on demand.
2012-06-04 00:03:49 +02:00
Günther Brammer f166fdaed7 Move Parser from C4AulScript to C4ScriptHost 2011-10-13 18:01:02 +02:00
Günther Brammer 5f2f995852 Unify the #include blocks a little bit
One line for C4Include.h, one for the .h corresponding to the .cpp, one
empty line, the other C4* includes, another empty line, external headers.
2011-11-01 23:17:41 +01:00
Günther Brammer 9bc61db360 copyright notices update 2011 2011-09-01 16:58:52 +02:00
Nicolas Hake fe747db554 Clean up copyright notices
Use real names for copyright attribution wherever they are known,
drop duplicates
2011-09-01 12:47:54 +02:00
Günther Brammer 45620c2b85 Move some C4AulDebug code into C4AulDebug 2011-03-03 00:58:43 +01:00
Günther Brammer be342d4a51 copyright notices update 2010
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
2010-12-23 01:01:24 +01:00
Günther Brammer 40c24961dd Correctly map bytecode to linenumber for global/appended/included functions
The method to get the C4AulScript instance that stores the bytecode of a
function is ridiculous, but at least it's now capsuled in a function. While
at it, this also always stores the bytecode index instead of a bytecode
pointer in the function.
2010-12-22 02:10:58 +01:00
Günther Brammer d02c424dab Script: Split SPos out of the bytecode into an extra vector for speed
SPos is only needed to display debug messages. Not having that data in the
cache for normal execution speeds up script execution by ten percent on at
least one artificial benchmark.
2010-10-25 23:48:08 +02:00
Martin Plicht 99cbfecdff Debugger: Execute scripts using the calling object 2010-04-26 20:16:04 +02:00
Martin Plicht faffb26b95 C4ControlScript::Execute informs the debugger about evaluated scripts 2010-04-26 20:13:36 +02:00
Martin Plicht 1d9911ced7 Debugger: Fix typo + change format of the VAR command result 2010-03-22 10:54:41 +01:00
Armin Burgmeier c2924041c9 Fix seperate->separate everywhere 2010-04-01 23:08:06 +02:00
Benjamin Herr 4378de147c Rerun astyle with missing \ added 2010-03-28 20:58:01 +02:00
Benjamin Herr 5ccb193928 override both Close() overrides in C4AulDebug
If we only override the Close() function with no parameters, the
overload taking an addr_t gets hidden. So we specifically override that
as well, preventing a gcc warning.
2010-03-21 19:18:27 +01:00
Armin Burgmeier 7d17cb28e6 Fix a few compiler warnings 2010-03-16 12:39:58 +01:00
Martin Plicht 15967dc313 Reorder preprocessor directives in C4AulDebug.cpp to make compiler happy 2010-02-24 19:16:17 +01:00
Martin Plicht 2bb528b5d4 Define NOAULDEBUG to compile without C4AulDebug 2010-02-23 19:29:26 +01:00
Martin Plicht 9d565fb3fd Debugger: Add VAR command to query the value of a variable 2010-01-21 16:22:33 +01:00
Martin Plicht 7966e59e18 Debugger: Not scenario-relative but relative to the scenario's container 2010-01-16 05:24:10 +01:00
Martin Plicht a519a5f352 Debugger: Send scenario-relative paths 2010-01-16 02:32:53 +01:00
Martin Plicht 98dfe3dc1a Debugger: Return correct script path (pOrgScript) 2010-01-15 15:31:51 +01:00
Martin Plicht cee326dd57 Debugger: Stack frame support (not finished) 2010-01-15 05:46:16 +01:00
Martin Plicht db281e3d10 Add C4AulDebug command to toggle breakpoint (TBR) 2010-01-15 01:47:20 +01:00
Martin Plicht 03881cec3f Add C4AulDebug.cpp (was moved from gui) 2010-01-13 19:26:03 +01:00