ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_misc.C
(Generate patch)

Comparing deliantra/server/server/c_misc.C (file contents):
Revision 1.42 by root, Fri Feb 2 21:50:43 2007 UTC vs.
Revision 1.46 by pippijn, Thu Mar 1 13:18:37 2007 UTC

69{ 69{
70 display_motd (op); 70 display_motd (op);
71 return 1; 71 return 1;
72} 72}
73 73
74int
75command_bug (object *op, char *params)
76{
77 char buf[MAX_BUF];
78
79 if (params == NULL)
80 {
81 new_draw_info (NDI_UNIQUE, 0, op, "what bugs?");
82 return 1;
83 }
84 strcpy (buf, op->name);
85 strcat (buf, " bug-reports: ");
86 strncat (buf, ++params, MAX_BUF - strlen (buf));
87 buf[MAX_BUF - 1] = '\0';
88 bug_report (buf);
89 LOG (llevError, "%s\n", buf);
90 new_draw_info (NDI_ALL | NDI_UNIQUE, 1, NULL, buf);
91 new_draw_info (NDI_UNIQUE, 0, op, "OK, thanks!");
92 return 1;
93}
94
95/* 74/*
96 * Pretty much identical to current map_info, but on a bigger scale 75 * Pretty much identical to current map_info, but on a bigger scale
97 * This function returns the name of the players current region, and 76 * This function returns the name of the players current region, and
98 * a description of it. It is there merely for flavour text. 77 * a description of it. It is there merely for flavour text.
99 */ 78 */
100void 79void
101current_region_info (object *op) 80current_region_info (object *op)
102{ 81{
103 if (region *reg = op->region ()) 82 if (region *reg = op->region ())
104 new_draw_info_format (NDI_UNIQUE, 0, op, "You are in %s.\n%s", &reg->longname, &reg->msg); 83 new_draw_info_format (NDI_UNIQUE, 0, op, "You are %s.\n%s", &reg->longname, &reg->msg);
105} 84}
106 85
107void 86void
108current_map_info (object *op) 87current_map_info (object *op)
109{ 88{
110 maptile *m = op->map; 89 maptile *m = op->map;
111 90
112 if (!m) 91 if (!m)
113 return; 92 return;
114 93
115 new_draw_info_format (NDI_UNIQUE, 0, op, "%s (%s) in %s", &m->name, &m->path, &op->region ()->name); 94 new_draw_info_format (NDI_UNIQUE, 0, op, "%s (%s) %s", &m->name, &m->path, &op->region ()->longname);
116 95
117 if (QUERY_FLAG (op, FLAG_WIZ)) 96 if (QUERY_FLAG (op, FLAG_WIZ))
118 new_draw_info_format (NDI_UNIQUE, 0, op, 97 new_draw_info_format (NDI_UNIQUE, 0, op,
119 "players:%d difficulty:%d size:%dx%d start:%dx%d timeout %ld", 98 "players:%d difficulty:%d size:%dx%d start:%dx%d timeout %ld",
120 m->players, m->difficulty, m->width, m->height, m->enter_x, m->enter_y, m->timeout); 99 m->players, m->difficulty, m->width, m->height, m->enter_x, m->enter_y, m->timeout);
170 149
171 new_draw_info_format (NDI_UNIQUE, 0, op, "In the world currently there are:"); 150 new_draw_info_format (NDI_UNIQUE, 0, op, "In the world currently there are:");
172 151
173 for_all_regions (rgn) 152 for_all_regions (rgn)
174 if (rgn->counter) 153 if (rgn->counter)
175 new_draw_info_format (NDI_UNIQUE, 0, op, "%u players in %s", rgn->counter, &rgn->longname); 154 new_draw_info_format (NDI_UNIQUE, 0, op, "%u players %s", rgn->counter, &rgn->longname);
176 155
177 return 1; 156 return 1;
178} 157}
179 158
180typedef struct 159typedef struct
801 780
802 if (!(dirp = opendir (filename))) 781 if (!(dirp = opendir (filename)))
803 return; 782 return;
804 783
805 line[0] = '\0'; 784 line[0] = '\0';
806 while (de = readdir (dirp)) 785 while ((de = readdir (dirp)))
807 { 786 {
808 namelen = strlen (de->d_name); 787 namelen = strlen (de->d_name);
809 if (namelen <= 2 && *de->d_name == '.' && (namelen == 1 || de->d_name[1] == '.')) 788 if (namelen <= 2 && *de->d_name == '.' && (namelen == 1 || de->d_name[1] == '.'))
810 continue; 789 continue;
811 linelen += namelen + 1; 790 linelen += namelen + 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines