Inheritance: AdminCommandInfo
Example #1
0
        public override void Execute(Player player)
        {
            int userid = Player.GetUserID(player);

            if (player != null && !player.Privileges.HasPrivilege("map")) {
                OnFailure(userid, "You have no map privileges");
                return;
            }

            if (!Server.IsMapValid(Map)) {
                OnFailure(userid, "Invalid map provided");
                return;
            }

            MapChangeInfo mc = new MapChangeInfo(player, Map);

            //int comp = int.Parse(CVar.Get("smod_map_completness").String);
            int comp = 1;

            // TODO: make this work
            /*
            Task.Factory.StartNew(() => {
                try {
                    var res = SharpMod.Verifier.VerifyMap(Map + ".bsp");
                    if (comp >= 1 && !res.ServerCapable) {
                        TaskManager.Join(OnFailure, userid, "Server is not capable of running this map");
                    }

                    if (comp >= 2 && !res.ClientCapable) {
                        TaskManager.Join(OnFailure, userid, "Server is not capable of serving all client files");
                    }
                    SharpMod.Database.AddMapChange(mc);
                    TaskManager.Join(OnSuccess, userid);
                } catch (Exception e) {
                    TaskManager.Join(OnFailure, userid, e);
                }
            });
            */
        }
Example #2
0
 public void AddMapChange(MapChangeInfo mi, Action<bool> callback)
 {
     callback(false);
 }
Example #3
0
 public void AddMapChange(MapChangeInfo mi, Action <bool> callback)
 {
     callback(false);
 }