本文整理汇总了C++中sqf::Parameters::at方法的典型用法代码示例。如果您正苦于以下问题:C++ Parameters::at方法的具体用法?C++ Parameters::at怎么用?C++ Parameters::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sqf::Parameters
的用法示例。
在下文中一共展示了Parameters::at方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: playerDeath
Sqf::Value HiveExtApp::playerDeath( Sqf::Parameters params )
{
int characterId = Sqf::GetIntAny(params.at(0));
int duration = static_cast<int>(Sqf::GetDouble(params.at(1)));
return booleanReturn(_charData->killCharacter(characterId,duration));
}
示例2: loadPlayer
Sqf::Value HiveExtApp::loadPlayer( Sqf::Parameters params )
{
string playerId = Sqf::GetStringAny(params.at(0));
string playerName = Sqf::GetStringAny(params.at(2));
return _charData->fetchCharacterInitial(playerId,getServerId(),playerName);
}
示例3: recordCharacterLogin
Sqf::Value HiveExtApp::recordCharacterLogin( Sqf::Parameters params )
{
string playerId = Sqf::GetStringAny(params.at(0));
int characterId = Sqf::GetIntAny(params.at(1));
int action = Sqf::GetIntAny(params.at(2));
//TODO: Get survivor ID
return booleanReturn(_charData->recordLogEntry(playerId,0,getServerId(),action));
}
示例4: recordCharacterLogin
Sqf::Value HiveExtApp::recordCharacterLogin( Sqf::Parameters params )
{
string playerId = Sqf::GetStringAny(params.at(0));
int characterId = Sqf::GetIntAny(params.at(1));
int action = Sqf::GetIntAny(params.at(2));
return booleanReturn(_charData->recordLogin(playerId,characterId,action));
}
示例5: playerInit
Sqf::Value HiveExtApp::playerInit( Sqf::Parameters params )
{
int characterId = Sqf::GetIntAny(params.at(0));
Sqf::Value inventory = boost::get<Sqf::Parameters>(params.at(1));
Sqf::Value backpack = boost::get<Sqf::Parameters>(params.at(2));
return booleanReturn(_charData->initCharacter(characterId,inventory,backpack));
}
示例6: objectInventory
Sqf::Value HiveExtApp::objectInventory( Sqf::Parameters params, bool byUID /*= false*/ )
{
Int64 objectIdent = Sqf::GetBigInt(params.at(0));
Sqf::Value inventory = boost::get<Sqf::Parameters>(params.at(1));
if (objectIdent != 0) //all the vehicles have objectUID = 0, so it would be bad to update those
return booleanReturn(_objData->updateObjectInventory(getServerId(),objectIdent,byUID,inventory));
return booleanReturn(true);
}
示例7: vehicleDamaged
Sqf::Value HiveExtApp::vehicleDamaged( Sqf::Parameters params )
{
Int64 objectIdent = Sqf::GetBigInt(params.at(0));
Sqf::Value hitPoints = boost::get<Sqf::Parameters>(params.at(1));
double damage = Sqf::GetDouble(params.at(2));
if (objectIdent > 0) //sometimes script sends this with object id 0, which is bad
return booleanReturn(_objData->updateVehicleStatus(getServerId(),objectIdent,hitPoints,damage));
return booleanReturn(true);
}
示例8: vehicleMoved
Sqf::Value HiveExtApp::vehicleMoved( Sqf::Parameters params )
{
Int64 objectIdent = Sqf::GetBigInt(params.at(0));
Sqf::Value worldspace = boost::get<Sqf::Parameters>(params.at(1));
double fuel = Sqf::GetDouble(params.at(2));
if (objectIdent > 0) //sometimes script sends this with object id 0, which is bad
return booleanReturn(_objData->updateVehicleMovement(getServerId(),objectIdent,worldspace,fuel));
return booleanReturn(true);
}
示例9: populateQuery
void SqlCustDataSource::populateQuery(string query, Sqf::Parameters& params, CustomDataQueue& queue)
{
for (int i = 0; i < params.size(); i++)
{
query = boost::algorithm::replace_nth_copy(query, "?", i, Sqf::GetStringAny(params.at(i)));
}
auto custRes = getDB()->queryParams(query.c_str());
while (custRes->fetchRow())
{
Sqf::Parameters custParams;
for (int i = 0; i < custRes->numFields(); i++)
{
int val = custRes->at(i).getInt32();
if (val == 0 && custRes->at(i).getString() != "0")
{
custParams.push_back(custRes->at(i).getString());
}
else
{
custParams.push_back(val);
}
}
queue.push(custParams);
}
}
示例10: objectDelete
Sqf::Value HiveExtApp::objectDelete( Sqf::Parameters params, bool byUID /*= false*/ )
{
Int64 objectIdent = Sqf::GetBigInt(params.at(0));
if (objectIdent != 0) //all the vehicles have objectUID = 0, so it would be bad to delete those
return booleanReturn(_objData->deleteObject(getServerId(),objectIdent,byUID));
return booleanReturn(true);
}
示例11: customExecute
bool SqlCustDataSource::customExecute(string query, Sqf::Parameters& params) {
static SqlStatementID stmtId;
auto stmt = getDB()->makeStatement(stmtId, query);
for (int i = 0; i < params.size(); i++)
{
try
{
stmt->addInt32(lexical_cast<int>(params.at(i)));
}
catch (bad_lexical_cast)
{
stmt->addString(lexical_cast<string>(params.at(i)));
}
}
bool exRes = stmt->execute();
poco_assert(exRes == true);
return exRes;
}
示例12: streamCustom
Sqf::Value HiveExtApp::streamCustom( Sqf::Parameters params )
{
if (_custQueue.empty())
{
string query = Sqf::GetStringAny(params.at(0));
//if (!Sqf::IsNull(params.at(1)))
Sqf::Parameters rawParams = boost::get<Sqf::Parameters>(params.at(1));
_custData->populateQuery(query, rawParams, _custQueue);
Sqf::Parameters retVal;
retVal.push_back(string("CustomStreamStart"));
retVal.push_back(static_cast<int>(_custQueue.size()));
return retVal;
}
else
{
Sqf::Parameters retVal = _custQueue.front();
_custQueue.pop();
return retVal;
}
}
示例13: objectPublish
Sqf::Value HiveExtApp::objectPublish( Sqf::Parameters params )
{
string className = boost::get<string>(params.at(1));
double damage = Sqf::GetDouble(params.at(2));
int characterId = Sqf::GetIntAny(params.at(3));
Sqf::Value worldSpace = boost::get<Sqf::Parameters>(params.at(4));
Sqf::Value inventory = boost::get<Sqf::Parameters>(params.at(5));
Sqf::Value hitPoints = boost::get<Sqf::Parameters>(params.at(6));
double fuel = Sqf::GetDouble(params.at(7));
Int64 uniqueId = Sqf::GetBigInt(params.at(8));
return booleanReturn(_objData->createObject(getServerId(),className,damage,characterId,worldSpace,inventory,hitPoints,fuel,uniqueId));
}
示例14: objectPublish
Sqf::Value HiveExtApp::objectPublish( Sqf::Parameters params )
{
/*int serverId = boost::get<int>(params.at(0));
string className = boost::get<string>(params.at(1));
string characterId = Sqf::GetIntAny(params.at(2));
Sqf::Value worldSpace = boost::get<Sqf::Parameters>(params.at(3));
Int64 uniqueId = Sqf::GetBigInt(params.at(4));
*/
int serverId = boost::get<int>(params.at(0));
string className = boost::get<string>(params.at(1));
double damage = Sqf::GetDouble(params.at(2));
int characterId = Sqf::GetIntAny(params.at(3));
Sqf::Value worldSpace = boost::get<Sqf::Parameters>(params.at(4));
Sqf::Value inventory = boost::get<Sqf::Parameters>(params.at(5));
Sqf::Value hitPoints = boost::get<Sqf::Parameters>(params.at(6));
double fuel = Sqf::GetDouble(params.at(7));
Int64 uniqueId = Sqf::GetBigInt(params.at(8));
//return booleanReturn(_objData->createObject(serverId,className,characterId,worldSpace,uniqueId));
//1:TentStorage:0:3:[329,[11173,3155.13,0.00391388]]:[]:[]:0:111730315510329:|
return booleanReturn(_objData->createObject(serverId,className,damage,characterId,worldSpace,inventory,hitPoints,fuel,uniqueId));
}
示例15: loadTraderDetails
Sqf::Value HiveExtApp::loadTraderDetails( Sqf::Parameters params )
{
if (_srvObjects.empty())
{
int characterId = Sqf::GetIntAny(params.at(0));
_objData->populateTraderObjects(characterId, _srvObjects);
Sqf::Parameters retVal;
retVal.push_back(string("ObjectStreamStart"));
retVal.push_back(static_cast<int>(_srvObjects.size()));
return retVal;
}
else
{
Sqf::Parameters retVal = _srvObjects.front();
_srvObjects.pop();
return retVal;
}
}