Exemplo n.º 1
0
        /// <summary>
        /// Follows the warp master if the warp mode is set to MASTER and warp master is in another subspace
        /// </summary>
        private IEnumerator FollowWarpMaster()
        {
            var seconds = new WaitForSeconds(CheckFollowMasterSInterval);

            while (true)
            {
                try
                {
                    if (!Enabled)
                    {
                        break;
                    }

                    if (MainSystem.Singleton.GameRunning)
                    {
                        if (ClientSubspaceList.ContainsKey(SettingsSystem.ServerSettings.WarpMaster) &&
                            ClientSubspaceList[SettingsSystem.ServerSettings.WarpMaster] != CurrentSubspace)
                        {
                            //Follow the warp master into warp if needed
                            CurrentSubspace = ClientSubspaceList[SettingsSystem.ServerSettings.WarpMaster];
                        }
                    }
                }
                catch (Exception e)
                {
                    Debug.LogError($"[LMP]: Error in coroutine FollowWarpMaster {e}");
                    throw;
                }

                yield return(seconds);
            }
        }
Exemplo n.º 2
0
 public void RemovePlayer(string playerName)
 {
     if (ClientSubspaceList.ContainsKey(playerName))
     {
         ClientSubspaceList.Remove(playerName);
     }
 }
Exemplo n.º 3
0
 public int GetPlayerSubspace(string playerName)
 {
     if (ClientSubspaceList.ContainsKey(playerName))
     {
         return(ClientSubspaceList[playerName]);
     }
     return(0);
 }
Exemplo n.º 4
0
        public bool PlayerIsInPastSubspace(string player)
        {
            if (ClientSubspaceList.ContainsKey(player) && CurrentSubspace >= 0)
            {
                var playerSubspace = ClientSubspaceList[player];
                if (playerSubspace == -1)
                {
                    return(false);
                }

                return(playerSubspace != CurrentSubspace && Subspaces[playerSubspace] < Subspaces[CurrentSubspace]);
            }
            return(false);
        }