Merge branch 'master' into dev

This commit is contained in:
Maruno17
2021-01-30 21:56:29 +00:00
3 changed files with 14 additions and 14 deletions

View File

@@ -568,25 +568,28 @@ def pbPostData(url, postdata, filename=nil, depth=0)
return ""
end
def pbDownloadData(url, filename=nil, depth=0)
def pbDownloadData(url, filename = nil, authorization = nil, depth = 0, &block)
raise "Redirection level too deep" if depth > 10
if url[/^http:\/\/([^\/]+)(.*)$/]
host = $1
path = $2
if url[/^(([^:\/?#]+):(?=\/\/))?(\/\/)?((([^:]+)(?::([^@]+)?)?@)?([^@\/?#:]*)(?::(\d+)?)?)?([^?#]*)(\?([^#]*))?(#(.*))?/]
host = $8
path = $10
parameters = $11
port = $9 ? $9.to_i : 80
path = "/" if path.length == 0
userAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14"
request = "GET #{path} HTTP/1.1\r\n"
request = "GET #{path}#{parameters} HTTP/1.1\r\n"
request += "User-Agent: #{userAgent}\r\n"
request += "Pragma: no-cache\r\n"
request += "Host: #{host}\r\n"
request += "Proxy-Connection: Close\r\n"
request += "Authorization: #{authorization}\r\n" if authorization
request += "\r\n"
return pbHttpRequest(host, request, filename, depth)
return pbHttpRequest(host, request, filename, depth, port, &block)
end
return ""
end
def pbHttpRequest(host, request, filename=nil, depth=0)
def pbHttpRequest(host, request, filename = nil, depth = 0, port = nil)
raise "Redirection level too deep" if depth>10
socket = ::TCPSocket.new(host, 80)
time = Time.now.to_i
@@ -617,7 +620,7 @@ def pbHttpRequest(host, request, filename=nil, depth=0)
end
if headers["Location"] && errorcode>=300 && errorcode<400
socket.close rescue socket = nil
return pbDownloadData(headers["Location"],filename,depth+1)
return pbDownloadData(headers["Location"],filename,nil,depth+1)
end
if chunked
# Chunked content

View File

@@ -9,7 +9,7 @@ class Game_Map
attr_accessor :tileset_name # tileset file name
attr_accessor :autotile_names # autotile file name
attr_reader :passages # passage table
attr_reader :priorities # prioroty table
attr_reader :priorities # priority table
attr_reader :terrain_tags # terrain tag table
attr_reader :events # events
attr_accessor :panorama_name # panorama file name

View File

@@ -147,9 +147,6 @@ end
# Dungeon generation algorithm found at:
# http://members.gamedev.net/potentialwell/ProceduralDungeonGeneration-JTippets.pdf
class MazeNode
def initialize
@edges=0