Beispiel #1
0
        public override void CreateSession(string sessionName, OperationResultDelegate onComplete)
        {
            if (State != NetworkState.Running)
            {
                Log.Info(LogChannel, "[PhotonNetworkInterface] Cannot create session if not in running state");
                return;
            }

            if (!BoltNetwork.IsServer)
            {
                Log.Info(LogChannel, "[PhotonNetworkInterface] Cannot create session if not of type server");
                return;
            }

            _operationCallbackSessionCreated = onComplete;

            // Create some room custom properties
            PhotonRoomProperties roomProperties = new PhotonRoomProperties();

            roomProperties.IsOpen    = true;
            roomProperties.IsVisible = true;

            // Create the Photon Room
            BoltMatchmaking.CreateSession(sessionName, roomProperties);

            Log.Info(LogChannel, "[PhotonNetworkInterface] Session creation begun...");
        }
Beispiel #2
0
        public override void ConnectToSession(INetworkInterfaceSession session, OperationResultDelegate onComplete)
        {
            _operationCallbackSessionConnected = onComplete;

            UdpSession udpSession = ((PhotonNetworkInterfaceSession)session).UdpSession;

            BoltMatchmaking.JoinSession(udpSession);

            _connectedSessionInfo = session;
        }
Beispiel #3
0
        public override void LaunchServer(OperationResultDelegate onComplete)
        {
            if (State != NetworkState.Stopped)
            {
                throw new Exception("Cannot launch server when state is not 'Stopped'.");
            }

            _operationCallbackLaunch = onComplete;
            State = NetworkState.Launching;
            Log.Info(LogChannel, "[PhotonNetworkInterface] LaunchServer...");
            BoltLauncher.StartServer(GameBoltConfig.GetConfig());
        }
Beispiel #4
0
 public override void Shutdown(OperationResultDelegate onComplete)
 {
     _operationCallbackShutdown = onComplete;
     State = NetworkState.ShuttingDown;
     BoltNetwork.Shutdown();
 }
 public abstract void ConnectToSession(INetworkInterfaceSession session, OperationResultDelegate onComplete = null);
 public abstract void DisconnectFromSession(OperationResultDelegate onComplete = null);
 public abstract void Shutdown(OperationResultDelegate onComplete     = null);
 public override void CreateSession(string sessionName, OperationResultDelegate onComplete = null)
 {
     throw new NotImplementedException();
 }
 public abstract void LaunchClient(OperationResultDelegate onComplete = null);
 public abstract void LaunchServer(OperationResultDelegate onComplete = null);
 public override void Shutdown(OperationResultDelegate onComplete = null)
 {
     onComplete(true, "");
 }
 public override void LaunchServer(OperationResultDelegate onComplete = null)
 {
     onComplete(false, "Not implemented");
 }
 public override void DisconnectFromSession(OperationResultDelegate onComplete = null)
 {
     throw new NotImplementedException();
 }
Beispiel #14
0
 public override void DisconnectFromSession(OperationResultDelegate onComplete)
 {
     //_operationCallbackDisconnectedFromSession = onComplete;
     _connectedSessionInfo = null;
     Shutdown(onComplete); // with bolt, we have no way of returning to 'lobby' state
 }
 public abstract void CreateSession(string sessionName, OperationResultDelegate onComplete = null);
Beispiel #16
0
 void ConcludeOperationCallback(ref OperationResultDelegate callback, bool success, string message)
 {
     callback?.Invoke(success, message);
     callback = null;
 }
#pragma warning restore CS0067 // Naming Styles

    public override void ConnectToSession(INetworkInterfaceSession session, OperationResultDelegate onComplete = null)
    {
        throw new NotImplementedException();
    }