void DumpWeaponConfig(weaponconfig_t *wc) { FILE *fp; int i; fp = Log_FileStruct(); if (!fp) return; for (i = 0; i < wc->numprojectiles; i++) { WriteStructure(fp, &projectileinfo_struct, (char *) &wc->projectileinfo[i]); Log_Flush(); } for (i = 0; i < wc->numweapons; i++) { WriteStructure(fp, &weaponinfo_struct, (char *) &wc->weaponinfo[i]); Log_Flush(); } }
bool CVSClient::WriteData(void) { CSmallString client_id("-1"); if(ActionRequest.GetParameterKeyValue("id",client_id) == false) { ES_ERROR("unable to get client id from command specification"); return(false); } // is client_id integer? if(client_id.IsInt() == false) { CSmallString error; error << "specified client id '" << client_id << "' is not an integer number"; ES_ERROR(error); return(false); } CSmallString molid; if(ActionRequest.GetParameterKeyValue("molid",molid) == false) { ES_ERROR("unable to get molid from command specification"); return(false); } // ------------------------------------------- // create command CClientCommand* p_command = CreateCommand(Operation_WriteVSData); if(p_command == NULL) return(false); // set client ID CXMLElement* p_ele = p_command->GetRootCommandElement(); if(p_ele == NULL) { ES_ERROR("unable to get root command element"); delete p_command; return(false); } bool result = true; p_ele->SetAttribute("client_id",client_id); p_ele->SetAttribute("molid",molid); if(result == false) { ES_ERROR("unable to set client_id and/or molid"); delete p_command; return(false); } if(WriteStructure(p_ele) == false) { ES_ERROR("unable to write structure"); delete p_command; return(false); } // FIXME - try/catch ExecuteCommand(p_command); if(result == false) { ES_ERROR("unable to execute command"); delete p_command; return(false); } delete p_command; return(true); }