예제 #1
0
        // Race win pos
        void Result(InSim insim, IS_RES RES)
        {
            try
            {
                Connections CurrentConnection = GetConnection(RES.PLID);

                if (CurrentConnection.SentMSG == false)
                {
                    if (RES.ResultNum == 0)
                    {
                        // insim.Send(255, "" + _connections[CurrentConnection.UCID].PName + " ^8finished 1st!");
                        CurrentConnection.points += 4;
                    }
                    else if (RES.ResultNum == 1)
                    {
                        // insim.Send(255, "" + _connections[CurrentConnection.UCID].PName + " ^8finished 2nd!");
                        CurrentConnection.points += 3;
                    }
                    else if (RES.ResultNum == 2)
                    {
                        // insim.Send(255, "" + _connections[CurrentConnection.UCID].PName + " ^8finished 2nd!");
                        CurrentConnection.points += 2;
                    }
                    else if (RES.ResultNum == 3)
                    {
                        // insim.Send(255, "" + _connections[CurrentConnection.UCID].PName + " ^8finished 2nd!");
                        CurrentConnection.points += 1;
                    }
                }

                UpdateGui(CurrentConnection.UCID, true);
            }
            catch (Exception e)
            { LogTextToFile("error", "[" + RES.PLID + "] " + "" + "() BFN - Exception: " + e, false); }
        }
예제 #2
0
        // Player laps
        void Res(InSim insim, IS_RES RES)
        {
            try
            {
                var conn = GetConnection(RES.PLID);

                if (PointSystem == true)
                {
                    if (RES.Confirm == ConfirmationFlags.CONF_PENALTY_30)
                    {
                        insim.Send(conn.UCID, "^8You've been fined ^1-1 ^8points for ^230-SECOND PENALTY");
                        conn.points      -= 1;
                        conn.Disqualified = true;
                    }

                    if (RES.Confirm == ConfirmationFlags.CONF_PENALTY_45)
                    {
                        insim.Send(conn.UCID, "^8You've been fined ^1-4 ^8points for ^245-SECOND PENALTY");
                        conn.points      -= 4;
                        conn.Disqualified = true;
                    }
                }
            }
            catch (Exception e) { LogTextToFile("InSim-Errors", "[" + RES.PLID + "] " + " NCN - Exception: " + e, false); }
        }
예제 #3
0
 // Player laps
 void Res(InSim insim, IS_RES RES)
 {
     try
     {
         var conn = GetConnection(RES.PLID);
     }
     catch (Exception e) { LogTextToFile("InSim-Errors", "[" + RES.PLID + "] " + " NCN - Exception: " + e, false); }
 }
예제 #4
0
        // Race win pos
        void Result(InSim insim, IS_RES RES)
        {
            try
            {
                Connections CurrentConnection = GetConnection(RES.PLID);

                if (PointSystem == true)
                {
                    if (CurrentConnection.SentMSG == false)
                    {
                        if (RES.ResultNum == 0)
                        {
                            // insim.Send(255, "" + _connections[CurrentConnection.UCID].PName + " ^8finished 1st!");
                            CurrentConnection.points += Convert.ToInt32(onepts);

                            if (Convert.ToInt32(onepts) != 0)
                            {
                                insim.Send(255, "^7" + CurrentConnection.PName + " ^8earned ^2" + Convert.ToInt32(onepts) + " points");
                            }
                        }
                        else if (RES.ResultNum == 1)
                        {
                            // insim.Send(255, "" + _connections[CurrentConnection.UCID].PName + " ^8finished 2nd!");
                            CurrentConnection.points += Convert.ToInt32(twopts);
                            if (Convert.ToInt32(twopts) != 0)
                            {
                                insim.Send(255, "^7" + CurrentConnection.PName + " ^8earned ^2" + Convert.ToInt32(twopts) + " points");
                            }
                        }
                        else if (RES.ResultNum == 2)
                        {
                            // insim.Send(255, "" + _connections[CurrentConnection.UCID].PName + " ^8finished 2nd!");
                            CurrentConnection.points += Convert.ToInt32(threepts);
                            if (Convert.ToInt32(threepts) != 0)
                            {
                                insim.Send(255, "^7" + CurrentConnection.PName + " ^8earned ^2" + Convert.ToInt32(threepts) + " points");
                            }
                        }
                        else if (RES.ResultNum == 3)
                        {
                            // insim.Send(255, "" + _connections[CurrentConnection.UCID].PName + " ^8finished 2nd!");
                            CurrentConnection.points += Convert.ToInt32(fourpts);
                            if (Convert.ToInt32(fourpts) != 0)
                            {
                                insim.Send(255, "^7" + CurrentConnection.PName + " ^8earned ^2" + Convert.ToInt32(fourpts) + " points");
                            }
                        }


                        if (RES.ResultNum == _players.Count - 1)
                        {
                            RaceFinished   = true;
                            ScoreboardTick = 0;
                        }
                    }
                }

                UpdateGui(CurrentConnection.UCID, true);
            }
            catch (Exception e)
            { LogTextToFile("error", "[" + RES.PLID + "] " + "" + "() RES - Exception: " + e, false); }
        }