当前位置: 首页>>代码示例>>C++>>正文


C++ AddMember函数代码示例

本文整理汇总了C++中AddMember函数的典型用法代码示例。如果您正苦于以下问题:C++ AddMember函数的具体用法?C++ AddMember怎么用?C++ AddMember使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AddMember函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: strlen

int CBlock::Write( int member_id, const char *member_data, CIcarus* icarus )
{
	CBlockMember *bMember = new CBlockMember;

	bMember->SetID( member_id );
	
	bMember->SetData( member_data, icarus );
	bMember->SetSize( strlen(member_data) + 1 );

	AddMember( bMember );

	return true;
}
开发者ID:Elfmagi,项目名称:OpenJK,代码行数:13,代码来源:BlockStream.cpp

示例2: time

bool Group::Create(ObjectGuid guid, const char* name)
{
    m_leaderGuid = guid;
    m_leaderName = name;
    m_leaderLastOnline = time(nullptr);

    m_groupType  = isBattleGroup() ? GROUPTYPE_RAID : GROUPTYPE_NORMAL;

    if (m_groupType == GROUPTYPE_RAID)
        _initRaidSubGroupsCounter();

    m_lootMethod = GROUP_LOOT;
    m_lootThreshold = ITEM_QUALITY_UNCOMMON;
    m_masterLooterGuid = guid;
    m_currentLooterGuid = guid;                                             // used for round robin looter


    if (!isBattleGroup())
    {
        m_Id = sObjectMgr.GenerateGroupId();

        Player* leader = sObjectMgr.GetPlayer(guid);

        Player::ConvertInstancesToGroup(leader, this, guid);

        // store group in database
        CharacterDatabase.BeginTransaction();
        CharacterDatabase.PExecute("DELETE FROM groups WHERE groupId ='%u'", m_Id);
        CharacterDatabase.PExecute("DELETE FROM group_member WHERE groupId ='%u'", m_Id);

        CharacterDatabase.PExecute("INSERT INTO groups(groupId,leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid) "
                                   "VALUES('%u','%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u')",
                                   m_Id, m_leaderGuid.GetCounter(), m_mainTankGuid.GetCounter(), m_mainAssistantGuid.GetCounter(), uint32(m_lootMethod),
                                   m_masterLooterGuid.GetCounter(), uint32(m_lootThreshold),
                                   m_targetIcons[0].GetRawValue(), m_targetIcons[1].GetRawValue(),
                                   m_targetIcons[2].GetRawValue(), m_targetIcons[3].GetRawValue(),
                                   m_targetIcons[4].GetRawValue(), m_targetIcons[5].GetRawValue(),
                                   m_targetIcons[6].GetRawValue(), m_targetIcons[7].GetRawValue(),
                                   isRaidGroup());
    }

    if (!AddMember(guid, name))
        return false;

    if (!isBattleGroup())
        CharacterDatabase.CommitTransaction();

    _updateLeaderFlag();

    return true;
}
开发者ID:Ghaster,项目名称:mangos-classic,代码行数:51,代码来源:Group.cpp

示例3: sizeof

int CBlock::Write( int member_id, vector_t member_data )
{
	CBlockMember *bMember; 

	bMember = new CBlockMember;

	bMember->SetID( member_id );
	bMember->SetData( member_data );
	bMember->SetSize( sizeof(vector_t) );

	AddMember( bMember );

	return true;
}
开发者ID:DavidZeise,项目名称:OpenJK,代码行数:14,代码来源:BlockStream.cpp

示例4: nsXBLProtoImplMethod

void
nsXBLContentSink::ConstructMethod(const PRUnichar **aAtts)
{
  mMethod = nsnull;

  const PRUnichar* name = nsnull;
  if (FindValue(aAtts, nsGkAtoms::name, &name)) {
    mMethod = new nsXBLProtoImplMethod(name);
  }

  if (mMethod) {
    AddMember(mMethod);
  }
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:14,代码来源:nsXBLContentSink.cpp

示例5: AddMember

bool Party::AddMember(const int aid, const RogueGame &roguegame) {
	//めちゃくちゃ例外的な処理 4番目に無理やり冬(すぐ死ぬ)を入れてる
	if (aid == 23) {
		members[3] = make_shared<MyChara>(aid, actionlog, situation);
	}
	else {
		for (int i = 0; i < maxmember; ++i) {
			if (members[i] == NULL) {
				return AddMember(aid, i, roguegame);
			}
		}
	}
	return false;
}
开发者ID:yumakmc,项目名称:cuigame,代码行数:14,代码来源:RogueGameParty.cpp

示例6: CreateRank

void Guild::create(uint64 lGuid, std::string gname)
{
	Player *pl;
	MemberSlot *newmember;
	std::string rname;

	pl = ObjectAccessor::Instance().FindPlayer(lGuid);
	if(!pl) return;
	
	leaderGuid = lGuid;
	name = gname;
	MOTD = "No message set.";
	
	rname = "Guild Master";
	CreateRank(rname,GR_RIGHT_ALL);
	rname = "Officer";
	CreateRank(rname,GR_RIGHT_ALL);
	rname = "Veteran";
	CreateRank(rname,GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
	rname = "Member";
	CreateRank(rname,GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
	rname = "Initiate";
	CreateRank(rname,GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);

	Log::getSingleton().outDebug("GUILD: creating guild %s to leader:%d", gname.c_str(), leaderGuid);

	
	QueryResult *result = sDatabase.Query( "SELECT MAX(guildId) FROM guilds" );
	if( result )
	{
  		Id = (*result)[0].GetUInt32()+1;
  		delete result;
	}
	else Id = 1;	
	
	if(pl) 
	{
		pl->SetInGuild(Id);
		pl->SetRank( GR_GUILDMASTER	);
	}
	
	newmember = new MemberSlot;
	newmember->guid = leaderGuid;
	newmember->RankId = GR_GUILDMASTER;
	newmember->Pnote = "";
	newmember->OFFnote = "";
	AddMember(newmember);
	SaveGuildToDB();

}
开发者ID:Artea,项目名称:mangos-svn,代码行数:50,代码来源:Guild.cpp

示例7: sizeof

int CBlock::Write( int member_id, vec3_t member_data, CIcarus* icarus )
{
	CBlockMember *bMember; 

	bMember = new CBlockMember;

	bMember->SetID( member_id );
	bMember->SetData( member_data, icarus );
	bMember->SetSize( sizeof(vec3_t) );

	AddMember( bMember );

	return true;
}
开发者ID:DingoOz,项目名称:OpenJK,代码行数:14,代码来源:BlockStream.cpp

示例8: time

bool Guild::Create(Player* leader, std::string gname)
{
    if (sGuildMgr.GetGuildByName(gname))
        { return false; }

    WorldSession* lSession = leader->GetSession();
    if (!lSession)
        { return false; }

    m_LeaderGuid = leader->GetObjectGuid();
    m_Name = gname;
    GINFO.clear();
    MOTD = "No message set.";
    m_Id = sObjectMgr.GenerateGuildId();

    // creating data
    time_t now = time(0);
    tm local = *(localtime(&now));                          // dereference and assign
    m_CreatedDay   = local.tm_mday;
    m_CreatedMonth = local.tm_mon + 1;
    m_CreatedYear  = local.tm_year + 1900;

    DEBUG_LOG("GUILD: creating guild %s to leader: %s", gname.c_str(), m_LeaderGuid.GetString().c_str());

    // gname already assigned to Guild::name, use it to encode string for DB
    CharacterDatabase.escape_string(gname);

    std::string dbGINFO = GINFO;
    std::string dbMOTD = MOTD;
    CharacterDatabase.escape_string(dbGINFO);
    CharacterDatabase.escape_string(dbMOTD);

    CharacterDatabase.BeginTransaction();
    // CharacterDatabase.PExecute("DELETE FROM guild WHERE guildid='%u'", Id); - MAX(guildid)+1 not exist
    CharacterDatabase.PExecute("DELETE FROM guild_member WHERE guildid='%u'", m_Id);
    CharacterDatabase.PExecute("INSERT INTO guild (guildid,name,leaderguid,info,motd,createdate,EmblemStyle,EmblemColor,BorderStyle,BorderColor,BackgroundColor) "
                               "VALUES('%u','%s','%u', '%s', '%s','" UI64FMTD "','%u','%u','%u','%u','%u')",
                               m_Id, gname.c_str(), m_LeaderGuid.GetCounter(), dbGINFO.c_str(), dbMOTD.c_str(), uint64(now), m_EmblemStyle, m_EmblemColor, m_BorderStyle, m_BorderColor, m_BackgroundColor);
    CharacterDatabase.CommitTransaction();

    CreateDefaultGuildRanks(lSession->GetSessionDbLocaleIndex());

    // Used by Eluna
#ifdef ENABLE_ELUNA
    sEluna->OnCreate(this, leader, gname.c_str());
#endif /* ENABLE_ELUNA */

    return AddMember(m_LeaderGuid, (uint32)GR_GUILDMASTER);
}
开发者ID:billy1arm,项目名称:MangosMC,代码行数:49,代码来源:Guild.cpp

示例9: PIntRange

/* PIntRange: parse an integer range and add its members to s */
static void PIntRange(IntSet s)
{
   int i,i1,i2;

   i1 = GetInt(1,s.nMembers);
   SkipSpaces();
   if (ch == '-') {
      ReadCh();
      i2 = GetInt(1,s.nMembers);
   }
   else
      i2=i1;
   for (i=i1; i<=i2; i++)
      AddMember(s,i);
}
开发者ID:deardaniel,项目名称:PizzaTest,代码行数:16,代码来源:HUtil.c

示例10: GUID_LOPART

bool ArenaTeam::Create(uint32 captainGuid, ArenaType type, std::string teamName, uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor, uint8 borderStyle, uint32 borderColor)
{
    // Check if arena type is valid
    if (!IsArenaTypeValid(type))
        return false;

    // Check if captain is present
    if (!sObjectMgr->GetPlayer(captainGuid))
        return false;

    // Check if arena team name is already taken
    if (sArenaTeamMgr->GetArenaTeamByName(TeamName))
        return false;


    // Generate new arena team id
    TeamId = sArenaTeamMgr->GenerateArenaTeamId();

    // Assign member variables
    CaptainGuid = captainGuid;
    Type = type;
    TeamName = teamName;
    BackgroundColor = backgroundColor;
    EmblemStyle = emblemStyle;
    EmblemColor = emblemColor;
    BorderStyle = borderStyle;
    BorderColor = borderColor;

    // Save arena team to db
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_ARENA_TEAM);
    stmt->setUInt32(0, TeamId);
    stmt->setString(1, TeamName);
    stmt->setUInt32(2, GUID_LOPART(CaptainGuid));
    stmt->setUInt8(3, Type);
    stmt->setUInt16(4, Stats.Rating);
    stmt->setUInt32(5, BackgroundColor);
    stmt->setUInt8(6, EmblemStyle);
    stmt->setUInt32(7, EmblemColor);
    stmt->setUInt8(8, BorderStyle);
    stmt->setUInt32(9, BorderColor);
    CharacterDatabase.Execute(stmt);

    // Add captain as member
    AddMember(CaptainGuid);

    sLog->outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), GUID_LOPART(CaptainGuid));
    return true;
}
开发者ID:sk3tche,项目名称:TrinityCore,代码行数:48,代码来源:ArenaTeam.cpp

示例11: assert

JSONValue JSONValue::CreateChild(const String& name, JSONValueType valueType)
{
    assert(IsObject());
    if (!IsObject())
        return JSONValue::EMPTY;

    Value jsonValue;
    if (valueType == JSON_OBJECT)
        jsonValue.SetObject();
    else if (valueType == JSON_ARRAY)
        jsonValue.SetArray();

    AddMember(name, jsonValue);

    return GetChild(name, valueType);
}
开发者ID:Boshin,项目名称:Urho3D,代码行数:16,代码来源:JSONValue.cpp

示例12: GUID_LOPART

bool ArenaTeam::Create(uint64 captainGuid, uint8 type, std::string const& arenaTeamName,
                       uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor,
                       uint8 borderStyle, uint32 borderColor)
{
    // Check if captain is present
    if (!ObjectAccessor::FindPlayer(captainGuid))
        return false;

    // Check if arena team name is already taken
    if (sArenaTeamMgr->GetArenaTeamByName(arenaTeamName))
        return false;

    // Generate new arena team id
    TeamId = sArenaTeamMgr->GenerateArenaTeamId();

    // Assign member variables
    CaptainGuid = captainGuid;
    Type = type;
    TeamName = arenaTeamName;
    BackgroundColor = backgroundColor;
    EmblemStyle = emblemStyle;
    EmblemColor = emblemColor;
    BorderStyle = borderStyle;
    BorderColor = borderColor;
    uint32 captainLowGuid = GUID_LOPART(captainGuid);

    // Save arena team to db
    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM);
    stmt->setUInt32(0, TeamId);
    stmt->setString(1, TeamName);
    stmt->setUInt32(2, captainLowGuid);
    stmt->setUInt8(3, Type);
    stmt->setUInt16(4, Stats.Rating);
    stmt->setUInt32(5, BackgroundColor);
    stmt->setUInt8(6, EmblemStyle);
    stmt->setUInt32(7, EmblemColor);
    stmt->setUInt8(8, BorderStyle);
    stmt->setUInt32(9, BorderColor);
    CharacterDatabase.Execute(stmt);

    // Add captain as member
    AddMember(CaptainGuid);

    TC_LOG_DEBUG("bg.arena", "New ArenaTeam created [Id: %u, Name: %s] [Type: %u] [Captain low GUID: %u]", GetId(), GetName().c_str(), GetType(), captainLowGuid);
    return true;
}
开发者ID:reon,项目名称:5.4.1,代码行数:46,代码来源:ArenaTeam.cpp

示例13: DSP_DEBUG_BREAK_IF

CParty::CParty(CBattleEntity* PEntity)
{
	DSP_DEBUG_BREAK_IF(PEntity == NULL);
	DSP_DEBUG_BREAK_IF(PEntity->PParty != NULL);

    m_PartyID   = PEntity->id;
    m_PartyType = PEntity->objtype == TYPE_PC ? PARTY_PCS : PARTY_MOBS;

    m_PLeader       = NULL;
	m_PAlliance		= NULL;
	m_PSyncTarget 	= NULL;
	m_PQuaterMaster = NULL;


	AddMember(PEntity);
	SetLeader(PEntity);
}
开发者ID:ZeDingo,项目名称:darkstar,代码行数:17,代码来源:party.cpp

示例14: DSP_DEBUG_BREAK_IF

CParty::CParty(CBattleEntity* PEntity)
{
    DSP_DEBUG_BREAK_IF(PEntity == nullptr);
    DSP_DEBUG_BREAK_IF(PEntity->PParty != nullptr);

    m_PartyID = PEntity->id;
    m_PartyType = PEntity->objtype == TYPE_PC ? PARTY_PCS : PARTY_MOBS;
    m_PartyNumber = 0;

    m_PLeader = nullptr;
    m_PAlliance = nullptr;
    m_PSyncTarget = nullptr;
    m_PQuaterMaster = nullptr;

    m_EffectsChanged = false;
    AddMember(PEntity);
    SetLeader((char*)PEntity->name.c_str());
}
开发者ID:DerpStarProject,项目名称:darkstar,代码行数:18,代码来源:party.cpp

示例15: DSP_DEBUG_BREAK_IF

CParty::CParty(CBattleEntity* PEntity, Sql_t* sql)
{
	DSP_DEBUG_BREAK_IF(PEntity == NULL);
	DSP_DEBUG_BREAK_IF(PEntity->PParty != NULL);

    m_PartyID   = PEntity->id;
    m_PartyType = PEntity->objtype == TYPE_PC ? PARTY_PCS : PARTY_MOBS;
    m_PartyNumber = 0;

    m_PLeader       = NULL;
	m_PAlliance		= NULL;
	m_PSyncTarget 	= NULL;
	m_PQuaterMaster = NULL;


	AddMember(PEntity, sql);
	SetLeader((int8*)PEntity->name.c_str());
}
开发者ID:ERA-Found-It,项目名称:darkstar,代码行数:18,代码来源:party.cpp


注:本文中的AddMember函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。