Beispiel #1
0
 public void PrintHelpMessage(string player, string command)
 {
     for (int i = 0; i < m_MasterHelpList.Count; i += 1)
     {
         if (m_MasterHelpList[i].Command == command)
         {
             for (int j = 0; j < m_MasterHelpList[i].Description.Length; j += 1)
             {
                 Game(msg.pm(player, m_MasterHelpList[i].Description[j]));
             }
             return;
         }
     }
     Game(msg.pm(player, "Im sorry I do not understand the command [" + command + "]."));
     return;
 }
Beispiel #2
0
        public void doTest(ChatEvent e)
        {
            string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            psyGame.Send(msg.pm("PsyOps", path));
            psyGame.Send(msg.pm("PsyOps", System.IO.Directory.GetParent(path).ToString()));
            //Game(msg.arena("Time: ["+(DateTime.Now - ts)+"]"));
            //ts = DateTime.Now;
        }
Beispiel #3
0
        //----------------------------------------------------------------------//
        //                       Commands                                       //
        //----------------------------------------------------------------------//
        public void command_PlayGame(SSPlayer p, ChatEvent e)
        {
            if (!this.allowedCommandUsage(p))
            {
                return;
            }

            if (e.Message.Contains(' '))
            {
                string[] data = e.Message.Split(' ');
                int      num;

                if (int.TryParse(data[1], out num) || int.TryParse(data[1], out num))
                {
                    if (!this.m_BaseManager.CheckBaseSafe(num))
                    {
                        psyGame.Send(msg.pm(p.PlayerName, "Base[ " + num + " ] is an invalid base. It is either too close to another base that is in use or the base number is too high. Please select a base from 1 to " + m_BaseManager.Bases.Count() + "."));
                        return;
                    }

                    this.loadBase(num);
                    e.Message = ".race";
                    psyGame.CoreSend(e);
                }
                return;
            }

            if (!this.m_Timer.Enabled)
            {
                timer_startRaceTimer();
            }
            if (this.m_Status == RaceState.InProgress)
            {
                psyGame.Send(msg.pm(p.PlayerName, "?|setfreq " + m_Freq + (p.Ship == ShipTypes.Spectator ? "|setship 1" : "|prize warp") + "|prize fullcharge|a A race is currently in progress. Please wait here. Once next race starts you will be inlcuded and warped."));
                return;
            }

            psyGame.Send(msg.pm(p.PlayerName, "?|setfreq " + m_Freq + (p.Ship == ShipTypes.Spectator ? "|setship 1" : "|prize warp") + "|prize fullcharge|a Please select the ship you wish to race in. A race will begin shortly."));
        }
Beispiel #4
0
        //----------------------------------------------------------------------//
        //                       Commands                                       //
        //----------------------------------------------------------------------//
        public void command_GameStart(SSPlayer p)
        {
            if (this.m_Timer.Enabled || this.m_Status != Misc.BaseGameStatus.NotStarted)
            {
                psyGame.Send(msg.pm(p.PlayerName, "The game has already been started."));
                return;
            }

            // Get freq counts
            int aCount = this.m_Players.PlayerList.FindAll(item => item.Frequency == this.m_AlphaFreq && item.Ship != ShipTypes.Spectator).Count;
            int bCount = this.m_Players.PlayerList.FindAll(item => item.Frequency == this.m_BravoFreq && item.Ship != ShipTypes.Spectator).Count;

            if (aCount > 0 && bCount > 0)
            {
                this.freqDump(this.m_AlphaFreq, this.m_CurrentPoint.AlphaTeam(), true);
                this.freqDump(this.m_BravoFreq, this.m_CurrentPoint.BravoTeam(), false);

                psyGame.Send(msg.arena("[ BaseDuel ] A game will begin in " + this.m_StartGameDelay + " seconds. [ " + this.m_CurrentPoint.AlphaCount() + " vs " + this.m_CurrentPoint.BravoCount() + " ]" + (this.m_MultiOn ? "      - " + this.m_GameTag + " -" : ".")));
                psyGame.Send(msg.team_pm(this.m_AlphaFreq, "Welcome to Team: " + this.m_ATeamName + ". Good Luck!"));
                psyGame.Send(msg.team_pm(this.m_BravoFreq, "Welcome to Team: " + this.m_BTeamName + ". Good Luck!"));

                this.timer_Setup(Misc.TimerType.GameStart);
                return;
            }

            // Need one player on opfor
            psyGame.Send(msg.pm(p.PlayerName, "You need to have at least 1 player on each team to start. Please find an opponent and have them join Freq= " + (aCount == 0 ? this.m_AlphaFreq : this.m_BravoFreq) + "."));
        }
Beispiel #5
0
 public void cmd_timeleft(ChatEvent e)
 {
     if (game_status == true)
     {
         TimeSpan m_TimeGameTimeSpan = DateTime.Now - m_TimeGame;
         psyGame.Send(msg.pm(e.PlayerName, "timeleft: " + m_TimeGameTimeSpan.Minutes.ToString().PadLeft(2, '0') + ":" + m_TimeGameTimeSpan.Seconds.ToString().PadLeft(2, '0') + "." + m_TimeGameTimeSpan.Milliseconds));
     }
 }
Beispiel #6
0
        public Queue <EventArgs> getBaseInfo(string PlayerName, int BaseNumber)
        {
            Queue <EventArgs> reply = new Queue <EventArgs>();

            int offset = 38;

            reply.Enqueue(msg.pm(PlayerName, "Base Information ----------------------------"));      //BaseNumber
            reply.Enqueue(msg.pm(PlayerName, "Base Name".PadRight(20) + m_Bases[BaseNumber].BaseName.PadLeft(25)));
            reply.Enqueue(msg.pm(PlayerName, "Base Number".PadRight(20) + BaseNumber.ToString().PadLeft(2, '0').PadLeft(25)));
            reply.Enqueue(msg.pm(PlayerName, "Tile Count".PadRight(20) + m_Bases[BaseNumber].TileCount.ToString().PadLeft(25)));
            reply.Enqueue(msg.pm(PlayerName, "Base Size".PadRight(20) + m_Bases[BaseNumber].Size.ToString().PadLeft(25)));
            reply.Enqueue(msg.pm(PlayerName, ("+--------  Dimension   --------+").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("|  x1 [ " + m_Bases[BaseNumber].BaseDimension[0].ToString().PadLeft(4) + " ]    y1 [ " + m_Bases[BaseNumber].BaseDimension[1].ToString().PadLeft(4) + " ]  |").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("|  x2 [ " + m_Bases[BaseNumber].BaseDimension[2].ToString().PadLeft(4) + " ]    y2 [ " + m_Bases[BaseNumber].BaseDimension[3].ToString().PadLeft(4) + " ]  |").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("+--------  Alpha Safe  --------+").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("|  x1 [ " + m_Bases[BaseNumber].AlphaSafe[0].ToString().PadLeft(4) + " ]    y1 [ " + m_Bases[BaseNumber].AlphaSafe[1].ToString().PadLeft(4) + " ]  |").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("|  x2 [ " + m_Bases[BaseNumber].AlphaSafe[2].ToString().PadLeft(4) + " ]    y2 [ " + m_Bases[BaseNumber].AlphaSafe[3].ToString().PadLeft(4) + " ]  |").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("+--Warp Point     -------------+").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("|  x  [ " + m_Bases[BaseNumber].AlphaStartX.ToString().PadLeft(4) + " ]    y  [ " + m_Bases[BaseNumber].AlphaStartY.ToString().PadLeft(4) + " ]  |").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("|--------  Bravo Safe  --------+").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("|  x1 [ " + m_Bases[BaseNumber].BravoSafe[0].ToString().PadLeft(4) + " ]    y1 [ " + m_Bases[BaseNumber].BravoSafe[1].ToString().PadLeft(4) + " ]  |").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("|  x2 [ " + m_Bases[BaseNumber].BravoSafe[2].ToString().PadLeft(4) + " ]    y2 [ " + m_Bases[BaseNumber].BravoSafe[3].ToString().PadLeft(4) + " ]  |").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("+--Warp Point     -------------+").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("|  x  [ " + m_Bases[BaseNumber].BravoStartX.ToString().PadLeft(4) + " ]    y  [ " + m_Bases[BaseNumber].BravoStartY.ToString().PadLeft(4) + " ]  |").PadLeft(offset)));
            reply.Enqueue(msg.pm(PlayerName, ("+------------------------------+").PadLeft(offset)));

            return(reply);
        }
Beispiel #7
0
        private void command_GetGameScore(SSPlayer p, ChatEvent e)
        {
            if (p.Ship == ShipTypes.Spectator)
            {
                psyGame.Send(msg.pm(p.PlayerName, "+--------------------------------------------------+"));
                psyGame.Send(msg.pm(p.PlayerName, "| Game Number               Score                  |"));
                psyGame.Send(msg.pm(p.PlayerName, "+--------------------------------------------------+"));
                foreach (Classes.BaseGame b in this.m_Games)
                {
                    //psyGame.Send(msg.pm(p.PlayerName, "Game[ " + b.gameNum().ToString().PadLeft(2,'0') + " ]     Freq[ " + b.AlphaFreq.ToString().PadLeft(2,'0') + " ]   " + b.AlphaScore + " - " + b.BravoScore + "   [ " + b.BravoFreq + " ]Freq"));
                    psyGame.Send(msg.pm(p.PlayerName, "| [ " + b.gameNum().ToString().PadLeft(2, '0') + " ]       Freq[ " + b.AlphaFreq.ToString().PadLeft(2) + " ]  " + b.AlphaScore.ToString().PadLeft(2) + " - " + b.BravoScore.ToString().PadRight(2) + "   [ " + b.BravoFreq.ToString().PadLeft(2) + " ]Freq    |"));
                }
                psyGame.Send(msg.pm(p.PlayerName, "+--------------------------------------------------+"));
                return;
            }

            Classes.BaseGame game = this.getGame_FromCommand(p, e, ModLevels.None);

            if (game != null)
            {
                psyGame.Send(msg.pm(p.PlayerName, game.AlphaName + "   " + game.AlphaScore.ToString().PadLeft(2) + " - " + game.BravoScore.ToString().PadRight(2) + "   " + game.BravoName));
            }
        }
Beispiel #8
0
        private void doBaseInfo(SSPlayer p, ChatEvent e)
        {
            int num;

            if (int.TryParse(e.Message.Split(' ')[2], out num))
            {
                List <BRPlayer> listRequested = this.m_FakeDB.GetBaseRecords(num);

                if (listRequested == null)
                {
                    psyGame.Send(msg.pm(p.PlayerName, "There are no records for Base Number[ " + num + " ]."));
                    return;
                }

                psyGame.Send(msg.pm(p.PlayerName, "+----------------------------------------------------------------------+"));
                psyGame.Send(msg.pm(p.PlayerName, "|  Base Times for:                                     BaseID #[ " + num.ToString().PadLeft(2, '0') + " ]  |"));
                psyGame.Send(msg.pm(p.PlayerName, "+----------------------------------------------------------------------+"));
                psyGame.Send(msg.pm(p.PlayerName, "|    Player".PadRight(25) + "Time".PadRight(22) + "Ship".PadRight(13) + "Date".PadRight(11) + "|"));
                psyGame.Send(msg.pm(p.PlayerName, "+----------------------------------------------------------------------+"));
                int i = 1;
                foreach (BRPlayer b in listRequested)
                {
                    psyGame.Send(msg.pm(p.PlayerName, "| " + (i++).ToString().PadLeft(2, '0') + "." + b.PlayerName.PadRight(20) + b.Time.ToString().PadRight(22) + b.Ship.ToString().PadRight(13) + b.Date.ToShortDateString().PadRight(11) + "|"));
                }
                psyGame.Send(msg.pm(p.PlayerName, "+----------------------------------------------------------------------+"));
                psyGame.Send(msg.pm(p.PlayerName, "| For any help with commands type :                     .br commands   |"));
                psyGame.Send(msg.pm(p.PlayerName, "+----------------------------------------------------------------------+"));
                return;
            }
            psyGame.Send(msg.pm(p.PlayerName, "The correct format for this command is : .br baseinfo [ID#]      EXAMPLE:   .br baseinfo 23"));
        }