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

C++ idb_remove函数代码示例

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

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



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


示例16: guild_check_empty

// ギルドが空かどうかチェック
int guild_check_empty(struct guild *g) {
	int i;

	for(i = 0; i < g->max_member; i++) {
		if (g->member[i].account_id > 0) {
			return 0;
		}
	}
		// 誰もいないので解散
	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 1;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:16,代码来源:int_guild.c


示例17: chrif_auth_delete

bool chrif_auth_delete(int account_id, int char_id, enum sd_state state) {
	struct auth_node *node;
	if ((node=chrif_auth_check(account_id, char_id, state)))
	{
		int fd = node->sd?node->sd->fd:node->fd;
		if (session[fd] && session[fd]->session_data == node->sd)
			session[fd]->session_data = NULL;
		if (node->char_dat) aFree(node->char_dat);
		if (node->sd) aFree(node->sd);
		ers_free(auth_db_ers, node);
		idb_remove(auth_db,account_id);
		return true;
	}
	return false;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:15,代码来源:chrif.c


示例18: guild_castledataloadack

// ギルド城データ要求返信
int guild_castledataloadack(int castle_id,int index,int value)
{
	struct guild_castle *gc=guild_castle_search(castle_id);
	int code=castle_id|(index<<16);
	struct eventlist *ev,*ev2;

	if(gc==NULL){
		return 0;
	}
	switch(index){
	case 1:
		gc->guild_id = value;
		if (gc->guild_id && guild_search(gc->guild_id)==NULL) //Request guild data which will be required for spawned guardians. [Skotlex]
			guild_request_info(gc->guild_id);
		break;
	case 2: gc->economy = value; break;
	case 3: gc->defense = value; break;
	case 4: gc->triggerE = value; break;
	case 5: gc->triggerD = value; break;
	case 6: gc->nextTime = value; break;
	case 7: gc->payTime = value; break;
	case 8: gc->createTime = value; break;
	case 9: gc->visibleC = value; break;
	case 10:
	case 11:
	case 12:
	case 13:
	case 14:
	case 15:
	case 16:
	case 17:
		gc->guardian[index-10].visible = value; break;
	default:
		ShowError("guild_castledataloadack ERROR!! (Not found castle_id=%d index=%d)\n", castle_id, index);
		return 0;
	}

	if( (ev = (struct eventlist *)idb_remove(guild_castleinfoevent_db,code))!=NULL )
	{
		while(ev){
			npc_event_do(ev->name);
			ev2=ev->next;
			aFree(ev);
			ev=ev2;
		}
	}
	return 1;
}
开发者ID:casioza,项目名称:server000,代码行数:49,代码来源:guild.c


示例19: bg_team_delete

/// Deletes BG Team from db
bool bg_team_delete(int bg_id) {
	int i;
	struct battleground_data *bgd = bg->team_search(bg_id);

	if( bgd == NULL ) return false;
	for( i = 0; i < MAX_BG_MEMBERS; i++ ) {
		struct map_session_data *sd = bgd->members[i].sd;
		if (sd == NULL)
			continue;

		bg->send_dot_remove(sd);
		sd->bg_id = 0;
	}
	idb_remove(bg->team_db, bg_id);
	return true;
}
开发者ID:IeYasuru,项目名称:CrystalCore,代码行数:17,代码来源:battleground.c


示例20: buyingstore_close

/**
 * Close buying store and clear buying store data from tables
 * @param sd
 */
void buyingstore_close(struct map_session_data *sd) {
	nullpo_retv(sd);

	if( sd->state.buyingstore ) {
		if( Sql_Query(mmysql_handle, "DELETE FROM `%s` WHERE buyingstore_id = %d;", buyingstore_items_db, sd->buyer_id) != SQL_SUCCESS ||
			Sql_Query(mmysql_handle, "DELETE FROM `%s` WHERE `id` = %d;", buyingstores_db, sd->buyer_id) != SQL_SUCCESS )
			Sql_ShowDebug(mmysql_handle);

		sd->state.buyingstore = 0;
		sd->buyer_id = 0;
		memset(&sd->buyingstore, 0, sizeof(sd->buyingstore));
		idb_remove(buyingstore_db, sd->status.char_id);

		// Notify other players
		clif_buyingstore_disappear_entry(sd);
	}
}
开发者ID:BlazingSpear,项目名称:idathena,代码行数:21,代码来源:buyingstore.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ide_drive_get函数代码示例发布时间:2022-05-30
下一篇:
C++ idb_put函数代码示例发布时间: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