// enable menu syncing
alias menu_sync "menu_cmd sync"
+
+set sv_join_notices ""
+set sv_join_notices_time 15
\ No newline at end of file
Net_VehicleSetup();
bHandled = true;
break;
+ case TE_CSQC_SVNOTICE:
+ cl_notice_read();
+ bHandled = true;
+ break;
default:
// No special logic for this temporary entity; return 0 so the engine can handle it
bHandled = false;
#define BUTTON_3 4
#define BUTTON_4 8
+float cl_notice_run();
void CSQC_UpdateView(float w, float h)
{
entity e;
wcross_color = stov(autocvar_crosshair_dot_color);
CROSSHAIR_DRAW(wcross_resolution * autocvar_crosshair_dot_size, "gfx/crosshairdot.tga", f * autocvar_crosshair_dot_alpha);
- // FIXME why don't we use wcross_alpha here?
+ // FIXME why don't we use wcross_alpha here?cl_notice_run();
wcross_color = wcross_color_old;
}
}
else if(hud == HUD_BUMBLEBEE)
CSQC_BUMBLE_HUD();
}
+
+ cl_notice_run();
+
// let's reset the view back to normal for the end
setproperty(VF_MIN, '0 0 0');
setproperty(VF_SIZE, '1 0 0' * w + '0 1 0' * h);
../common/command/generic.qh
../common/command/shared_defs.qh
../common/urllib.qh
-
command/cl_cmd.qh
autocvars.qh
scoreboard.qc
mapvoting.qc
csqcmodel_hooks.qc
+../common/net_notice.qc
rubble.qc
hook.qc
../server/w_all.qc
../common/explosion_equation.qc
../common/urllib.qc
-
command/cl_cmd.qc
../warpzonelib/anglestransform.qc
const float TE_CSQC_MINELAYER_MAXMINES = 117;
const float TE_CSQC_HAGAR_MAXROCKETS = 118;
const float TE_CSQC_VEHICLESETUP = 119;
+const float TE_CSQC_SVNOTICE = 120;
const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const float RACE_NET_CHECKPOINT_CLEAR = 1;
--- /dev/null
+#ifdef SVQC\r
+\r
+void sv_notice_to(entity _to, string _notice, float _howlong, float _modal)\r
+{\r
+ msg_entity = _to;
+ WriteByte(MSG_ONE, SVC_TEMPENTITY);
+ WriteByte(MSG_ONE, TE_CSQC_SVNOTICE);
+ WriteString(MSG_ONE, _notice);\r
+ WriteLong(MSG_ONE, _howlong);\r
+ WriteByte(MSG_ONE, _modal);\r
+}\r
+\r
+void sv_notice_toall(string _notice, float _howlong, float _modal)\r
+{\r
+ entity _head;\r
+ FOR_EACH_REALCLIENT(_head)\r
+ sv_notice_to(_head, _notice, _howlong, _modal);\r
+ \r
+}\r
+\r
+#endif // SVQC\r
+\r
+#ifdef CSQC\r
+void SUB_Remove()
+{ remove(self); }
+\r
+void cl_notice_read()\r
+{\r
+ entity _notice;\r
+ float _done;\r
+ float _modal;\r
+ _notice = spawn();\r
+ _notice.classname = "sv_notice";\r
+ _notice.netname = strzone(ReadString());\r
+ _notice.alpha = ReadLong() + time;\r
+ _notice.skin = ReadByte();\r
+}\r
+\r
+float cl_notice_run()\r
+{\r
+ entity _notes;\r
+ string _notice;\r
+ float c, m = FALSE;\r
+ \r
+ _notes = findchain(classname, "sv_notice");\r
+ if(!_notes)\r
+ return FALSE;\r
+ #define M1 30\r
+ #define M2 10\r
+ \r
+ vector v1, v2, v3;\r
+ v1 = '1 1 0' * M1;\r
+ v2_x = vid_conwidth - (2 * M1);\r
+ v2_y = vid_conheight - (2 * M1);\r
+ \r
+ drawfill(v1, v2, '0 0 0', 0.5, DRAWFLAG_NORMAL);\r
+ v1 = '1 1 0' * (M1 + M2);\r
+ v2_x = vid_conwidth - (2 * (M1 + M2));\r
+ v2_y = vid_conheight - (2 * (M1 + M2));\r
+ drawfill(v1, v2, '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);\r
+ v3 = v1 + '10 10 0';\r
+ \r
+ #define OUT(s,z) drawcolorcodedstring(v3, s, '1 1 0' * z, 1, DRAWFLAG_NORMAL); v3_y += z + 4\r
+ \r
+ OUT("^1Server notices:", 32);\r
+ \r
+ //drawcolorcodedstring(v1 + '5 5 0', "^1Server notices:", '32 32 0', 1, DRAWFLAG_NORMAL);\r
+ while(_notes)\r
+ {\r
+ \r
+ _notice = sprintf("^7%s (^3%d sec left)", _notes.netname , rint(_notes.alpha - time));\r
+ OUT(_notice, 16);\r
+\r
+ if(_notes.skin) \r
+ m = TRUE;\r
+ \r
+ if(_notes.alpha <= time)\r
+ {\r
+ _notes.think = SUB_Remove;\r
+ _notes.nextthink = time;\r
+ }\r
+ \r
+ _notes = _notes.chain; \r
+ }\r
+ \r
+ #undef OUT\r
+ #undef M1\r
+ #undef M2\r
+ \r
+ return m;\r
+}\r
+\r
+#endif // CSQC\r
--- /dev/null
+#ifdef CSQC\r
+void cl_notice_read();\r
+void sv_notice_to(entity _to, string _notice, float _howlong, float _modal);\r
+#endif\r
+\r
+#ifdef SVQC\r
+string autocvar_sv_join_notices;\r
+float autocvar_sv_join_notices_time;\r
+\r
+void sv_notice_to(entity _to, string _notice, float _howlong, float _modal);\r
+void sv_notice_toall(string _notice, float _howlong, float _modal);\r
+#endif\r
=============
*/
//void() ctf_playerchanged;
+
void PutClientInServer (void)
{
if(clienttype(self) == CLIENTTYPE_BOT)
} else if(self.classname == "observer" || (g_ca && !allowed_to_spawn)) {
PutObserverInServer ();
}
+
+ // to-do: make sv_join_notices support per-entry times
+ if(!autocvar_sv_join_notices || autocvar_sv_join_notices == "")
+ return;
+
+ float argc = tokenizebyseparator(autocvar_sv_join_notices, "|");
+ if(argc > 0)
+ {
+ float i;
+ for(i = argc - 1; i >= 0; --i)
+ sv_notice_to(self, argv(i), autocvar_sv_join_notices_time, FALSE);
+ }
//if(g_ctf)
// ctf_playerchanged();
../common/command/rpn.qh
../common/command/generic.qh
../common/command/shared_defs.qh
+../common/net_notice.qh
autocvars.qh
constants.qh
../common/command/markup.qc
../common/command/rpn.qc
../common/command/generic.qc
+../common/net_notice.qc
+
command/common.qc
command/banning.qc
command/radarmap.qc