summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cd1240f)
raw | patch | inline | side by side (parent: cd1240f)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Mon, 25 Apr 2016 19:31:16 +0000 (22:31 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Mon, 25 Apr 2016 19:31:16 +0000 (22:31 +0300) |
diff --git a/src/game/Doom2DF.dpr b/src/game/Doom2DF.dpr
index a9044fb9d614cff917282b7baa15a337246458a7..3fbd82967e4ab008d93e2f75585f3aad9b4ddc49 100644 (file)
--- a/src/game/Doom2DF.dpr
+++ b/src/game/Doom2DF.dpr
f: Integer;
noct: Boolean = false;
begin
- for f := 1 to ParamCount do if ParamStr(f) = '--gdb' then noct := true;
+ for f := 1 to ParamCount do
+ begin
+ if ParamStr(f) = '--gdb' then noct := true
+ else if ParamStr(f) = '--log' then conbufDumpToStdOut := true;
+ end;
if noct then
Main()
else
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index df45e6ab722df26f38a9fde510ed1078c3e12c49..fcabed7ba667ec84613f3e80cb698ddcfbaac5f5 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
while length(L) > 0 do
begin
f := Pos(#10, L);
- if f < 0 then f := length(L)+1;
+ if f <= 0 then f := length(L)+1;
conmsg(Copy(L, 1, f-1));
Delete(L, 1, f);
end;
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index e1e21d8d3de2ea5563dd89df7c88776272646775..0d84cf24a1bb27ef60c9e0456f76f4e8b0c9abda 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
e_WriteLog('Read config file', MSG_NOTIFY);
g_Options_Read(GameDir + '/' + CONFIG_FILENAME);
+{$IFDEF HEADLESS}
+ conbufDumpToStdOut := true;
+{$ENDIF}
e_WriteToStdOut := False; //{$IFDEF HEADLESS}True;{$ELSE}False;{$ENDIF}
//GetSystemDefaultLCID()
index adc285cb1c5b23030d40eed3366d3ec45a4d2d12..1f7ddf1e787877483b48dce108eaa7ddd01de0bc 100644 (file)
--- a/src/game/g_netmaster.pas
+++ b/src/game/g_netmaster.pas
Cnt := e_Raw_Read_Byte(NetMEvent.packet^.data);
e_WriteLog('Retrieved ' + IntToStr(Cnt) + ' server(s).', MSG_NOTIFY);
g_Console_Add(_lc[I_NET_MSG] + Format(_lc[I_NET_SLIST_RETRIEVED], [Cnt]), True);
+ //writeln('BOO!');
if Cnt > 0 then
begin
diff --git a/src/shared/conbuf.pas b/src/shared/conbuf.pas
index 57ed64431cab091c167ee4052c82f239446909ff..1be01b2f80df2eb36fffd90ec3d380828a97ea5d 100644 (file)
--- a/src/shared/conbuf.pas
+++ b/src/shared/conbuf.pas
procedure cbufClear ();
+var
+ conbufDumpToStdOut: Boolean = false;
+
implementation
// ////////////////////////////////////////////////////////////////////////// //
-{$IFDEF HEADLESS}
var
needCon: Boolean = true;
-{$ENDIF}
+
procedure cbufPutChars (buf: PChar; count: Integer);
var
np: LongWord;
begin
if count > 0 then
begin
-{$IFDEF HEADLESS}
- //write(stderr, 'CON: ');
- for np := 0 to count-1 do
+ if conbufDumpToStdOut then
begin
- if needCon then begin write(stdout, 'CON: '); needCon := false; end;
- write(stdout, buf[np]);
- needCon := (buf[np] = #10);
+ for np := 0 to count-1 do
+ begin
+ if needCon then begin write(stdout, 'CON: '); needCon := false; end;
+ write(stdout, buf[np]);
+ needCon := (buf[np] = #10);
+ end;
end;
-{$ENDIF}
Inc(changeCount);
if changeCount = 0 then changeCount := 1;
while count > 0 do