コード例 #1
0
ファイル: Objects.cs プロジェクト: mizzouse/FreeInfantry
        /// <summary>
        /// Sends a ball update to a specific player
        /// </summary>
        static public void Object_Ball(Player player, IEnumerable <Ball> bStates)
        {   //Prepare the packet
            SC_BallState ball = new SC_BallState();

            ball.balls = bStates;

            //Send it
            player._client.sendReliable(ball);
        }
コード例 #2
0
ファイル: Objects.cs プロジェクト: mizzouse/FreeInfantry
        /// <summary>
        /// Sends a series of ball updates to active players
        /// </summary>
        static public void Object_Ball(IEnumerable <Player> players, IEnumerable <Ball> bStates)
        {   //Prepare the packet
            SC_BallState ball = new SC_BallState();

            ball.balls = bStates;

            //Send it
            foreach (Player p in players)
            {
                p._client.sendReliable(ball);
            }
        }
コード例 #3
0
ファイル: Objects.cs プロジェクト: mizzouse/FreeInfantry
        /// <summary>
        /// Sends a ball update to active players
        /// </summary>
        static public void Object_Ball(IEnumerable <Player> players, Ball bState)
        {   //Prepare the packet
            SC_BallState ball = new SC_BallState();

            ball.singleUpdate = bState;

            //Send it
            foreach (Player p in players)
            {
                p._client.sendReliable(ball);
            }
        }
コード例 #4
0
ファイル: Objects.cs プロジェクト: mizzouse/FreeInfantry
        /// <summary>
        /// Instructs the client to reset and disable a single active ball
        /// </summary>
        static public void Object_BallReset(IEnumerable <Player> players, Ball bState)
        {   //Prepare the packet
            SC_BallState ball = new SC_BallState();

            ball.bDisable     = true;
            ball.singleUpdate = bState;

            //Send it
            foreach (Player p in players)
            {
                if (p._gotBallID == bState._id)
                {
                    p._gotBallID = 999;
                }
                p._client.sendReliable(ball);
            }
        }
コード例 #5
0
ファイル: Objects.cs プロジェクト: mizzouse/FreeInfantry
        /// <summary>
        /// Instructs the client to reset and disable any active balls
        /// </summary>
        static public void Object_BallReset(IEnumerable <Player> players, IEnumerable <Ball> bState)
        {   //Prepare the packet
            SC_BallState ball = new SC_BallState();

            ball.bDisable = true;
            ball.balls    = bState;

            //Send it
            foreach (Player p in players)
            {
                //Update server side ball handlers
                foreach (Ball b in bState)
                {
                    if (p._gotBallID == b._id)
                    {
                        p._gotBallID = 999;
                    }
                }
                p._client.sendReliable(ball);
            }
        }