Server: show 'entered game' message once and only in MP.

This commit is contained in:
Marco Cawthorne 2024-03-04 19:45:33 -08:00
parent f0034cb03a
commit 32a36d8017
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
16 changed files with 96 additions and 35 deletions

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_node.tga
{
map $diffuse
blendFunc blend
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/info_node_air.tga
{
map $diffuse
blendFunc blend
}
}

View File

@ -0,0 +1,9 @@
{
diffusemap textures/editor/light_dynamic.tga
{
map $diffuse
blendFunc blend
rgbGen vertex
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/model_bone.tga
{
map $diffuse
blendFunc blend
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/path_track.tga
{
map $diffuse
blendFunc blend
}
}

View File

@ -0,0 +1,8 @@
{
diffusemap textures/editor/scripted_sequence.tga
{
map $diffuse
blendFunc blend
}
}

View File

@ -61,6 +61,7 @@ public:
nonvirtual void PathEndTrigger(entity, triggermode_t);
/* overrides */
virtual void DebugDraw(void);
virtual void Respawn(void);
virtual void SpawnKey(string, string);
virtual void Save(float);
@ -89,6 +90,25 @@ path_track::path_track(void)
m_strEndTrigger = __NULL__;
}
void
path_track::DebugDraw(void)
{
vector pos = GetOrigin();
pos[2] += 32;
R_BeginPolygon("textures/editor/path_track", 0, 0);
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], [1,1,1], 1.0f);
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], [1,1,1], 1.0f);
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], [1,1,1], 1.0f);
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], [1,1,1], 1.0f);
R_EndPolygon();
R_BeginPolygon("", 0, 0);
R_PolygonVertex(GetOrigin(), [0,1], [1,1,1], 0.5f);
R_PolygonVertex(pos, [1,1], [1,1,1], 0.5f);
R_EndPolygon();
}
void
path_track::SpawnKey(string keyName, string setValue)
{

View File

@ -104,6 +104,7 @@ public:
virtual void Respawn(void);
virtual void SpawnKey(string,string);
virtual void Touch(entity);
virtual void DebugDraw(void);
nonvirtual void RunOnEntity(entity);
nonvirtual void InitIdle(void);
@ -128,6 +129,25 @@ scripted_sequence::scripted_sequence(void)
m_iMove = 0i;
}
void
scripted_sequence::DebugDraw(void)
{
vector pos = GetOrigin();
pos[2] += 32;
R_BeginPolygon("textures/editor/scripted_sequence", 0, 0);
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], [1,1,1], 1.0f);
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], [1,1,1], 1.0f);
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], [1,1,1], 1.0f);
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], [1,1,1], 1.0f);
R_EndPolygon();
R_BeginPolygon("", 0, 0);
R_PolygonVertex(GetOrigin(), [0,1], [1,1,1], 0.5);
R_PolygonVertex(pos, [1,1], [1,1,1], 0.5);
R_EndPolygon();
}
void
scripted_sequence::Save(float handle)
{

View File

@ -92,7 +92,9 @@ ClientDisconnect(void)
pl.Disappear();
pl.classname = "";
pl.flags = 0;
pl.deaths = 0;
pl.frags = 0;
pl.score = 0;
}
/** Called by the `kill` console command.
@ -161,7 +163,10 @@ PutClientInServer(void)
}
Plugin_PlayerEntered((NSClientPlayer)self);
bprint(PRINT_HIGH, sprintf("%s^d entered the game.\n", self.netname));
if (g_grMode.IsMultiplayer() == true && self.deaths <= 0) {
bprint(PRINT_HIGH, sprintf("%s^d entered the game.\n", self.netname));
}
/* activate all game_playerspawn entities */
for (entity a = world; (a = find(a, ::targetname, "game_playerspawn"));) {

View File

@ -286,38 +286,5 @@ SV_AddDebugPolygons(void)
R_PolygonVertex(w->origin + v_right * 8 + v_up * 8, [1,0], NODE_RECT_COLOR, NODE_RECT_ALPHA);
R_EndPolygon();
}
for (entity s = world; (s = find(s, ::classname, "path_track"));) {
vector pos = s.origin;
pos[2] += 32;
R_BeginPolygon("textures/dev/path_track", 0, 0);
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], [1,1,1], 1.0f);
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], [1,1,1], 1.0f);
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], [1,1,1], 1.0f);
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], [1,1,1], 1.0f);
R_EndPolygon();
R_BeginPolygon("", 0, 0);
R_PolygonVertex(s.origin, [0,1], [1,1,1], NODE_LINE_ALPHA);
R_PolygonVertex(pos, [1,1], [1,1,1], NODE_LINE_ALPHA);
R_EndPolygon();
}
for (entity s = world; (s = find(s, ::classname, "scripted_sequence"));) {
vector pos = s.origin;
pos[2] += 32;
R_BeginPolygon("textures/dev/scripted_sequence", 0, 0);
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], SEQUENCE_RECT_COLOR, NODE_RECT_ALPHA);
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], SEQUENCE_RECT_COLOR, NODE_RECT_ALPHA);
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], SEQUENCE_RECT_COLOR, NODE_RECT_ALPHA);
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], SEQUENCE_RECT_COLOR, NODE_RECT_ALPHA);
R_EndPolygon();
R_BeginPolygon("", 0, 0);
R_PolygonVertex(s.origin, [0,1], [1,1,1], NODE_LINE_ALPHA);
R_PolygonVertex(pos, [1,1], [1,1,1], NODE_LINE_ALPHA);
R_EndPolygon();
}
}
#endif