本文整理匯總了C++中Error1函數的典型用法代碼示例。如果您正苦於以下問題:C++ Error1函數的具體用法?C++ Error1怎麽用?C++ Error1使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Error1函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: Calc_Folder_
//------------------------------------------------------------------------------
static int Calc_Folder_(HTREEITEM hitem, char *Name_Dir, char *NameFo, int pr)//Вычисления для копирование выбранной папки на диск ПК
{
HTREEITEM ind = TreeView_GetChild(hwndTree, hitem); //Вошли во внутренний уровень дерева
if(ind == NULL)
if(pr == 0) return Error1((Lan+92)->msg); //if(pr == 0) return Error1("В указанной папке нет файлов для копирования.");
else return 0; //Для вложенных пустых папок ничего не делаем
char nName_Dir[512]; //Суммарный путь
lstrcpy(nName_Dir, Name_Dir);
lstrcat(nName_Dir, "\\");
lstrcat(nName_Dir, NameFo);
for(;;) //Просмотр всего дерева от текущей папки
{ TV_ITEM item;
char Msg[100];
item.mask = TVIF_TEXT | TVIF_PARAM;
item.hItem = ind;
item.pszText = Msg;
item.cchTextMax = 100;
if(TreeView_GetItem(hwndTree, &item) == FALSE)
return Error1((Lan+33)->msg); //return Error1("Ошибка при запросе информации об элементе дерева.");
if((aTree + item.lParam)->pf.type == 48 || //Очередное имя это папка
(aTree + item.lParam)->pf.type == 47) //Данное имя это специальная папка
{ if(Calc_Folder_(ind, nName_Dir, (aTree + item.lParam)->NameF, ++pr) < 0) return -1; }//Вычисления для копирование выбранной папки на диск ПК
else //Очередное имя это файл
{ numAllInCl += DWORD(((aTree + item.lParam)->pf.SizeF + sCl_B - 1) / sCl_B); //Суммарное число кластеров во всех копируемых файлах
numAllOutCl += ((aTree + item.lParam)->pf.SizeF + BytesPerClaster - 1) / BytesPerClaster; //Суммарный число выходных кластеров
numAllFi++; //Число копируемых файлах
}
ind = TreeView_GetNextSibling(hwndTree, ind); //Следующая запись на том же уровне дерева
if(ind == NULL) break; //Больше записей данного уровня нет
}
return 0;
示例2: Error1
void pawsConfigEntityLabels::SetDefault()
{
if (!CreatureRBG->SetActive("mouse"))
{
Error1("No widget with such name");
return;
}
if (!ItemRBG->SetActive("mouse"))
{
Error1("No widget with such name");
return;
}
visGuildCheck->SetState(true);
labelColors[ENTITY_DEFAULT] = defLabelColors[ENTITY_DEFAULT];
labelColors[ENTITY_PLAYER] = defLabelColors[ENTITY_PLAYER];
labelColors[ENTITY_DEV] = defLabelColors[ENTITY_DEV];
labelColors[ENTITY_TESTER] = defLabelColors[ENTITY_TESTER];
labelColors[ENTITY_DEAD] = defLabelColors[ENTITY_DEAD];
labelColors[ENTITY_GM1] = defLabelColors[ENTITY_GM1];
labelColors[ENTITY_GM25] = defLabelColors[ENTITY_GM25];
labelColors[ENTITY_NPC] = defLabelColors[ENTITY_NPC];
labelColors[ENTITY_GROUP] = defLabelColors[ENTITY_GROUP];
labelColors[ENTITY_GUILD] = defLabelColors[ENTITY_GUILD];
dirty = true;
}
示例3: Load_Dir
//------------------------------------------------------------------------------
int Load_Dir(void) //Загрузка кластера каталога
{
//Чтение кластера каталога (каталога может и не существовать и, в том числе каталога самого верхнего уровня)
//Обновление каталога (добавление строки нового файла) и в том числе создание нового каталога
DWORD nSector = Start_SecDir1 + (ClStDir - 1) * sClSec; //Номер сектора по номеру кластера
if(ReadClast1_P(nSector, bufDir) < 0) return -1; //Чтение кластера
s_Kat = (One_Str_Cat *)bufDir;
int prPoint = 0; //Признак наличия каталогов с точкой как признак правильности структуры
ns_Dir = 0; //Номер свободной строки каталога
for(; ns_Dir<4*sClSec; ns_Dir++) //По всем возможным записям в одном кластере каталога (В каждом секторе 4 записи)
{ if((s_Kat + ns_Dir)->pf.type == 0) break; //Конец записей каталога
DWORD NamePoint = *((DWORD*)&(s_Kat + ns_Dir)->Name);
if(NamePoint == 0x00002E00) //Это одна точка т.е. кластер текущего каталога
{ if(ns_Dir == 0) prPoint++; continue; }
if(NamePoint == 0x2E002E00) //Это две точки т.е. кластер предыдущего каталога
{ if(ns_Dir == 1) prPoint++; continue; }
WORD NameDel = *((WORD*)&(s_Kat + ns_Dir)->Name);
if(NameDel == 0xE500 && (s_Kat + ns_Dir)->pf.ClSt == 0) break;//Это удаленное имя т.е. свободная строка
}
if(prPoint != 2)
return Error1((Lan+96)->msg); //"Нарушена структура каталога."
if(ns_Dir < 2 || ns_Dir >= 4*sClSec)
return Error1((Lan+181)->msg); //"В каталоге нет места для новой записи."
示例4: Error1
bool pawsConfigAutoexec::PostSetup()
{
// setup the widget. Needed in the xml file are a Checkbox (to enable and disable autoexec)
// and two multiline edit boxes for the general and character commands
autoexec = psengine->GetAutoexec();
if(!autoexec)
{
Error1("Couldn't find Autoexec!");
return false;
}
enabled = dynamic_cast<pawsCheckBox*>(FindWidget("enabled"));
if (!enabled) {
Error1("Could not locate enabled widget!");
return false;
}
generalCommandBox = dynamic_cast<pawsMultilineEditTextBox*>(FindWidget("GeneralCommandBox"));
if (!generalCommandBox) {
Error1("Could not locate GeneralCommandBox widget!");
return false;
}
charCommandBox = dynamic_cast<pawsMultilineEditTextBox*>(FindWidget("CharCommandBox"));
if (!generalCommandBox) {
Error1("Could not locate CharCommandBox widget!");
return false;
}
drawFrame();
return true;
}
示例5: Error1
bool pawsConfigTooltips::PostSetup()
{
EnableTooltips = (pawsCheckBox*)FindWidget("EnableTooltips");
if (!EnableTooltips) {
Error1("Could not locate EnableTooltips widget!");
return false;
}
EnableBgColor = (pawsCheckBox*)FindWidget("EnableBgColor");
if (!EnableBgColor) {
Error1("Could not locate EnableBgColor widget!");
return false;
}
TooltipBgColor = (pawsTextBox*)FindWidget("BgColorFrame");
if (!TooltipBgColor) {
Error1("Could not locate BgColorFrame widget!");
return false;
}
TooltipFontColor = (pawsTextBox*)FindWidget("FontColorFrame");
if (!TooltipFontColor) {
Error1("Could not locate FontColorFrame widget!");
return false;
}
TooltipShadowColor = (pawsTextBox*)FindWidget("ShadowColorFrame");
if (!TooltipShadowColor) {
Error1("Could not locate ShadowColorFrame widget!");
return false;
}
return true;
}
示例6: pvp_region
CombatManager::CombatManager(CacheManager* cachemanager, EntityManager* entitymanager) : pvp_region(NULL)
{
randomgen = psserver->rng;
cacheManager = cachemanager;
entityManager = entitymanager;
calc_damage = psserver->GetMathScriptEngine()->FindScript("Calculate Damage");
calc_decay = psserver->GetMathScriptEngine()->FindScript("Calculate Decay");
if ( !calc_damage )
{
Error1("Calculate Damage Script could not be found. Check the math_scripts DB table.");
}
else if ( !calc_decay )
{
Error1("Calculate Decay Script could not be found. Check the math_scripts DB table.");
}
else
{
targetLocations.Push(PSCHARACTER_SLOT_HELM);
targetLocations.Push(PSCHARACTER_SLOT_TORSO);
targetLocations.Push(PSCHARACTER_SLOT_ARMS);
targetLocations.Push(PSCHARACTER_SLOT_GLOVES);
targetLocations.Push(PSCHARACTER_SLOT_LEGS);
targetLocations.Push(PSCHARACTER_SLOT_BOOTS);
}
staminacombat = psserver->GetMathScriptEngine()->FindScript("StaminaCombat");
Subscribe(&CombatManager::HandleDeathEvent, MSGTYPE_DEATH_EVENT, NO_VALIDATION);
}
示例7: xioparsenetwork_ip4
int xioparsenetwork_ip4(const char *rangename, struct xiorange *range) {
struct hostent *maskaddr;
struct in_addr *netaddr_in = &range->netaddr.ip4.sin_addr;
struct in_addr *netmask_in = &range->netmask.ip4.sin_addr;
char *rangename1; /* a copy of rangename with writing allowed */
char *delimpos; /* absolute address of delimiter */
unsigned int bits; /* netmask bits */
if ((rangename1 = strdup(rangename)) == NULL) {
Error1("strdup(\"%s\"): out of memory", rangename);
return STAT_RETRYLATER;
}
if (delimpos = strchr(rangename1, '/')) {
char *endptr;
bits = strtoul(delimpos+1, &endptr, 10);
if (! ((*(delimpos+1) != '\0') && (*endptr == '\0'))) {
Error1("not a valid netmask in \"%s\"", rangename);
bits = 32; /* most secure selection */
} else if (bits > 32) {
Error1("netmask \"%s\" is too large", rangename);
bits = 32;
}
if (bits <= 0) {
netmask_in->s_addr = 0;
} else {
netmask_in->s_addr = htonl((0xffffffff << (32-bits)));
}
} else if (delimpos = strchr(rangename1, ':')) {
if ((maskaddr = Gethostbyname(delimpos+1)) == NULL) {
/* note: cast is req on AIX: */
Error2("gethostbyname(\"%s\"): %s", delimpos+1,
h_errno == NETDB_INTERNAL ? strerror(errno) :
(char *)hstrerror(h_errno));
return STAT_NORETRY;
}
netmask_in->s_addr = *(uint32_t *)maskaddr->h_addr_list[0];
} else {
Error1("xioparsenetwork_ip4(\"%s\",,): missing netmask delimiter", rangename);
free(rangename1);
return STAT_NORETRY;
}
{
struct hostent *nameaddr;
*delimpos = 0;
if ((nameaddr = Gethostbyname(rangename1)) == NULL) {
/* note: cast is req on AIX: */
Error2("gethostbyname(\"%s\"): %s", rangename1,
h_errno == NETDB_INTERNAL ? strerror(errno) :
(char *)hstrerror(h_errno));
free(rangename1);
return STAT_NORETRY;
}
netaddr_in->s_addr = *(uint32_t *)nameaddr->h_addr_list[0];
}
free(rangename1);
return STAT_OK;
}
示例8: Clear
bool pawsTreeNode::Load(iDocumentNode* node)
{
csRef<iDocumentNodeIterator> xmlChildren, xmlAttrList;
csRef<iDocumentNode> xmlChild, xmlAttr;
csString factory;
pawsWidget* childAsWidget;
pawsTreeNode* childNode;
Clear();
name = node->GetAttributeValue("name");
xmlChildren = node->GetNodes("widget");
while(xmlChildren->HasNext())
{
xmlChild = xmlChildren->Next();
factory = xmlChild->GetAttributeValue("factory");
childAsWidget = PawsManager::GetSingleton().CreateWidget(factory);
if(!childAsWidget)
{
Error2("Could not create node from factory: %s", factory.GetData());
return false;
}
childNode = dynamic_cast<pawsTreeNode*>(childAsWidget);
if(childNode == NULL)
{
Error1("Created node is not pawsTreeNode");
return false;
}
InsertChild(childNode);
if(!childNode->Load(xmlChild))
{
Error1("Node failed to load");
return false;
}
}
attrList.DeleteAll();
xmlAttrList = node->GetNodes("attr");
while(xmlAttrList->HasNext())
{
xmlAttr = xmlAttrList->Next();
SetAttr(xmlAttr->GetAttributeValue("name"), xmlAttr->GetAttributeValue("value"));
}
if(tree != NULL)
tree->NodeChanged();
csString collapsed = node->GetAttributeValue("collapsed");
if(collapsed == "yes")
CollapseAll();
return true;
}
示例9: events
bool GMEventManager::Initialise(void)
{
GMEvent* ongoingGMEvent;
// load any existing gm events from database
Result events(db->Select("SELECT * from gm_events order by id"));
if (events.IsValid())
{
for (unsigned long e=0; e<events.Count(); e++)
{
ongoingGMEvent = new GMEvent;
ongoingGMEvent->id = events[e].GetInt("id");
ongoingGMEvent->status = static_cast<GMEventStatus>(events[e].GetInt("status"));
ongoingGMEvent->gmID = events[e].GetInt("gm_id");
ongoingGMEvent->EndTime = 0;
ongoingGMEvent->eventName = csString(events[e]["name"]);
ongoingGMEvent->eventDescription = csString(events[e]["description"]);
gmEvents.Push(ongoingGMEvent);
// setup next available id
if (ongoingGMEvent->id >= nextEventID)
nextEventID = ongoingGMEvent->id + 1;
}
// load registered players from database
Result registeredPlayers(db->Select("SELECT * from character_events order by event_id"));
if (registeredPlayers.IsValid())
{
PlayerData eventPlayer;
int eventID;
for (unsigned long rp=0; rp<registeredPlayers.Count(); rp++)
{
eventID = registeredPlayers[rp].GetInt("event_id");
eventPlayer.PlayerID = registeredPlayers[rp].GetInt("player_id");
eventPlayer.CanEvaluate = (registeredPlayers[rp]["vote"] == NULL);
if ((ongoingGMEvent = GetGMEventByID(eventID)) != NULL)
ongoingGMEvent->Player.Push(eventPlayer);
else
{
Error1("GMEventManager: gm_events / character_events table mismatch.");
return false; // ermm.. somethings gone wrong with the DB!!!
}
}
}
else
{
Error1("GMEventManager: character_events table is not valid.");
return false;
}
return true;
}
Error1("GMEventManager: gm_events table is not valid.");
return false;
}
示例10: ParseFile
bool pawsConfigTooltips::LoadDefaults()
{
csString fileName;
if( psengine->GetVFS()->Exists(PawsManager::GetSingleton().getToolTipSkinPath()) )
fileName = PawsManager::GetSingleton().getToolTipSkinPath(); // skin.zip
else fileName = CONFIG_TOOLTIPS_FILE_NAME_DEF; // data/options
csRef<iDocument> ToolTipdoc;
csRef<iDocumentNode> ToolTiproot,TooltipsNode;
csString TooltipOption;
ToolTipdoc = ParseFile(PawsManager::GetSingleton().GetObjectRegistry(), fileName);
if (ToolTipdoc == NULL)
{
Error1("Failed to parse file");
return false;
}
ToolTiproot = ToolTipdoc->GetRoot();
if (ToolTiproot == NULL)
{
Error1("File has no XML root");
return false;
}
TooltipsNode = ToolTiproot->GetNode("tooltips");
if (TooltipsNode == NULL)
{
Error1("File has no <tooltips> tag");
return false;
}
else
{
csRef<iDocumentNodeIterator> ToolTipoNodes = TooltipsNode->GetNodes();
while(ToolTipoNodes->HasNext())
{
csRef<iDocumentNode> TooltipOption = ToolTipoNodes->Next();
csString ToolTipnodeName (TooltipOption->GetValue());
if (ToolTipnodeName == "enable_tooltips")
defToolTipEnable = TooltipOption->GetAttributeValueAsBool("value");
if (ToolTipnodeName == "enable_bgcolor")
defToolTipEnableBgColor = TooltipOption->GetAttributeValueAsBool("value");
if (ToolTipnodeName == "bgcolor")
defTooltipsColors[0] = TooltipOption->GetAttributeValueAsInt("value");
if (ToolTipnodeName == "fontcolor")
defTooltipsColors[1] = TooltipOption->GetAttributeValueAsInt("value");
if (ToolTipnodeName == "shadowcolor")
defTooltipsColors[2] = TooltipOption->GetAttributeValueAsInt("value");
}
}
return true;
}
示例11: statdrmsg
void psClientDR::HandleStatsUpdate( MsgEntry* me )
{
psStatDRMessage statdrmsg(me);
GEMClientActor* gemObject = (GEMClientActor*)celclient->FindObject( statdrmsg.entityid );
if (!gemObject)
{
Error2("Stat request failed because CelClient not ready for %s", ShowID(statdrmsg.entityid));
return;
}
// Dirty short cut to allways display 0 HP when dead.
if (!gemObject->IsAlive() && statdrmsg.hp)
{
//printf("clientdr 275 dead");
Error1("Server report HP but object is not alive");
statdrmsg.hp = 0;
statdrmsg.hp_rate = 0;
}
// Check if this client actor was updated
GEMClientActor* mainActor = celclient->GetMainPlayer();
if (mainActor == gemObject)
{
gemObject->GetVitalMgr()->HandleDRData(statdrmsg,"Self");
}
else
{ // Publish Vitals data using EntityID
csString ID;
ID.Append(gemObject->GetEID().Unbox());
gemObject->GetVitalMgr()->HandleDRData(statdrmsg, ID.GetData() );
}
//It is not an else if so Target is always published
if (psengine->GetCharManager()->GetTarget() == gemObject)
gemObject->GetVitalMgr()->HandleDRData(statdrmsg,"Target");
if (mainActor != gemObject && gemObject->IsGroupedWith(celclient->GetMainPlayer()) )
{
if (!groupWindow)
{
// Get the windowMgr
pawsWidget* widget = PawsManager::GetSingleton().FindWidget("GroupWindow");
groupWindow = (pawsGroupWindow*)widget;
if (!groupWindow)
{
Error1("Group Window Was Not Found. Bad Error");
return;
}
}
groupWindow->SetStats(gemObject);
}
}
示例12: ParseFile
bool pawsNpcDialogWindow::LoadSetting()
{
csRef<iDocument> doc;
csRef<iDocumentNode> root,npcDialogNode, npcDialogOptionsNode;
csString option;
doc = ParseFile(psengine->GetObjectRegistry(), CONFIG_NPCDIALOG_FILE_NAME);
if(doc == NULL)
{
//load the default configuration file in case the user one fails (missing or damaged)
doc = ParseFile(psengine->GetObjectRegistry(), CONFIG_NPCDIALOG_FILE_NAME_DEF);
if(doc == NULL)
{
Error2("Failed to parse file %s", CONFIG_NPCDIALOG_FILE_NAME_DEF);
return false;
}
}
root = doc->GetRoot();
if(root == NULL)
{
Error1("npcdialog_def.xml or npcdialog.xml has no XML root");
return false;
}
npcDialogNode = root->GetNode("npcdialog");
if(npcDialogNode == NULL)
{
Error1("npcdialog_def.xml or npcdialog.xml has no <npcdialog> tag");
return false;
}
// Load options for the npc dialog
npcDialogOptionsNode = npcDialogNode->GetNode("npcdialogoptions");
if(npcDialogOptionsNode != NULL)
{
csRef<iDocumentNodeIterator> oNodes = npcDialogOptionsNode->GetNodes();
while(oNodes->HasNext())
{
csRef<iDocumentNode> option = oNodes->Next();
csString nodeName(option->GetValue());
if(nodeName == "usenpcdialog")
{
//showWindow->SetState(!option->GetAttributeValueAsBool("value"));
useBubbles = option->GetAttributeValueAsBool("value");
}
}
}
return true;
}
示例13: FN_A
int FN_A (double *x, double *res)
{
int j;
FillStructs_A (x);
*res = SCALE0 * Error1 (TheEdges[0][I], TheCameraPositions[0], TheLines[I]);
for (j=1; j < m; ++j)
*res += Error1 (TheEdges[j][I], TheCameraPositions[j], TheLines[I]);
return 0;
}
示例14: CS_ASSERT
gemNPC* EntityManager::CloneNPC ( psCharacter *chardata )
{
csVector3 pos;
float yrot = 0.0F;
iSector *sector;
CS_ASSERT( chardata != NULL );
// Adjust Position of npc from owners pos
chardata->GetActor()->GetPosition( pos, yrot, sector );
float deltax = psserver->GetRandom(6)/4 - 1.5;
float deltaz = psserver->GetRandom(6)/4 - 1.5;
PID npcPID(this->CopyNPCFromDatabase( chardata->GetPID(),
pos.x + deltax, pos.y, pos.z + deltaz, // Set position some distance from parent
yrot, sector->QueryObject()->GetName(),
0,NULL, NULL)); // Keep name of parent
if (!npcPID.IsValid())
{
Error1( "Could not clone the master NPC .");
return NULL;
}
// Prepare NPC client to the new npc
psserver->npcmanager->NewNPCNotify(npcPID, chardata->GetPID(), 0 );
// Create npc using new ID
this->CreateNPC( npcPID , false); //Do not update proxList, we will do that later.
gemNPC * npc = GEMSupervisor::GetSingleton().FindNPCEntity( npcPID );
if (npc == NULL)
{
Error1("Could not find GEM and set its location.");
return NULL;
}
db->Command("INSERT INTO npc_knowledge_areas(player_id, area, priority) VALUES (%d, 'Pet %s 1', '1')",
npcPID.Unbox(), npc->GetCharacterData()->GetRaceInfo()->name.GetData() );
psServer::CharacterLoader.SaveCharacterData( npc->GetCharacterData(), npc, false );
psserver->npcmanager->ControlNPC( npc );
// Add npc to all nearby clients
npc->UpdateProxList( true );
return npc;
}
示例15: LoadWidget
void PawsManager::CreateYesNoBox( const char* message, pawsWidget* notify, bool modal )
{
pawsYesNoBox* yesNoBox = (pawsYesNoBox*)FindWidget("YesNoWindow");
if ( !yesNoBox )
{
LoadWidget("yesno.xml");
yesNoBox = (pawsYesNoBox*)FindWidget("YesNoWindow");
if ( !yesNoBox )
{
Error1("Cannot Load YesNo Window");
return;
}
}
yesNoBox->MoveTo( (graphics2D->GetWidth() - yesNoBox->GetActualWidth(512) ) / 2,
(graphics2D->GetHeight() - yesNoBox->GetActualHeight(256))/2 );
yesNoBox->SetText( Translate(message) );
yesNoBox->Show();
if ( modal )
SetModalWidget(yesNoBox);
if ( notify )
yesNoBox->SetNotify(notify);
}