mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-01 06:33:38 +01:00
Switch chat name URL parm to 'chatname', add 'playername' URL part for initial player follow selection
This commit is contained in:
parent
ca00a84dc5
commit
bd92cc37bf
@ -19,7 +19,7 @@ componentconstructors['chat'] = function(dynmap, configuration) {
|
||||
});
|
||||
var pname = null;
|
||||
if(configuration.allowurlname) {
|
||||
pname = dynmap.getParameterByName("playername");
|
||||
pname = dynmap.getParameterByName("chatname");
|
||||
if(pname == "") pname = null;
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ DynMap.prototype = {
|
||||
serverday: false,
|
||||
inittime: new Date().getTime(),
|
||||
followingPlayer: '',
|
||||
initfollow: null,
|
||||
missedupdates: 0,
|
||||
layercontrol: undefined,
|
||||
formatUrl: function(name, options) {
|
||||
@ -115,6 +116,10 @@ DynMap.prototype = {
|
||||
if(typeof me.options.defaultzoom == 'undefined')
|
||||
me.options.defaultzoom = 1;
|
||||
|
||||
var initfollowplayer = me.getParameterByName('playername');
|
||||
if(initfollowplayer != "")
|
||||
me.initfollow = initfollowplayer;
|
||||
|
||||
var map = this.map = new L.Map(mapContainer.get(0), {
|
||||
zoom: me.options.defaultzoom,
|
||||
center: new L.LatLng(0, 0),
|
||||
@ -556,6 +561,10 @@ DynMap.prototype = {
|
||||
me.updatePlayer(player, playerUpdate);
|
||||
} else {
|
||||
me.addPlayer(playerUpdate);
|
||||
if(me.initfollow && me.initfollow == name) {
|
||||
me.followPlayer(me.players[name]);
|
||||
me.initfollow = null;
|
||||
}
|
||||
}
|
||||
newplayers[name] = player;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user