• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ party_check_exp_share函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: mapif_parse_PartyChangeMap

// パーティマップ更新要求
static void mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id, const char *map, unsigned char online, unsigned short lv)
{
	const struct party *p1 = partydb_load_num(party_id);
	struct party p2;
	int i;

	if(p1 == NULL)
		return;

	memcpy(&p2,p1,sizeof(struct party));
	for(i=0;i<MAX_PARTY;i++){
		if(p2.member[i].account_id == account_id && p2.member[i].char_id == char_id) {
			memcpy(p2.member[i].map,map,16);
			p2.member[i].map[15] = '\0';	// force \0 terminal
			p2.member[i].online  = online;
			p2.member[i].lv      = lv;
			mapif_party_membermoved(party_id, &p2.member[i]);

			if( p2.exp>0 && !party_check_exp_share(&p2,0) ){
				p2.exp=0;
				mapif_party_optionchanged(fd,&p2,0,0);
			}
			break;
		}
	}
	partydb_save(&p2);

	return;
}
开发者ID:AurigaProject,项目名称:root,代码行数:30,代码来源:int_party.c


示例2: int_party_check_lv

//Updates party's level range and unsets even share if broken.
static int int_party_check_lv (struct party_data *p)
{
	int i;
	unsigned int lv;
	p->min_lv = UINT_MAX;
	p->max_lv = 0;

	for (i = 0; i < MAX_PARTY; i++)
	{
		if (!p->party.member[i].online)
			continue;

		lv = p->party.member[i].lv;

		if (lv < p->min_lv) p->min_lv = lv;

		if (lv > p->max_lv) p->max_lv = lv;
	}

	if (p->party.exp && !party_check_exp_share (p))
	{
		p->party.exp = 0;
		mapif_party_optionchanged (0, &p->party, 0, 0);
		return 0;
	}

	return 1;
}
开发者ID:Zellukas,项目名称:Radices,代码行数:29,代码来源:int_party.c


示例3: mapif_parse_PartyChangeMap

// パーティマップ更新要求
static
void mapif_parse_PartyChangeMap(int fd, int party_id, int account_id,
        MapName map, int online, int lv)
{
    struct party *p = party_db.search(party_id);
    if (p == NULL)
        return;

    for (int i = 0; i < MAX_PARTY; i++)
    {
        if (p->member[i].account_id != account_id)
            continue;
        int flag = 0;

        p->member[i].map = map;
        p->member[i].online = online;
        p->member[i].lv = lv;
        mapif_party_membermoved(p, i);

        if (p->exp > 0 && !party_check_exp_share(p))
        {
            p->exp = 0;
            flag = 1;
        }
        if (flag)
            mapif_party_optionchanged(fd, p, 0, 0);
        return;
    }
}
开发者ID:cinderweb,项目名称:tmwa,代码行数:30,代码来源:int_party.cpp


示例4: mapif_parse_PartyChangeMap

//-----------------------
// A member change of map
//-----------------------
void mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, char *map, unsigned char online, int lv) { // online: 0: offline, 1:online
	struct party *p;
	int i;

	p = numdb_search(party_db, (CPU_INT)party_id);
	if (p == NULL)
		return;

	for(i = 0; i < MAX_PARTY; i++) {
		if (p->member[i].account_id == account_id) { // same account can have more than character in same party. we must check name here too!
			memset(p->member[i].map, 0, sizeof(p->member[i].map));
			strncpy(p->member[i].map, map, 16); // 17 - NULL
			p->member[i].online = online; // online: 0: offline, 1:online
			p->member[i].lv = lv;
			mapif_party_membermoved(p, i);

			if (p->exp > 0 && !party_check_exp_share(p)) {
				p->exp = 0;
				mapif_party_optionchanged(fd, p, 0, 0);
			}
			break;
		}
	}

	return;
}
开发者ID:OmarAcero,项目名称:freya,代码行数:29,代码来源:int_party.c


示例5: mapif_parse_PartyAddMember

//---------------------------
// Adding a member in a party
//---------------------------
void mapif_parse_PartyAddMember(int fd, int party_id, int account_id, char *nick, char *map, int lv) {
	struct party *p;
	int i;

	p = numdb_search(party_db, (CPU_INT)party_id);
	if (p == NULL) {
		mapif_party_memberadded(fd, party_id, account_id, 1);
		return;
	}

	for(i = 0; i < MAX_PARTY; i++) {
		if (p->member[i].account_id == 0) { // must we check if an other character of same account is in the party?
			p->member[i].account_id = account_id;
			memset(p->member[i].name, 0, sizeof(p->member[i].name));
			strncpy(p->member[i].name, nick, 24);
			memset(p->member[i].map, 0, sizeof(p->member[i].map));
			strncpy(p->member[i].map, map, 16); // 17 - NULL
			p->member[i].leader = 0;
			p->member[i].online = 1;
			p->member[i].lv = lv;
			mapif_party_memberadded(fd, party_id, account_id, 0);
			mapif_party_info(-1, p);

			if (p->exp > 0 && !party_check_exp_share(p)) {
				p->exp = 0;
				mapif_party_optionchanged(fd, p, 0, 0);
			}
			return;
		}
	}
	mapif_party_memberadded(fd, party_id, account_id, 1);

	return;
}
开发者ID:OmarAcero,项目名称:freya,代码行数:37,代码来源:int_party.c


示例6: mapif_parse_PartyChangeOption

// パーティー設定変更要求
int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int item)
{
	struct party *p;
	int flag=0;

	p = party_pt;
	if(p==NULL){
		ShowFatalError("int_party: out of memory !\n");
		return 0;
	}

	inter_party_fromsql(party_id, p);

	if(p->party_id <= 0){
		return 0;
	}

	p->exp=exp;
	if( exp>0 && !party_check_exp_share(p) ){
		flag|=0x01;
		p->exp=0;
	}

	p->item=item;

	mapif_party_optionchanged(fd,p,account_id,flag);
	inter_party_tosql(party_id, p);
	return 0;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:30,代码来源:int_party.c


示例7: mapif_parse_PartyChangeMap

//-----------------------
// A member change of map
//-----------------------
void mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, char *map, unsigned char online, int lv) { // online: 0: offline, 1:online
	int i;

	inter_party_fromsql(party_id); // fill party_tmp with informations of the party (or set all values to 0)

	if (party_tmp.party_id <= 0) // party doesn't exist
		return;

	for(i = 0; i < MAX_PARTY; i++) {
		if (party_tmp.member[i].account_id == account_id) { // same account can have more than character in same party. we must check name here too!
			memset(party_tmp.member[i].map, 0, sizeof(party_tmp.member[i].map));
			strncpy(party_tmp.member[i].map, map, 16); // 17 - NULL
			party_tmp.member[i].online = online; // online: 0: offline, 1:online
			party_tmp.member[i].lv = lv;
			mapif_party_membermoved(&party_tmp, i);

			if (party_tmp.exp > 0 && !party_check_exp_share(&party_tmp)) {
				party_tmp.exp = 0;
				mapif_party_optionchanged(fd, &party_tmp, 0, 0);
			}
			break;
		}
	}
	inter_party_tosql(party_id, &party_tmp);

	return;
}
开发者ID:MagicalTux,项目名称:nezumi,代码行数:30,代码来源:int_party.c


示例8: mapif_parse_PartyChangeMap

// パーティマップ更新要求
int mapif_parse_PartyChangeMap(int fd,int party_id,int account_id,char *map,int online,int lv)
{
	struct party *p;
	int i;
	p=numdb_search(party_db,party_id);
	if(p==NULL){
		return 0;
	}
	for(i=0;i<MAX_PARTY;i++){
		if(p->member[i].account_id==account_id){
			int flag=0;
			
			memcpy(p->member[i].map,map,16);
			p->member[i].online=online;
			p->member[i].lv=lv;
			mapif_party_membermoved(p,i);

			if( p->exp>0 && !party_check_exp_share(p) ){
				p->exp=0;
				flag=1;
			}
			if(flag)
				mapif_party_optionchanged(fd,p,0,0);
			break;
		}
	}
	if(online==0)	// 誰かがログアウトするごとにセーブ
		inter_party_save();
	return 0;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:31,代码来源:int_party.c


示例9: mapif_parse_PartyAddMember

// パーティ追加要求
int mapif_parse_PartyAddMember(int fd,int party_id,int account_id,char *nick,char *map,int lv)
{
	struct party *p;
	int i;
	p=numdb_search(party_db,party_id);
	if(p==NULL){
		mapif_party_memberadded(fd,party_id,account_id,1);
		return 0;
	}
	
	for(i=0;i<MAX_PARTY;i++){
		if(p->member[i].account_id==0){
			int flag=0;
			
			p->member[i].account_id=account_id;
			memcpy(p->member[i].name,nick,24);
			memcpy(p->member[i].map,map,16);
			p->member[i].leader=0;
			p->member[i].online=1;
			p->member[i].lv=lv;
			mapif_party_memberadded(fd,party_id,account_id,0);
			mapif_party_info(-1,p);

			if( p->exp>0 && !party_check_exp_share(p) ){
				p->exp=0;
				flag=0x01;
			}
			if(flag)
				mapif_party_optionchanged(fd,p,0,0);
			return 0;
		}
	}
	mapif_party_memberadded(fd,party_id,account_id,1);
	return 0;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:36,代码来源:int_party.c


示例10: int_party_calc_state

//Calculates the state of a party.
static void int_party_calc_state (struct party_data *p)
{
	int i;
	unsigned int lv;
	p->min_lv = UINT_MAX;
	p->max_lv = 0;
	p->party.count =
		p->size =
			p->family = 0;

	//Check party size
	for (i = 0; i < MAX_PARTY; i++)
	{
		if (!p->party.member[i].lv) continue;

		p->size++;

		if (p->party.member[i].online)
			p->party.count++;
	}

	if (p->size == 3)
	{
		//Check Family State.
		p->family = char_family (
						p->party.member[0].char_id,
						p->party.member[1].char_id,
						p->party.member[2].char_id
					);
	}

	//max/min levels.
	for (i = 0; i < MAX_PARTY; i++)
	{
		lv = p->party.member[i].lv;

		if (!lv) continue;

		if (p->party.member[i].online &&
				//On families, the kid is not counted towards exp share rules.
				p->party.member[i].char_id != p->family)
		{
			if (lv < p->min_lv) p->min_lv = lv;

			if (p->max_lv < lv) p->max_lv = lv;
		}
	}

	if (p->party.exp && !party_check_exp_share (p))
	{
		p->party.exp = 0; //Set off even share.
		mapif_party_optionchanged (0, &p->party, 0, 0);
	}

	return;
}
开发者ID:Zellukas,项目名称:Radices,代码行数:57,代码来源:int_party.c


示例11: int_party_calc_state

//Calculates the state of a party.
static void int_party_calc_state(struct party_data *p)
{
	int i;
	unsigned int lv;
	p->min_lv = UINT_MAX;
	p->max_lv = 0;
	p->party.count =
	p->size =
	p->family = 0;

	//Check party size
	for(i=0;i<MAX_PARTY;i++){
		if (!p->party.member[i].lv) continue;
		p->size++;
		if(p->party.member[i].online)
			p->party.count++;
	}
	if( p->size == 2 && ( char_child(p->party.member[0].char_id,p->party.member[1].char_id) || char_child(p->party.member[1].char_id,p->party.member[0].char_id) ) ) {
		//Child should be able to share with either of their parents  [RoM]
		if(p->party.member[0].class_&0x2000) //first slot is the child?
			p->family = p->party.member[0].char_id;
		else
			p->family = p->party.member[1].char_id;
	} else if( p->size == 3 ) {
		//Check Family State.
		p->family = char_family(
			p->party.member[0].char_id,
			p->party.member[1].char_id,
			p->party.member[2].char_id
		);
	}
	//max/min levels.
	for(i=0;i<MAX_PARTY;i++){
		lv=p->party.member[i].lv;
		if (!lv) continue;
		if(p->party.member[i].online &&
			//On families, the kid is not counted towards exp share rules.
			p->party.member[i].char_id != p->family)
		{
			if( lv < p->min_lv ) p->min_lv=lv;
			if( p->max_lv < lv ) p->max_lv=lv;
		}
	}

	if (p->party.exp && !party_check_exp_share(p)) {
		p->party.exp = 0; //Set off even share.
		mapif_party_optionchanged(0, &p->party, 0, 0);
	}
	return;
}
开发者ID:BlazingSpear,项目名称:rathena,代码行数:51,代码来源:int_party.c


示例12: mapif_parse_PartyLeave

// パーティ脱退要求
void mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
{
	const struct party *p1 = partydb_load_num(party_id);
	struct party p2;
	int i;

	if(p1 == NULL)
		return;

	memcpy(&p2,p1,sizeof(struct party));
	for(i=0;i<MAX_PARTY;i++){
		if(p2.member[i].account_id == account_id && p2.member[i].char_id == char_id)
		{
			mapif_party_leaved(party_id,account_id,p2.member[i].char_id,p2.member[i].name);
			memset(&p2.member[i],0,sizeof(struct party_member));

			if(fd >= 0) {
				// キャラ削除でない場合はパーティIDを0に初期化
				const struct mmo_chardata *cd = chardb_load(char_id);
				if(cd) {
					struct mmo_charstatus st;
					memcpy(&st, &cd->st, sizeof(st));
					st.party_id = 0;
					chardb_save(&st);
				}
			}

			if( party_check_empty(&p2) ) {
				// 空になったので解散
				mapif_party_broken(p2.party_id,0);
				partydb_delete(p2.party_id);
			} else {
				// まだ人がいるのでデータ送信
				mapif_party_info(-1,&p2);

				if( p2.exp>0 && !party_check_exp_share(&p2,0) ){
					p2.exp=0;
					mapif_party_optionchanged(fd,&p2,0,0);
				}
				partydb_save(&p2);
			}
			return;
		}
	}

	return;
}
开发者ID:AurigaProject,项目名称:root,代码行数:48,代码来源:int_party.c


示例13: mapif_parse_PartyChangeOption

// パ?ティ?設定?更要求
int mapif_parse_PartyChangeOption(int fd, int party_id, int account_id, int exp, int item) {
	struct party_data *p;
	int flag = 0;

	p = idb_get(party_db, party_id);
	if (p == NULL)
		return 0;

	p->party.exp = exp;
	if (exp>0 && !party_check_exp_share(p)) {
		flag |= 0x01;
		p->party.exp = 0;
	}
	p->party.item = item&0x3;
	mapif_party_optionchanged(fd, &p->party, account_id, flag);
	return 0;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:18,代码来源:int_party.c


示例14: mapif_parse_PartyAddMember

// パーティ追加要求
int mapif_parse_PartyAddMember(int fd,int party_id,int account_id,char *nick,char *map,int lv)
{
	struct party *p;
	int i;

	p = party_pt;
	if(p==NULL){
		ShowFatalError("int_party: out of memory !\n");
		return 0;
	}
	inter_party_fromsql(party_id, p);

	if(p->party_id <= 0){
		mapif_party_memberadded(fd,party_id,account_id,1);
		return 0;
	}

	for(i=0;i<MAX_PARTY;i++){
		if(p->member[i].account_id==0){
			int flag=0;

			p->member[i].account_id=account_id;
			memcpy(p->member[i].name,nick,NAME_LENGTH-1);
			memcpy(p->member[i].map,map,MAP_NAME_LENGTH-1);
			p->member[i].leader=0;
			p->member[i].online=1;
			p->member[i].lv=lv;
			mapif_party_memberadded(fd,party_id,account_id,0);
			mapif_party_info(-1,p);

			if( p->exp>0 && !party_check_exp_share(p) ){
				p->exp=0;
				flag=0x01;
			}
			if(flag)
				mapif_party_optionchanged(fd,p,0,0);

			inter_party_tosql(party_id, p);
			return 0;
		}
	}
	mapif_party_memberadded(fd,party_id,account_id,1);
	//inter_party_tosql(party_id, p);
	return 0;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:46,代码来源:int_party.c


示例15: mapif_parse_PartyChangeOption

// パーティー設定変更要求
int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int item)
{
	struct party_data *p;
	int flag = 0;
	p = inter_party_fromsql(party_id);

	if(!p)
		return 0;

	p->party.exp=exp;
	if( exp && !party_check_exp_share(p) ){
		flag|=0x01;
		p->party.exp=0;
	}
	p->party.item = item&0x3; //Filter out invalid values.
	mapif_party_optionchanged(fd,&p->party,account_id,flag);
	inter_party_tosql(&p->party, PS_BASIC, 0);
	return 0;
}
开发者ID:Tonetete,项目名称:eathena,代码行数:20,代码来源:int_party.c


示例16: inter_party_logged

//Checks whether the even-share setting of a party is broken when a character logs in. [Skotlex]
int inter_party_logged(int party_id, int account_id)
{
	struct party *p = party_pt;
	if(p==NULL){
		ShowFatalError("int_party: out of memory !\n");
		return 0;
	}
	if (!party_id)
		return 0;
		
	inter_party_fromsql(party_id, p);

	if(p->party_id && p->exp == 1 && !party_check_exp_share(p))
	{
		p->exp=0;
		mapif_party_optionchanged(0,p,0,0);
		return 1;
	}
	return 0;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:21,代码来源:int_party.c


示例17: mapif_parse_PartyChangeOption

// パーティー設定変更要求
static
void mapif_parse_PartyChangeOption(int fd, int party_id, int account_id,
        int exp, int item)
{
    struct party *p = party_db.search(party_id);
    if (p == NULL)
        return;

    p->exp = exp;
    int flag = 0;
    if (exp > 0 && !party_check_exp_share(p))
    {
        flag |= 0x01;
        p->exp = 0;
    }

    p->item = item;

    mapif_party_optionchanged(fd, p, account_id, flag);
}
开发者ID:cinderweb,项目名称:tmwa,代码行数:21,代码来源:int_party.cpp


示例18: mapif_parse_PartyAddMember

//---------------------------
// Adding a member in a party
//---------------------------
void mapif_parse_PartyAddMember(int fd, int party_id, int account_id, char *nick, char *map, int lv) {
	int i;

	inter_party_fromsql(party_id); // fill party_tmp with informations of the party (or set all values to 0)

	if (party_tmp.party_id <= 0) { // party doesn't exist
		mapif_party_memberadded(fd, party_id, account_id, 1);
		return;
	}

	for(i = 0; i < MAX_PARTY; i++) {
		if (party_tmp.member[i].account_id == 0) { // must we check if an other character of same account is in the party?
			party_tmp.member[i].account_id = account_id;
			memset(party_tmp.member[i].name, 0, sizeof(party_tmp.member[i].name));
			strncpy(party_tmp.member[i].name, nick, 24);
			memset(party_tmp.member[i].map, 0, sizeof(party_tmp.member[i].map));
			strncpy(party_tmp.member[i].map, map, 16); // 17 - NULL
			party_tmp.member[i].leader = 0;
			party_tmp.member[i].online = 1;
			party_tmp.member[i].lv = lv;
			mapif_party_memberadded(fd, party_id, account_id, 0);
			mapif_party_info(-1, &party_tmp);
			// Update character in memory
			for(i = 0; i < char_num; i++)
				if (char_dat[i].account_id == account_id && memcmp(char_dat[i].name, nick, 24) == 0) {
					char_dat[i].party_id = party_tmp.party_id;
					break;
				}

			if (party_tmp.exp > 0 && !party_check_exp_share(&party_tmp)) {
				party_tmp.exp = 0;
				mapif_party_optionchanged(fd, &party_tmp, 0, 0);
			}
			inter_party_tosql(party_id, &party_tmp);
			return;
		}
	}
	mapif_party_memberadded(fd, party_id, account_id, 1);

	return;
}
开发者ID:MagicalTux,项目名称:nezumi,代码行数:44,代码来源:int_party.c


示例19: mapif_parse_PartyChangeOption

//--------------------------------------
// Request to change a option in a party
//--------------------------------------
void mapif_parse_PartyChangeOption(int fd, int party_id, int account_id, unsigned short exp, unsigned char item) {
	struct party *p;
	int flag;

	p = numdb_search(party_db, (CPU_INT)party_id);
	if (p == NULL)
		return;

	flag = 0;
	p->exp = exp;
	if (exp > 0 && !party_check_exp_share(p)) {
		flag = 1;
		p->exp = 0;
	}

	p->item = item;

	mapif_party_optionchanged(fd, p, account_id, flag);

	return;
}
开发者ID:OmarAcero,项目名称:freya,代码行数:24,代码来源:int_party.c


示例20: mapif_parse_PartyAddMember

// パーティ追加要求
int mapif_parse_PartyAddMember(int fd,int party_id,int account_id,int char_id,const char *nick,const char *map,int lv)
{
	const struct party *p1 = partydb_load_num(party_id);
	struct party p2;
	int i;

	if(p1 == NULL){
		mapif_party_memberadded(fd, party_id, account_id, char_id, nick, 1);
		return 0;
	}
	memcpy(&p2,p1,sizeof(struct party));

	for(i=0;i<MAX_PARTY;i++){
		if(p2.member[i].account_id == account_id && p2.member[i].char_id == char_id)
			break;
		if(p2.member[i].account_id == 0) {
			p2.member[i].account_id = account_id;
			p2.member[i].char_id    = char_id;
			memcpy(p2.member[i].name,nick,24);
			p2.member[i].name[23] = '\0';	// force \0 terminal
			memcpy(p2.member[i].map,map,16);
			p2.member[i].map[15] = '\0';	// force \0 terminal
			p2.member[i].leader  = 0;
			p2.member[i].online  = 1;
			p2.member[i].lv=lv;
			mapif_party_memberadded(fd, party_id, account_id, char_id, nick, 0);
			mapif_party_info(-1,&p2);

			if( p2.exp>0 && !party_check_exp_share(&p2,0) ){
				p2.exp=0;
				mapif_party_optionchanged(fd,&p2,0,0);
			}
			partydb_save(&p2);
			return 0;
		}
	}
	mapif_party_memberadded(fd, party_id, account_id, char_id, nick, 1);
	partydb_save(&p2);
	return 0;
}
开发者ID:AurigaProject,项目名称:root,代码行数:41,代码来源:int_party.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ party_search函数代码示例发布时间:2022-05-30
下一篇:
C++ part函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap