Interpret() public static méthode

Thread-safe callback from each TelnetConnection, parsing input. This function is timed internally by PulseTimer().
public static Interpret ( PolaMUD.TelnetConnection conn, string line ) : void
conn PolaMUD.TelnetConnection The TelnetConnection the input is coming from
line string The input string
Résultat void
Exemple #1
0
 public void ProcessLine(string line)
 {
     if (player != null)
     {
         player.IncomingBuffer.Enqueue(line);
     }
     else
     {
         Parser.Interpret(this, line);
     }
 }
Exemple #2
0
        /// <summary>
        /// Called every game pulse, handling player I/O buffers and other events, as well as timing
        /// the Round and Tick Timers
        /// </summary>
        void PulseTimer()
        {
            //Global.Server.SendToAll(".");
            Pulses++;

            DecrementEvents(PulseEvents);

            foreach (Mob mob in Global.Mobs)
            {
                DecrementAffects(mob, TimerType.Pulse);
            }

            foreach (Player player in Global.Players)
            {
                player.SendOutgoingBuffer();

                if (player.WaitPulses > 0)
                {
                    player.WaitPulses--;

                    if (player.CombatType == CombatType.TurnBased)
                    {
                        player.WaitPulses = 0;
                    }
                }
                else if (player.IncomingBuffer.Count > 0)
                {
                    Parser.Interpret(player.Connection, player.IncomingBuffer.Dequeue());
                }
            }

            RoundCounter++;
            if (RoundCounter == Global.RoundDuration)
            {
                RoundTimer();
                RoundCounter = 0;
            }

            TickCounter++;
            if (TickCounter == Global.TickDuration)
            {
                TickTimer();
                TickCounter = 0;
            }
        }