1 // --------------------------------------------------------------------------
\r
2 // BEGIN REQUIRED CSQC FUNCTIONS
\r
5 #define DP_CSQC_ENTITY_REMOVE_IS_B0RKED
\r
7 void cvar_clientsettemp(string cv, string val)
\r
10 for(e = world; (e = find(e, classname, "saved_cvar_value")); )
\r
14 e.classname = "saved_cvar_value";
\r
15 e.netname = strzone(cv);
\r
16 e.message = strzone(cvar_string(cv));
\r
21 void cvar_clientsettemp_restore()
\r
24 for(e = world; (e = find(e, classname, "saved_cvar_value")); )
\r
25 cvar_set(e.netname, e.message);
\r
28 void() menu_show_error =
\r
30 drawstring('0 200 0', "ERROR - MENU IS VISIBLE BUT NO MENU WAS DEFINED!", '8 8 0', '1 0 0', 1, 0);
\r
33 // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load)
\r
34 // Useful for precaching things
\r
36 void() menu_sub_null =
\r
41 float __engine_check;
\r
44 string config_get(string key, string defaultvalue)
\r
47 s = db_get(configdb, strcat("/s/", key));
\r
49 return defaultvalue;
\r
51 return db_get(configdb, strcat("/v/", key));
\r
55 void WaypointSprite_Load();
\r
56 void CSQC_Init(void)
\r
60 __engine_check = checkextension("DP_SV_WRITEPICTURE");
\r
63 print("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n");
\r
64 localcmd("\ndisconnect\n");
\r
74 configdb = db_create();
\r
75 binddb = db_create();
\r
76 tempdb = db_create();
\r
77 compressShortVector_init();
\r
80 menu_visible = FALSE;
\r
81 menu_show = menu_show_error;
\r
82 menu_action = menu_sub_null;
\r
83 maxclients = 255; // we later get the real maxclients to speed up stuff
\r
85 // localcmd("alias order \"cmd order $*\""); enable if ctf-command thingy is used
\r
86 //registercmd("ctf_menu");
\r
87 registercmd("ons_map");
\r
88 //registercmd("menu_action");
\r
89 registercmd("sbar_columns_set");
\r
90 registercmd("sbar_columns_help");
\r
92 registercmd("+button3");
\r
93 registercmd("-button3");
\r
94 registercmd("+button4");
\r
95 registercmd("-button4");
\r
97 registercvar("sbar_usecsqc", "1");
\r
98 registercvar("sbar_columns", "default", CVAR_SAVE);
\r
102 // sbar_fields uses strunzone on the titles!
\r
103 for(i = 0; i < MAX_SBAR_FIELDS; ++i)
\r
104 sbar_title[i] = strzone("(null)");
\r
108 teams = Sort_Spawn();
\r
109 players = Sort_Spawn();
\r
111 GetTeam(COLOR_SPECTATOR, true); // add specs first
\r
113 cvar_clientsettemp("_supports_weaponpriority", "1");
\r
118 cs_project_is_b0rked = TRUE;
\r
119 R_SetView(VF_VIEWPORT, '0 0 0', '640 480 0');
\r
120 R_SetView(VF_FOV, '90 90 0');
\r
121 R_SetView(VF_ORIGIN, '0 0 0');
\r
122 R_SetView(VF_ANGLES, '0 0 0');
\r
123 R_SetView(VF_PERSPECTIVE, 1);
\r
124 makevectors('0 0 0');
\r
126 v = cs_project(v_forward);
\r
131 cs_project_is_b0rked = FALSE;
\r
133 WaypointSprite_Load();
\r
135 Projectile_Precache();
\r
136 GibSplash_Precache();
\r
139 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
\r
140 void CSQC_Shutdown(void)
\r
144 if(!__engine_check)
\r
151 db_close(configdb);
\r
155 cvar_clientsettemp_restore();
\r
159 float SetTeam(entity o, float Team)
\r
162 if(Team == -1) // leave
\r
166 //print("(DISCONNECT) leave team ", ftos(o.team), "\n");
\r
167 tm = GetTeam(o.team, false);
\r
177 //print("(CONNECT) enter team ", ftos(o.team), "\n");
\r
179 tm = GetTeam(Team, true);
\r
184 else if(Team != o.team)
\r
186 //print("(CHANGE) leave team ", ftos(o.team), "\n");
\r
187 tm = GetTeam(o.team, false);
\r
190 //print("(CHANGE) enter team ", ftos(o.team), "\n");
\r
191 tm = GetTeam(Team, true);
\r
199 void Playerchecker_Think()
\r
203 for(i = 0; i < maxclients; ++i)
\r
205 e = playerslots[i];
\r
206 if(GetPlayerName(i) == "")
\r
210 //print("playerchecker: KILL KILL KILL\n");
\r
211 // player disconnected
\r
214 e.sort_prev = world;
\r
220 if not(e.sort_prev)
\r
222 //print("playerchecker: SPAWN SPAWN SPAWN\n");
\r
223 // player connected
\r
225 playerslots[i] = e = spawn();
\r
227 //e.gotscores = 0; // we might already have the scores...
\r
228 SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with Sbar_UpdatePlayerTeams
\r
230 Sbar_UpdatePlayerPos(e);
\r
234 self.nextthink = time + 0.2;
\r
238 void PostInit(void)
\r
240 print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n"));
\r
241 localcmd(strcat("\nsbar_columns_set ", cvar_string("sbar_columns"), ";\n"));
\r
243 entity playerchecker;
\r
244 playerchecker = spawn();
\r
245 playerchecker.think = Playerchecker_Think;
\r
246 playerchecker.nextthink = time + 0.2;
\r
253 // CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function
\r
254 // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
\r
256 void Cmd_Sbar_SetFields(float);
\r
257 void Cmd_Sbar_Help(float);
\r
258 float CSQC_ConsoleCommand(string strMessage)
\r
262 //argc = tokenize(strMessage);
\r
263 argc = tokenize_sane(strMessage);
\r
266 local string strCmd;
\r
269 if(strCmd == "+button4") { // zoom
\r
270 // return false, because the message shall be sent to the server anyway (for demos/speccing)
\r
271 if(ignore_plus_zoom)
\r
273 --ignore_plus_zoom;
\r
278 } else if(strCmd == "-button4") { // zoom
\r
279 if(ignore_minus_zoom)
\r
281 --ignore_minus_zoom;
\r
286 } else if(strCmd == "+button3") { // secondary
\r
287 button_attack2 = 1;
\r
289 } else if(strCmd == "-button3") { // secondary
\r
290 button_attack2 = 0;
\r
292 } else if(strCmd == "+showscores") {
\r
293 sb_showscores = true;
\r
295 } else if(strCmd == "-showscores") {
\r
296 sb_showscores = false;
\r
303 float GameCommand(string msg)
\r
306 argc = tokenize_sane(msg);
\r
309 if(cmd == "mv_download") {
\r
310 Cmd_MapVote_MapDownload(argc);
\r
313 else if(cmd == "settemp") {
\r
314 cvar_clientsettemp(argv(1), argv(2));
\r
316 else if(cmd == "radar") {
\r
317 ons_showmap = !ons_showmap;
\r
319 else if(cmd == "sbar_columns_set") {
\r
320 Cmd_Sbar_SetFields(argc);
\r
322 else if(cmd == "sbar_columns_help") {
\r
323 Cmd_Sbar_Help(argc);
\r
326 else if(cmd == "blurtest") {
\r
327 blurtest_time0 = time;
\r
328 blurtest_time1 = time + stof(argv(1));
\r
329 blurtest_radius = stof(argv(2));
\r
330 blurtest_power = stof(argv(3));
\r
337 // CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
\r
338 // Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
\r
339 // All keys are in ascii.
\r
340 // bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
\r
341 // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
\r
342 // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
\r
343 float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
\r
345 local float bSkipKey;
\r
349 if(menu_action(bInputType, nPrimary, nSecondary))
\r
354 // END REQUIRED CSQC FUNCTIONS
\r
355 // --------------------------------------------------------------------------
\r
357 // --------------------------------------------------------------------------
\r
358 // BEGIN OPTIONAL CSQC FUNCTIONS
\r
359 void Ent_ReadEntCS()
\r
361 InterpolateOrigin_Undo();
\r
363 self.classname = "entcs_receiver";
\r
364 self.sv_entnum = ReadByte() - 1;
\r
365 self.origin_x = ReadShort();
\r
366 self.origin_y = ReadShort();
\r
367 self.origin_z = ReadShort();
\r
368 self.angles_y = ReadByte() * 360.0 / 256;
\r
369 self.origin_z = self.angles_x = self.angles_z = 0;
\r
371 InterpolateOrigin_Note();
\r
374 void Ent_RemoveEntCS()
\r
379 void Ent_ReadPlayerScore()
\r
385 // damnit -.- don't want to go change every single .sv_entnum in sbar.qc AGAIN
\r
386 // (no I've never heard of M-x replace-string, sed, or anything like that)
\r
387 isNew = !self.owner; // workaround for DP bug
\r
390 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
\r
391 if(!isNew && n != self.sv_entnum)
\r
393 print("A CSQC entity changed its owner!\n");
\r
396 self.enttype = ENT_CLIENT_SCORES;
\r
400 self.sv_entnum = n;
\r
402 if not(playerslots[self.sv_entnum])
\r
403 playerslots[self.sv_entnum] = spawn();
\r
404 o = self.owner = playerslots[self.sv_entnum];
\r
405 o.sv_entnum = self.sv_entnum;
\r
408 //if not(o.sort_prev)
\r
409 // RegisterPlayer(o);
\r
410 //playerchecker will do this for us later, if it has not already done so
\r
413 for(i = 0; i < MAX_SCORE; ++i)
\r
414 o.(scores[i]) = ReadShort();
\r
423 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
\r
425 o.(scores[i]) = ReadShort();
\r
429 Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet!
\r
432 void Ent_ReadTeamScore()
\r
437 self.team = ReadByte();
\r
438 o = self.owner = GetTeam(self.team, true);
\r
440 #if MAX_TEAMSCORE <= 3
\r
441 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
442 o.(teamscores[i]) = ReadShort();
\r
445 #if MAX_TEAMSCORE <= 8
\r
451 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
\r
453 o.(teamscores[i]) = ReadShort();
\r
456 Sbar_UpdateTeamPos(o);
\r
467 if(vote_called_vote)
\r
468 strunzone(vote_called_vote);
\r
469 vote_called_vote = strzone(ColorTranslateRGB(ReadString()));
\r
472 ready_waiting = (nags & 1);
\r
473 ready_waiting_for_me = (nags & 2);
\r
474 vote_waiting = (nags & 4);
\r
475 vote_waiting_for_me = (nags & 8);
\r
478 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
\r
479 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
\r
480 void Ent_RadarLink();
\r
481 void(float bIsNewEntity) CSQC_Ent_Update =
\r
487 // set up the "time" global for received entities to be correct for interpolation purposes
\r
492 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
\r
494 if(t != self.enttype)
\r
496 print("A CSQC entity changed its type!\n");
\r
501 if(self.enttype == ENT_CLIENT_ENTCS)
\r
503 else if(self.enttype == ENT_CLIENT_SCORES)
\r
504 Ent_ReadPlayerScore();
\r
505 else if(self.enttype == ENT_CLIENT_TEAMSCORES)
\r
506 Ent_ReadTeamScore();
\r
507 else if(self.enttype == ENT_CLIENT_POINTPARTICLES)
\r
508 Ent_PointParticles();
\r
509 else if(self.enttype == ENT_CLIENT_RAINSNOW)
\r
511 else if(self.enttype == ENT_CLIENT_LASER)
\r
513 else if(self.enttype == ENT_CLIENT_NAGGER)
\r
515 else if(self.enttype == ENT_CLIENT_WAYPOINT)
\r
516 Ent_WaypointSprite();
\r
517 else if(self.enttype == ENT_CLIENT_RADARLINK)
\r
519 else if(self.enttype == ENT_CLIENT_PROJECTILE)
\r
521 else if(self.enttype == ENT_CLIENT_GIBSPLASH)
\r
523 else if(self.enttype == ENT_CLIENT_DAMAGEINFO)
\r
526 error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n"));
\r
530 // Destructor, but does NOT deallocate the entity by calling remove(). Also
\r
531 // used when an entity changes its type. For an entity that someone interacts
\r
532 // with others, make sure it can no longer do so.
\r
536 if(self.enttype == ENT_CLIENT_ENTCS)
\r
539 } else if(self.enttype == ENT_CLIENT_SCORES)
\r
543 SetTeam(self.owner, -1);
\r
544 self.owner.gotscores = 0;
\r
545 for(i = 0; i < MAX_SCORE; ++i)
\r
546 self.owner.(scores[i]) = 0; // clear all scores
\r
548 } else if(self.enttype == ENT_CLIENT_TEAMSCORES)
\r
552 RemoveTeam(self.owner);
\r
554 // we don't NEED to remove them... they won't display anyway
\r
555 // plus, svqc never does this anyway
\r
556 } else if(self.enttype == ENT_CLIENT_POINTPARTICLES)
\r
558 Ent_PointParticles_Remove();
\r
560 else if(self.enttype == ENT_CLIENT_WAYPOINT)
\r
561 Ent_RemoveWaypointSprite();
\r
562 else if(self.enttype == ENT_CLIENT_PROJECTILE)
\r
563 Ent_RemoveProjectile();
\r
566 self.classname = "";
\r
567 self.draw = menu_sub_null;
\r
568 // TODO possibly set more stuff to defaults
\r
570 // CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(self) as well.
\r
571 void CSQC_Ent_Remove()
\r
578 void Gamemode_Init()
\r
580 get_mi_min_max_texcoords(1); // try the CLEVER way first
\r
581 minimapname = strcat("gfx/", mi_shortname, "_radar.tga");
\r
582 shortmapname = mi_shortname;
\r
584 if(precache_pic(minimapname) == "")
\r
586 // but maybe we have a non-clever minimap
\r
587 minimapname = strcat("gfx/", mi_shortname, "_mini.tga");
\r
588 if(precache_pic(minimapname) == "")
\r
589 minimapname = ""; // FAIL
\r
591 get_mi_min_max_texcoords(0); // load new texcoords
\r
594 mi_center = (mi_min + mi_max) * 0.5;
\r
595 mi_scale = mi_max - mi_min;
\r
596 minimapname = strzone(minimapname);
\r
598 if(gametype == GAME_ONSLAUGHT) {
\r
599 print(strcat("Using ", minimapname, " as minimap.\n"));
\r
600 precache_pic("gfx/ons-cp-neutral.tga");
\r
601 precache_pic("gfx/ons-cp-red.tga");
\r
602 precache_pic("gfx/ons-cp-blue.tga");
\r
603 precache_pic("gfx/ons-frame.tga");
\r
604 precache_pic("gfx/ons-frame-team.tga");
\r
605 } else if(gametype == GAME_KEYHUNT) {
\r
606 precache_pic("gfx/sb_key_carrying");
\r
607 precache_pic("gfx/sb_key_carrying_outline");
\r
610 // CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided. To execute standard behavior, simply execute localcmd with the string.
\r
611 void CSQC_Parse_StuffCmd(string strMessage)
\r
613 localcmd(strMessage);
\r
615 // CSQC_Parse_Print : Provides the print string in the first parameter that the server provided. To execute standard behavior, simply execute print with the string.
\r
616 void CSQC_Parse_Print(string strMessage)
\r
618 print(ColorTranslateRGB(strMessage));
\r
620 // CSQC_Parse_CenterPrint : Provides the centerprint string in the first parameter that the server provided. To execute standard behavior, simply execute cprint with the string.
\r
621 void CSQC_Parse_CenterPrint(string strMessage)
\r
623 cprint(ColorTranslateRGB(strMessage));
\r
626 void CSQC_CheckRevision();
\r
630 // TODO somehow thwart prvm_globalset client ...
\r
633 localcmd(strcat("\nfog ", forcefog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
\r
639 strunzone(forcefog);
\r
640 ReadCoord(); // ignore fog interval
\r
641 forcefog = strzone(ReadString());
\r
644 void Gamemode_Init();
\r
645 void Net_ReadScoresInfo()
\r
648 gametype = ReadByte();
\r
649 for(i = 0; i < MAX_SCORE; ++i)
\r
651 scores_label[i] = strzone(ReadString());
\r
652 scores_flags[i] = ReadByte();
\r
654 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
656 teamscores_label[i] = strzone(ReadString());
\r
657 teamscores_flags[i] = ReadByte();
\r
663 void Net_ReadInit()
\r
666 csqc_revision = ReadShort();
\r
667 maxclients = ReadByte();
\r
668 for(i = 0; i < 24; ++i)
\r
669 weaponimpulse[i] = ReadByte() - 1;
\r
670 hook_shotorigin_x = ReadCoord();
\r
671 hook_shotorigin_y = ReadCoord();
\r
672 hook_shotorigin_z = ReadCoord();
\r
673 CSQC_CheckRevision();
\r
676 string Net_ReadPicture()
\r
679 if(csqc_flags & CSQC_FLAG_READPICTURE)
\r
681 img = ReadPicture();
\r
682 print(strcat("Got Picture: ", img, "\n"));
\r
684 img = ReadString();
\r
685 print(strcat("^3Warning: ^7Couldn't download ", img, ". This is probably because your engine build is outdated.\n"));
\r
687 psize = ReadShort();
\r
688 // Can I be sure that ReadShort is 2 bytes and ReadLong is 4 bytes?
\r
689 // Because then this could be optimized to first get all 4-byte-groups,
\r
690 // then the remaining 2, then the remaining 1
\r
691 for(i = 0; i < psize; ++i)
\r
700 key = ReadString();
\r
701 value = ReadString();
\r
702 db_put(configdb, strcat("/v/", key), value);
\r
703 db_put(configdb, strcat("/s/", key), "1");
\r
706 void Net_ReadRace()
\r
714 case RACE_NET_CHECKPOINT_HIT_QUALIFYING:
\r
715 race_checkpoint = ReadByte();
\r
716 race_time = ReadShort();
\r
717 race_previousbesttime = ReadShort();
\r
718 if(race_previousbestname)
\r
719 strunzone(race_previousbestname);
\r
720 race_previousbestname = strzone(ColorTranslateRGB(ReadString()));
\r
722 race_checkpointtime = time;
\r
724 if(race_checkpoint == 0)
\r
725 race_laptime = time; // valid
\r
729 case RACE_NET_CHECKPOINT_CLEAR:
\r
731 race_checkpointtime = 0;
\r
734 case RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING:
\r
735 race_laptime = ReadCoord();
\r
736 race_checkpointtime = -99999;
\r
738 case RACE_NET_CHECKPOINT_NEXT_QUALIFYING:
\r
739 race_nextcheckpoint = ReadByte();
\r
741 race_nextbesttime = ReadShort();
\r
742 if(race_nextbestname)
\r
743 strunzone(race_nextbestname);
\r
744 race_nextbestname = strzone(ColorTranslateRGB(ReadString()));
\r
747 case RACE_NET_CHECKPOINT_HIT_RACE:
\r
748 race_mycheckpoint = ReadByte();
\r
749 race_mycheckpointtime = time;
\r
750 race_mycheckpointdelta = ReadShort();
\r
751 race_mycheckpointlapsdelta = ReadByte();
\r
752 if(race_mycheckpointlapsdelta >= 128)
\r
753 race_mycheckpointlapsdelta -= 256;
\r
754 if(race_mycheckpointenemy)
\r
755 strunzone(race_mycheckpointenemy);
\r
756 race_mycheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
\r
759 case RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT:
\r
760 race_othercheckpoint = ReadByte();
\r
761 race_othercheckpointtime = time;
\r
762 race_othercheckpointdelta = ReadShort();
\r
763 race_othercheckpointlapsdelta = ReadByte();
\r
764 if(race_othercheckpointlapsdelta >= 128)
\r
765 race_othercheckpointlapsdelta -= 256;
\r
766 if(race_othercheckpointenemy)
\r
767 strunzone(race_othercheckpointenemy);
\r
768 race_othercheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
\r
773 void Net_ReadForceScoreboard()
\r
775 sb_showscores_force = ReadByte();
\r
782 race_checkpointtime = 0;
\r
783 for(i = 0; i < 24; ++i)
\r
784 angles_held_status[i] = 0;
\r
787 void Net_ReadSpectating()
\r
789 float newspectatee_status;
\r
790 newspectatee_status = ReadByte();
\r
791 if(newspectatee_status == player_localentnum)
\r
792 newspectatee_status = -1; // observing
\r
793 if(newspectatee_status != spectatee_status)
\r
795 spectatee_status = newspectatee_status;
\r
798 void Net_ReadZoomNotify()
\r
800 spectatorbutton_zoom = ReadByte();
\r
803 void Net_ReadSpawn()
\r
806 current_viewzoom = 0.6;
\r
809 void Net_ReadWarmupStage()
\r
811 warmup_stage = ReadByte();
\r
814 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
\r
815 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
\r
816 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
\r
817 void Net_ReadHoldAngles();
\r
818 float CSQC_Parse_TempEntity()
\r
820 local float bHandled;
\r
824 nTEID = ReadByte();
\r
826 // NOTE: Could just do return instead of break...
\r
833 case TE_CSQC_MAPVOTE:
\r
837 case TE_CSQC_CONFIG:
\r
841 case TE_CSQC_SCORESINFO:
\r
842 Net_ReadScoresInfo();
\r
849 case TE_CSQC_FORCESCOREBOARD:
\r
850 Net_ReadForceScoreboard();
\r
853 case TE_CSQC_SPECTATING:
\r
854 Net_ReadSpectating();
\r
857 case 13: // TE_BEAM
\r
858 Net_GrapplingHook();
\r
861 case TE_CSQC_SPAWN:
\r
865 case TE_CSQC_ZOOMNOTIFY:
\r
866 Net_ReadZoomNotify();
\r
869 case TE_CSQC_HOLDANGLES:
\r
870 Net_ReadHoldAngles();
\r
873 case TE_CSQC_WARMUP:
\r
874 Net_ReadWarmupStage();
\r
882 // No special logic for this temporary entity; return 0 so the engine can handle it
\r
893 // COMMIT-TODO: Update if necessare, before committing
\r
894 void CSQC_CheckRevision()
\r
896 if(csqc_revision == CSQC_REVISION)
\r
898 print("^2SVQC and CSQC revisions are compatible.\n");
\r
899 } else if(csqc_revision < CSQC_REVISION) {
\r
900 print("^1Your csprogs.dat (CSQC) version is newer than the one on the server.\n");
\r
901 } else if(csqc_revision > CSQC_REVISION) {
\r
902 print("^1Your csprogs.dat (CSQC) is too old for this server.\n");
\r
903 print("^1Please update to a newer version.\n");
\r
907 string getcommandkey(string text, string command)
\r
912 if (!sbar_showbinds)
\r
915 keys = db_get(binddb, command);
\r
916 if(csqc_flags & CSQC_FLAG_READPICTURE)
\r
920 n = tokenize_insane(findkeysforcommand(command)); // uses '...' strings
\r
921 for(j = 0; j < n; ++j)
\r
927 keys = keynumtostring(k);
\r
929 keys = strcat(keys, ", ", keynumtostring(k));
\r
932 if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break;
\r
936 db_put(binddb, command, keys);
\r
941 if (sbar_showbinds > 1)
\r
942 return strcat(text, " (not bound)");
\r
946 else if (sbar_showbinds > 1)
\r
947 return strcat(text, " (", keys, ")");
\r