Exemplo n.º 1
0
void System::threadInfo(cTerm & t,int argc,char *argv[])
{
	cyg_handle_t thread = 0;
	cyg_uint16 id;
	cyg_thread_info info;
	bool flag = 1;

	t<<t.format(UNDERLINE("% 2s% 15s% 6s  % 10s  % 10s% 5s\n"),"#", "Name" ,"Prior","S_Size","Used","Perc");

	while ( cyg_thread_get_next(&thread,&id) )
	{

		if ( !cyg_thread_get_info(thread,id,&info) )
		{
			break;
		}

		if(flag)
			t<<t.format(CYAN("% 2d% 15s% 6d  0x%08X  0x%08X% 5d\n"),info.id, info.name, (int)info.set_pri, info.stack_size, info.stack_used, (int)((info.stack_used*100)/info.stack_size));
		else
			t<<t.format(CYAN_B("% 2d% 15s% 6d  0x%08X  0x%08X% 5d\n"),info.id, info.name, (int)info.set_pri, info.stack_size, info.stack_used, (int)((info.stack_used*100)/info.stack_size));

		flag = !flag;

	}

	return;
}
Exemplo n.º 2
0
void xmrig::CommonConfig::printAPI()
{
#   ifndef XMRIG_NO_API
    if (apiPort() == 0) {
        return;
    }

    Log::i()->text(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN("%s:") CYAN_BOLD("%d")
                              : " * %-13s%s:%d",
                   "API BIND", isApiIPv6() ? "[::]" : "0.0.0.0", apiPort());
#   endif
}
Exemplo n.º 3
0
static void print_tokens(const struct token *const tokens,
    const size_t ntokens, const int error)
{
    for (size_t i = 0, alternate = 0; i < ntokens; ++i) {
        const struct token token = tokens[i];

        if (token.tk == TK_FBEG || token.tk == TK_FEND) {
            continue;
        }

        if (token.tk != TK_WSPC && token.tk != TK_LCOM && token.tk != TK_BCOM) {
            alternate++;
        }

        const int len = token.end - token.beg;

        if (i == ntokens - 1 && error == LEX_UNKNOWN_TOKEN) {
            printf(RED("%.*s") CYAN("< Unknown token\n"), len ?: 1, token.beg);
        } else if (token.tk == TK_LCOM || token.tk == TK_BCOM) {
Exemplo n.º 4
0
void am_error(const char *pretty_func, const char *_file,
              int                line, const char *_format, ...)
{
  init();
  if (AM_UNLIKELY(AM_LOG_LEVEL_ERROR <= logLevel)) {
    char text[2*1024]   = {0};
    char module[256]    = {0};
    char func[256]      = {0};
    char file[256]      = {0};
    char format[2*1024] = {0};
    va_list vlist;

    function_name(func, sizeof(func), pretty_func);
    class_name(module, sizeof(module), pretty_func);
    file_name(file, sizeof(file), _file);
    snprintf(format, sizeof(format), "%s", _format);
    if (format[strlen(format) - 1] == '\n') {
      //Eat trailing \n, \n will be added automatically!
      format[strlen(format) - 1] = '\0';
    }
    if (logTarget == AM_LOG_TARGET_SYSLOG) {
      sprintf(text, "[%6s][%s:%d: %s]: %s",
              "ERROR", file, line, func, format);
    } else if (logTarget == AM_LOG_TARGET_FILE) {
      sprintf(text, "[%20s][%6s][%s:%d: %s]: %s",
              module, "ERROR", file, line, func, format);
    } else {
      sprintf(text, "["B_GREEN("%20s")"]["B_RED("%6s")"]"\
              CYAN("[%s:%d: %s]: ")RED("%s"),
              module, "ERROR", file, line, func, format);
    }
    va_start(vlist, _format);
    am_level_logv(module, AM_LOG_LEVEL_ERROR, text, vlist);
    va_end(vlist);
  }
}
Exemplo n.º 5
0
//------------------------------------------------------------------------------
// ゲームの初期化
//------------------------------------------------------------------------------
// 引数
//  なし
// 戻り値
//  なし
//------------------------------------------------------------------------------
void CGame::Init(void)
{
	gamePhase = PHASE_3;
	gamePhaseCnt = 0;
	gameEndCount = 0;


	CSoundAL::Play(CSoundAL::BGM_GAME);
	//地形生成
	Ground = nullptr;
	Ground = CMeshGround::Create(VECTOR3(0.0f,0.0f,0.0f),VECTOR2(FIELD_PANEL_SIZE,FIELD_PANEL_SIZE),VECTOR2(0,0),1.5f);
	Ground->SetTex(CTexture::Texture(TEX_FIELD));

	// 空生成
	Sky = nullptr;
	Sky = CMeshSphere::Create(VECTOR3(0.0f,0.0f,0.0f),VECTOR2(16.0f,8.0f),RADIUS_SKY);
	Sky->SetTex(CTexture::Texture(TEX_SKY));

	// 境界線生成
	CylinderArea = nullptr;
	CylinderArea = CBattleAreaCylinder::Create(VECTOR3(0.0f,0.0f,0.0f),HEIGHT_WALL,VECTOR2(64.0f,1.0f),RADIUS_AREA_BATTLE,VECTOR2(1,-0.5f));
	CylinderArea->SetTex(CTexture::Texture(TEX_WALL));
	CylinderArea->SetAlpha(0.5f);

	Player = new CPlayer*[PLAYER_MAX];
	// プレイヤー生成
	for (int i = 0; i < PLAYER_MAX; i++)
	{
		if (i % 2 == 1)
			Player[i] = CPlayer::Create(CModel::RINCHAN,PLAYER_POSITION_LIST[i],i);
		else
			Player[i] = CPlayer::Create(CModel::YOUJO,PLAYER_POSITION_LIST[i],i);

		Player[i]->SetTex(CTexture::Texture(TEX_YOUJO_RED + i));
  Player[i]->SetDestRot(PLAYER_ROTATION_LIST[i]);
  Player[i]->SetRot(PLAYER_ROTATION_LIST[i]);
		Player[i]->setBarrelTex(TEX_YOUJO_RED + i);

		if (i == CManager::netData.charNum)
		{
			Player[i]->SetPlayerFlag(true);
			Player[i]->CreateBallistic();
		}
	}
		//プレイヤーカメラ生成
	CPlayerCamera::Create(Player[CManager::netData.charNum],35.0f);

	// 【テスト】各プレイヤーの色をセット
	for(int i = 0; i < PLAYER_MAX; i++)
	{
		switch(i)
		{
			// 赤
			case 0:
				Player[i]->SetPlayerColor(RED(0.5f));
				break;

			// 青
			case 1:
				Player[i]->SetPlayerColor(BLUE(0.5f));
				break;

			// 水
			case 2:
				Player[i]->SetPlayerColor(CYAN(0.5f));
				break;

			// 橙
			case 3:
				Player[i]->SetPlayerColor(COLOR(1.0f, 0.7f, 0.0f, 0.5f));
				break;
		
			// 白
			case 4:
				Player[i]->SetPlayerColor(WHITE(0.5f));
				break;

			// P
			case 5:
				Player[i]->SetPlayerColor(YELLOW(0.5f));
				break;

			default:
				break;
		}
	}

	// プレイヤーの入力を止める
	for (int i = 0; i < PLAYER_MAX; i++){
		Player[i]->SetInputFlag(false);
	}

	// UI初期化
	UI = new CUI;
	UI->Init();
	UI->setMyID(CManager::netData.charNum);
	UI->SetPlayer(Player);
	UI->MiniMap()->SetFieldSize(VECTOR3(RADIUS_AREA_BATTLE*2.25f,0,RADIUS_AREA_BATTLE*2.25f));

	// 岩の生成
	ppRock_ = new CModel*[MAX_ROCK];

	for (int cntRock = 0; cntRock < MAX_ROCK; ++cntRock)
	{
		ppRock_[cntRock] = CModel::Create(CModel::ROCK,ROCK_POSITION_LIST[cntRock]);
		ppRock_[cntRock]->SetRot(ROCK_ROTATION_LIST[cntRock]);
		ppRock_[cntRock]->SetScl(1,1,1);
		ppRock_[cntRock]->SetTex(CTexture::Texture(TEX_ROCK));
		PushBackObjectByField(ppRock_[cntRock], 10.0f);
	}

	// 影生成
	Shadow = new CShadow*[2 * PLAYER_MAX];
	for (int cntShadow = 0; cntShadow < 2 * PLAYER_MAX; ++cntShadow)
	{
		Shadow[cntShadow] = nullptr;
		Shadow[cntShadow] = CShadow::Create(VECTOR3(0.0f, 0.0f, 0.0f), VECTOR2(1.0f, 1.0f));
		if (cntShadow < PLAYER_MAX)
		{
			Shadow[cntShadow]->SetScl(30, 30, 30);
		}
		else
		{
			Shadow[cntShadow]->SetScl(20, 20, 20);
		}
		Shadow[cntShadow]->SetTex(CTexture::Texture(TEX_SHADOW));
	}

	CManager::gameStartFlag = true;

	CManager::sendGameStart();
}
Exemplo n.º 6
0
static void print_api(xmrig::Controller *controller)
{
    const int port = controller->config()->apiPort();
    if (port == 0) {
        return;
    }

    Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-12s") CYAN("%s:") CYAN_BOLD("%d")
                                                    : " * %-12s%s:%d",
                   "API BIND", controller->config()->isApiIPv6() ? "[::]" : "0.0.0.0", port);
}
Exemplo n.º 7
0
static void print_bind(xmrig::Controller *controller)
{
    const std::vector<Addr> &addrs = controller->config()->addrs();

    for (size_t i = 0; i < addrs.size(); ++i) {
        Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("BIND #%-6d") CYAN("%s%s%s:") CYAN_BOLD("%d")
                                                        : " * BIND #%-6d%s%s%s:%d",
                       i + 1,
                       addrs[i].isIPv6() ? "[" : "",
                       addrs[i].ip(),
                       addrs[i].isIPv6() ? "]" : "",
                       addrs[i].port());
    }
}