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

Comparing deliantra/server/socket/request.C (file contents):
Revision 1.156 by root, Fri Nov 6 12:49:19 2009 UTC vs.
Revision 1.157 by root, Fri Nov 6 13:05:57 2009 UTC

220 socket.current_x = ob->x; 220 socket.current_x = ob->x;
221 socket.current_y = ob->y; 221 socket.current_y = ob->y;
222} 222}
223 223
224/** 224/**
225 * This sends the skill number to name mapping. We ignore
226 * the params - we always send the same info no matter what.
227 */
228void
229send_skill_info (client *ns, char *params)
230{
231 packet sl;
232 sl << "replyinfo skill_info\n";
233
234 for (int i = 1; i < NUM_SKILLS; i++)
235 sl.printf ("%d:%s\n", i + CS_STAT_SKILLINFO, &skill_names [i]);
236
237 if (sl.length () > MAXSOCKBUF)
238 {
239 LOG (llevError, "Buffer overflow in send_skill_info!\n");
240 fatal (0);
241 }
242
243 ns->send_packet (sl);
244}
245
246/**
247 * This sends the spell path to name mapping. We ignore
248 * the params - we always send the same info no matter what.
249 */
250void
251send_spell_paths (client * ns, char *params)
252{
253 packet sl;
254
255 sl << "replyinfo spell_paths\n";
256
257 for (int i = 0; i < NRSPELLPATHS; i++)
258 sl.printf ("%d:%s\n", 1 << i, spellpathnames[i]);
259
260 if (sl.length () > MAXSOCKBUF)
261 {
262 LOG (llevError, "Buffer overflow in send_spell_paths!\n");
263 fatal (0);
264 }
265
266 ns->send_packet (sl);
267}
268
269/**
225 * RequestInfo is sort of a meta command. There is some specific 270 * RequestInfo is sort of a meta command. There is some specific
226 * request of information, but we call other functions to provide 271 * request of information, but we call other functions to provide
227 * that information. 272 * that information.
228 */ 273 */
229void 274void
1233{ 1278{
1234 pl->contr->ns->send_packet (buf); 1279 pl->contr->ns->send_packet (buf);
1235} 1280}
1236 1281
1237/** 1282/**
1238 * This sends the skill number to name mapping. We ignore
1239 * the params - we always send the same info no matter what.
1240 */
1241void
1242send_skill_info (client *ns, char *params)
1243{
1244 packet sl;
1245 sl << "replyinfo skill_info\n";
1246
1247 for (int i = 1; i < NUM_SKILLS; i++)
1248 sl.printf ("%d:%s\n", i + CS_STAT_SKILLINFO, &skill_names [i]);
1249
1250 if (sl.length () > MAXSOCKBUF)
1251 {
1252 LOG (llevError, "Buffer overflow in send_skill_info!\n");
1253 fatal (0);
1254 }
1255
1256 ns->send_packet (sl);
1257}
1258
1259/**
1260 * This sends the spell path to name mapping. We ignore
1261 * the params - we always send the same info no matter what.
1262 */
1263void
1264send_spell_paths (client * ns, char *params)
1265{
1266 packet sl;
1267
1268 sl << "replyinfo spell_paths\n";
1269
1270 for (int i = 0; i < NRSPELLPATHS; i++)
1271 sl.printf ("%d:%s\n", 1 << i, spellpathnames[i]);
1272
1273 if (sl.length () > MAXSOCKBUF)
1274 {
1275 LOG (llevError, "Buffer overflow in send_spell_paths!\n");
1276 fatal (0);
1277 }
1278
1279 ns->send_packet (sl);
1280}
1281
1282/**
1283 * This looks for any spells the player may have that have changed their stats. 1283 * This looks for any spells the player may have that have changed their stats.
1284 * it then sends an updspell packet for each spell that has changed in this way 1284 * it then sends an updspell packet for each spell that has changed in this way
1285 */ 1285 */
1286void 1286void
1287esrv_update_spells (player *pl) 1287esrv_update_spells (player *pl)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines