@@ -879,6 +879,7 @@ static void EnvHandler(Player player, CommandReader cmd) {
879
879
case "tex" :
880
880
case "terrain" :
881
881
case "texture" :
882
+ FilterURL ( ref value ) ;
882
883
if ( value . CaselessEquals ( "default" ) ) {
883
884
player . Message ( "Reset texture for {0}&S to {1}" , world . ClassyName , Server . DefaultTerrain ) ;
884
885
value = "Default" ;
@@ -891,6 +892,7 @@ static void EnvHandler(Player player, CommandReader cmd) {
891
892
} else {
892
893
player . Message ( "Set texture for {0}&S to {1}" , world . ClassyName , value ) ;
893
894
}
895
+
894
896
world . Texture = value ;
895
897
foreach ( Player p in world . Players ) {
896
898
if ( p . Supports ( CpeExt . EnvMapAspect ) )
@@ -934,6 +936,17 @@ static void EnvHandler(Player player, CommandReader cmd) {
934
936
return ;
935
937
}
936
938
WorldManager . SaveWorldList ( ) ;
939
+ }
940
+
941
+ static void FilterURL ( ref string url ) {
942
+ // a lot of people try linking to the dropbox page instead of directly to file, so we auto correct them
943
+ if ( url . StartsWith ( "http://www.dropbox" ) ) {
944
+ url = "http://dl.dropbox" + url . Substring ( "http://www.dropbox" . Length ) ;
945
+ url = url . Replace ( "?dl=0" , "" ) ;
946
+ } else if ( url . StartsWith ( "https://www.dropbox" ) ) {
947
+ url = "https://dl.dropbox" + url . Substring ( "https://www.dropbox" . Length ) ;
948
+ url = url . Replace ( "?dl=0" , "" ) ;
949
+ }
937
950
}
938
951
939
952
static void ShowEnvSettings ( Player player , World world ) {
0 commit comments