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
45 void WaypointSprite_Load();
\r
46 void CSQC_Init(void)
\r
50 __engine_check = checkextension("DP_SV_WRITEPICTURE");
\r
53 print("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n");
\r
54 localcmd("\ndisconnect\n");
\r
64 binddb = db_create();
\r
65 tempdb = db_create();
\r
66 compressShortVector_init();
\r
69 menu_visible = FALSE;
\r
70 menu_show = menu_show_error;
\r
71 menu_action = menu_sub_null;
\r
72 maxclients = 255; // we later get the real maxclients to speed up stuff
\r
74 // localcmd("alias order \"cmd order $*\""); enable if ctf-command thingy is used
\r
75 //registercmd("ctf_menu");
\r
76 registercmd("ons_map");
\r
77 //registercmd("menu_action");
\r
78 registercmd("sbar_columns_set");
\r
79 registercmd("sbar_columns_help");
\r
81 registercmd("+button3");
\r
82 registercmd("-button3");
\r
83 registercmd("+button4");
\r
84 registercmd("-button4");
\r
86 registercvar("sbar_usecsqc", "1");
\r
87 registercvar("sbar_columns", "default", CVAR_SAVE);
\r
91 // sbar_fields uses strunzone on the titles!
\r
92 for(i = 0; i < MAX_SBAR_FIELDS; ++i)
\r
93 sbar_title[i] = strzone("(null)");
\r
97 teams = Sort_Spawn();
\r
98 players = Sort_Spawn();
\r
100 GetTeam(COLOR_SPECTATOR, true); // add specs first
\r
102 cvar_clientsettemp("_supports_weaponpriority", "1");
\r
107 cs_project_is_b0rked = TRUE;
\r
108 R_SetView(VF_VIEWPORT, '0 0 0', '640 480 0');
\r
109 R_SetView(VF_FOV, '90 90 0');
\r
110 R_SetView(VF_ORIGIN, '0 0 0');
\r
111 R_SetView(VF_ANGLES, '0 0 0');
\r
112 R_SetView(VF_PERSPECTIVE, 1);
\r
113 makevectors('0 0 0');
\r
115 v = cs_project(v_forward);
\r
120 cs_project_is_b0rked = FALSE;
\r
124 WaypointSprite_Load();
\r
126 Projectile_Precache();
\r
127 GibSplash_Precache();
\r
128 Casings_Precache();
\r
129 DamageInfo_Precache();
\r
131 get_mi_min_max_texcoords(1); // try the CLEVER way first
\r
132 minimapname = strcat("gfx/", mi_shortname, "_radar.tga");
\r
133 shortmapname = mi_shortname;
\r
135 if(precache_pic(minimapname) == "")
\r
137 // but maybe we have a non-clever minimap
\r
138 minimapname = strcat("gfx/", mi_shortname, "_mini.tga");
\r
139 if(precache_pic(minimapname) == "")
\r
140 minimapname = ""; // FAIL
\r
142 get_mi_min_max_texcoords(0); // load new texcoords
\r
145 mi_center = (mi_min + mi_max) * 0.5;
\r
146 mi_scale = mi_max - mi_min;
\r
147 minimapname = strzone(minimapname);
\r
150 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
\r
151 void CSQC_Shutdown(void)
\r
155 if(!__engine_check)
\r
165 cvar_clientsettemp_restore();
\r
169 float SetTeam(entity o, float Team)
\r
172 if(Team == -1) // leave
\r
176 //print("(DISCONNECT) leave team ", ftos(o.team), "\n");
\r
177 tm = GetTeam(o.team, false);
\r
187 //print("(CONNECT) enter team ", ftos(o.team), "\n");
\r
189 tm = GetTeam(Team, true);
\r
194 else if(Team != o.team)
\r
196 //print("(CHANGE) leave team ", ftos(o.team), "\n");
\r
197 tm = GetTeam(o.team, false);
\r
200 //print("(CHANGE) enter team ", ftos(o.team), "\n");
\r
201 tm = GetTeam(Team, true);
\r
209 void Playerchecker_Think()
\r
213 for(i = 0; i < maxclients; ++i)
\r
215 e = playerslots[i];
\r
216 if(GetPlayerName(i) == "")
\r
220 //print("playerchecker: KILL KILL KILL\n");
\r
221 // player disconnected
\r
224 e.sort_prev = world;
\r
230 if not(e.sort_prev)
\r
232 //print("playerchecker: SPAWN SPAWN SPAWN\n");
\r
233 // player connected
\r
235 playerslots[i] = e = spawn();
\r
237 //e.gotscores = 0; // we might already have the scores...
\r
238 SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with Sbar_UpdatePlayerTeams
\r
240 Sbar_UpdatePlayerPos(e);
\r
244 self.nextthink = time + 0.2;
\r
248 void PostInit(void)
\r
250 print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n"));
\r
251 localcmd(strcat("\nsbar_columns_set ", cvar_string("sbar_columns"), ";\n"));
\r
253 entity playerchecker;
\r
254 playerchecker = spawn();
\r
255 playerchecker.think = Playerchecker_Think;
\r
256 playerchecker.nextthink = time + 0.2;
\r
263 // CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function
\r
264 // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
\r
266 void Cmd_Sbar_SetFields(float);
\r
267 void Cmd_Sbar_Help(float);
\r
268 float CSQC_ConsoleCommand(string strMessage)
\r
272 //argc = tokenize(strMessage);
\r
273 argc = tokenize_sane(strMessage);
\r
276 local string strCmd;
\r
279 if(strCmd == "+button4") { // zoom
\r
280 // return false, because the message shall be sent to the server anyway (for demos/speccing)
\r
281 if(ignore_plus_zoom)
\r
283 --ignore_plus_zoom;
\r
288 } else if(strCmd == "-button4") { // zoom
\r
289 if(ignore_minus_zoom)
\r
291 --ignore_minus_zoom;
\r
296 } else if(strCmd == "+button3") { // secondary
\r
297 button_attack2 = 1;
\r
299 } else if(strCmd == "-button3") { // secondary
\r
300 button_attack2 = 0;
\r
302 } else if(strCmd == "+showscores") {
\r
303 sb_showscores = true;
\r
305 } else if(strCmd == "-showscores") {
\r
306 sb_showscores = false;
\r
313 float GameCommand(string msg)
\r
316 argc = tokenize_sane(msg);
\r
319 if(cmd == "mv_download") {
\r
320 Cmd_MapVote_MapDownload(argc);
\r
323 else if(cmd == "settemp") {
\r
324 cvar_clientsettemp(argv(1), argv(2));
\r
326 else if(cmd == "radar") {
\r
327 ons_showmap = !ons_showmap;
\r
329 else if(cmd == "sbar_columns_set") {
\r
330 Cmd_Sbar_SetFields(argc);
\r
332 else if(cmd == "sbar_columns_help") {
\r
333 Cmd_Sbar_Help(argc);
\r
336 else if(cmd == "blurtest") {
\r
337 blurtest_time0 = time;
\r
338 blurtest_time1 = time + stof(argv(1));
\r
339 blurtest_radius = stof(argv(2));
\r
340 blurtest_power = stof(argv(3));
\r
347 // CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
\r
348 // Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
\r
349 // All keys are in ascii.
\r
350 // bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
\r
351 // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
\r
352 // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
\r
353 float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
\r
355 local float bSkipKey;
\r
359 if(menu_action(bInputType, nPrimary, nSecondary))
\r
364 // END REQUIRED CSQC FUNCTIONS
\r
365 // --------------------------------------------------------------------------
\r
367 // --------------------------------------------------------------------------
\r
368 // BEGIN OPTIONAL CSQC FUNCTIONS
\r
369 void Ent_ReadEntCS()
\r
371 InterpolateOrigin_Undo();
\r
373 self.classname = "entcs_receiver";
\r
374 self.sv_entnum = ReadByte() - 1;
\r
375 self.origin_x = ReadShort();
\r
376 self.origin_y = ReadShort();
\r
377 self.origin_z = ReadShort();
\r
378 self.angles_y = ReadByte() * 360.0 / 256;
\r
379 self.origin_z = self.angles_x = self.angles_z = 0;
\r
381 InterpolateOrigin_Note();
\r
384 void Ent_RemoveEntCS()
\r
389 void Ent_ReadPlayerScore()
\r
395 // damnit -.- don't want to go change every single .sv_entnum in sbar.qc AGAIN
\r
396 // (no I've never heard of M-x replace-string, sed, or anything like that)
\r
397 isNew = !self.owner; // workaround for DP bug
\r
400 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
\r
401 if(!isNew && n != self.sv_entnum)
\r
403 print("A CSQC entity changed its owner!\n");
\r
406 self.enttype = ENT_CLIENT_SCORES;
\r
410 self.sv_entnum = n;
\r
412 if not(playerslots[self.sv_entnum])
\r
413 playerslots[self.sv_entnum] = spawn();
\r
414 o = self.owner = playerslots[self.sv_entnum];
\r
415 o.sv_entnum = self.sv_entnum;
\r
418 //if not(o.sort_prev)
\r
419 // RegisterPlayer(o);
\r
420 //playerchecker will do this for us later, if it has not already done so
\r
423 for(i = 0; i < MAX_SCORE; ++i)
\r
424 o.(scores[i]) = ReadShort();
\r
433 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
\r
435 o.(scores[i]) = ReadShort();
\r
439 Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet!
\r
442 void Ent_ReadTeamScore()
\r
447 self.team = ReadByte();
\r
448 o = self.owner = GetTeam(self.team, true);
\r
450 #if MAX_TEAMSCORE <= 3
\r
451 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
452 o.(teamscores[i]) = ReadShort();
\r
455 #if MAX_TEAMSCORE <= 8
\r
461 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
\r
463 o.(teamscores[i]) = ReadShort();
\r
466 Sbar_UpdateTeamPos(o);
\r
473 void Ent_ClientData()
\r
476 float newspectatee_status;
\r
480 sb_showscores_force = (f & 1);
\r
484 newspectatee_status = ReadByte();
\r
485 if(newspectatee_status == player_localentnum)
\r
486 newspectatee_status = -1; // observing
\r
489 newspectatee_status = 0;
\r
491 spectatorbutton_zoom = (f & 4);
\r
495 angles_held_status = 1;
\r
496 angles_held_x = ReadAngle();
\r
497 angles_held_y = ReadAngle();
\r
501 if(newspectatee_status != spectatee_status)
\r
503 // clear race stuff
\r
505 race_checkpointtime = 0;
\r
507 spectatee_status = newspectatee_status;
\r
518 if(vote_called_vote)
\r
519 strunzone(vote_called_vote);
\r
520 vote_called_vote = strzone(ColorTranslateRGB(ReadString()));
\r
523 ready_waiting = (nags & 1);
\r
524 ready_waiting_for_me = (nags & 2);
\r
525 vote_waiting = (nags & 4);
\r
526 vote_waiting_for_me = (nags & 8);
\r
527 warmup_stage = (nags & 16);
\r
530 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
\r
531 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
\r
532 void Ent_RadarLink();
\r
534 void Ent_ScoresInfo();
\r
535 void(float bIsNewEntity) CSQC_Ent_Update =
\r
541 // set up the "time" global for received entities to be correct for interpolation purposes
\r
546 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
\r
548 if(t != self.enttype)
\r
550 print("A CSQC entity changed its type!\n");
\r
555 if(self.enttype == ENT_CLIENT_ENTCS)
\r
557 else if(self.enttype == ENT_CLIENT_SCORES)
\r
558 Ent_ReadPlayerScore();
\r
559 else if(self.enttype == ENT_CLIENT_TEAMSCORES)
\r
560 Ent_ReadTeamScore();
\r
561 else if(self.enttype == ENT_CLIENT_POINTPARTICLES)
\r
562 Ent_PointParticles();
\r
563 else if(self.enttype == ENT_CLIENT_RAINSNOW)
\r
565 else if(self.enttype == ENT_CLIENT_LASER)
\r
567 else if(self.enttype == ENT_CLIENT_NAGGER)
\r
569 else if(self.enttype == ENT_CLIENT_WAYPOINT)
\r
570 Ent_WaypointSprite();
\r
571 else if(self.enttype == ENT_CLIENT_RADARLINK)
\r
573 else if(self.enttype == ENT_CLIENT_PROJECTILE)
\r
575 else if(self.enttype == ENT_CLIENT_GIBSPLASH)
\r
577 else if(self.enttype == ENT_CLIENT_DAMAGEINFO)
\r
579 else if(self.enttype == ENT_CLIENT_CASING)
\r
581 else if(self.enttype == ENT_CLIENT_INIT)
\r
583 else if(self.enttype == ENT_CLIENT_SCORES_INFO)
\r
585 else if(self.enttype == ENT_CLIENT_MAPVOTE)
\r
587 else if(self.enttype == ENT_CLIENT_CLIENTDATA)
\r
590 error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n"));
\r
594 // Destructor, but does NOT deallocate the entity by calling remove(). Also
\r
595 // used when an entity changes its type. For an entity that someone interacts
\r
596 // with others, make sure it can no longer do so.
\r
600 if(self.enttype == ENT_CLIENT_ENTCS)
\r
603 } else if(self.enttype == ENT_CLIENT_SCORES)
\r
607 SetTeam(self.owner, -1);
\r
608 self.owner.gotscores = 0;
\r
609 for(i = 0; i < MAX_SCORE; ++i)
\r
610 self.owner.(scores[i]) = 0; // clear all scores
\r
612 } else if(self.enttype == ENT_CLIENT_TEAMSCORES)
\r
616 RemoveTeam(self.owner);
\r
618 // we don't NEED to remove them... they won't display anyway
\r
619 // plus, svqc never does this anyway
\r
620 } else if(self.enttype == ENT_CLIENT_POINTPARTICLES)
\r
622 Ent_PointParticles_Remove();
\r
624 else if(self.enttype == ENT_CLIENT_WAYPOINT)
\r
625 Ent_RemoveWaypointSprite();
\r
626 else if(self.enttype == ENT_CLIENT_PROJECTILE)
\r
627 Ent_RemoveProjectile();
\r
630 self.classname = "";
\r
631 self.draw = menu_sub_null;
\r
632 // TODO possibly set more stuff to defaults
\r
634 // CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(self) as well.
\r
635 void CSQC_Ent_Remove()
\r
642 void Gamemode_Init()
\r
644 if(gametype == GAME_ONSLAUGHT) {
\r
645 print(strcat("Using ", minimapname, " as minimap.\n"));
\r
646 precache_pic("gfx/ons-cp-neutral.tga");
\r
647 precache_pic("gfx/ons-cp-red.tga");
\r
648 precache_pic("gfx/ons-cp-blue.tga");
\r
649 precache_pic("gfx/ons-frame.tga");
\r
650 precache_pic("gfx/ons-frame-team.tga");
\r
651 } else if(gametype == GAME_KEYHUNT) {
\r
652 precache_pic("gfx/sb_key_carrying");
\r
653 precache_pic("gfx/sb_key_carrying_outline");
\r
656 // 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
657 void CSQC_Parse_StuffCmd(string strMessage)
\r
659 localcmd(strMessage);
\r
661 // 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
662 void CSQC_Parse_Print(string strMessage)
\r
664 print(ColorTranslateRGB(strMessage));
\r
666 // 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
667 void CSQC_Parse_CenterPrint(string strMessage)
\r
669 cprint(ColorTranslateRGB(strMessage));
\r
672 void CSQC_CheckRevision();
\r
676 // TODO somehow thwart prvm_globalset client ...
\r
679 localcmd(strcat("\nfog ", forcefog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
\r
682 void Gamemode_Init();
\r
683 void Ent_ScoresInfo()
\r
686 self.classname = "ent_client_scores_info";
\r
687 gametype = ReadByte();
\r
688 for(i = 0; i < MAX_SCORE; ++i)
\r
690 scores_label[i] = strzone(ReadString());
\r
691 scores_flags[i] = ReadByte();
\r
693 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
695 teamscores_label[i] = strzone(ReadString());
\r
696 teamscores_flags[i] = ReadByte();
\r
705 self.classname = "ent_client_init";
\r
707 csqc_revision = ReadShort();
\r
709 maxclients = ReadByte();
\r
710 for(i = 0; i < 24; ++i)
\r
711 weaponimpulse[i] = ReadByte() - 1;
\r
712 hook_shotorigin_x = ReadCoord();
\r
713 hook_shotorigin_y = ReadCoord();
\r
714 hook_shotorigin_z = ReadCoord();
\r
717 strunzone(forcefog);
\r
718 forcefog = strzone(ReadString());
\r
720 CSQC_CheckRevision();
\r
725 string Net_ReadPicture()
\r
728 if(csqc_flags & CSQC_FLAG_READPICTURE)
\r
730 img = ReadPicture();
\r
731 print(strcat("Got Picture: ", img, "\n"));
\r
733 img = ReadString();
\r
734 print(strcat("^3Warning: ^7Couldn't download ", img, ". This is probably because your engine build is outdated.\n"));
\r
736 psize = ReadShort();
\r
737 // Can I be sure that ReadShort is 2 bytes and ReadLong is 4 bytes?
\r
738 // Because then this could be optimized to first get all 4-byte-groups,
\r
739 // then the remaining 2, then the remaining 1
\r
740 for(i = 0; i < psize; ++i)
\r
746 void Net_ReadRace()
\r
754 case RACE_NET_CHECKPOINT_HIT_QUALIFYING:
\r
755 race_checkpoint = ReadByte();
\r
756 race_time = ReadShort();
\r
757 race_previousbesttime = ReadShort();
\r
758 if(race_previousbestname)
\r
759 strunzone(race_previousbestname);
\r
760 race_previousbestname = strzone(ColorTranslateRGB(ReadString()));
\r
762 race_checkpointtime = time;
\r
764 if(race_checkpoint == 0)
\r
765 race_laptime = time; // valid
\r
769 case RACE_NET_CHECKPOINT_CLEAR:
\r
771 race_checkpointtime = 0;
\r
774 case RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING:
\r
775 race_laptime = ReadCoord();
\r
776 race_checkpointtime = -99999;
\r
778 case RACE_NET_CHECKPOINT_NEXT_QUALIFYING:
\r
779 race_nextcheckpoint = ReadByte();
\r
781 race_nextbesttime = ReadShort();
\r
782 if(race_nextbestname)
\r
783 strunzone(race_nextbestname);
\r
784 race_nextbestname = strzone(ColorTranslateRGB(ReadString()));
\r
787 case RACE_NET_CHECKPOINT_HIT_RACE:
\r
788 race_mycheckpoint = ReadByte();
\r
789 race_mycheckpointtime = time;
\r
790 race_mycheckpointdelta = ReadShort();
\r
791 race_mycheckpointlapsdelta = ReadByte();
\r
792 if(race_mycheckpointlapsdelta >= 128)
\r
793 race_mycheckpointlapsdelta -= 256;
\r
794 if(race_mycheckpointenemy)
\r
795 strunzone(race_mycheckpointenemy);
\r
796 race_mycheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
\r
799 case RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT:
\r
800 race_othercheckpoint = ReadByte();
\r
801 race_othercheckpointtime = time;
\r
802 race_othercheckpointdelta = ReadShort();
\r
803 race_othercheckpointlapsdelta = ReadByte();
\r
804 if(race_othercheckpointlapsdelta >= 128)
\r
805 race_othercheckpointlapsdelta -= 256;
\r
806 if(race_othercheckpointenemy)
\r
807 strunzone(race_othercheckpointenemy);
\r
808 race_othercheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
\r
813 void Net_ReadSpawn()
\r
816 current_viewzoom = 0.6;
\r
819 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
\r
820 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
\r
821 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
\r
822 float CSQC_Parse_TempEntity()
\r
824 local float bHandled;
\r
828 nTEID = ReadByte();
\r
830 // NOTE: Could just do return instead of break...
\r
833 case TE_CSQC_PICTURE:
\r
834 Net_MapVote_Picture();
\r
841 case 13: // TE_BEAM
\r
842 Net_GrapplingHook();
\r
845 case TE_CSQC_SPAWN:
\r
850 // No special logic for this temporary entity; return 0 so the engine can handle it
\r
858 // COMMIT-TODO: Update if necessare, before committing
\r
859 void CSQC_CheckRevision()
\r
861 if(csqc_revision == CSQC_REVISION)
\r
863 print("^2SVQC and CSQC revisions are compatible.\n");
\r
864 } else if(csqc_revision < CSQC_REVISION) {
\r
865 print("^1Your csprogs.dat (CSQC) version is newer than the one on the server.\n");
\r
866 } else if(csqc_revision > CSQC_REVISION) {
\r
867 print("^1Your csprogs.dat (CSQC) is too old for this server.\n");
\r
868 print("^1Please update to a newer version.\n");
\r
872 string getcommandkey(string text, string command)
\r
877 if (!sbar_showbinds)
\r
880 keys = db_get(binddb, command);
\r
881 if(csqc_flags & CSQC_FLAG_READPICTURE)
\r
885 n = tokenize_insane(findkeysforcommand(command)); // uses '...' strings
\r
886 for(j = 0; j < n; ++j)
\r
892 keys = keynumtostring(k);
\r
894 keys = strcat(keys, ", ", keynumtostring(k));
\r
897 if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break;
\r
901 db_put(binddb, command, keys);
\r
906 if (sbar_showbinds > 1)
\r
907 return strcat(text, " (not bound)");
\r
911 else if (sbar_showbinds > 1)
\r
912 return strcat(text, " (", keys, ")");
\r