]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/miscfunctions.qc
Merge remote branch 'origin/terencehill/physics_panel_updates'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / miscfunctions.qc
1 var float(string text, float handleColors, vector fontSize) stringwidth;
2
3 entity players;
4 entity teams;
5
6 void AuditLists()
7 {
8         entity e;
9         entity prev;
10
11         prev = players;
12         for(e = prev.sort_next; e; prev = e, e = e.sort_next)
13         {
14                 if(prev != e.sort_prev)
15                         error(strcat("sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
16         }
17
18         prev = teams;
19         for(e = prev.sort_next; e; prev = e, e = e.sort_next)
20         {
21                 if(prev != e.sort_prev)
22                         error(strcat("sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
23         }
24 }
25
26
27 float RegisterPlayer(entity player)
28 {
29         entity pl;
30         AuditLists();
31         for(pl = players.sort_next; pl; pl = pl.sort_next)
32                 if(pl == player)
33                         error("Player already registered!");
34         player.sort_next = players.sort_next;
35         player.sort_prev = players;
36         if(players.sort_next)
37                 players.sort_next.sort_prev = player;
38         players.sort_next = player;
39         AuditLists();
40         return true;
41 }
42
43 void RemovePlayer(entity player)
44 {
45         entity pl, parent;
46         AuditLists();
47         parent = players;
48         for(pl = players.sort_next; pl && pl != player; pl = pl.sort_next)
49                 parent = pl;
50
51         if(!pl)
52         {
53                 error("Trying to remove a player which is not in the playerlist!");
54                 return;
55         }
56         parent.sort_next = player.sort_next;
57         if(player.sort_next)
58                 player.sort_next.sort_prev = parent;
59         AuditLists();
60 }
61
62 void MoveToLast(entity e)
63 {
64         AuditLists();
65         other = e.sort_next;
66         while(other)
67         {
68                 SORT_SWAP(other, e);
69                 other = e.sort_next;
70         }
71         AuditLists();
72 }
73
74 float RegisterTeam(entity Team)
75 {
76         entity tm;
77         AuditLists();
78         for(tm = teams.sort_next; tm; tm = tm.sort_next)
79                 if(tm == Team)
80                         error("Team already registered!");
81         Team.sort_next = teams.sort_next;
82         Team.sort_prev = teams;
83         if(teams.sort_next)
84                 teams.sort_next.sort_prev = Team;
85         teams.sort_next = Team;
86         AuditLists();
87         return true;
88 }
89
90 void RemoveTeam(entity Team)
91 {
92         entity tm, parent;
93         AuditLists();
94         parent = teams;
95         for(tm = teams.sort_next; tm && tm != Team; tm = tm.sort_next)
96                 parent = tm;
97
98         if(!tm)
99         {
100                 print(_("Trying to remove a team which is not in the teamlist!"));
101                 return;
102         }
103         parent.sort_next = Team.sort_next;
104         if(Team.sort_next)
105                 Team.sort_next.sort_prev = parent;
106         AuditLists();
107 }
108
109 entity GetTeam(float Team, float add)
110 {
111         float num;
112         entity tm;
113         num = (Team == COLOR_SPECTATOR) ? 16 : Team;
114         if(teamslots[num])
115                 return teamslots[num];
116         if not(add)
117                 return world;
118         tm = spawn();
119         tm.team = Team;
120         teamslots[num] = tm;
121         RegisterTeam(tm);
122         return tm;
123 }
124
125 vector HUD_GetFontsize(string cvarname)
126 {
127         vector v;
128         v = stov(cvar_string(cvarname));
129         if(v_x == 0)
130                 v = '8 8 0';
131         if(v_y == 0)
132                 v_y = v_x;
133         v_z = 0;
134         return v;
135 }
136
137 float PreviewExists(string name)
138 {
139         if(autocvar_cl_readpicture_force)
140                 return false;
141
142         if (fexists(strcat(name, ".tga"))) return true;
143         if (fexists(strcat(name, ".png"))) return true;
144         if (fexists(strcat(name, ".jpg"))) return true;
145         if (fexists(strcat(name, ".pcx"))) return true;
146
147         return false;
148 }
149
150 vector rotate(vector v, float a)
151 {
152         vector w;
153         // FTEQCC SUCKS AGAIN
154         w_x =      v_x * cos(a) + v_y * sin(a);
155         w_y = -1 * v_x * sin(a) + v_y * cos(a);
156         return w;
157 }
158
159 float ColorTranslateMode;
160
161 string ColorTranslateRGB(string s)
162 {
163         if(ColorTranslateMode & 1)
164                 return strdecolorize(s);
165         else
166                 return s;
167 }
168
169 string Team_ColorCode(float teamid)
170 {
171     if (teamid == COLOR_TEAM1)
172         return "^1";
173     else if (teamid == COLOR_TEAM2)
174         return "^4";
175     else if (teamid == COLOR_TEAM3)
176         return "^3";
177     else if (teamid == COLOR_TEAM4)
178         return "^6";
179     else
180         return "^7";
181 }
182
183 // decolorizes and team colors the player name when needed
184 string playername(string thename, float teamid)
185 {
186     string t;
187     if (teamplay)
188     {
189         t = Team_ColorCode(teamid);
190         return strcat(t, strdecolorize(thename));
191     }
192     else
193         return strdecolorize(thename);
194 }
195
196 float cvar_or(string cv, float v)
197 {
198         string s;
199         s = cvar_string(cv);
200         if(s == "")
201                 return v;
202         else
203                 return stof(s);
204 }
205
206 vector project_3d_to_2d(vector vec)
207 {
208         vec = cs_project(vec);
209         if(cs_project_is_b0rked > 0)
210         {
211                 vec_x *= vid_conwidth / vid_width;
212                 vec_y *= vid_conheight / vid_height;
213         }
214         return vec;
215 }
216
217 void dummyfunction(float a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8)
218 {
219 }
220
221 float expandingbox_sizefactor_from_fadelerp(float fadelerp)
222 {
223         return 1.2 / (1.2 - fadelerp);
224 }
225
226 vector expandingbox_resize_centered_box_offset(float sz, vector boxsize, float boxxsizefactor)
227 {
228         boxsize_x *= boxxsizefactor; // easier interface for text
229         return boxsize * (0.5 * (1 - sz));
230 }
231
232 void drawborderlines(float thickness, vector pos, vector dim, vector color, float theAlpha, float drawflag)
233 {
234         vector line_dim;
235
236         // left and right lines
237         pos_x -= thickness;
238         line_dim_x = thickness;
239         line_dim_y = dim_y;
240         drawfill(pos, line_dim, color, theAlpha, drawflag);
241         drawfill(pos + (dim_x + thickness) * '1 0 0', line_dim, color, theAlpha, drawflag);
242
243         // upper and lower lines
244         pos_y -= thickness;
245         line_dim_x = dim_x + thickness * 2; // make upper and lower lines longer
246         line_dim_y = thickness;
247         drawfill(pos, line_dim, color, theAlpha, drawflag);
248         drawfill(pos + (dim_y + thickness) * '0 1 0', line_dim, color, theAlpha, drawflag);
249 }
250
251 void drawpic_tiled(vector pos, string pic, vector sz, vector area, vector color, float theAlpha, float drawflag)
252 {
253         vector current_pos, end_pos, new_size, ratio;
254         end_pos = pos + area;
255
256         current_pos_y = pos_y;
257         while (current_pos_y < end_pos_y)
258         {
259                 current_pos_x = pos_x;
260                 while (current_pos_x < end_pos_x)
261                 {
262                         new_size_x = min(sz_x, end_pos_x - current_pos_x);
263                         new_size_y = min(sz_y, end_pos_y - current_pos_y);
264                         ratio_x = new_size_x / sz_x;
265                         ratio_y = new_size_y / sz_y;
266                         drawsubpic(current_pos, new_size, pic, '0 0 0', ratio, color, theAlpha, drawflag);
267                         current_pos_x += sz_x;
268                 }
269                 current_pos_y += sz_y;
270         }
271 }
272
273 // drawpic wrapper to draw an image as large as possible with preserved aspect ratio into a box
274 var float _drawpic_imgaspect;
275 var vector _drawpic_imgsize;
276 var vector _drawpic_sz;
277 var float _drawpic_oldsz;
278 var string _drawpic_picpath;
279 #define drawpic_aspect(pos,pic,mySize,color,theAlpha,drawflag)\
280         do {\
281                 _drawpic_imgsize = draw_getimagesize(pic);\
282                 if(_drawpic_imgsize != '0 0 0') {\
283                         _drawpic_imgaspect = _drawpic_imgsize_x/_drawpic_imgsize_y;\
284                         _drawpic_sz = mySize;\
285                         if(_drawpic_sz_x/_drawpic_sz_y > _drawpic_imgaspect) {\
286                                 _drawpic_oldsz = _drawpic_sz_x;\
287                                 _drawpic_sz_x = _drawpic_sz_y * _drawpic_imgaspect;\
288                                 if(_drawpic_sz_x)\
289                                         drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\
290                         } else {\
291                                 _drawpic_oldsz = _drawpic_sz_y;\
292                                 _drawpic_sz_y = _drawpic_sz_x / _drawpic_imgaspect;\
293                                 if(_drawpic_sz_y)\
294                                         drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\
295                         }\
296                 }\
297         } while(0)
298
299 // draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
300 #define drawpic_aspect_skin(pos,pic,sz,color,theAlpha,drawflag)\
301         do{\
302                 _drawpic_picpath = strcat(hud_skin_path, "/", pic);\
303                 if(precache_pic(_drawpic_picpath) == "") {\
304                         _drawpic_picpath = strcat("gfx/hud/default/", pic);\
305                 }\
306                 drawpic_aspect(pos, _drawpic_picpath, sz, color, theAlpha, drawflag);\
307                 _drawpic_picpath = string_null;\
308         } while(0)
309
310 // draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
311 #define drawpic_skin(pos,pic,sz,color,theAlpha,drawflag)\
312         do{\
313                 _drawpic_picpath = strcat(hud_skin_path, "/", pic);\
314                 if(precache_pic(_drawpic_picpath) == "") {\
315                         _drawpic_picpath = strcat("gfx/hud/default/", pic);\
316                 }\
317                 drawpic(pos, _drawpic_picpath, sz, color, theAlpha, drawflag);\
318                 _drawpic_picpath = string_null;\
319         } while(0)
320
321 void drawpic_aspect_skin_expanding(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
322 {
323         float sz;
324         sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
325
326         drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, theAlpha * (1 - fadelerp), flag);
327 }
328
329 void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
330 {
331         drawpic_aspect_skin_expanding(position, pic, scale, rgb, theAlpha, flag, fadelerp);
332         drawpic_skin(position, pic, scale, rgb, theAlpha * fadelerp, flag);
333 }
334 #define SET_POS_AND_SZ_Y_ASPECT(allow_colors)\
335         float textaspect, oldsz;\
336         textaspect = stringwidth(text, allow_colors, '1 1 1' * sz_y) / sz_y;\
337         if(sz_x/sz_y > textaspect) {\
338                 oldsz = sz_x;\
339                 sz_x = sz_y * textaspect;\
340                 pos_x += (oldsz - sz_x) * 0.5;\
341         } else {\
342                 oldsz = sz_y;\
343                 sz_y = sz_x / textaspect; \
344                 pos_y += (oldsz - sz_y) * 0.5;\
345         }
346
347 // drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
348 void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag) {
349         SET_POS_AND_SZ_Y_ASPECT(FALSE)
350         drawstring(pos, text, '1 1 0' * sz_y, color, theAlpha, drawflag);
351 }
352
353 // drawstring wrapper to draw a colorcodedstring as large as possible with preserved aspect ratio into a box
354 void drawcolorcodedstring_aspect(vector pos, string text, vector sz, float theAlpha, float drawflag) {
355         SET_POS_AND_SZ_Y_ASPECT(TRUE)
356         drawcolorcodedstring(pos, text, '1 1 0' * sz_y, theAlpha, drawflag);
357 }
358
359 vector drawfontscale;
360 void drawstring_expanding(vector position, string text, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
361 {
362         float sz;
363         sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
364
365         drawfontscale = sz * '1 1 0';
366         dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
367         drawstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, FALSE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag);
368         // width parameter:
369         //    (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz)
370         //    SIZE1
371         drawfontscale = '1 1 0';
372 }
373
374 // drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
375 void drawstring_aspect_expanding(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag, float fadelerp) {
376         SET_POS_AND_SZ_Y_ASPECT(FALSE)
377         drawstring_expanding(pos, text, '1 1 0' * sz_y, color, theAlpha, drawflag, fadelerp);
378 }
379
380 void drawcolorcodedstring_expanding(vector position, string text, vector scale, float theAlpha, float flag, float fadelerp)
381 {
382         float sz;
383         sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
384
385         drawfontscale = sz * '1 1 0';
386         dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
387         drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, TRUE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag);
388         drawfontscale = '1 1 0';
389 }
390
391 void drawcolorcodedstring_aspect_expanding(vector pos, string text, vector sz, float theAlpha, float drawflag, float fadelerp) {
392         SET_POS_AND_SZ_Y_ASPECT(TRUE)
393         drawcolorcodedstring_expanding(pos, text, '1 1 0' * sz_y, theAlpha, drawflag, fadelerp);
394 }
395
396 // this draws the triangles of a model DIRECTLY. Don't expect high performance, really...
397 float PolyDrawModelSurface(entity e, float i_s)
398 {
399         float i_t;
400         float n_t;
401         vector tri;
402         string tex;
403         tex = getsurfacetexture(e, i_s);
404         if not(tex)
405                 return 0; // this is beyond the last one
406         n_t = getsurfacenumtriangles(e, i_s);
407         for(i_t = 0; i_t < n_t; ++i_t)
408         {
409                 tri = getsurfacetriangle(e, i_s, i_t);
410                 R_BeginPolygon(tex, 0);
411                 R_PolygonVertex(getsurfacepoint(e, i_s, tri_x), getsurfacepointattribute(e, i_s, tri_x, SPA_TEXCOORDS0), '1 1 1', 1);
412                 R_PolygonVertex(getsurfacepoint(e, i_s, tri_y), getsurfacepointattribute(e, i_s, tri_y, SPA_TEXCOORDS0), '1 1 1', 1);
413                 R_PolygonVertex(getsurfacepoint(e, i_s, tri_z), getsurfacepointattribute(e, i_s, tri_z, SPA_TEXCOORDS0), '1 1 1', 1);
414                 R_EndPolygon();
415         }
416         return 1;
417 }
418 void PolyDrawModel(entity e)
419 {
420         float i_s;
421         for(i_s = 0; ; ++i_s)
422                 if(!PolyDrawModelSurface(e, i_s))
423                         break;
424 }
425
426 void DrawCircleClippedPic(vector centre, float radius, string pic, float f, vector rgb, float a, float drawflag)
427 {
428         float x, y, q, d;
429         vector ringsize, v, t;
430         ringsize = radius * '1 1 0';
431
432         x = cos(f * 2 * M_PI);
433         y = sin(f * 2 * M_PI);
434         q = fabs(x) + fabs(y);
435         x /= q;
436         y /= q;
437
438         if(f >= 1)
439         {
440                 // draw full rectangle
441                 R_BeginPolygon(pic, drawflag);
442                         v = centre;                     t = '0.5 0.5 0';
443                         v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
444                         R_PolygonVertex(v, t, rgb, a);
445
446                         v = centre;                     t = '0.5 0.5 0';
447                         v_y += 0.5 * ringsize_y;        t += '0.5 -0.5 0';
448                         R_PolygonVertex(v, t, rgb, a);
449
450                         v = centre;                     t = '0.5 0.5 0';
451                         v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
452                         R_PolygonVertex(v, t, rgb, a);
453
454                         v = centre;                     t = '0.5 0.5 0';
455                         v_y -= 0.5 * ringsize_y;        t -= '0.5 -0.5 0';
456                         R_PolygonVertex(v, t, rgb, a);
457                 R_EndPolygon();
458
459                 d = q - 1;
460                 if(d > 0)
461                 {
462                         R_BeginPolygon(pic, drawflag);
463                                 v = centre;                     t = '0.5 0.5 0';
464                                 R_PolygonVertex(v, t, rgb, a);
465
466                                 v = centre;                     t = '0.5 0.5 0';
467                                 v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
468                                 R_PolygonVertex(v, t, rgb, a);
469                 }
470         }
471         else if(f > 0.75)
472         {
473                 // draw upper and first triangle
474                 R_BeginPolygon(pic, drawflag);
475                         v = centre;                     t = '0.5 0.5 0';
476                         v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
477                         R_PolygonVertex(v, t, rgb, a);
478
479                         v = centre;                     t = '0.5 0.5 0';
480                         v_y += 0.5 * ringsize_y;        t += '0.5 -0.5 0';
481                         R_PolygonVertex(v, t, rgb, a);
482
483                         v = centre;                     t = '0.5 0.5 0';
484                         v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
485                         R_PolygonVertex(v, t, rgb, a);
486                 R_EndPolygon();
487                 R_BeginPolygon(pic, drawflag);
488                         v = centre;                     t = '0.5 0.5 0';
489                         R_PolygonVertex(v, t, rgb, a);
490
491                         v = centre;                     t = '0.5 0.5 0';
492                         v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
493                         R_PolygonVertex(v, t, rgb, a);
494
495                         v = centre;                     t = '0.5 0.5 0';
496                         v_y -= 0.5 * ringsize_y;        t -= '0.5 -0.5 0';
497                         R_PolygonVertex(v, t, rgb, a);
498
499                 d = q - 0.75;
500                 if(d <= 0)
501                         R_EndPolygon();
502         }
503         else if(f > 0.5)
504         {
505                 // draw upper triangle
506                 R_BeginPolygon(pic, drawflag);
507                         v = centre;                     t = '0.5 0.5 0';
508                         v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
509                         R_PolygonVertex(v, t, rgb, a);
510
511                         v = centre;                     t = '0.5 0.5 0';
512                         v_y += 0.5 * ringsize_y;        t += '0.5 -0.5 0';
513                         R_PolygonVertex(v, t, rgb, a);
514
515                         v = centre;                     t = '0.5 0.5 0';
516                         v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
517                         R_PolygonVertex(v, t, rgb, a);
518                 R_EndPolygon();
519
520                 d = q - 0.5;
521                 if(d > 0)
522                 {
523                         R_BeginPolygon(pic, drawflag);
524                                 v = centre;                     t = '0.5 0.5 0';
525                                 R_PolygonVertex(v, t, rgb, a);
526
527                                 v = centre;                     t = '0.5 0.5 0';
528                                 v_x -= 0.5 * ringsize_x;        t -= '0.5 0.5 0';
529                                 R_PolygonVertex(v, t, rgb, a);
530                 }
531         }
532         else if(f > 0.25)
533         {
534                 // draw first triangle
535                 R_BeginPolygon(pic, drawflag);
536                         v = centre;                     t = '0.5 0.5 0';
537                         R_PolygonVertex(v, t, rgb, a);
538
539                         v = centre;                     t = '0.5 0.5 0';
540                         v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
541                         R_PolygonVertex(v, t, rgb, a);
542
543                         v = centre;                     t = '0.5 0.5 0';
544                         v_y += 0.5 * ringsize_y;        t += '0.5 -0.5 0';
545                         R_PolygonVertex(v, t, rgb, a);
546
547                 d = q - 0.25;
548                 if(d <= 0)
549                         R_EndPolygon();
550         }
551         else
552         {
553                 d = q;
554                 if(d > 0)
555                 {
556                         R_BeginPolygon(pic, drawflag);
557                                 v = centre;                     t = '0.5 0.5 0';
558                                 R_PolygonVertex(v, t, rgb, a);
559
560                                 v = centre;                     t = '0.5 0.5 0';
561                                 v_x += 0.5 * ringsize_x;        t += '0.5 0.5 0';
562                                 R_PolygonVertex(v, t, rgb, a);
563                 }
564         }
565
566         if(d > 0)
567         {
568                         v = centre;                     t = '0.5 0.5 0';
569                         v_x += x * 0.5 * ringsize_x;    t += x * '0.5 0.5 0';
570                         v_y += y * 0.5 * ringsize_y;    t += y * '0.5 -0.5 0';
571                         R_PolygonVertex(v, t, rgb, a);
572                 R_EndPolygon();
573         }
574 }
575
576 const vector GETPLAYERORIGIN_ERROR = '1123581321 2357111317 3141592653'; // way out of bounds for anything on the map
577 vector getplayerorigin(float pl)
578 {
579         string s;
580         entity e;
581
582         e = CSQCModel_server2csqc(pl + 1);
583         if(e)
584                 return e.origin;
585
586 #ifndef NO_LEGACY_NETWORKING
587         s = getplayerkeyvalue(pl, "TEMPHACK_origin");
588         if(s != "")
589                 return stov(s);
590 #endif
591
592         e = entcs_receiver[pl];
593         if(e)
594                 return e.origin;
595
596         return GETPLAYERORIGIN_ERROR;
597 }
598
599 float getplayerisdead(float pl)
600 {
601         entity e;
602         
603         e = CSQCModel_server2csqc(pl + 1);
604         if(e)
605                 return e.csqcmodel_isdead;
606         
607         return FALSE;
608 }
609
610 void URI_Get_Callback(float id, float status, string data)
611 {
612         if(url_URI_Get_Callback(id, status, data))
613         {
614                 // handled
615         }
616         else if (id == URI_GET_DISCARD)
617         {
618                 // discard
619         }
620         else if (id >= URI_GET_CURL && id <= URI_GET_CURL_END)
621         {
622                 // sv_cmd curl
623                 Curl_URI_Get_Callback(id, status, data);
624         }
625         else
626         {
627                 print(sprintf(_("Received HTTP request data for an invalid id %d.\n"), id));
628         }
629 }