Beispiel #1
0
extern "C" { // work around visual compiler mangling variables
    URES res_all;
}
#else
URES res_all;
#endif
int32_t res_all_size = sizeof(res_all);

/* Definition of records permitted within each
 * resource with the routine to process the record
 * information.
 */

/*  Console "globals" */
static RES_ITEM cons_items[] = {
   {"name",           store_name,     ITEM(res_cons.hdr.name), 0, ITEM_REQUIRED, 0},
   {"description",    store_str,      ITEM(res_cons.hdr.desc), 0, 0, 0},
   {"rcfile",         store_dir,      ITEM(res_cons.rc_file), 0, 0, 0},
   {"historyfile",    store_dir,      ITEM(res_cons.hist_file), 0, 0, 0},
   {"password",       store_password, ITEM(res_cons.password), 0, ITEM_REQUIRED, 0},
   {"tlsauthenticate",store_bool,    ITEM(res_cons.tls_authenticate), 0, 0, 0},
   {"tlsenable",      store_bool,    ITEM(res_cons.tls_enable), 0, 0, 0},
   {"tlsrequire",     store_bool,    ITEM(res_cons.tls_require), 0, 0, 0},
   {"tlscacertificatefile", store_dir, ITEM(res_cons.tls_ca_certfile), 0, 0, 0},
   {"tlscacertificatedir", store_dir,  ITEM(res_cons.tls_ca_certdir), 0, 0, 0},
   {"tlscertificate", store_dir,       ITEM(res_cons.tls_certfile), 0, 0, 0},
   {"tlskey",         store_dir,       ITEM(res_cons.tls_keyfile), 0, 0, 0},
   {"director",       store_str,       ITEM(res_cons.director), 0, 0, 0},
   {"heartbeatinterval", store_time, ITEM(res_cons.heartbeat_interval), 0, ITEM_DEFAULT, 0},
   {NULL, NULL, {0}, 0, 0, 0}
};
Beispiel #2
0
 * then move it to allocated memory when the resource
 * scan is complete.
 */
#if defined(_MSC_VER)
extern "C" URES res_all; /* declare as C to avoid name mangling by visual c */
#endif
URES res_all;
int32_t res_all_size = sizeof(res_all);

/*
 * Definition of records permitted within each
 * resource with the routine to process the record
 * information.
 */
static RES_ITEM dir_items[] = {
   { "name", store_name, ITEM(dir_res.hdr.name), 0, ITEM_REQUIRED, NULL },
   { "description", store_str, ITEM(dir_res.hdr.desc), 0, 0, NULL },
   { "dirport", store_pint32, ITEM(dir_res.DIRport), 0, ITEM_DEFAULT, DIR_DEFAULT_PORT },
   { "address", store_str, ITEM(dir_res.address), 0, ITEM_REQUIRED, NULL },
   { "password", store_password, ITEM(dir_res.password), 0, ITEM_REQUIRED, NULL },
   { "tlsauthenticate",store_bool, ITEM(dir_res.tls_authenticate), 0, 0, NULL },
   { "tlsenable", store_bool, ITEM(dir_res.tls_enable), 0, 0, NULL },
   { "tlsrequire", store_bool, ITEM(dir_res.tls_require), 0, 0, NULL },
   { "tlsverifypeer", store_bool, ITEM(dir_res.tls_verify_peer), 0, ITEM_DEFAULT, "true" },
   { "tlscacertificatefile", store_dir, ITEM(dir_res.tls_ca_certfile), 0, 0, NULL },
   { "tlscacertificatedir", store_dir, ITEM(dir_res.tls_ca_certdir), 0, 0, NULL },
   { "tlscertificaterevocationlist", store_dir, ITEM(dir_res.tls_crlfile), 0, 0, NULL },
   { "tlscertificate", store_dir, ITEM(dir_res.tls_certfile), 0, 0, NULL },
   { "tlskey", store_dir, ITEM(dir_res.tls_keyfile), 0, 0, NULL },
   { "heartbeatinterval", store_time, ITEM(dir_res.heartbeat_interval), 0, ITEM_DEFAULT, "0" },
   { NULL, NULL, { 0 }, 0, 0, NULL }
Beispiel #3
0
__int64 Item::GetPrice(ObjectItem * lpItem, int Mode)
{
	__int64 Money				= -1;
	__int64 StartMoney			= pSetItemPrice(lpItem, Mode);
	__int64 NewOptionAddMoney	= 0;
	int Divisor					= 3;
	// ----
	if( gItemPrice.CheckItem(lpItem->ItemID, GET_ITEMOPT_LEVEL(lpItem->Level), &Money, &Divisor) )
	{
		if( Money != -1 )
		{
			if( Mode == 1 )
			{
				Money /= Divisor;
			}
			// ----
			return Money;
		}
	}
	// ----
	if( lpItem->ItemID >= ITEM(0, 0) && lpItem->ItemID <= ITEM(12, 6) 
		|| lpItem->ItemID >= ITEM(12, 36) && lpItem->ItemID <= ITEM(12, 43)  
		|| lpItem->ItemID >= ITEM(12, 49) && lpItem->ItemID <= ITEM(12, 50) 
		|| lpItem->ItemID == ITEM(13, 30) )
	{
		for( int i = 0; i < lpItem->SpecialCount; i++ )
		{
			switch(lpItem->SpecialType[i])
			{
			case eItemOption::Damage:
			case eItemOption::WizardryDamage:
			case eItemOption::CurseSpell:
			case eItemOption::Defense:
			case eItemOption::HPRecovery:
				{
					switch(lpItem->SpecialValue[i])
					{
					case 20:
						NewOptionAddMoney += (StartMoney * 84.0 / 10.0);
						break;
					case 24:
						NewOptionAddMoney += (StartMoney * 112.0 / 10.0);
						break;
					case 28:
						NewOptionAddMoney += (StartMoney * 140.0 / 10.0);
						break;
					}
				}
				break;
			}
		}
	}
	// ----
	if( NewOptionAddMoney > 0 )
	{
		if( StartMoney + NewOptionAddMoney > 2000000000 )
		{
			Money = 2000000000;
		}
		else
		{
			Money = StartMoney + NewOptionAddMoney;
		}
	}
	// ----
	if( Money != -1 )
	{
		if( Mode == 1 )
		{
			Money /= 3;
		}
		// ----
		return Money;
	}
	// ----
	return pSetItemPrice(lpItem, Mode);
}
Beispiel #4
0
 * then move it to allocated memory when the resource
 * scan is complete.
 */
#if defined(_MSC_VER)
extern "C" URES res_all; /* declare as C to avoid name mangling by visual c */
#endif
URES res_all;
int32_t res_all_size = sizeof(res_all);

/*
 * Definition of records permitted within each
 * resource with the routine to process the record
 * information.
 */
static RES_ITEM dir_items[] = {
   { "Name", CFG_TYPE_NAME, ITEM(dir_res.hdr.name), 0, CFG_ITEM_REQUIRED, NULL, NULL, NULL },
   { "Description", CFG_TYPE_STR, ITEM(dir_res.hdr.desc), 0, 0, NULL, NULL, NULL },
   { "DirPort", CFG_TYPE_PINT32, ITEM(dir_res.DIRport), 0, CFG_ITEM_DEFAULT, DIR_DEFAULT_PORT, NULL, NULL },
   { "Address", CFG_TYPE_STR, ITEM(dir_res.address), 0, CFG_ITEM_REQUIRED, NULL, NULL, NULL },
   { "Password", CFG_TYPE_MD5PASSWORD, ITEM(dir_res.password), 0, CFG_ITEM_REQUIRED, NULL, NULL, NULL },
   { "HeartBeatInterval", CFG_TYPE_TIME, ITEM(dir_res.heartbeat_interval), 0, CFG_ITEM_DEFAULT, "0", NULL, NULL },
   TLS_CONFIG(dir_res)
   { NULL, 0, { 0 }, 0, 0, NULL, NULL, NULL }
};

static RES_ITEM con_items[] = {
   { "Name", CFG_TYPE_NAME, ITEM(con_res.hdr.name), 0, CFG_ITEM_REQUIRED, NULL, NULL, NULL },
   { "Description", CFG_TYPE_STR, ITEM(con_res.hdr.desc), 0, 0, NULL, NULL, NULL },
   { "Password", CFG_TYPE_MD5PASSWORD, ITEM(con_res.password), 0, CFG_ITEM_REQUIRED, NULL, NULL, NULL },
   { "HeartBeatInterval", CFG_TYPE_TIME, ITEM(con_res.heartbeat_interval), 0, CFG_ITEM_DEFAULT, "0", NULL, NULL },
   TLS_CONFIG(dir_res)