Commit 3714c6cb authored by 神楽坂玲奈's avatar 神楽坂玲奈

revert

parent 4a224628
@mycard = {}
@mycard.room_name = (name, password, pvp = false, rule = 0, mode = 0, start_lp = 8000, start_hand = 5, draw_count = 1) ->
if rule != 0 or start_lp != 8000 or start_hand != 5 or draw_count != 1
result = "#{rule}#{mode}FFF#{start_lp},#{start_hand},#{draw_count},"
else if mode == 2
result = "T#"
else if pvp and mode == 1
result = "PM#"
else if pvp
result = "P#"
else if mode == 1
result = "M#"
else
result = ""
result += name
result = encodeURIComponent(result)
if password
result += '$' + encodeURIComponent(password)
result
#127.0.0.1:8087/test
@mycard.room_string = (ip,port,room,username,password, _private, server_auth)->
result = ''
if username
result += encodeURIComponent(username)
if password
result += ':' + encodeURIComponent(password)
result += '@'
result += ip + ':' + port + '/' + room
if _private
result += '?private=true'
if server_auth
result += '&server_auth=true'
else if server_auth
result += '?server_auth=true'
result
#http://my-card.in/rooms/127.0.0.1:8087/test
@mycard.room_url = (ip,port,room,username,password, _private, server_auth)->
result = 'http://my-card.in/rooms/' + @room_string(ip,port,room,username,password, _private, server_auth)
#mycard://127.0.0.1:8087/test
@mycard.room_url_mycard = (ip,port,room,username,password, _private, server_auth)->
result = 'mycard://' + @room_string(ip,port,room,username,password, _private, server_auth)
@mycard.join = (ip,port,room,username,password, _private, server_auth)->
window.location.href = @room_url_mycard(ip,port,room,username,password, _private, server_auth)
\ No newline at end of file
// Generated by CoffeeScript 1.4.0
(function() {
this.mycard = {};
this.mycard.room_name = function(name, password, pvp, rule, mode, start_lp, start_hand, draw_count) {
var result;
if (pvp == null) {
pvp = false;
}
if (rule == null) {
rule = 0;
}
if (mode == null) {
mode = 0;
}
if (start_lp == null) {
start_lp = 8000;
}
if (start_hand == null) {
start_hand = 5;
}
if (draw_count == null) {
draw_count = 1;
}
if (rule !== 0 || start_lp !== 8000 || start_hand !== 5 || draw_count !== 1) {
result = "" + rule + mode + "FFF" + start_lp + "," + start_hand + "," + draw_count + ",";
} else if (mode === 2) {
result = "T#";
} else if (pvp && mode === 1) {
result = "PM#";
} else if (pvp) {
result = "P#";
} else if (mode === 1) {
result = "M#";
} else {
result = "";
}
result += name;
result = encodeURIComponent(result);
if (password) {
result += '$' + encodeURIComponent(password);
}
return result;
};
this.mycard.room_string = function(ip, port, room, username, password, _private, server_auth) {
var result;
result = '';
if (username) {
result += encodeURIComponent(username);
if (password) {
result += ':' + encodeURIComponent(password);
}
result += '@';
}
result += ip + ':' + port + '/' + room;
if (_private) {
result += '?private=true';
if (server_auth) {
result += '&server_auth=true';
}
} else if (server_auth) {
result += '?server_auth=true';
}
return result;
};
this.mycard.room_url = function(ip, port, room, username, password, _private, server_auth) {
var result;
return result = 'http://my-card.in/rooms/' + this.room_string(ip, port, room, username, password, _private, server_auth);
};
this.mycard.room_url_mycard = function(ip, port, room, username, password, _private, server_auth) {
var result;
return result = 'mycard://' + this.room_string(ip, port, room, username, password, _private, server_auth);
};
this.mycard.join = function(ip, port, room, username, password, _private, server_auth) {
return window.location.href = this.room_url_mycard(ip, port, room, username, password, _private, server_auth);
};
}).call(this);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment