public void Init(Game game) { Game = game; CanvasController = transform.GetChild(0).GetComponent <CanvasController>(); CanvasController.Init(this); PhpController = GetComponent <PhpController>(); PhpController.Init(GameSparksController.Instance().PhpOffline); LoginController = GetComponent <LoginController>(); ChatController = GetComponent <ChatController>(); }
public void OnPhpAuthentication(bool success, string userId = null) { if (success) { GameSparksController.Instance() .AuthenticateUser(_userField.text, _passField.text, OnRegistration, OnAuthentication, ErrorCallback); DebugTool.Instance().SetMessage(new DebugMessage("Credentials are fine.", DebugMessageType.Message)); } else { DebugTool.Instance().SetMessage(new DebugMessage("Password or username was not good.", DebugMessageType.Message)); DisableLoginForm(false); } }
public void StartNewRtSession(RtSessionInfo info, OnPlayerConnectedToGame onPlayerConnectedToGame, OnPlayerDisconnected onPlayerDisconnected, OnRTReady onRtReady, OnPacketReceived onPacketReceived) { GameSparksController.Instance().GetGameSparksFactory().StartNewRtSession( info, onPlayerConnectedToGame, onPlayerDisconnected, onRtReady, onPacketReceived, ref _sessionInfo, ref _gameSparksRtUnity ); }