
Originally Posted by
Solid Snake
We're you able to sign into GameCenter when the game started?
I get Gamcenter log in, the famous "Wellcome Playerxxx ****SANDBOX****". Lets hope DanielH gets there soon!!!
(DanielH read this post, it says yo use May build, but August should work too: http://forums.epicgames.com/threads/...1#post28759669)
Now we need to move on, we want to enable GameCenter Multiplayer.
I use Krussel's code in my playercontroller, but I cannot get standard GameCenter Multiplayer UI(like in Infinity Blade, when you press the Multiplayer Button).
My game starts and nothing happens, i mean, it plays like a standard single player. I dont ever get the Gamecenter UI to appear on screen, like Epic documentation says.
I may be missing something here, some function to call the GC UI. The code I'm using is at the end of this post.
My router is fine, beacause i can play Infinity blade beetween my iPhone 4 and my iPad 2.
I get logs on my mac like this(I guess it is connected to GC??):
Oct 18 19:06:59 unknown UDKGame[3578] <Info>: 19:06:59.186007 com.apple.AVConference: GKSConnSettings: set server: {
"gk-cdx" = "17.155.5.253:4398";
"gk-commnat-cohort" = "17.155.5.237:16386";
"gk-commnat-main0" = "17.155.5.236:16384";
"gk-commnat-main1" = "17.155.5.236:16385";
}
What is missing here to make the GC Multiplayer UI to pop in the game screen?? (sorry I'm not very good at UnrealScript)
Code:
class HKPlayerController extends UTPlayerController;
// These don't need to be filled in with data but they cannot be none or ShowMatchmakingUI will crash
var OnlineGameSearch SearchSettings;
var OnlineGameSettings GameSettings;
simulated event PostBeginPlay()
{
super.PostBeginPlay();
SearchSettings = new class'OnlineGameSearch';
GameSettings = new class'OnlineGameSettings';
// OnlineSuppliedUIInterface(OnlineSub.GetNamedInterface('SuppliedUI')).ShowMatchmakingUI(0, SearchSettings, GameSettings); JUST TO TEST, NOT WORKING HERE
}
function ClearCreateOnlineGameDelegates()
{
OnlineSub.GameInterface.ClearCreateOnlineGameCompleteDelegate(OnCreateOnlineGameComplete);
}
function OnCreateOnlineGameComplete(name SessionName,bool bWasSuccessful)
{
local string URL;
local string MapName;
local string GameTypeName;
if(!bWasSuccessful) {
ClearCreateOnlineGameDelegates();
`Log("OnCreateOnlineGameComplete was NOT successful");
return;
}
MapName = WorldInfo.GetMapName(true); // Retrieve Map Name
GameTypeName = PathName(WorldInfo.GetGameClass()); // Retrieve Game Type
URL = MapName $ "?game=" $ GameTypeName $ "?listen"; // Make URL
// URL = "map01" $ "?game=MyGame.MyDeathmatch" $ "?listen"; Old Krussel Script
`Log("Resulting URL is ("$URL$")");
ClientTravel(URL, TRAVEL_Absolute);
ClearCreateOnlineGameDelegates();
}
function ClearJoinOnlineDelegates()
{
OnlineSub.GameInterface.ClearJoinOnlineGameCompleteDelegate(OnInviteJoinComplete);
}
function OnJoinOnlineGameComplete(name SessionName,bool bWasSuccessful)
{
local string URL;
if(!bWasSuccessful || OnlineSub == none || OnlineSub.GameInterface == none ) {
ClearJoinOnlineDelegates();
`Log("OnJoinOnlineGameComplete was not Successful, OnlineSub = OnlineSub.GameOnteface = none");
return;
}
if (OnlineSub.GameInterface.GetResolvedConnectString(SessionName,URL))
{
// allow game to override
URL = ModifyClientURL(URL);
`Log("Resulting url is ("$URL$")");
// Open a network connection to it
ClientTravel(URL, TRAVEL_Absolute);
}
ClearJoinOnlineDelegates();
}
function OpenNativeMatchmakingUI()
{
local OnlineSuppliedUIInterface OSI;
if(OnlineSub == none)
OnlineSub = class'GameEngine'.static.GetOnlineSubsystem();
if(OnlineSub == none)
return;
if(OnlineSub.GameInterface == none)
return;
OSI = OnlineSuppliedUIInterface(OnlineSub.GetNamedInterface('SuppliedUI'));
if (OSI == none)
return;
OnlineSub.GameInterface.AddCreateOnlineGameCompleteDelegate(OnCreateOnlineGameComplete);
OnlineSub.GameInterface.AddJoinOnlineGameCompleteDelegate(OnInviteJoinComplete);
OSI.ShowMatchmakingUI(0,SearchSettings, GameSettings);
}
defaultproperties
{
}
I'm using July, August & Setpember UDK, no luck.
Bookmarks