Sets the value of an individual world attribute.
None (returns immediately)
This method is new in Active Worlds 3.1 and requires at least SDK build 18.
This method was added to make the implementation of a "remote atload" utility easier and is of limited use to the general SDK programmer. In particular, meaningful values for the attribute argument correspond only to entries in a world server attribute dump file and are not otherwise documented; they do not correspond to the various AW_WORLD_ attributes defined within the SDK.
SDK applications that wish to change specific world attributes should continue to do so by using the aw_int_set, aw_bool_set, aw_float_set, and aw_string_set routines followed by a call to aw_world_attributes_change.
This method only changes the local value of the world attribute (i.e. within the SDK.) To change the value for everyone, aw_world_attributes_change must be called.
FILE* fp; int rc; int id; char string[256];
/* implement a simplistic remote atload utility */
aw_world_attributes_reset ();
fp = fopen ("atdump.txt", "r");
for (;;) {
rc = fscanf (fp, "%d %[^\n]", &id, string);
if (rc == EOF)
break;
if (rc != 2) {
printf ("Unable to load attributes: invalid format");
fclose (fp);
return;
}
if (rc = aw_world_attribute_set (id, string)) {
printf ("Unable to set attribute: %d", rc);
fclose (fp);
return;
}
}
fclose (fp);
if (rc = aw_world_attributes_change ())
printf ("Unable to load attributes: %d", rc);
else
printf ("Attribute load complete");