这篇教程C++ sys_err函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中sys_err函数的典型用法代码示例。如果您正苦于以下问题:C++ sys_err函数的具体用法?C++ sys_err怎么用?C++ sys_err使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了sys_err函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: sys_errbool CItem::AddToGround(long lMapIndex, const PIXEL_POSITION & pos, bool skipOwnerCheck){ if (0 == lMapIndex) { sys_err("wrong map index argument: %d", lMapIndex); return false; } if (GetSectree()) { sys_err("sectree already assigned"); return false; } if (!skipOwnerCheck && m_pOwner) { sys_err("owner pointer not null"); return false; } LPSECTREE tree = SECTREE_MANAGER::instance().Get(lMapIndex, pos.x, pos.y); if (!tree) { sys_err("cannot find sectree by %dx%d", pos.x, pos.y); return false; } //tree->Touch(); SetWindow(GROUND); SetXYZ(pos.x, pos.y, pos.z); tree->InsertEntity(this); UpdateSectree(); Save(); return true;}
开发者ID:ronniwe,项目名称:Varios,代码行数:37,
示例2: sys_logvoid CWarMap::OnKill(LPCHARACTER killer, LPCHARACTER ch){ if (m_bEnded) return; DWORD dwKillerGuild = 0; DWORD dwDeadGuild = 0; if (killer->GetGuild()) dwKillerGuild = killer->GetGuild()->GetID(); if (ch->GetGuild()) dwDeadGuild = ch->GetGuild()->GetID(); BYTE idx; sys_log(0, "WarMap::OnKill %u %u", dwKillerGuild, dwDeadGuild); if (!GetTeamIndex(dwKillerGuild, idx)) return; if (!GetTeamIndex(dwDeadGuild, idx)) return; switch (m_kMapInfo.bType) { case WAR_MAP_TYPE_NORMAL: SendGuildWarScore(dwKillerGuild, dwDeadGuild, 1, ch->GetLevel()); break; case WAR_MAP_TYPE_FLAG: { CAffect * pkAff = ch->FindAffect(AFFECT_WAR_FLAG); if (pkAff) { if (GetTeamIndex(pkAff->lApplyValue, idx)) AddFlag(idx, ch->GetX(), ch->GetY()); ch->RemoveAffect(AFFECT_WAR_FLAG); } } break; default: sys_err("unknown war map type %u index %d", m_kMapInfo.bType, m_kMapInfo.lMapIndex); break; }}
开发者ID:adi97ida,项目名称:Server,代码行数:49,
示例3: mainint main(int argc, char *argv[]) { int i, status; unsigned int n; char *cmd; char **args; char *envp[2]; int n_args = argc-2; char ncopia[17]; int **fds; char buffer[1024]; size_t len; if (argc < 3) err("usage: lancian n cmd arg1 arg2 ..."); envp[0] = (char *)ncopia; envp[1] = NULL; n = atoi(argv[1]); args = malloc((n_args+1)*sizeof(char *)); cmd = args[0] = argv[2]; args[n_args] = NULL; for (i = 1; i < n_args; ++i) args[i] = argv[i+2]; fds = malloc(n*sizeof(int *)); for (i = 0; i < n; ++i) { fds[i] = malloc(2*sizeof(int)); pipe(fds[i]); if (fork() == 0) { close(fds[i][0]); dup2(fds[i][1], 1); close(fds[i][1]); sprintf(ncopia, "NCOPIA=%d", i); if (execvpe(cmd, args, envp) == -1) sys_err("execvpe"); } } for (i = 0; i < n; ++i) { close(fds[i][1]); while ((len = read(fds[i][0], buffer, sizeof(buffer))) != 0) write(1, buffer, len); } printf("lancian: fine/n"); exit(0);}
开发者ID:micmn,项目名称:so-esami-lab,代码行数:49,
示例4: strlcpyLPDESC DESC_MANAGER::AcceptDesc(LPFDWATCH fdw, socket_t s){ socket_t desc; LPDESC newd; static struct sockaddr_in peer; static char host[MAX_HOST_LENGTH + 1]; if ((desc = socket_accept(s, &peer)) == -1) return NULL; strlcpy(host, inet_ntoa(peer.sin_addr), sizeof(host)); if (g_bAuthServer) { if (IsBanIP(peer.sin_addr)) { sys_log(0, "connection from %s was banned.", host); socket_close(desc); return NULL; } } if (!IsValidIP(admin_ip, host)) // admin_ip C++ sys_errmsg函数代码示例 C++ sys_env_set_status函数代码示例
|