Add a special notice

This commit is contained in:
calzoneman 2013-08-18 18:35:49 -05:00
parent 1f7a53a90b
commit e3ef9e7896
2 changed files with 40 additions and 0 deletions

View File

@ -508,6 +508,12 @@ Channel.prototype.tryNameBan = function(actor, name) {
}
name = name.toLowerCase();
if(name == actor.name.toLowerCase()) {
actor.socket.emit("costanza", {
msg: "Trying to ban yourself?"
});
return;
}
self.getRank(name, function (err, rank) {
if(err) {
@ -570,6 +576,13 @@ Channel.prototype.tryIPBan = function(actor, name, range) {
if(typeof name != "string") {
return;
}
name = name.toLowerCase();
if(name == actor.name.toLowerCase()) {
actor.socket.emit("costanza", {
msg: "Trying to ban yourself?"
});
return;
}
self.server.db.listIPsForName(name, function (err, ips) {
if(err) {
actor.socket.emit("errorMsg", {

View File

@ -74,6 +74,33 @@ Callbacks = {
alert(data.msg);
},
costanza: function (data) {
hidePlayer();
$("#costanza-modal").modal("hide");
var modal = $("<div/>").addClass("modal hide fade")
.attr("id", "costanza-modal")
.appendTo($("body"));
var body = $("<div/>").addClass("modal-body").appendTo(modal);
$("<button/>").addClass("close")
.attr("data-dismiss", "modal")
.attr("data-hidden", "true")
.html("&times;")
.appendTo(body);
$("<img/>").attr("src", "http://i0.kym-cdn.com/entries/icons/original/000/005/498/1300044776986.jpg")
.appendTo(body);
$("<strong/>").text(data.msg).appendTo(body);
modal.on("hidden", function () {
modal.remove();
unhidePlayer();
});
modal.modal();
},
announcement: function(data) {
$("#announcements").html("");
makeAlert(data.title, data.text)