Skip to content

Commit 923f895

Browse files
committed
make p1xbratenversion available in server
1 parent 110588d commit 923f895

File tree

8 files changed

+42
-44
lines changed

8 files changed

+42
-44
lines changed

patches/anticheat.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1173,10 +1173,10 @@ diff --git src/shared/iengine.h src/shared/iengine.h
11731173
index 7373c6f..c50bf24 100644
11741174
--- src/shared/iengine.h
11751175
+++ src/shared/iengine.h
1176-
@@ -589,3 +589,7 @@ extern void g3d_resetcursor();
1177-
extern void g3d_limitscale(float scale);
1178-
1176+
@@ -594,3 +594,7 @@ extern void g3d_resetcursor();
11791177
extern char *p1xbratenversion;
1178+
extern int naturalsort(const char *a, const char *b); // from command.cpp
1179+
extern void migratep1xbraten();
11801180
+
11811181
+#ifdef ANTICHEAT
11821182
+extern int anticheatenabled; // toggled by -e CLI flag

patches/modversion.patch

+21-28
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
1-
Index: src/engine/engine.h
2-
===================================================================
3-
--- src/engine/engine.h (revision 6502)
4-
+++ src/engine/engine.h (working copy)
5-
@@ -407,6 +407,8 @@
6-
extern void checksleep(int millis);
7-
extern void clearsleep(bool clearoverrides = true);
8-
9-
+extern int naturalsort(const char *a, const char *b);
10-
+
11-
// console
12-
extern void processtextinput(const char *str, int len);
13-
extern void processkey(int code, bool isdown, int modstate = 0);
14-
@@ -431,6 +433,8 @@
15-
};
16-
extern int initing, numcpus;
17-
18-
+extern void migratep1xbraten();
19-
+
20-
enum
21-
{
22-
CHANGE_GFX = 1<<0,
23-
Index: src/engine/main.cpp
24-
===================================================================
25-
--- src/engine/main.cpp (revision 6502)
26-
+++ src/engine/main.cpp (working copy)
1+
diff --git src/engine/main.cpp src/engine/main.cpp
2+
index d79944d..9811024 100644
3+
--- src/engine/main.cpp
4+
+++ src/engine/main.cpp
275
@@ -1330,6 +1330,8 @@
286

297
identflags |= IDF_PERSIST;
@@ -33,12 +11,24 @@ Index: src/engine/main.cpp
3311
logoutf("init: mainloop");
3412

3513
if(execfile("once.cfg", false)) remove(findfile("once.cfg", "rb"));
14+
diff --git src/engine/server.cpp src/engine/server.cpp
15+
index d79944d..9811024 100644
16+
--- src/engine/server.cpp
17+
+++ src/engine/server.cpp
18+
@@ -979,6 +979,7 @@ void initserver(bool listen, bool dedicated)
19+
#ifdef WIN32
20+
setupwindow("Cube 2: Sauerbraten server");
21+
#endif
22+
+ migratep1xbraten();
23+
}
24+
25+
execfile("server-init.cfg", false);
3626
Index: src/p1xbraten/version.cpp
3727
===================================================================
3828
--- src/p1xbraten/version.cpp (nonexistent)
3929
+++ src/p1xbraten/version.cpp (working copy)
4030
@@ -0,0 +1,22 @@
41-
+#include "engine.h"
31+
+#include "cube.h"
4232
+
4333
+MOD(SVARP, p1xbratenversion, "");
4434
+
@@ -161,11 +151,14 @@ Index: src/shared/iengine.h
161151
===================================================================
162152
--- src/shared/iengine.h (revision 6502)
163153
+++ src/shared/iengine.h (working copy)
164-
@@ -581,3 +581,4 @@
154+
@@ -581,3 +581,7 @@
165155
extern void g3d_resetcursor();
166156
extern void g3d_limitscale(float scale);
167157

158+
+// p1xbraten
168159
+extern char *p1xbratenversion;
160+
+extern int naturalsort(const char *a, const char *b); // from command.cpp
161+
+extern void migratep1xbraten();
169162
Index: src/shared/tools.h
170163
===================================================================
171164
--- src/shared/tools.h (revision 6502)

patches/zenmode.patch

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ Index: src/p1xbraten/version.cpp
44
===================================================================
55
--- src/p1xbraten/version.cpp (nonexistent)
66
+++ src/p1xbraten/version.cpp (working copy)
7-
@@ -15,6 +15,12 @@
7+
@@ -15,6 +15,14 @@
88
if(naturalsort(p1xbratenversion, version) == -1)
99
{
1010
// we're newer, run migrations
1111
+ if(naturalsort(p1xbratenversion, "3.0.0") == -1) {
12+
+#ifndef STANDALONE
1213
+ // activate CON_NONZEN in all consoles
1314
+ if(!(confilter&(1<<14))) confilter += 1<<14;
1415
+ if(!(fullconfilter&(1<<14))) fullconfilter += 1<<14;
1516
+ if(!(miniconfilter&(1<<14))) miniconfilter += 1<<14;
17+
+#endif
1618
+ }
1719
}
1820
setsvar("p1xbratenversion", version);

src/Makefile

+8-7
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ SERVER_OBJS= \
180180
p1xbraten/demo_info_message-standalone.o \
181181
p1xbraten/managed_games-standalone.o \
182182
p1xbraten/proxy_real_ip-standalone.o \
183-
p1xbraten/remote_commands-standalone.o
183+
p1xbraten/remote_commands-standalone.o \
184+
p1xbraten/version-standalone.o
184185
ifdef ANTICHEAT
185186
override SERVER_OBJS+= anticheat/anticheat-standalone.o
186187
endif
@@ -558,12 +559,9 @@ p1xbraten/serverbrowser.o: shared/igame.h fpsgame/ai.h
558559
p1xbraten/serverbrowser.o: p1xbraten/serverbrowser.h engine/engine.h
559560
p1xbraten/serverbrowser.o: engine/world.h engine/octa.h engine/lightmap.h
560561
p1xbraten/serverbrowser.o: engine/bih.h engine/texture.h engine/model.h
561-
p1xbraten/version.o: engine/engine.h shared/cube.h shared/tools.h
562-
p1xbraten/version.o: shared/geom.h shared/ents.h shared/command.h
563-
p1xbraten/version.o: shared/glexts.h shared/glemu.h shared/iengine.h
564-
p1xbraten/version.o: shared/igame.h engine/world.h engine/octa.h
565-
p1xbraten/version.o: engine/lightmap.h engine/bih.h engine/texture.h
566-
p1xbraten/version.o: engine/model.h
562+
p1xbraten/version.o: shared/cube.h shared/tools.h shared/geom.h shared/ents.h
563+
p1xbraten/version.o: shared/command.h shared/glexts.h shared/glemu.h
564+
p1xbraten/version.o: shared/iengine.h shared/igame.h
567565
p1xbraten/weaponstats.o: fpsgame/game.h shared/cube.h shared/tools.h
568566
p1xbraten/weaponstats.o: shared/geom.h shared/ents.h shared/command.h
569567
p1xbraten/weaponstats.o: shared/glexts.h shared/glemu.h shared/iengine.h
@@ -619,3 +617,6 @@ p1xbraten/remote_commands-standalone.o: shared/tools.h shared/geom.h
619617
p1xbraten/remote_commands-standalone.o: shared/ents.h shared/command.h
620618
p1xbraten/remote_commands-standalone.o: shared/iengine.h shared/igame.h
621619
p1xbraten/remote_commands-standalone.o: fpsgame/ai.h
620+
p1xbraten/version-standalone.o: shared/cube.h shared/tools.h shared/geom.h
621+
p1xbraten/version-standalone.o: shared/ents.h shared/command.h
622+
p1xbraten/version-standalone.o: shared/iengine.h shared/igame.h

src/engine/engine.h

-4
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,6 @@ extern void writecfg(const char *name = NULL);
412412
extern void checksleep(int millis);
413413
extern void clearsleep(bool clearoverrides = true);
414414

415-
extern int naturalsort(const char *a, const char *b);
416-
417415
// console
418416
extern void processtextinput(const char *str, int len);
419417
extern void processkey(int code, bool isdown, int modstate = 0);
@@ -438,8 +436,6 @@ enum
438436
};
439437
extern int initing, numcpus;
440438

441-
extern void migratep1xbraten();
442-
443439
enum
444440
{
445441
CHANGE_GFX = 1<<0,

src/engine/server.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ void initserver(bool listen, bool dedicated)
979979
#ifdef WIN32
980980
setupwindow("Cube 2: Sauerbraten server");
981981
#endif
982+
migratep1xbraten();
982983
}
983984

984985
execfile("server-init.cfg", false);

src/p1xbraten/version.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "engine.h"
1+
#include "cube.h"
22

33
MOD(SVARP, p1xbratenversion, "");
44

@@ -16,10 +16,12 @@ void migratep1xbraten()
1616
{
1717
// we're newer, run migrations
1818
if(naturalsort(p1xbratenversion, "3.0.0") == -1) {
19+
#ifndef STANDALONE
1920
// activate CON_NONZEN in all consoles
2021
if(!(confilter&(1<<14))) confilter += 1<<14;
2122
if(!(fullconfilter&(1<<14))) fullconfilter += 1<<14;
2223
if(!(miniconfilter&(1<<14))) miniconfilter += 1<<14;
24+
#endif
2325
}
2426
}
2527
setsvar("p1xbratenversion", version);

src/shared/iengine.h

+3
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,10 @@ extern void g3d_cursorpos(float &x, float &y);
591591
extern void g3d_resetcursor();
592592
extern void g3d_limitscale(float scale);
593593

594+
// p1xbraten
594595
extern char *p1xbratenversion;
596+
extern int naturalsort(const char *a, const char *b); // from command.cpp
597+
extern void migratep1xbraten();
595598

596599
#ifdef ANTICHEAT
597600
extern int anticheatenabled; // toggled by -e CLI flag

0 commit comments

Comments
 (0)