상속: Entity
예제 #1
0
파일: Command.cs 프로젝트: txdv/sharpmod
 public KickCommand(Player player, string reason)
     : this(player.Name, reason)
 {
 }
예제 #2
0
파일: Command.cs 프로젝트: txdv/sharpmod
        /// <summary>
        /// This function is used internally.
        /// It executes all needed handlers when a specific command occures.
        /// </summary>
        /// <param name="str">
        /// A <see cref="System.String"/>
        /// </param>
        /// <param name="cmd">
        /// A <see cref="Command"/>
        /// </param>
        internal static void Execute(Player player, Command cmd)
        {
            foreach (KeyValuePair<string, ClientCommandDelegate> keyval in events) {
                if (cmd.ToString().StartsWith(keyval.Key)) {
                    if (keyval.Value != null) {
                        keyval.Value(player, cmd);
                    }
                }
            }

            cmd.Execute(player);
        }
예제 #3
0
파일: Command.cs 프로젝트: txdv/sharpmod
 public KickCommand(Player player)
     : this(player.Name)
 {
 }
예제 #4
0
파일: Command.cs 프로젝트: txdv/sharpmod
 protected virtual void OnFailure(Player player)
 {
     Server.LogDeveloper("Command failed: {0}", Arguments.Join(' '));
 }
예제 #5
0
파일: Command.cs 프로젝트: txdv/sharpmod
 protected virtual void OnSuccess(Player player)
 {
     Server.LogDeveloper("Command successful: {0}", Arguments.Join(' '));
 }
예제 #6
0
파일: Command.cs 프로젝트: txdv/sharpmod
 protected static void WriteLine(Player player, string text)
 {
     Write(player, text + '\n');
 }
예제 #7
0
파일: Command.cs 프로젝트: txdv/sharpmod
 protected static void WriteLine(Player player, string format, params object[] param)
 {
     WriteLine(player, string.Format(format, param));
 }
예제 #8
0
파일: Command.cs 프로젝트: txdv/sharpmod
 /// <summary>
 /// Emulates a player calling a command.
 /// </summary>
 /// <param name="p">
 /// Instance of the player <see cref="Player"/>
 /// </param>
 public void FakeCall(Player p)
 {
     overrideArguments = true;
     instance = this;
     MetaModEngine.dllapiFunctions.ClientCommand(p.Pointer);
     instance = null;
     overrideArguments = false;
 }
예제 #9
0
파일: Command.cs 프로젝트: txdv/sharpmod
 protected static void Write(Player player, string text)
 {
     if (player == null) {
         Server.Print(text);
     } else {
         player.PrintConsole(text);
     }
 }
예제 #10
0
파일: DProto.cs 프로젝트: txdv/sharpmod
 /// <summary>
 /// Updates the two dproto variables according to the player.
 /// </summary>
 /// <param name="player">
 /// The information about this player <see cref="Player"/>
 /// </param>
 public static void UpdateCVariables(Player player)
 {
     UpdateCVariables(player.Index);
 }
예제 #11
0
파일: Command.cs 프로젝트: txdv/sharpmod
 public virtual void Execute(Player player)
 {
     Server.LogDeveloper("Command executed: {0}", Arguments.Join(' '));
     OnFailure(player.UserID);
 }
예제 #12
0
 public void SwearCheck(Player player, Command cmd)
 {
 }
예제 #13
0
 void HandleSayExec(Player player, Command command)
 {
     // Ommit /exec and execute the following text
       string exec_string = command.Arguments[1].Split(' ').Shift().Join(' ') + ";";
       EvaluateGoldSrc(player, exec_string);
 }
예제 #14
0
        /// <summary>
        /// This function evaluates a piece of code and prints the output linewise to the chat of the player
        /// </summary>
        /// <param name="p">
        /// A player instance <see cref="Player"/>
        /// </param>
        /// <param name="code">
        /// A command <see cref="System.String"/>
        /// </param>
        protected virtual void EvaluateGoldSrc(Player p, string code)
        {
            bool result_set;
              object result;

              try
              {
            Evaluator.Evaluate(code, out result, out result_set);
            if (result_set)
            {
              System.IO.TextWriter tw = new System.IO.StringWriter();
              PrettyPrint(tw, result);

              p.ClientPrintEachLine(tw.ToString());
            }
              }
              catch (Exception e)
              {
            p.ClientPrintEachLine(e.ToString());
              }
        }
예제 #15
0
파일: Warmup.cs 프로젝트: txdv/sharpmod
        public void SendMessage(Player player, float time)
        {
            Message.Begin(MessageDestination.OneReliable, Message.GetUserMessageID("TextMsg"), IntPtr.Zero, player.Pointer);
            Message.WriteByte(4);
            Message.WriteString("#Game_will_restart_in");
            Message.WriteString(time.ToString());
            Message.WriteString("SECOND");
            Message.End();

            Message.Begin(MessageDestination.OneReliable, Message.GetUserMessageID("TextMsg"), IntPtr.Zero, player.Pointer);
            Message.WriteByte(2);
            Message.WriteString("#Game_will_restart_in_console");
            Message.WriteString(time.ToString());
            Message.WriteString("SECOND");
            Message.End();
        }
예제 #16
0
파일: Warmup.cs 프로젝트: txdv/sharpmod
 public void ClearPlayer(Player player)
 {
     if (knifeonly.Bool()) {
         player.StripUserWeapons();
         player.GiveItem("weapon_knife");
         player.SetMoney(0);
     }
 }