本文整理汇总了C++中IOnlineSubsystem::Exec方法的典型用法代码示例。如果您正苦于以下问题:C++ IOnlineSubsystem::Exec方法的具体用法?C++ IOnlineSubsystem::Exec怎么用?C++ IOnlineSubsystem::Exec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOnlineSubsystem
的用法示例。
在下文中一共展示了IOnlineSubsystem::Exec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnlineExec
/**
* Exec handler that routes online specific execs to the proper subsystem
*
* @param InWorld World context
* @param Cmd the exec command being executed
* @param Ar the archive to log results to
*
* @return true if the handler consumed the input, false to continue searching handlers
*/
static bool OnlineExec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar )
{
bool bWasHandled = false;
// Ignore any execs that don't start with ONLINE
if (FParse::Command(&Cmd, TEXT("ONLINE")))
{
FString SubName;
FParse::Value(Cmd, TEXT("Sub="), SubName);
// Allow for either Sub=<platform> or Subsystem=<platform>
if (SubName.Len() > 0)
{
Cmd += FCString::Strlen(TEXT("Sub=")) + SubName.Len();
}
else
{
FParse::Value(Cmd, TEXT("Subsystem="), SubName);
if (SubName.Len() > 0)
{
Cmd += FCString::Strlen(TEXT("Subsystem=")) + SubName.Len();
}
}
IOnlineSubsystem* OnlineSub = NULL;
// If the exec requested a specific subsystem, the grab that one for routing
if (SubName.Len())
{
OnlineSub = Online::GetSubsystem(InWorld, *SubName);
}
// Otherwise use the default subsystem and route to that
else
{
OnlineSub = Online::GetSubsystem(InWorld);
}
if (OnlineSub != NULL)
{
bWasHandled = OnlineSub->Exec(InWorld, Cmd, Ar);
// If this wasn't handled, see if this is a testing request
if (!bWasHandled)
{
if (FParse::Command(&Cmd, TEXT("TEST")))
{
if (FParse::Command(&Cmd, TEXT("FRIENDS")))
{
TArray<FString> Invites;
for (FString FriendId=FParse::Token(Cmd, false); !FriendId.IsEmpty(); FriendId=FParse::Token(Cmd, false))
{
Invites.Add(FriendId);
}
// This class deletes itself once done
(new FTestFriendsInterface(SubName))->Test(InWorld, Invites);
bWasHandled = true;
}
// Spawn the object that will exercise all of the session methods as host
else if (FParse::Command(&Cmd, TEXT("SESSIONHOST")))
{
bool bTestLAN = FParse::Command(&Cmd, TEXT("LAN")) ? true : false;
bool bTestPresence = FParse::Command(&Cmd, TEXT("PRESENCE")) ? true : false;
// This class deletes itself once done
(new FTestSessionInterface(SubName, true))->Test(InWorld, bTestLAN, bTestPresence);
bWasHandled = true;
}
// Spawn the object that will exercise all of the session methods as client
else if (FParse::Command(&Cmd, TEXT("SESSIONCLIENT")))
{
bool bTestLAN = FParse::Command(&Cmd, TEXT("LAN")) ? true : false;
bool bTestPresence = FParse::Command(&Cmd, TEXT("PRESENCE")) ? true : false;
// This class deletes itself once done
(new FTestSessionInterface(SubName, false))->Test(InWorld, bTestLAN, bTestPresence);
bWasHandled = true;
}
else if (FParse::Command(&Cmd, TEXT("CLOUD")))
{
// This class deletes itself once done
(new FTestCloudInterface(SubName))->Test(InWorld);
bWasHandled = true;
}
else if (FParse::Command(&Cmd, TEXT("LEADERBOARDS")))
{
// This class deletes itself once done
(new FTestLeaderboardInterface(SubName))->Test(InWorld);
bWasHandled = true;
}
else if (FParse::Command(&Cmd, TEXT("VOICE")))
{
// This class deletes itself once done
(new FTestVoice())->Test();
bWasHandled = true;
}
else if (FParse::Command(&Cmd, TEXT("TIME")))
//.........这里部分代码省略.........