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


C++ idb_remove函数代码示例

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


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

示例1: party_booking_delete

bool party_booking_delete(struct map_session_data *sd)
{
	struct party_booking_ad_info* pb_ad;

	if((pb_ad = (struct party_booking_ad_info*)idb_get(party_booking_db, sd->status.char_id))!=NULL)
	{
		clif->PartyBookingDeleteNotify(sd, pb_ad->index);
		idb_remove(party_booking_db,sd->status.char_id);
	}
	return true;
}
开发者ID:Vlync,项目名称:Hercules,代码行数:11,代码来源:party.c

示例2: logchrif_parse_reqauth

/**
 * Request from char-server to authenticate an account.
 * @param fd: fd to parse from (char-serv)
 * @param id: id of char-serv
 * @param ip: char-serv ip (used for info)
 * @return 0 not enough info transmitted, 1 success
 */
int logchrif_parse_reqauth(int fd, int id,char* ip){
	if( RFIFOREST(fd) < 23 )
		return 0;
	else{
		struct auth_node* node;
		uint32 account_id = RFIFOL(fd,2);
		uint32 login_id1 = RFIFOL(fd,6);
		uint32 login_id2 = RFIFOL(fd,10);
		uint8 sex = RFIFOB(fd,14);
		//uint32 ip_ = ntohl(RFIFOL(fd,15));
		int request_id = RFIFOL(fd,19);
		RFIFOSKIP(fd,23);

		node = (struct auth_node*)idb_get(auth_db, account_id);
		if( runflag == LOGINSERVER_ST_RUNNING &&
			node != NULL &&
			node->account_id == account_id &&
			node->login_id1  == login_id1 &&
			node->login_id2  == login_id2 &&
			node->sex        == sex_num2str(sex) /*&&
			node->ip         == ip_*/ ){// found
			//ShowStatus("Char-server '%s': authentication of the account %d accepted (ip: %s).\n", server[id].name, account_id, ip);

			// send ack
			WFIFOHEAD(fd,21);
			WFIFOW(fd,0) = 0x2713;
			WFIFOL(fd,2) = account_id;
			WFIFOL(fd,6) = login_id1;
			WFIFOL(fd,10) = login_id2;
			WFIFOB(fd,14) = sex;
			WFIFOB(fd,15) = 0;// ok
			WFIFOL(fd,16) = request_id;
			WFIFOB(fd,20) = node->clienttype;
			WFIFOSET(fd,21);

			// each auth entry can only be used once
			idb_remove(auth_db, account_id);
		}else{// authentication not found
			ShowStatus("Char-server '%s': authentication of the account %d REFUSED (ip: %s).\n", ch_server[id].name, account_id, ip);
			WFIFOHEAD(fd,21);
			WFIFOW(fd,0) = 0x2713;
			WFIFOL(fd,2) = account_id;
			WFIFOL(fd,6) = login_id1;
			WFIFOL(fd,10) = login_id2;
			WFIFOB(fd,14) = sex;
			WFIFOB(fd,15) = 1;// auth failed
			WFIFOL(fd,16) = request_id;
			WFIFOB(fd,20) = 0;
			WFIFOSET(fd,21);
		}
	}
	return 1;
}
开发者ID:RadianFord,项目名称:rAthena,代码行数:60,代码来源:loginchrif.cpp

示例3: auction_delete

void auction_delete(struct auction_data *auction)
{
	unsigned int auction_id = auction->auction_id;

	if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `auction_id` = '%d'", auction_db, auction_id) )
		Sql_ShowDebug(sql_handle);

	if( auction->auction_end_timer != INVALID_TIMER )
		delete_timer(auction->auction_end_timer, auction_end_timer);

	idb_remove(auction_db_, auction_id);
}
开发者ID:DiscoverCZY,项目名称:15-3athena,代码行数:12,代码来源:int_auction.c

示例4: vending_closevending

/**
 * Closes a vending shop.
 *
 * @param sd       The shop owner character.
 * @param quitting Whether the character is quitting (to skip sending packets to it).
 */
void vending_closevending(struct map_session_data *sd, bool quitting)
{
	nullpo_retv(sd);

	if (sd->state.vending) {
		if (!quitting) {
			sd->state.vending = 0;
			clif->closevendingboard(&sd->bl, 0);
		}
		idb_remove(vending->p->db, sd->status.char_id);
	}
}
开发者ID:70hz,项目名称:Hercules,代码行数:18,代码来源:vending.c

示例5: inter_pet_delete

int inter_pet_delete(int pet_id)
{
	struct s_pet *p;
	p = (struct s_pet*)idb_get(pet_db,pet_id);
	if( p == NULL)
		return 1;
	else {
		idb_remove(pet_db,pet_id);
		ShowInfo("Deleted pet (pet_id: %d)\n",pet_id);
	}
	return 0;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:12,代码来源:int_pet.c

示例6: inter_party_CharOffline

int inter_party_CharOffline (int char_id, int party_id)
{
	struct party_data *p = NULL;
	int i;

	if (party_id == -1)
	{
		// Get guild_id from the database
		char *data;

		if (SQL_ERROR == Sql_Query (sql_handle, "SELECT party_id FROM `%s` WHERE char_id='%d'", char_db, char_id))
		{
			Sql_ShowDebug (sql_handle);
			return 0;
		}

		if (SQL_SUCCESS != Sql_NextRow (sql_handle))
			return 0; //Eh? No party?

		Sql_GetData (sql_handle, 0, &data, NULL);
		party_id = atoi (data);
		Sql_FreeResult (sql_handle);
	}

	if (party_id == 0)
		return 0; //No party...

	//Character has a party, set character offline and check if they were the only member online
	if ( (p = inter_party_fromsql (party_id)) == NULL)
		return 0;

	//Set member offline
	for (i = 0; i < MAX_PARTY; i++)
	{
		if (p->party.member[i].char_id == char_id)
		{
			p->party.member[i].online = 0;
			p->party.count--;

			if (p->party.member[i].lv == p->min_lv ||
					p->party.member[i].lv == p->max_lv)
				int_party_check_lv (p);

			break;
		}
	}

	if (!p->party.count)
		//Parties don't have any data that needs be saved at this point... so just remove it from memory.
		idb_remove (party_db_, party_id);

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

示例7: inter_guild_storage_delete

// ギルド倉庫データ削除
int inter_guild_storage_delete(int guild_id)
{
	struct guild_storage *gs = (struct guild_storage*)idb_get(guild_storage_db,guild_id);
	if(gs) {
		int i;
		for(i=0;i<gs->storage_amount;i++){
			if(gs->items[i].card[0] == (short)0xff00)
				inter_pet_delete( MakeDWord(gs->items[i].card[1],gs->items[i].card[2]) );
		}
		idb_remove(guild_storage_db,guild_id);
	}
	return 0;
}
开发者ID:Angelmelody,项目名称:eathena,代码行数:14,代码来源:int_storage.c

示例8: party_check_empty

// パ?ティが空かどうかチェック
int party_check_empty(struct party *p) {
	int i;

	for(i = 0; i < MAX_PARTY; i++) {
		if (p->member[i].account_id > 0) {
			return 0;
		}
	}
	mapif_party_broken(p->party_id, 0);
	idb_remove(party_db, p->party_id);

	return 1;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:14,代码来源:int_party.c

示例9: itemdb_load

/*==========================================
 * Loads (and creates if not found) an item from the db.
 *------------------------------------------
 */
struct item_data* itemdb_load(int nameid)
{
	struct item_data *id = idb_ensure(item_db,nameid,create_item_data);
	if (id == &dummy_item)
  	{	//Remove dummy_item, replace by real data.
		DBKey key;
		key.i = nameid;
		idb_remove(item_db,nameid);
		id = create_item_data(key, NULL);
		idb_put(item_db,nameid,id);
	}
	return id;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:17,代码来源:itemdb.c

示例10: inter_storage_delete

// 倉庫データ削除
int inter_storage_delete(int account_id)
{
	struct storage_data *s = (struct storage_data*)idb_get(storage_db,account_id);
	if(s) {
		int i;
		for(i=0;i<s->storage_amount;i++){
			if(s->items[i].card[0] == (short)0xff00)
				inter_pet_delete( MakeDWord(s->items[i].card[1],s->items[i].card[2]) );
		}
		idb_remove(storage_db,account_id);
	}
	return 0;
}
开发者ID:Angelmelody,项目名称:eathena,代码行数:14,代码来源:int_storage.c

示例11: storage_save

/// Writes provided data into storage cache.
/// If data contains 0 items, any existing entry in cache is destroyed.
/// If data contains 1+ items and no cache entry exists, a new one is created.
bool storage_save(int account_id, struct storage_data* storage)
{
	if( storage->storage_amount > 0 )
	{
		struct storage_data* s = (struct storage_data*)idb_ensure(storage_db, account_id, create_storage);
		memcpy(s, storage, sizeof(*storage));
	}
	else
	{
		idb_remove(storage_db, account_id);
	}

	return true;
}
开发者ID:Angelmelody,项目名称:eathena,代码行数:17,代码来源:int_storage.c

示例12: guild_check_empty

// ギルドが空かどうか?ェック
static bool guild_check_empty(struct guild *g)
{
	int i;
	ARR_FIND( 0, g->max_member, i, g->member[i].account_id > 0 );
	if( i < g->max_member)
		return false; // not empty

	// 誰もいないので解散
	guild_db->foreach(guild_db, guild_break_sub, g->guild_id);
	inter_guild_storage_delete(g->guild_id);
	mapif_guild_broken(g->guild_id, 0);
	idb_remove(guild_db, g->guild_id);
	return true;
}
开发者ID:KimKyung-wook,项目名称:ilathena-project,代码行数:15,代码来源:int_guild.c

示例13: channel_leave

/**
 * Leaves a channel.
 *
 * @param chan The channel to leave
 * @param sd   The character
 */
void channel_leave(struct channel_data *chan, struct map_session_data *sd)
{
	nullpo_retv(chan);
	nullpo_retv(sd);

	if (!idb_remove(chan->users,sd->status.char_id))
		return;

	if (chan == sd->gcbind)
		sd->gcbind = NULL;

	if (!db_size(chan->users) && chan->type == HCS_TYPE_PRIVATE) {
		channel->delete(chan);
	} else if (!channel->config->closing && (chan->options & HCS_OPT_ANNOUNCE_JOIN)) {
开发者ID:xdgimf,项目名称:Renewal,代码行数:20,代码来源:channel.c

示例14: mapif_parse_WisReply

// Wisp/page transmission result
int mapif_parse_WisReply(int fd) {
    int id = RFIFOL(fd,2), flag = RFIFOB(fd,6);
    struct WisData *wd = idb_get(wis_db, id);

    if (wd == NULL)
        return 0;	// This wisp was probably suppress before, because it was timeout of because of target was found on another map-server

    if ((--wd->count) <= 0 || flag != 1) {
        mapif_wis_end(wd, flag); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
        idb_remove(wis_db, id);
    }

    return 0;
}
开发者ID:mleo1,项目名称:Ragnarok-OldTimes,代码行数:15,代码来源:inter.c

示例15: vending_closevending

/**
 * Make a player close his shop
 * @param sd : player session
 */
void vending_closevending(struct map_session_data* sd)
{
	nullpo_retv(sd);

	if( sd->state.vending ) {
		if( Sql_Query( mmysql_handle, "DELETE FROM `%s` WHERE vending_id = %d;", vending_items_db, sd->vender_id ) != SQL_SUCCESS ||
			Sql_Query( mmysql_handle, "DELETE FROM `%s` WHERE `id` = %d;", vendings_db, sd->vender_id ) != SQL_SUCCESS ){
				Sql_ShowDebug(mmysql_handle);
		}
		
		sd->state.vending = false;
		clif_closevendingboard(&sd->bl, 0);
		idb_remove(vending_db, sd->status.char_id);
	}
}
开发者ID:DragonKhal,项目名称:rathena,代码行数:19,代码来源:vending.c


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