1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#include "swserv.h"
int NetHandleObjectMaximums(int condescriptor, char *arg)
{
return(0);
}
int NetSendObjectMaximums(int condescriptor, long object_num)
{
char sndbuf[CS_DATA_MAX_LEN];
xsw_object_struct *obj_ptr;
/* Make sure object is valid. */
if(DBIsObjectGarbage(object_num))
return(-1);
else
obj_ptr = xsw_object[object_num];
/*
* Format SWEXTCMD_STDOBJMAXS:
*
* type, imageset, owner, size, scanner_range,
* velocity_max, thrust_power, turnrate, hp_max, power_max,
* power_purity, core_efficency, antimatter_max, total_weapons,
* visibility
*/
sprintf(sndbuf,
"%i %i %ld\
%i %i %ld %ld %.4lf\
%.4lf %.4lf %.4lf %.4lf %.4lf\
%.4lf %.4lf %.4lf %i %.4lf\n",
CS_CODE_EXT,
SWEXTCMD_STDOBJMAXS,
object_num,
obj_ptr->type,
obj_ptr->imageset,
obj_ptr->owner,
obj_ptr->size,
obj_ptr->scanner_range,
obj_ptr->velocity_max,
obj_ptr->thrust_power,
obj_ptr->turnrate,
obj_ptr->hp_max,
obj_ptr->power_max,
obj_ptr->power_purity,
obj_ptr->core_efficency,
obj_ptr->antimatter_max,
obj_ptr->total_weapons,
obj_ptr->visibility
);
NetDoSend(condescriptor, sndbuf);
return(0);
}
|