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


C++ ShowInfo函数代码示例

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


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

示例1: mapif_elemental_load

bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele)
{
	char *data;

	memset(ele, 0, sizeof(struct s_elemental));
	ele->elemental_id = ele_id;
	ele->char_id = char_id;

	if(SQL_ERROR == Sql_Query(sql_handle, "SELECT `class`, `mode`, `hp`, `sp`, `max_hp`, `max_sp`, `atk1`, `atk2`, `matk`, `aspd`,"
	                          "`def`, `mdef`, `flee`, `hit`, `life_time` FROM `elemental` WHERE `ele_id` = '%d' AND `char_id` = '%d'",
	                          ele_id, char_id)) {
		Sql_ShowDebug(sql_handle);
		return false;
	}

	if(SQL_SUCCESS != Sql_NextRow(sql_handle)) {
		Sql_FreeResult(sql_handle);
		return false;
	}

	Sql_GetData(sql_handle,  0, &data, NULL); ele->class_ = atoi(data);
	Sql_GetData(sql_handle,  1, &data, NULL); ele->mode = atoi(data);
	Sql_GetData(sql_handle,  2, &data, NULL); ele->hp = atoi(data);
	Sql_GetData(sql_handle,  3, &data, NULL); ele->sp = atoi(data);
	Sql_GetData(sql_handle,  4, &data, NULL); ele->max_hp = atoi(data);
	Sql_GetData(sql_handle,  5, &data, NULL); ele->max_sp = atoi(data);
	Sql_GetData(sql_handle,  6, &data, NULL); ele->atk = atoi(data);
	Sql_GetData(sql_handle,  7, &data, NULL); ele->atk2 = atoi(data);
	Sql_GetData(sql_handle,  8, &data, NULL); ele->matk = atoi(data);
	Sql_GetData(sql_handle,  9, &data, NULL); ele->amotion = atoi(data);
	Sql_GetData(sql_handle, 10, &data, NULL); ele->def = atoi(data);
	Sql_GetData(sql_handle, 11, &data, NULL); ele->mdef = atoi(data);
	Sql_GetData(sql_handle, 12, &data, NULL); ele->flee = atoi(data);
	Sql_GetData(sql_handle, 13, &data, NULL); ele->hit = atoi(data);
	Sql_GetData(sql_handle, 14, &data, NULL); ele->life_time = atoi(data);
	Sql_FreeResult(sql_handle);
	if(save_log)
		ShowInfo(read_message("Source.char.elemental_load"), ele->elemental_id, ele->char_id);

	return true;
}
开发者ID:Chocolate31,项目名称:eamod,代码行数:41,代码来源:int_elemental.c

示例2: instance_create

/*--------------------------------------
 * name : instance name
 * Return value could be
 * -4 = already exists | -3 = no free instances | -2 = party not found | -1 = invalid type
 * On success return instance_id
 *--------------------------------------*/
int instance_create(int party_id, const char *name)
{
	int i;
	struct party_data* p;

	if( ( p = party_search(party_id) ) == NULL )
	{
		ShowError("instance_create: party %d not found for instance '%s'.\n", party_id, name);
		return -2;
	}

	if( p->instance_id )
		return -4; // Party already instancing

	// Searching a Free Instance
	// 0 is ignored as this mean "no instance" on maps
	ARR_FIND(1, MAX_INSTANCE, i, instance[i].state == INSTANCE_FREE);
	if( i == MAX_INSTANCE )
	{
		ShowError("instance_create: no free instances, consider increasing MAX_INSTANCE.\n");
		return -3;
	}

	instance[i].state = INSTANCE_IDLE;
	instance[i].instance_id = i;
	instance[i].idle_timer = INVALID_TIMER;
	instance[i].idle_timeout = instance[i].idle_timeoutval = 0;
	instance[i].progress_timer = INVALID_TIMER;
	instance[i].progress_timeout = 0;
	instance[i].users = 0;
	instance[i].party_id = party_id;
	instance[i].vars = idb_alloc(DB_OPT_RELEASE_DATA);

	safestrncpy( instance[i].name, name, sizeof(instance[i].name) );
	memset( instance[i].map, 0x00, sizeof(instance[i].map) );
	p->instance_id = i;

	clif_instance(i, 1, 0); // Start instancing window
	ShowInfo("[Instance] Created: %s.\n", name);
	return i;
}
开发者ID:Milkaka,项目名称:Cronus-Emulator,代码行数:47,代码来源:instance.c

示例3: harmony_iterate_groups_adminlevel

static bool harmony_iterate_groups_adminlevel(int group_id, int level, const char* name) {
	int account_id;

	if (level < current_groupscan_minlevel)
		return true;

	ShowInfo("Registering group %d..\n", group_id);
	if (SQL_SUCCESS != SqlStmt_BindParam(admin_stmt, 0, SQLDT_INT, (void*)&group_id, sizeof(group_id)) ||
		SQL_SUCCESS != SqlStmt_Execute(admin_stmt))
	{
		ShowError("Fetching GM accounts from group %d failed.\n", group_id);
		Sql_ShowDebug(mmysql_handle);
		return true;
	}

	SqlStmt_BindColumn(admin_stmt, 0, SQLDT_INT, &account_id, 0, NULL, NULL);
	while (SQL_SUCCESS == SqlStmt_NextRow(admin_stmt)) {
		harm_funcs->zone_register_admin(account_id, false);
	}
	return true;
}
开发者ID:karanjagdev,项目名称:hashield,代码行数:21,代码来源:harmony.c

示例4: mapif_party_created

// Create a party whether or not
int mapif_party_created(int fd, int account_id, int char_id, struct party *p)
{
	nullpo_ret(p);
	WFIFOHEAD(fd, 39);
	WFIFOW(fd,0)=0x3820;
	WFIFOL(fd,2)=account_id;
	WFIFOL(fd,6)=char_id;
	if(p!=NULL){
		WFIFOB(fd,10)=0;
		WFIFOL(fd,11)=p->party_id;
		memcpy(WFIFOP(fd,15),p->name,NAME_LENGTH);
		ShowInfo("int_party: Party created (%d - %s)\n",p->party_id,p->name);
	}else{
		WFIFOB(fd,10)=1;
		WFIFOL(fd,11)=0;
		memset(WFIFOP(fd,15),0,NAME_LENGTH);
	}
	WFIFOSET(fd,39);

	return 0;
}
开发者ID:Mateuus,项目名称:Cronus,代码行数:22,代码来源:int_party.c

示例5: channel_create

/**
 * Create a channel
 * - Will then add it in the channel_db if the type is not map or ally
 * @param name: Channel name, can't be null
 * @param pass: Channel password, can be null
 * @param color: Display color
 * @param chantype: Channel type
 * @return NULL on failure or Channel on success
 */
struct Channel* channel_create(struct Channel *tmp_chan) {
	struct Channel* channel;

	if (!tmp_chan->name[0])
		return NULL;

	CREATE(channel, struct Channel, 1); //will exit on fail allocation
	//channel->id = tmp_chan->id;
	channel->users = idb_alloc(DB_OPT_BASE);
	channel->banned = idb_alloc(static_cast<DBOptions>(DB_OPT_BASE|DB_OPT_RELEASE_DATA) );
	channel->opt = tmp_chan->opt;
	channel->type = tmp_chan->type;
	channel->color = tmp_chan->color;
	safestrncpy(channel->name, tmp_chan->name, CHAN_NAME_LENGTH); // Store channel cname without '#'
	safestrncpy(channel->alias, tmp_chan->alias[0] ? tmp_chan->alias : tmp_chan->name, CHAN_NAME_LENGTH);
	if (!tmp_chan->pass[0])
		channel->pass[0] = '\0';
	else
		safestrncpy(channel->pass, tmp_chan->pass, CHAN_NAME_LENGTH);
	channel->msg_delay = tmp_chan->msg_delay;

	switch (channel->type) {
		case CHAN_TYPE_MAP:
			channel->m = tmp_chan->m;
			break;
		case CHAN_TYPE_ALLY:
			channel->gid = tmp_chan->gid;
			break;
		case CHAN_TYPE_PRIVATE:
			channel->char_id = tmp_chan->char_id;
		default:
			strdb_put(channel_db, channel->name, channel);
			break;
	}

	if (battle_config.etc_log)
		ShowInfo("Create channel %s alias %s type=%d, owner=%d/%d/%d\n",channel->name,channel->alias,channel->type,channel->char_id,channel->m,channel->gid);

	return channel;
}
开发者ID:Atemo,项目名称:rathena,代码行数:49,代码来源:channel.cpp

示例6: HasSubMenu

eOSState cSatipPluginSetup::ProcessKey(eKeys keyP)
{
  bool hadSubMenu = HasSubMenu();
  int oldOperatingMode = operatingModeM;
  int oldCiExtension = ciExtensionM;
  int oldNumDisabledSources = numDisabledSourcesM;
  int oldNumDisabledFilters = numDisabledFiltersM;
  eOSState state = cMenuSetupPage::ProcessKey(keyP);

  // Ugly hack with hardcoded '+/-' characters :(
  const char *p = Get(Current())->Text();
  if (!hadSubMenu && !HasSubMenu() && p && (*p == '+' || *p == '-') && (keyP == kOk))
     return DeviceInfo();
  if (hadSubMenu && !HasSubMenu())
     Setup();

  if (state == osUnknown) {
     switch (keyP) {
       case kRed:    return DeviceScan();
       case kYellow: return ShowDeviceStatus();
       case kBlue:   return ShowInfo();
       case kInfo:   if (Current() < helpM.Size())
                        return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), helpM[Current()]));
       default:      state = osContinue; break;
       }
     }

  if ((keyP == kNone) && (cSatipDiscover::GetInstance()->GetServers()->Count() != deviceCountM))
     Setup();

  if ((keyP != kNone) && ((numDisabledSourcesM != oldNumDisabledSources) || (numDisabledFiltersM != oldNumDisabledFilters) || (operatingModeM != oldOperatingMode) || (ciExtensionM != oldCiExtension) || (detachedModeM != SatipConfig.GetDetachedMode()))) {
     while ((numDisabledSourcesM < oldNumDisabledSources) && (oldNumDisabledSources > 0))
           disabledSourcesM[--oldNumDisabledSources] = cSource::stNone;
     while ((numDisabledFiltersM < oldNumDisabledFilters) && (oldNumDisabledFilters > 0))
           disabledFilterIndexesM[--oldNumDisabledFilters] = -1;
     Setup();
     }

  return state;
}
开发者ID:rofafor,项目名称:vdr-plugin-satip,代码行数:40,代码来源:setup.c

示例7: luaL_loadfile

bool Lua::LoadScriptFromFile(const std::string& filename, bool useGlue)
{
    m_filename = filename;

    // TODO Use glue file if required
    int r = luaL_loadfile(m_pL, filename.c_str());

    if (r == 0)
    {
        // Need to do this before we can call any functions in the file.
        lua_call(m_pL, 0, 0);
        if (ShowInfo())
        {
            std::cout << "LUA: c++: Loaded lua file " << filename << " OK\n";
        }
    }
    else
    {
        std::string error = "LUA: c++: Loading lua file \"" + filename +
                            "\" failed: Code " + ToString(r) + ": " + lua_tostring(m_pL, -1);
        ReportError(error);
    }

    return (r == 0);


    // TODO use Amju::File
    bool NOVERSIONINFO = false;
    File f(NOVERSIONINFO, useGlue ? File::GLUE : File::STD);
    if (!f.OpenRead(filename)) // TODO binary ? use Root Dir ?
    {
        f.ReportError("Failed to open Lua script file.");
        return false;
    }
    // Load the whole file into memory if not a glue file.
    // If a glue file, it's in memory already, but we need the start and length.


    return false;
}
开发者ID:jason-amju,项目名称:amjulib,代码行数:40,代码来源:AmjuLua.cpp

示例8: memmgr_info

/* 現在の状況を表示する */
static void memmgr_info(void) {
	int i;
	struct block *p;
	ShowInfo("** Informacao da administracao de memoria **\n");
	if(block_first == NULL) {
		ShowMessage("Nao inicializado.\n");
		return;
	}
	ShowMessage(
		"Blocos: %04u , Tamanho do Bloco: %06u Byte , Usado: %08uKB\n",
		block_last->block_no+1,sizeof(struct block),
		(block_last->block_no+1) * sizeof(struct block) / 1024
	);
	p = block_first;
	for(i=0;i<=block_last->block_no;i++) {
		ShowMessage("    Bloco #%04u : ",p->block_no);
		if(p->unit_size == 0) {
			ShowMessage("nao unsado.\n");
		} else {
			ShowMessage(
				"tamanho: %05u byte. usado: %04u/%04u prev:",
				p->unit_size - sizeof(struct unit_head),p->unit_used,p->unit_count
			);
			if(p->samesize_prev == NULL) {
				ShowMessage("NULO");
			} else {
				ShowMessage("%04u",(p->samesize_prev)->block_no);
			}
			ShowMessage(" next:");
			if(p->samesize_next == NULL) {
				ShowMessage("NULO");
			} else {
				ShowMessage("%04u",(p->samesize_next)->block_no);
			}
			ShowMessage("\n");
		}
		p = p->block_next;
	}
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:40,代码来源:malloc.c

示例9: _msg_config_read

/*==========================================
 * Read Message Data
 *------------------------------------------*/
int _msg_config_read(const char* cfgName,int size, char ** msg_table)
{
    int msg_number;
    char line[1024], w1[1024], w2[1024];
    FILE *fp;
    static int called = 1;

    if ((fp = fopen(cfgName, "r")) == NULL) {
	ShowError("Messages file not found: %s\n", cfgName);
	return 1;
    }

    if ((--called) == 0)
	memset(msg_table, 0, sizeof (msg_table[0]) * size);

    while (fgets(line, sizeof (line), fp)) {
	if (line[0] == '/' && line[1] == '/')
	    continue;
	if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
	    continue;

	if (strcmpi(w1, "import") == 0)
	    _msg_config_read(w2,size,msg_table);
	else {
	    msg_number = atoi(w1);
	    if (msg_number >= 0 && msg_number < size) {
		if (msg_table[msg_number] != NULL)
		    aFree(msg_table[msg_number]);
		msg_table[msg_number] = (char *) aMalloc((strlen(w2) + 1) * sizeof (char));
		strcpy(msg_table[msg_number], w2);
	    }
	}
    }

    fclose(fp);
    ShowInfo("Finished reading %s.\n",cfgName);

    return 0;
}
开发者ID:yakiie,项目名称:Emulador,代码行数:42,代码来源:msg_conf.c

示例10: inter_pet_tosql

/**
 * Saves a pet to the SQL database.
 *
 * @remark
 *   In case of newly created pet, the pet ID is not updated to reflect the
 *   newly assigned ID.  The caller must do so.
 *
 * @param p The pet data to save.
 * @return The ID of the saved pet.
 * @retval 0 in case of errors.
 */
int inter_pet_tosql(const struct s_pet *p)
{
	//`pet` (`pet_id`, `class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`)
	char esc_name[NAME_LENGTH*2+1];// escaped pet name
	int pet_id = 0, hungry = 0, intimate = 0;

	nullpo_ret(p);

	SQL->EscapeStringLen(inter->sql_handle, esc_name, p->name, strnlen(p->name, NAME_LENGTH));
	hungry = cap_value(p->hungry, 0, 100);
	intimate = cap_value(p->intimate, 0, 1000);

	if (p->pet_id == 0) {
		// New pet.
		if (SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` "
				"(`class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`) "
				"VALUES ('%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
				pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
				p->equip, intimate, hungry, p->rename_flag, p->incubate)) {
			Sql_ShowDebug(inter->sql_handle);
			return 0;
		}
		pet_id = (int)SQL->LastInsertId(inter->sql_handle);
	} else {
		// Update pet.
		if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `class`='%d',`name`='%s',`account_id`='%d',`char_id`='%d',`level`='%d',`egg_id`='%d',`equip`='%d',`intimate`='%d',`hungry`='%d',`rename_flag`='%d',`incubate`='%d' WHERE `pet_id`='%d'",
				pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
				p->equip, intimate, hungry, p->rename_flag, p->incubate, p->pet_id)) {
			Sql_ShowDebug(inter->sql_handle);
			return 0;
		}
		pet_id = p->pet_id;
	}

	if (save_log)
		ShowInfo("Pet saved %d - %s.\n", pet_id, p->name);

	return pet_id;
}
开发者ID:Barruch,项目名称:Hercules,代码行数:50,代码来源:int_pet.c

示例11: display_title

/*======================================
 *	CORE : Display title
 *--------------------------------------*/
static void display_title(void)
{
	//ClearScreen(); // clear screen and go up/left (0, 0 position in text)
	ShowMessage("\n");
	ShowMessage(""CL_WTBL"          (=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BT_YELLOW"            eAthena Development Team presents            "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD"       ______  __    __                                  "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD"      /\\  _  \\/\\ \\__/\\ \\                                 "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD"    __\\ \\ \\_\\ \\ \\ ,_\\ \\ \\___      __    ___      __      "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD"  /'__`\\ \\  __ \\ \\ \\/\\ \\  _ `\\  /'__`\\/' _ `\\  /'__`\\    "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD" /\\  __/\\ \\ \\/\\ \\ \\ \\_\\ \\ \\ \\ \\/\\  __//\\ \\/\\ \\/\\ \\_\\.\\_  "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD" \\ \\____\\\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\____\\ \\_\\ \\_\\ \\__/.\\_\\ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD"  \\/____/ \\/_/\\/_/\\/__/ \\/_/\\/_/\\/____/\\/_/\\/_/\\/__/\\/_/ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD"   _   _   _   _   _   _   _     _   _   _   _   _   _   "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD"  / \\ / \\ / \\ / \\ / \\ / \\ / \\   / \\ / \\ / \\ / \\ / \\ / \\  "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD" ( e | n | g | l | i | s | h ) ( A | t | h | e | n | a ) "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD"  \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/   \\_/ \\_/ \\_/ \\_/ \\_/ \\_/  "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_XXBL"          ("CL_BOLD"                                                         "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
	ShowMessage(""CL_WTBL"          (=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)"CL_CLL""CL_NORMAL"\n\n");

	ShowInfo("SVN Revision: '"CL_WHITE"%s"CL_RESET"'.\n", get_svn_revision());
}
开发者ID:dbrocom,项目名称:syncragnarok,代码行数:25,代码来源:core.c

示例12: mapif_elemental_load

bool mapif_elemental_load (int ele_id, int char_id, struct s_elemental *ele)
{
	char *data;
	memset (ele, 0, sizeof (struct s_elemental));
	ele->elemental_id = ele_id;
	ele->char_id = char_id;

	if (SQL_ERROR == Sql_Query (sql_handle, "SELECT `class`, `mode`, `hp`, `sp`, `max_hp`, `max_sp`, `str`, `agi`, `vit`, `int`, `dex`,"
								"`luk`, `life_time` FROM `elemental` WHERE `ele_id` = '%d' AND `char_id` = '%d'",
								ele_id, char_id)) {
		Sql_ShowDebug (sql_handle);
		return false;
	}

	if (SQL_SUCCESS != Sql_NextRow (sql_handle)) {
		Sql_FreeResult (sql_handle);
		return false;
	}

	Sql_GetData (sql_handle,  0, &data, NULL); ele->class_ = atoi (data);
	Sql_GetData (sql_handle,  1, &data, NULL); ele->mode = atoi (data);
	Sql_GetData (sql_handle,  2, &data, NULL); ele->hp = atoi (data);
	Sql_GetData (sql_handle,  3, &data, NULL); ele->sp = atoi (data);
	Sql_GetData (sql_handle,  4, &data, NULL); ele->max_hp = atoi (data);
	Sql_GetData (sql_handle,  5, &data, NULL); ele->max_sp = atoi (data);
	Sql_GetData (sql_handle,  6, &data, NULL); ele->str = atoi (data);
	Sql_GetData (sql_handle,  7, &data, NULL); ele->agi = atoi (data);
	Sql_GetData (sql_handle,  8, &data, NULL); ele->vit = atoi (data);
	Sql_GetData (sql_handle,  9, &data, NULL); ele->int_ = atoi (data);
	Sql_GetData (sql_handle, 10, &data, NULL); ele->dex = atoi (data);
	Sql_GetData (sql_handle, 11, &data, NULL); ele->luk = atoi (data);
	Sql_GetData (sql_handle, 12, &data, NULL); ele->life_time = atoi (data);
	Sql_FreeResult (sql_handle);

	if (save_log)
		ShowInfo ("Elemental carregado (%d - %d).\n", ele->elemental_id, ele->char_id);

	return true;
}
开发者ID:digofcbh,项目名称:Cronus,代码行数:39,代码来源:int_elemental.c

示例13: chrif_recvfamelist

int chrif_recvfamelist(int fd) {
	int num, size;
	int total = 0, len = 8;

	memset (smith_fame_list, 0, sizeof(smith_fame_list));
	memset (chemist_fame_list, 0, sizeof(chemist_fame_list));
	memset (taekwon_fame_list, 0, sizeof(taekwon_fame_list));

	size = RFIFOW(fd, 6); //Blacksmith block size
	
	for (num = 0; len < size && num < MAX_FAME_LIST; num++) {
		memcpy(&smith_fame_list[num], RFIFOP(fd,len), sizeof(struct fame_list));
 		len += sizeof(struct fame_list);
	}
	
	total += num;

	size = RFIFOW(fd, 4); //Alchemist block size
	
	for (num = 0; len < size && num < MAX_FAME_LIST; num++) {
		memcpy(&chemist_fame_list[num], RFIFOP(fd,len), sizeof(struct fame_list));
 		len += sizeof(struct fame_list);
	}
	
	total += num;

	size = RFIFOW(fd, 2); //Total packet length
	
	for (num = 0; len < size && num < MAX_FAME_LIST; num++) {
		memcpy(&taekwon_fame_list[num], RFIFOP(fd,len), sizeof(struct fame_list));
 		len += sizeof(struct fame_list);
	}
	
	total += num;

	ShowInfo("Received Fame List of '"CL_WHITE"%d"CL_RESET"' characters.\n", total);

	return 0;
}
开发者ID:Shaktoh,项目名称:Hercules,代码行数:39,代码来源:chrif.c

示例14: auth_db_cleanup_sub

/**
 * This can still happen (client times out while waiting for char to confirm auth data)
 * @see DBApply
 */
int auth_db_cleanup_sub(DBKey key, DBData *data, va_list ap) {
	struct auth_node *node = DB->data2ptr(data);
	const char* states[] = { "Login", "Logout", "Map change" };
	
	if(DIFF_TICK(gettick(),node->node_created)>60000) {
		switch (node->state) {
			case ST_LOGOUT:
				//Re-save attempt (->sd should never be null here).
				node->node_created = gettick(); //Refresh tick (avoid char-server load if connection is really bad)
				chrif_save(node->sd, 1);
				break;
			default:
				//Clear data. any connected players should have timed out by now.
				ShowInfo("auth_db: Node (state %s) timed out for %d:%d\n", states[node->state], node->account_id, node->char_id);
				chrif_char_offline_nsd(node->account_id, node->char_id);
				chrif_auth_delete(node->account_id, node->char_id, node->state);
				break;
		}
		return 1;
	}
	return 0;
}
开发者ID:Shaktoh,项目名称:Hercules,代码行数:26,代码来源:chrif.c

示例15: auction_end_timer

static int auction_end_timer(int tid, unsigned int tick, int id, intptr_t data)
{
	struct auction_data *auction;
	if( (auction = (struct auction_data *)idb_get(auction_db_, id)) != NULL )
	{
		if( auction->buyer_id )
		{
			mail_sendmail(0, "Auction Manager", auction->buyer_id, auction->buyer_name, "Auction", "Thanks, you won the auction!.", 0, &auction->item);
			mapif_Auction_message(auction->buyer_id, 6); // You have won the auction
			mail_sendmail(0, "Auction Manager", auction->seller_id, auction->seller_name, "Auction", "Payment for your auction!.", auction->price, NULL);
		}
		else
			mail_sendmail(0, "Auction Manager", auction->seller_id, auction->seller_name, "Auction", "No buyers have been found for your auction.", 0, &auction->item);
		
		ShowInfo("Auction End: id %u.\n", auction->auction_id);

		auction->auction_end_timer = INVALID_TIMER;
		auction_delete(auction);
	}

	return 0;
}
开发者ID:DiscoverCZY,项目名称:15-3athena,代码行数:22,代码来源:int_auction.c


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