示例#1
0
		public static HistoryItem[] GetHistory (MineProxy.Control.Player player)
		{
			lock (list) {
				if (list.ContainsKey (player.Username) == false)
					return null;
				else
					return list [player.Username].History;
			}
		}
示例#2
0
		public static void Update (MineProxy.Control.Player player)
		{
			if (player.Position == null)
				return;
			PlayerHistory ph;
			lock (list) {
				if (list.ContainsKey (player.Username) == false) {
					ph = new PlayerHistory ();
					list.Add (player.Username, ph);
				} else
					ph = list [player.Username];
			}
			ph.UpdateHistory (player);
		}
示例#3
0
		void UpdateHistory (MineProxy.Control.Player player)
		{
			long step = DateTime.Now.Ticks / StepSize.Ticks;
			if (lastStep != step) {
				lastStep = step;
			
				for (int n = History.Length - 1; n > 0; n--) {
					History [n] = History [n - 1];
				}
				History [0] = new HistoryItem ();
			}
			if (History [0] == null)
				History [0] = new HistoryItem ();
			History [0].Position = player.Position.Clone ();
			History [0].Dimension = player.Dimension;
			History [0].Attached = player.AttachedTo;
		}
示例#4
0
 public static void Kick(MineProxy.Control.Player player, string reason)
 {
     ControlMessage cm = new ControlMessage();
     cm.Kick = new Kick();
     cm.Kick.Username = player.Username;
     cm.Kick.Reason = reason;
     Send(cm);
 }
示例#5
0
 public static void Ban(MineProxy.Control.Player player, DateTime until, string reason)
 {
     Ban(player.Username, until, reason);
 }
示例#6
0
 public void Follow(MineProxy.Control.Player p)
 {
     FollowUser = p.Username;
 }