Example #1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        // Paddles
        if (collision.gameObject.name.Contains("Paddle"))
        {
            HandlePaddleHit(collision);
        }

        // Walls
        if (collision.gameObject.name.Contains("Wall"))
        {
            SoundManager.Instance.PlayOneShot(SoundManager.Instance.wallBloop);
        }

        // Goals
        if (collision.gameObject.name.Contains("Goal"))
        {
            SoundManager.Instance.PlayOneShot(SoundManager.Instance.goalBloop);

            if (collision.gameObject.name == "Left Goal")
            {
                UpdateAndContinue("Right Score", isOutOfBounds: false);

                ScoreLimit.ScoreLimitWinCondition(isLeftScore: false);
            }

            if (collision.gameObject.name == "Right Goal")
            {
                UpdateAndContinue("Left Score", isOutOfBounds: false);

                ScoreLimit.ScoreLimitWinCondition(isLeftScore: true);
            }
        }
    }
Example #2
0
        public string GetField(int field)
        {
            switch (field)
            {
            case 0: return(HostName);

            case 1: return(GameName);

            case 2: return(GameVersion);

            case 3: return(MapName);

            case 4: return(GameType);

            case 5: return(GameVariant);

            case 6: return(NumPlayers.ToString());

            case 7: return(MaxPlayers.ToString());

            case 8: return(GameMode);

            case 9: return((Password ? 1 : 0).ToString());

            case 10: return(TimeLimit.ToString());

            case 11: return(RoundTime.ToString());

            case 12: return(HostPort.ToString());

            case 13: return((Dedicated ? 1 : 0).ToString());

            case 14: return((Ranked ? 1 : 0).ToString());

            case 15: return((AntiCheat ? 1 : 0).ToString());

            case 16: return(OS);

            case 17: return((BattleRecorder ? 1 : 0).ToString());

            case 18: return(BRIndex);

            case 19: return(BRDownload);

            case 20: return((Voip ? 1 : 0).ToString());

            case 21: return((AutoBalance ? 1 : 0).ToString());

            case 22: return((FriendlyFire ? 1 : 0).ToString());

            case 23: return(TKMode);

            case 24: return(StartDelay.ToString());

            case 25: return(SpawnTime.ToString("0.000000", CultureInfo.InvariantCulture));

            case 26: return(ServerText);

            case 27: return(ServerLogo);

            case 28: return(CommunityWebsite);

            case 29: return(ScoreLimit.ToString());

            case 30: return(TicketRatio.ToString());

            case 31: return(TeamRatio.ToString("0.000000", CultureInfo.InvariantCulture));

            case 32: return(Team1Name);

            case 33: return(Team2Name);

            case 34: return((CoopEnabled ? 1 : 0).ToString());

            case 35: return((Pure ? 1 : 0).ToString());

            case 36: return(MapSize.ToString());

            case 37: return((Unlocks ? 1 : 0).ToString());

            case 38: return(Fps.ToString());

            case 39: return((Plasma ? 1 : 0).ToString());

            case 40: return(ReservedSlots.ToString());

            case 41: return(CoopBotRatio.ToString());

            case 42: return(CoopBotCount.ToString());

            case 43: return(CoopBotDifficulty.ToString());

            case 44: return((NoVehicles ? 1 : 0).ToString());

            default:
                return("");
            }
        }
    private void DisplayRoundOptions()
    {
        GUILayout.BeginHorizontal();

        GUILayout.BeginVertical();
        {
            GUILayout.BeginHorizontal(Relay.Instance.BaseSkin.box);
            GUILayout.Label("DEATHMATCH", Relay.Instance.OptionsMenu.LabelStyle);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (IsRoundInProgress)
            {
                if (GUIExts.Button("END ROUND", new GUIStyle(Relay.Instance.BaseSkin.button)
                {
                    fixedWidth = 95 * 3 + 1
                }))
                {
                    EndRoundNow();
                    StartRoundAfterMapChange = false;
                }
            }
            else
            {
                if (GUIExts.Button("START ROUND", new GUIStyle(Relay.Instance.BaseSkin.button)
                {
                    fixedWidth = 95 * 3 + 1
                }))
                {
                    StartRound();
                    StartRoundAfterMapChange   = true;
                    Relay.Instance.ShowOptions = false;
                }
            }
            GUILayout.Space(-3);
            GUILayout.EndHorizontal();
        }
        GUILayout.EndVertical();

        GUILayout.Space(1);

        GUILayout.BeginVertical(new GUIStyle()
        {
            fixedWidth = 95
        });
        {
            GUILayout.BeginHorizontal(Relay.Instance.BaseSkin.box);
            GUILayout.Label("SCORE LIMIT", Relay.Instance.OptionsMenu.LabelStyle);
            GUILayout.EndHorizontal();

            GUI.enabled = !IsRoundInProgress;
            var numText = GUILayout.TextField(ScoreLimit.ToString(), new GUIStyle(Relay.Instance.BaseSkin.textField)
            {
                fixedWidth = 95
            });
            if (numText.Length < 1)
            {
                ScoreLimit = 0;
            }
            else
            {
                int num;
                if (int.TryParse(numText, out num) && num > 0)
                {
                    ScoreLimit = num;
                }
            }
            GUI.enabled = true;
        }
        GUILayout.EndVertical();

        GUILayout.EndHorizontal();
    }
Example #4
0
        public static MsCrmResultObject GetScoreLimitsByType(ScoreType scoreType, SqlDataAccess sda)
        {
            MsCrmResultObject returnValue = new MsCrmResultObject();

            try
            {
                #region | SQL QUERY |
                string query = @"SELECT
	                                sl.new_scorelimitId AS Id
	                                ,sl.new_name AS Name
	                                ,sl.new_scoretype AS ScoreType
	                                ,sl.new_frequency AS Frequency
	                                ,sl.new_point AS Point
	                                ,sl.new_scoreperiod AS Period
                                FROM
	                                new_scorelimit AS sl (NOLOCK)
                                WHERE
	                                sl.new_scoretype=@ScoreType --Sisteme giriş
                                AND
	                                sl.statecode=0
                                AND
	                                sl.statuscode=1 --Aktif
                                ORDER BY
	                                sl.new_scoreperiod ASC"    ;
                #endregion

                SqlParameter[] parameters =
                {
                    new SqlParameter("@ScoreType", (int)scoreType)
                };

                DataTable dt = sda.getDataTable(query, parameters);


                if (dt != null && dt.Rows.Count > 0)
                {
                    List <ScoreLimit> returnList = new List <ScoreLimit>();

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        ScoreLimit _scoreLimit = new ScoreLimit();
                        _scoreLimit.Id        = (Guid)dt.Rows[i]["Id"];
                        _scoreLimit.Name      = dt.Rows[i]["Name"] != DBNull.Value ? dt.Rows[i]["Name"].ToString() : string.Empty;
                        _scoreLimit.ScoreType = (ScoreType)(int)dt.Rows[i]["ScoreType"];
                        _scoreLimit.Period    = (ScorePeriod)(int)dt.Rows[i]["Period"];
                        _scoreLimit.Point     = (int)dt.Rows[i]["Point"];
                        _scoreLimit.Frequency = (int)dt.Rows[i]["Frequency"];

                        returnList.Add(_scoreLimit);
                    }

                    returnValue.Success      = true;
                    returnValue.ReturnObject = returnList;
                }
                else
                {
                    returnValue.Success = false;
                    returnValue.Result  = "Skor Limit kaydı bulunamadı.";
                }
            }
            catch (Exception ex)
            {
                returnValue.Success = false;
                returnValue.Result  = ex.Message;
            }
            return(returnValue);
        }
Example #5
0
        public static MsCrmResultObject GetScoreLimitsByType(ScoreType scoreType, SqlDataAccess sda)
        {
            MsCrmResultObject returnValue = new MsCrmResultObject();
            try
            {
                #region | SQL QUERY |
                string query = @"SELECT
                                    sl.new_scorelimitId AS Id
                                    ,sl.new_name AS Name
                                    ,sl.new_scoretype AS ScoreType
                                    ,sl.new_frequency AS Frequency
                                    ,sl.new_point AS Point
                                    ,sl.new_scoreperiod AS Period
                                FROM
                                    new_scorelimit AS sl (NOLOCK)
                                WHERE
                                    sl.new_scoretype=@ScoreType --Sisteme giriş
                                AND
                                    sl.statecode=0
                                AND
                                    sl.statuscode=1 --Aktif
                                ORDER BY
                                    sl.new_scoreperiod ASC";
                #endregion

                SqlParameter[] parameters = {
                                            new SqlParameter("@ScoreType",(int)scoreType)
                                            };

                DataTable dt = sda.getDataTable(query, parameters);

                if (dt != null && dt.Rows.Count > 0)
                {
                    List<ScoreLimit> returnList = new List<ScoreLimit>();

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        ScoreLimit _scoreLimit = new ScoreLimit();
                        _scoreLimit.Id = (Guid)dt.Rows[i]["Id"];
                        _scoreLimit.Name = dt.Rows[i]["Name"] != DBNull.Value ? dt.Rows[i]["Name"].ToString() : string.Empty;
                        _scoreLimit.ScoreType = (ScoreType)(int)dt.Rows[i]["ScoreType"];
                        _scoreLimit.Period = (ScorePeriod)(int)dt.Rows[i]["Period"];
                        _scoreLimit.Point = (int)dt.Rows[i]["Point"];
                        _scoreLimit.Frequency = (int)dt.Rows[i]["Frequency"];

                        returnList.Add(_scoreLimit);
                    }

                    returnValue.Success = true;
                    returnValue.ReturnObject = returnList;
                }
                else
                {
                    returnValue.Success = false;
                    returnValue.Result = "Skor Limit kaydı bulunamadı.";
                }
            }
            catch (Exception ex)
            {
                returnValue.Success = false;
                returnValue.Result = ex.Message;
            }
            return returnValue;
        }