Merge pull request #20924 from hrydgard/file-upload

Add "File upload" functionality - upload files to the app through a web interface
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2025-10-27 13:09:12 +01:00
commit 7afc4fa5dc
85 files changed
+1420 -142

No files matched your search

+7 -2
View File
@@ -1605,6 +1605,8 @@ list(APPEND NativeAppSource
UI/SystemInfoScreen.cpp
UI/Store.h
UI/Store.cpp
UI/UploadScreen.h
UI/UploadScreen.cpp
UI/CwCheatScreen.h
UI/CwCheatScreen.cpp
UI/InstallZipScreen.h
@@ -2770,6 +2772,7 @@ set(NativeAssets
assets/asciifont_atlas.zim
assets/asciifont_atlas.meta
assets/debugger
assets/upload
assets/lang
assets/shaders
assets/themes
@@ -2913,6 +2916,7 @@ if(TargetBin)
file(GLOB_RECURSE SHADER_FILES assets/shaders/*)
file(GLOB_RECURSE THEME_FILE assets/themes/*)
file(GLOB_RECURSE DEBUGGER_FILES assets/debugger/*)
file(GLOB_RECURSE WEB_UPLOAD_FILES assets/upload/*)
file(GLOB_RECURSE VFPU_FILES assets/vfpu/*)
if(NOT IOS)
@@ -2924,17 +2928,18 @@ if(TargetBin)
set_source_files_properties(${SHADER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/shaders")
set_source_files_properties(${THEME_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/themes")
set_source_files_properties(${DEBUGGER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/debugger")
set_source_files_properties(${WEB_UPLOAD_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/upload")
set_source_files_properties(${VFPU_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/vfpu")
endif()
if(IOS)
set(AssetCatalog "${CMAKE_SOURCE_DIR}/ios/assets.xcassets")
add_executable(${TargetBin} MACOSX_BUNDLE ${NativeAssets} ${BigFontAssets} ${UIImages} ${AssetCatalog} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard")
add_executable(${TargetBin} MACOSX_BUNDLE ${NativeAssets} ${BigFontAssets} ${UIImages} ${AssetCatalog} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${WEB_UPLOAD_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard")
if(NOT IOS_APP_STORE)
file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/iOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/PPSSPP.app/Frameworks/")
endif()
else()
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${UIImages} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource})
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${UIImages} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${WEB_UPLOAD_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource})
file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/macOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/${TargetBin}.app/Contents/Frameworks/")
if(USING_QT_UI)
add_custom_command(TARGET ${TargetBin} POST_BUILD COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/Qt/macbundle.sh" "${CMAKE_BINARY_DIR}/PPSSPPQt.app")
+11 -3
View File
@@ -75,7 +75,8 @@ std::string GetLocalIP(int sock) {
} server_addr;
memset(&server_addr, 0, sizeof(server_addr));
socklen_t len = sizeof(server_addr);
if (getsockname(sock, (struct sockaddr *)&server_addr, &len) == 0) {
int retval = getsockname(sock, (struct sockaddr *)&server_addr, &len);
if (retval == 0) {
char temp[64]{};
// We clear the port below for WSAAddressToStringA.
@@ -94,17 +95,24 @@ std::string GetLocalIP(int sock) {
wchar_t wtemp[sizeof(temp)];
DWORD len = (DWORD)sizeof(temp);
// Windows XP doesn't support inet_ntop.
if (WSAAddressToStringW((struct sockaddr *)&server_addr, sizeof(server_addr), nullptr, wtemp, &len) == 0) {
HRESULT result = WSAAddressToStringW((struct sockaddr *)&server_addr, sizeof(server_addr), nullptr, wtemp, &len);
if (result == 0) {
return ConvertWStringToUTF8(wtemp);
} else {
return "";
}
#else
const char *result = inet_ntop(server_addr.sa.sa_family, addr, temp, sizeof(temp));
if (result) {
return result;
} else {
return "";
}
#endif
} else {
WARN_LOG(Log::IO, "GetLocalIP: getsockname failed with error %d (%s)", retval, strerror(retval));
return "";
}
return "";
}
} // fd_util
+4
View File
@@ -47,6 +47,10 @@ const char *DNSTypeAsString(DNSType type) {
}
}
std::string Connection::GetLocalIpAsString() const {
return fd_util::GetLocalIP(this->sock());
}
bool Connection::Resolve(const char *host, int port, DNSType type) {
if ((intptr_t)sock_ != -1) {
ERROR_LOG(Log::IO, "Resolve: Already have a socket");
+2
View File
@@ -30,6 +30,8 @@ public:
// Only to be used for bring-up and debugging.
uintptr_t sock() const { return sock_; }
std::string GetLocalIpAsString() const;
protected:
// Store the remote host here, so we can send it along through HTTP/1.1 requests.
// TODO: Move to http::client?
+37 -35
View File
@@ -66,7 +66,7 @@ ServerRequest::ServerRequest(int fd)
header_.ParseHeaders(in_);
if (header_.ok) {
VERBOSE_LOG(Log::IO, "The request carried with it %i bytes", (int)header_.content_length);
VERBOSE_LOG(Log::HTTP, "The request carried with it %i bytes", (int)header_.content_length);
} else {
Close();
}
@@ -76,11 +76,11 @@ ServerRequest::~ServerRequest() {
Close();
if (!in_->Empty()) {
ERROR_LOG(Log::IO, "Input not empty - invalid request?");
ERROR_LOG(Log::HTTP, "Input not empty - invalid request?");
}
delete in_;
if (!out_->Empty()) {
WARN_LOG(Log::IO, "Output not empty - connection abort? (%s) (%d bytes)", this->header_.resource, (int)out_->BytesRemaining());
WARN_LOG(Log::HTTP, "Output not empty - connection abort? (%s) (%d bytes)", this->header_.resource, (int)out_->BytesRemaining());
}
delete out_;
}
@@ -170,8 +170,8 @@ bool Server::Listen(int port, const char *reason, net::DNSType type) {
}
bool Server::Listen4(int port, const char *reason) {
listener_ = socket(AF_INET, SOCK_STREAM, 0);
if (listener_ < 0)
listenerSock_ = socket(AF_INET, SOCK_STREAM, 0);
if (listenerSock_ < 0)
return false;
struct sockaddr_in server_addr;
@@ -182,42 +182,43 @@ bool Server::Listen4(int port, const char *reason) {
int opt = 1;
// Enable re-binding to avoid the pain when restarting the server quickly.
setsockopt(listener_, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
setsockopt(listenerSock_, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
if (bind(listener_, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
if (bind(listenerSock_, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
#if PPSSPP_PLATFORM(WINDOWS)
int err = WSAGetLastError();
#else
int err = errno;
#endif
ERROR_LOG(Log::IO, "%s: Failed to bind to port %d, error=%d - Bailing (ipv4)", reason, port, err);
closesocket(listener_);
ERROR_LOG(Log::HTTP, "%s: Failed to bind to port %d, error=%d - Bailing (ipv4)", reason, port, err);
closesocket(listenerSock_);
return false;
}
fd_util::SetNonBlocking(listener_, true);
fd_util::SetNonBlocking(listenerSock_, true);
// 1024 is the max number of queued requests.
if (listen(listener_, 1024) < 0) {
closesocket(listener_);
if (listen(listenerSock_, 1024) < 0) {
closesocket(listenerSock_);
return false;
}
socklen_t len = sizeof(server_addr);
if (getsockname(listener_, (struct sockaddr *)&server_addr, &len) == 0) {
if (getsockname(listenerSock_, (struct sockaddr *)&server_addr, &len) == 0) {
port = ntohs(server_addr.sin_port);
}
INFO_LOG(Log::IO, "HTTP server started on port %d: %s", port, reason);
port_ = port;
localAddress_ = fd_util::GetLocalIP(listenerSock_);
INFO_LOG(Log::HTTP, "HTTP IPv4 server started on port %d: %s (ip: %s)", port, reason, localAddress_.c_str());
port_ = port;
return true;
}
bool Server::Listen6(int port, bool ipv6_only, const char *reason) {
#if !PPSSPP_PLATFORM(SWITCH)
listener_ = socket(AF_INET6, SOCK_STREAM, 0);
if (listener_ < 0)
listenerSock_ = socket(AF_INET6, SOCK_STREAM, 0);
if (listenerSock_ < 0)
return false;
struct sockaddr_in6 server_addr;
@@ -228,54 +229,55 @@ bool Server::Listen6(int port, bool ipv6_only, const char *reason) {
int opt = 1;
// Enable re-binding to avoid the pain when restarting the server quickly.
setsockopt(listener_, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
setsockopt(listenerSock_, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
// Enable listening on IPv6 and IPv4?
opt = ipv6_only ? 1 : 0;
setsockopt(listener_, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&opt, sizeof(opt));
setsockopt(listenerSock_, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&opt, sizeof(opt));
if (bind(listener_, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
if (bind(listenerSock_, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
#if PPSSPP_PLATFORM(WINDOWS)
int err = WSAGetLastError();
#else
int err = errno;
#endif
ERROR_LOG(Log::IO, "%s: Failed to bind to port %d, error=%d - Bailing (ipv6)", reason, port, err);
closesocket(listener_);
ERROR_LOG(Log::HTTP, "%s: Failed to bind to port %d, error=%d - Bailing (ipv6)", reason, port, err);
closesocket(listenerSock_);
return false;
}
fd_util::SetNonBlocking(listener_, true);
fd_util::SetNonBlocking(listenerSock_, true);
// 1024 is the max number of queued requests.
if (listen(listener_, 1024) < 0) {
closesocket(listener_);
if (listen(listenerSock_, 1024) < 0) {
closesocket(listenerSock_);
return false;
}
socklen_t len = sizeof(server_addr);
if (getsockname(listener_, (struct sockaddr *)&server_addr, &len) == 0) {
if (getsockname(listenerSock_, (struct sockaddr *)&server_addr, &len) == 0) {
port = ntohs(server_addr.sin6_port);
}
INFO_LOG(Log::IO, "HTTP server started on port %d: %s", port, reason);
localAddress_ = fd_util::GetLocalIP(listenerSock_);
INFO_LOG(Log::HTTP, "HTTP IPv6 server started on port %d: %s (ip: %s)", port, reason, localAddress_.c_str());
port_ = port;
return true;
#else
ERROR_LOG(Log::HTTP, "IPv6 not supported on this platform.");
return false;
#endif
}
bool Server::RunSlice(double timeout) {
if (listener_ < 0 || port_ == 0) {
if (listenerSock_ < 0 || port_ == 0) {
return false;
}
if (timeout <= 0.0) {
timeout = 86400.0;
}
if (!fd_util::WaitUntilReady(listener_, timeout, false)) {
if (!fd_util::WaitUntilReady(listenerSock_, timeout, false)) {
return false;
}
@@ -287,13 +289,13 @@ bool Server::RunSlice(double timeout) {
#endif
} client_addr;
socklen_t client_addr_size = sizeof(client_addr);
int conn_fd = accept(listener_, &client_addr.sa, &client_addr_size);
int conn_fd = accept(listenerSock_, &client_addr.sa, &client_addr_size);
if (conn_fd >= 0) {
executor_->Run(std::bind(&Server::HandleConnection, this, conn_fd));
return true;
}
else {
ERROR_LOG(Log::IO, "socket accept failed: %i", conn_fd);
ERROR_LOG(Log::HTTP, "socket accept failed: %i", conn_fd);
return false;
}
}
@@ -312,13 +314,13 @@ bool Server::Run(int port) {
}
void Server::Stop() {
closesocket(listener_);
closesocket(listenerSock_);
}
void Server::HandleConnection(int conn_fd) {
ServerRequest request(conn_fd);
if (!request.IsOK()) {
WARN_LOG(Log::IO, "Bad request, ignoring.");
WARN_LOG(Log::HTTP, "Bad request, ignoring.");
return;
}
HandleRequest(request);
@@ -350,7 +352,7 @@ void Server::HandleRequestDefault(const ServerRequest &request) {
}
void Server::Handle404(const ServerRequest &request) {
INFO_LOG(Log::IO, "No handler for '%.*s', falling back to 404.", (int)request.resource().size(), request.resource().data());
INFO_LOG(Log::HTTP, "No handler for '%.*s', falling back to 404.", (int)request.resource().size(), request.resource().data());
const char *payload = "<html><body>404 not found</body></html>\r\n";
request.WriteHttpResponseHeader("1.0", 404, strlen(payload));
request.Out()->Push(payload);
+13 -2
View File
@@ -38,6 +38,10 @@ public:
return header_.method;
}
const RequestHeader &Header() const {
return header_;
}
bool GetParamValue(const char *param_name, std::string *value) const {
return header_.GetParamValue(param_name, value);
}
@@ -96,9 +100,15 @@ public:
// if they don't recognize the url.
virtual void HandleRequest(const ServerRequest &request);
int Port() {
int ListenerSocket() const {
return listenerSock_;
}
int Port() const {
return port_;
}
const std::string &LocalAddress() const {
return localAddress_;
}
private:
bool Listen6(int port, bool ipv6_only, const char *reason);
@@ -113,8 +123,9 @@ private:
void HandleListing(const ServerRequest &request);
void Handle404(const ServerRequest &request);
int listener_;
int listenerSock_;
int port_ = 0;
std::string localAddress_;
UrlHandlerMap handlers_;
UrlHandlerFunc fallback_;
+7 -7
View File
@@ -113,7 +113,7 @@ void DNSResolveFree(addrinfo *res)
freeaddrinfo(res);
}
bool GetIPList(std::vector<std::string> &IP4s) {
bool GetLocalIP4List(std::vector<std::string> &IP4s) {
char ipstr[INET6_ADDRSTRLEN]; // We use IPv6 length since it's longer than IPv4
// getifaddrs first appeared in glibc 2.3, On Android officially supported since __ANDROID_API__ >= 24
#if defined(_IFADDRS_H_) || (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || (__ANDROID_API__ >= 24)
@@ -145,7 +145,7 @@ bool GetIPList(std::vector<std::string> &IP4s) {
return true;
}
#elif defined(SIOCGIFCONF) // Better detection on Linux/UNIX/MacOS/some Android
INFO_LOG(Log::sceNet, "GetIPList from SIOCGIFCONF");
INFO_LOG(Log::IO, "GetIPList from SIOCGIFCONF");
static struct ifreq ifreqs[32];
struct ifconf ifc{};
ifc.ifc_req = ifreqs;
@@ -153,13 +153,13 @@ bool GetIPList(std::vector<std::string> &IP4s) {
int sd = socket(AF_INET, SOCK_DGRAM, 0);
if (sd < 0) {
ERROR_LOG(Log::sceNet, "GetIPList failed to create socket (result = %i, errno = %i)", sd, socket_errno);
ERROR_LOG(Log::IO, "GetIPList failed to create socket (result = %i, errno = %i)", sd, socket_errno);
return false;
}
int r = ioctl(sd, SIOCGIFCONF, (char*)&ifc);
if (r != 0) {
ERROR_LOG(Log::sceNet, "GetIPList failed ioctl/SIOCGIFCONF (result = %i, errno = %i)", r, socket_errno);
ERROR_LOG(Log::IO, "GetIPList failed ioctl/SIOCGIFCONF (result = %i, errno = %i)", r, socket_errno);
return false;
}
@@ -175,7 +175,7 @@ bool GetIPList(std::vector<std::string> &IP4s) {
r = ioctl(sd, SIOCGIFADDR, item);
if (r != 0)
{
ERROR_LOG(Log::sceNet, "GetIPList failed ioctl/SIOCGIFADDR (i = %i, result = %i, errno = %i)", i, r, socket_errno);
ERROR_LOG(Log::IO, "GetIPList failed ioctl/SIOCGIFADDR (i = %i, result = %i, errno = %i)", i, r, socket_errno);
}
if (ifreqs[i].ifr_addr.sa_family == AF_INET) {
@@ -194,8 +194,8 @@ bool GetIPList(std::vector<std::string> &IP4s) {
close(sd);
return true;
#else // Fallback to POSIX/Cross-platform way but may not works well on Linux (ie. only shows 127.0.0.1)
INFO_LOG(Log::sceNet, "GetIPList from Fallback");
#else // Fallback to POSIX/Cross-platform way but may not work well on Linux (ie. only shows 127.0.0.1)
DEBUG_LOG(Log::IO, "GetIPList from fallback method");
struct addrinfo hints, * res, * p;
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version
+1 -1
View File
@@ -20,7 +20,7 @@ enum class DNSType {
bool DNSResolve(const std::string &host, const std::string &service, addrinfo **res, std::string &error, DNSType type = DNSType::ANY);
void DNSResolveFree(addrinfo *res);
bool GetIPList(std::vector<std::string>& IP4s);
bool GetLocalIP4List(std::vector<std::string>& IP4s);
int inet_pton(int af, const char* src, void* dst);
+33 -1
View File
@@ -9,6 +9,7 @@
#include "Common/Net/Sinks.h"
#include "Common/Log.h"
#include "Common/StringUtils.h"
#include "Common/File/FileDescriptor.h"
#ifndef MSG_NOSIGNAL
@@ -44,10 +45,41 @@ bool InputSink::ReadLineWithEnding(std::string &s) {
memcpy(&s[0], buf_ + read_, newline + 1);
}
AccountDrain(newline + 1);
return true;
}
std::pair<std::string_view, std::string_view> InputSink::BufferParts() const {
if (read_ + valid_ <= BUFFER_SIZE) {
return {std::string_view(buf_ + read_, valid_), std::string_view()};
} else {
size_t firstPartSize = BUFFER_SIZE - read_;
size_t secondPartSize = valid_ - firstPartSize;
return {std::string_view(buf_ + read_, firstPartSize), std::string_view(buf_, secondPartSize)};
}
}
size_t InputSink::ReadBinaryUntilTerminator(char *dest, size_t bufSize, std::string_view terminator, bool *didReadTerminator) {
Fill();
auto [part1, part2] = BufferParts();
size_t offset = SplitSearch(terminator, part1, part2);
if (offset == std::string_view::npos) {
*didReadTerminator = false;
// Not found, read as much as we can - but leave space for the terminator
const s64 toRead = std::min((s64)valid_, (s64)bufSize - (s64)terminator.length());
TakeExact(dest, toRead);
return toRead;
} else {
// Terminator found! Read right up to it, and then skip it.
*didReadTerminator = true;
_dbg_assert_(offset < valid_);
TakeExact(dest, offset);
Skip(terminator.size());
_dbg_assert_(valid_ >= 0);
return offset;
}
}
std::string InputSink::ReadLineWithEnding() {
std::string s;
ReadLineWithEnding(s);
+17 -1
View File
@@ -21,20 +21,36 @@ public:
bool Skip(size_t bytes);
void Discard();
size_t ReadBinaryUntilTerminator(char *dest, size_t bufSize, std::string_view terminator, bool *didReadTerminator);
bool Empty() const;
bool TryFill();
size_t ValidAmount() const {
return valid_;
}
// Size of the internal buffer. Useful for some clients.
enum {
BUFFER_SIZE = 32 * 1024,
};
private:
std::pair<std::string_view, std::string_view> BufferParts() const;
void Fill();
bool Block();
void AccountFill(int bytes);
void AccountDrain(size_t bytes);
size_t FindNewline() const;
static const size_t BUFFER_SIZE = 32 * 1024;
static const size_t PRESSURE = 8 * 1024;
size_t fd_;
// Circular buffer. read_ is the position to read from, write_ is the position to write to,
// valid_ is the number of valid bytes. valid_ can wrap around, so you might need to take
// two segments when reading and split when writing.
char buf_[BUFFER_SIZE];
size_t read_;
size_t write_;
+1 -1
View File
@@ -106,7 +106,7 @@ const AtlasImage *Atlas::getImage(ImageID name) const {
return nullptr;
for (int i = 0; i < num_images; i++) {
if (!strcmp(name.id, images[i].name))
if (name.id == images[i].name)
return &images[i];
}
return nullptr;
+10 -11
View File
@@ -3,6 +3,8 @@
#include <cstdint>
#include <cstring>
#include <string_view>
#define ATLAS_MAGIC ('A' | ('T' << 8) | ('L' << 16) | ('A' << 24))
// Metadata file structure v0:
@@ -21,34 +23,31 @@ struct Atlas;
struct ImageID {
public:
ImageID() : id(nullptr) {}
explicit ImageID(const char *_id) : id(_id) {}
ImageID() {}
explicit ImageID(std::string_view _id) : id(_id) {}
static inline ImageID invalid() {
return ImageID{ nullptr };
return ImageID{""};
}
bool isValid() const {
return id != nullptr;
return !id.empty();
}
bool isInvalid() const {
return id == nullptr;
return id.empty();
}
bool operator ==(const ImageID &other) {
return (id == other.id) || !strcmp(id, other.id);
return id == other.id;
}
bool operator !=(const ImageID &other) {
if (id == other.id) {
return false;
}
return strcmp(id, other.id) != 0;
return id != other.id;
}
private:
const char *id;
std::string_view id;
friend struct Atlas;
};
+34
View File
@@ -361,6 +361,16 @@ void SplitString(std::string_view str, const char delim, std::vector<std::string
}
}
bool SplitStringOnce(std::string_view str, std::string_view *firstPart, std::string_view *secondPart, char delim) {
size_t pos = str.find(delim);
if (pos == std::string_view::npos) {
return false;
}
*firstPart = str.substr(0, pos);
*secondPart = str.substr(pos + 1);
return true;
}
void SplitString(std::string_view str, const char delim, std::vector<std::string> &output, bool trimOutput) {
size_t next = 0;
size_t pos = 0;
@@ -547,3 +557,27 @@ void MakeUnique(std::vector<std::string> &v) {
}
v.swap(result);
}
size_t SplitSearch(std::string_view needle, std::string_view part1, std::string_view part2) {
if (part1.find(needle) != std::string_view::npos) {
// Easy case, found in part1.
return part1.find(needle);
}
size_t part1Size = part1.size();
size_t maxOverlap = std::min(needle.size() - 1, part1Size);
for (size_t overlap = maxOverlap; overlap > 0; overlap--) {
if (part1.substr(part1Size - overlap) == needle.substr(0, overlap)) {
// Found an overlap.
size_t remaining = needle.size() - overlap;
if (part2.substr(0, remaining) == needle.substr(overlap)) {
return part1Size - overlap;
}
}
}
// Now, check if it's found in part2 instead.
size_t posInPart2 = part2.find(needle);
if (posInPart2 != std::string_view::npos) {
return part1Size + posInPart2;
}
return std::string_view::npos;
}
+5
View File
@@ -110,6 +110,9 @@ void SplitString(std::string_view str, const char delim, std::vector<std::string
// Try to avoid this when possible, in favor of the string_view version.
void SplitString(std::string_view str, const char delim, std::vector<std::string> &output, bool trimOutput = false);
// Splits on the first occurrence of delim. Returns true if the delimiter was found.
bool SplitStringOnce(std::string_view str, std::string_view *firstPart, std::string_view *secondPart, char delim);
void GetQuotedStrings(std::string_view str, std::vector<std::string> &output);
std::string ReplaceAll(std::string_view input, std::string_view src, std::string_view dest);
@@ -151,6 +154,8 @@ inline void CharArrayFromFormat(char (& out)[Count], const char* format, ...)
void MakeUnique(std::vector<std::string> &vec);
size_t SplitSearch(std::string_view needle, std::string_view part1, std::string_view part2);
// Replaces %1, %2, %3 in format with arg1, arg2, arg3.
// Much safer than snprintf and friends.
// For mixes of strings and ints, manually convert the ints to strings.
+1
View File
@@ -145,6 +145,7 @@ enum SystemProperty {
SYSPROP_CLIPBOARD_TEXT,
SYSPROP_GPUDRIVER_VERSION,
SYSPROP_BUILD_VERSION,
SYSPROP_COMPUTER_NAME,
// Separate SD cards or similar.
// Need hacky solutions to get at this.
+1 -1
View File
@@ -37,6 +37,7 @@ void GetCurrentTimeFormatted(char formattedTime[13]);
// Most accurate timer possible - no extra double conversions. Only for spans.
class Instant {
public:
Instant();
static Instant Now() {
return Instant();
}
@@ -44,7 +45,6 @@ public:
double ElapsedMs() const { return ElapsedSeconds() * 1000.0; }
int64_t ElapsedNanos() const;
private:
Instant();
uint64_t nativeStart_;
#ifndef _WIN32
int64_t nsecs_;
+384 -30
View File
@@ -18,6 +18,7 @@
#include <algorithm>
#include <mutex>
#include <thread>
#include <string_view>
#include "Common/Net/HTTPClient.h"
#include "Common/Net/HTTPServer.h"
@@ -29,8 +30,11 @@
#include "Common/File/FileDescriptor.h"
#include "Common/File/DirListing.h"
#include "Common/File/VFS/VFS.h"
#include "Common/Data/Text/I18n.h"
#include "Common/TimeUtil.h"
#include "Common/StringUtils.h"
#include "Common/System/System.h"
#include "Common/System/OSD.h"
#include "Core/Util/RecentFiles.h"
#include "Core/Config.h"
#include "Core/Debugger/WebSocket.h"
@@ -50,10 +54,25 @@ static const int REPORT_PORT = 80;
static std::thread serverThread;
static ServerStatus serverStatus;
static std::mutex serverStatusLock;
static int serverFlags;
static WebServerFlags serverFlags;
std::mutex g_webServerLock;
static Path g_uploadPath; // TODO: Supply this through registration instead.
static std::atomic<int> g_uploadSessionId(1);
std::map<int, UploadProgress> g_uploadsInProgress;
// NOTE: These *only* encode spaces, which is almost enough.
std::vector<UploadProgress> GetUploadsInProgress() {
std::lock_guard<std::mutex> guard(g_webServerLock);
std::vector<UploadProgress> uploads;
uploads.reserve(g_uploadsInProgress.size());
for (const auto &pair : g_uploadsInProgress) {
uploads.push_back(pair.second);
}
return uploads;
}
std::string ServerUriEncode(std::string_view plain) {
return ReplaceAll(plain, " ", "%20");
}
@@ -73,7 +92,7 @@ static ServerStatus RetrieveStatus() {
}
// This reports the local IP address to report.ppsspp.org, which can then
// relay that address to a mobile device searching for the server.
// relay that address to a mobile device on the same wifi/LAN searching for the server.
static bool RegisterServer(int port) {
bool success = false;
http::Client http(nullptr);
@@ -86,7 +105,7 @@ static bool RegisterServer(int port) {
char resource4[1024]{};
if (http.Resolve(REPORT_HOSTNAME, REPORT_PORT, net::DNSType::IPV4)) {
if (http.Connect()) {
std::string ip = fd_util::GetLocalIP(http.sock());
std::string ip = http.GetLocalIpAsString();
snprintf(resource4, sizeof(resource4) - 1, "/match/update?local=%s&port=%d", ip.c_str(), port);
if (http.GET(http::RequestParams(resource4), &theVoid, &progress) > 0)
@@ -111,7 +130,7 @@ static bool RegisterServer(int port) {
// Currently, we're not using keepalive, so gotta reconnect...
if (http.Connect(timeout)) {
char resource6[1024] = {};
std::string ip = fd_util::GetLocalIP(http.sock());
std::string ip = http.GetLocalIpAsString();
snprintf(resource6, sizeof(resource6) - 1, "/match/update?local=%s&port=%d", ip.c_str(), port);
if (http.GET(http::RequestParams(resource6), &theVoid, &progress) > 0)
@@ -266,7 +285,7 @@ static void HandleListing(const http::ServerRequest &request) {
request.WriteHttpResponseHeader("1.0", 200, -1, "text/plain");
request.Out()->Printf("/\n");
if (serverFlags & (int)WebServerFlags::DISCS) {
if (serverFlags & WebServerFlags::DISCS) {
switch ((RemoteISOShareType)g_Config.iRemoteISOShareType) {
case RemoteISOShareType::RECENT:
// List the current discs in their recent order.
@@ -301,25 +320,60 @@ static void HandleListing(const http::ServerRequest &request) {
}
}
}
if (serverFlags & (int)WebServerFlags::DEBUGGER) {
if (serverFlags & WebServerFlags::DEBUGGER) {
request.Out()->Printf("/debugger\n");
}
}
static bool ServeDebuggerFile(const http::ServerRequest &request) {
std::string RenderTemplate(std::string_view input, const std::map<std::string, std::string>& values) {
std::string output;
output.reserve(input.size());
size_t i = 0;
while (i < input.size()) {
if (i + 3 < input.size() && input[i] == '{' && input[i + 1] == '{') {
size_t end = input.find("}}", i + 2);
if (end != std::string_view::npos) {
// Trim whitespace around key
size_t startKey = i + 2;
while (startKey < end && std::isspace(static_cast<unsigned char>(input[startKey])))
startKey++;
size_t endKey = end;
while (endKey > startKey && std::isspace(static_cast<unsigned char>(input[endKey - 1])))
endKey--;
std::string key(input.substr(startKey, endKey - startKey));
auto it = values.find(key);
if (it != values.end()) {
output += it->second;
} else {
// Keep the original placeholder if key not found
output.append(input.substr(i, end + 2 - i));
}
i = end + 2;
continue;
}
}
output.push_back(input[i]);
++i;
}
return output;
}
static bool ServeAssetFile(const http::ServerRequest &request) {
// Skip the slash at the start of the resource path.
std::string_view filename = request.resource().substr(1);
if (filename.find("..") != std::string_view::npos)
return false;
size_t size;
// TODO: ReadFile should take a string_view.
uint8_t *data = g_VFS.ReadFile(std::string(filename).c_str(), &size);
if (!data)
if (filename.find("..") != std::string_view::npos) {
// Don't allow directory traversal.
return false;
}
std::string ext = Path(filename).GetFileExtension();
const char *mimeType = "text/plain";
std::string_view mimeType = "text/plain";
if (ext == ".html") {
mimeType = "text/html";
} else if (ext == ".ico") {
@@ -334,10 +388,43 @@ static bool ServeDebuggerFile(const http::ServerRequest &request) {
mimeType = "text/css";
}
request.WriteHttpResponseHeader("1.0", 200, size, mimeType);
request.Out()->Push((char *)data, size);
size_t size;
// TODO: ReadFile should take a string_view.
uint8_t *data = g_VFS.ReadFile(std::string(filename).c_str(), &size);
if (!data) {
// Try appending index.html
data = g_VFS.ReadFile((std::string(filename) + "/index.html").c_str(), &size);
mimeType = "text/html";
if (!data) {
return false;
}
INFO_LOG(Log::HTTP, "Redirected to /index.html");
}
std::string html = std::string((const char *)data, size);
delete[] data;
// This is a gross, gross hack to have here in ServeAssetFile, but oh well.
if (mimeType == "text/html") {
if (html.find("<!--upload-->") != std::string::npos) {
std::string uploadPath = g_uploadPath.ToVisualString();
std::string deviceName = System_GetProperty(SYSPROP_NAME);
std::string computerName = System_GetProperty(SYSPROP_COMPUTER_NAME);
if (!computerName.empty()) {
deviceName = computerName;
}
std::map<std::string, std::string> values = {
{"upload_path", uploadPath},
{"device_name", deviceName},
};
// Use templating to insert some information.
html = RenderTemplate(html, values);
}
}
request.WriteHttpResponseHeader("1.0", 200, html.size(), std::string(mimeType).c_str());
request.Out()->Push(html.data(), html.size());
return true;
}
@@ -347,12 +434,13 @@ static void RedirectToDebugger(const http::ServerRequest &request) {
request.Out()->Push(payload);
}
// TODO: Allow registering ServeAssetFile roots as well.
static void HandleFallback(const http::ServerRequest &request) {
SetCurrentThreadName("HandleFallback");
AndroidJNIThreadContext jniContext;
if ((serverFlags & (int)WebServerFlags::DEBUGGER) != 0) {
if ((serverFlags & WebServerFlags::DEBUGGER) != 0) {
if (request.resource() == "/debugger/") {
RedirectToDebugger(request);
return;
@@ -360,13 +448,27 @@ static void HandleFallback(const http::ServerRequest &request) {
// Actually serve debugger files.
if (startsWith(request.resource(), "/debugger/")) {
if (ServeDebuggerFile(request)) {
if (ServeAssetFile(request)) {
return;
}
}
}
if (serverFlags & (int)WebServerFlags::DISCS) {
if (serverFlags & WebServerFlags::FILE_UPLOAD) {
Path uploadPath;
{
std::lock_guard<std::mutex> guard(g_webServerLock);
uploadPath = g_uploadPath;
}
if (startsWith(request.resource(), "/upload") && !uploadPath.empty()) {
if (ServeAssetFile(request)) {
return;
}
}
}
if (serverFlags & WebServerFlags::DISCS) {
std::string_view resource = request.resource();
Path localPath = LocalFromRemotePath(resource);
INFO_LOG(Log::Loader, "Serving %.*s from %s", (int)resource.size(), resource.data(), localPath.c_str());
@@ -388,9 +490,10 @@ static void HandleFallback(const http::ServerRequest &request) {
static void ForwardDebuggerRequest(const http::ServerRequest &request) {
SetCurrentThreadName("ForwardDebuggerRequest");
// Hm, is this needed?
AndroidJNIThreadContext jniContext;
if (serverFlags & (int)WebServerFlags::DEBUGGER) {
if (serverFlags & WebServerFlags::DEBUGGER) {
// Check if this is a websocket request...
std::string upgrade;
if (!request.GetHeader("upgrade", &upgrade)) {
@@ -408,7 +511,246 @@ static void ForwardDebuggerRequest(const http::ServerRequest &request) {
}
}
static void ExecuteWebServer() {
class ProgressTracker {
public:
ProgressTracker(int sessionId, s64 totalSize) : sessionId_(sessionId) {
std::lock_guard<std::mutex> guard(g_webServerLock);
g_uploadsInProgress[sessionId_] = UploadProgress{totalSize};
}
~ProgressTracker() {
std::lock_guard<std::mutex> guard(g_webServerLock);
g_uploadsInProgress.erase(sessionId_);
}
void SetFile(std::string_view filename, size_t size) {
std::lock_guard<std::mutex> guard(g_webServerLock);
auto &upload = g_uploadsInProgress[sessionId_];
upload.filename = filename;
upload.currentFileSize = size;
upload.uploadedBytes = 0;
}
void AddBytes(size_t bytes) {
std::lock_guard<std::mutex> guard(g_webServerLock);
g_uploadsInProgress[sessionId_].uploadedBytes += bytes;
}
private:
int sessionId_;
};
enum class MultiPartResult {
MoveToNext,
RequestError,
LocalError,
Done,
};
static MultiPartResult HandleMultipartPart(const http::ServerRequest &request, std::string boundary, const Path &uploadPath, ProgressTracker &progress) {
std::string firstBoundary = request.In()->ReadLine();
if (firstBoundary != "--" + boundary) {
WARN_LOG(Log::HTTP, "Bad boundary: Expected --%s but got %s", boundary.c_str());
return MultiPartResult::RequestError;
}
std::string disposition = request.In()->ReadLine();
INFO_LOG(Log::HTTP, "Disposition: %s", disposition.c_str());
std::vector<std::string_view> parts;
SplitString(disposition, ';', parts);
if (parts.size() < 2 || !startsWith(parts[0], "Content-Disposition: form-data")) {
WARN_LOG(Log::HTTP, "Bad content disposition: %s", disposition.c_str());
return MultiPartResult::RequestError;
}
std::string filename;
for (const auto &part : parts) {
std::string_view key;
std::string_view value;
if (SplitStringOnce(part, &key, &value, '=')) {
key = StripSpaces(key);
value = StripQuotes(StripSpaces(value));
if (key == "name") {
INFO_LOG(Log::HTTP, "Upload field name: %.*s", STR_VIEW(value));
} else if (key == "filename") {
INFO_LOG(Log::HTTP, "Upload filename: %.*s", STR_VIEW(value));
filename = value;
} else if (key == "fileSize") {
INFO_LOG(Log::HTTP, "Upload filesize: %.*s", STR_VIEW(value));
}
} else if (equalsNoCase(StripSpaces(part), "Content-Disposition: form-data")) {
// this is the first part, ok, ignore.
} else {
WARN_LOG(Log::HTTP, "Bad content disposition part: %.*s", STR_VIEW(part));
}
}
if (filename.empty()) {
ERROR_LOG(Log::HTTP, "Didn't receive a filename");
return MultiPartResult::RequestError;
}
std::string fileContentType = request.In()->ReadLine();
std::string secondBoundary = request.In()->ReadLine();
Path destPath = uploadPath / filename;
bool dryRun = false;
if (File::Exists(destPath)) {
INFO_LOG(Log::HTTP, "File already exists, entering dry run mode: %s", destPath.ToVisualString().c_str());
dryRun = true;
}
// Make sure the destination exists.
File::CreateFullPath(destPath.NavigateUp());
INFO_LOG(Log::HTTP, "Receiving '%s', writing to '%s' (unknown number of bytes)...", filename.c_str(), destPath.ToVisualString().c_str());
// OK, enter a loop where we read some data until we hit the boundary again.
// The boundary is chosen to be "unique" and unlikely to appear in the file. We trust that.
FILE *fp = nullptr;
if (!dryRun) {
fp = File::OpenCFile(destPath, "wb");
if (!fp) {
ERROR_LOG(Log::HTTP, "Failed to open destination file '%s' for writing, entering dry run mode.", destPath.ToVisualString().c_str());
dryRun = true; // We still want to keep reading the input stream - there might be more files following.
}
}
progress.SetFile(filename, 0);
u64 bytesTransferred = 0;
char buffer[net::InputSink::BUFFER_SIZE];
while (true) {
bool terminatorFound = false;
size_t readBytes = request.In()->ReadBinaryUntilTerminator(buffer, sizeof(buffer), "\r\n--" + boundary, &terminatorFound);
if (fp) {
if (fwrite(buffer, 1, readBytes, fp) != readBytes) {
ERROR_LOG(Log::HTTP, "Failed to write %d bytes to destination file '%s' - disk full?", (int)readBytes, destPath.ToVisualString().c_str());
fclose(fp);
// Delete the partially written file, so the user doesn't try to play it.
File::Delete(destPath);
return MultiPartResult::RequestError;
}
}
progress.AddBytes(readBytes);
bytesTransferred += readBytes;
if (terminatorFound) {
INFO_LOG(Log::HTTP, "Found terminator, skipping and proceeding.");
break;
}
}
INFO_LOG(Log::HTTP, "Total bytes transferred: %d", (int)bytesTransferred);
if (fp) {
fclose(fp);
}
auto n = GetI18NCategory(I18NCat::NETWORKING);
g_OSD.Show(OSDType::MESSAGE_SUCCESS, ApplySafeSubstitutions(n->T("File transfer complete: %1"), filename));
// NOTE: We already read the boundary above.
// However if this is the last part, the boundary will have "--\r\n" after it, otherwise there will be a line break.
// So, let's read two more bytes, to see if it's "--" or "\r\n".
std::string ending(2, 'x');
request.In()->TakeExact(ending.data(), 2);
if (ending == "--") {
INFO_LOG(Log::HTTP, "Upload of '%s' complete, '--' encountered. %d bytes left in buffer.", filename.c_str(), (int)request.In()->ValidAmount());
// Read the final \r\n.
std::string finalCRLF;
finalCRLF.resize(2);
request.In()->TakeExact(finalCRLF.data(), 2);
if (finalCRLF != "\r\n") {
// Not a big deal, but log it.
WARN_LOG(Log::HTTP, "Expected final CRLF after ending '--', got '%02x %02x'", finalCRLF[0], finalCRLF[1]);
}
return MultiPartResult::Done;
} else if (ending == "\r\n") {
INFO_LOG(Log::HTTP, "Upload of '%s' complete, continuing to next part.", filename.c_str());
return MultiPartResult::MoveToNext;
} else {
WARN_LOG(Log::HTTP, "Unexpected upload ending: '%s'. Bailing.", ending.c_str());
return MultiPartResult::RequestError;
}
}
// Handles a POST to upload a file.
// This uses the HTTP multipart protocol, which is arcane and complicated, unfortunately.
static void HandleUploadPost(const http::ServerRequest &request) {
AndroidJNIThreadContext jniContext;
// Do some sanity checks.
if (request.Method() != http::RequestHeader::POST) {
ERROR_LOG(Log::HTTP, "Wrong method");
return;
}
Path uploadPath;
{
std::lock_guard<std::mutex> guard(g_webServerLock);
uploadPath = g_uploadPath;
}
if (uploadPath.empty()) {
ERROR_LOG(Log::HTTP, "HandleUploadPost should not happen while uploadPath is empty");
return;
}
// Now start handling things.
std::string contentType;
if (!request.GetHeader("content-type", &contentType)) {
return;
}
size_t bpos = contentType.find("boundary=");
if (bpos == std::string::npos) {
return;
}
const std::string boundary = contentType.substr(bpos + strlen("boundary="));
// The total length of the entire multipart thing. This is just above the full size of the upload, so let's use it for progress.
u64 contentLength = request.Header().content_length;
if (contentLength == 0) {
WARN_LOG(Log::HTTP, "Bad content length");
return;
}
const int sessionId = g_uploadSessionId.fetch_add(1);
ProgressTracker progress(sessionId, contentLength);
while (true) {
MultiPartResult result = HandleMultipartPart(request, boundary, uploadPath, progress);
switch (result) {
case MultiPartResult::Done:
goto exitLoop;
case MultiPartResult::RequestError:
request.WriteHttpResponseHeader("1.0", 400, -1, "text/plain"); // Bad request
return;
case MultiPartResult::LocalError:
request.WriteHttpResponseHeader("1.0", 500, -1, "text/plain"); // Server error
return;
case MultiPartResult::MoveToNext:
// Else just continue to the next part.
break;
}
}
exitLoop:
// Now the buffer should be empty.
if (!request.In()->Empty()) {
size_t remaining = request.In()->ValidAmount();
WARN_LOG(Log::HTTP, "We didn't fully drain the request (%d bytes still buffered)", (int)remaining);
// std::string extraBytes;
// extraBytes.resize(remaining);
// request.In()->TakeExact(extraBytes.data(), remaining);
}
request.WriteHttpResponseHeader("1.0", 200, -1, "text/plain");
}
void WebServerSetUploadPath(const Path &path) {
std::lock_guard<std::mutex> guard(g_webServerLock);
g_uploadPath = path;
}
static void WebServerThread() {
SetCurrentThreadName("HTTPServer");
AndroidJNIThreadContext context; // Destructor detaches.
@@ -418,6 +760,7 @@ static void ExecuteWebServer() {
// This lists all the (current) recent ISOs. It also handles the debugger, which is very ugly.
http->SetFallbackHandler(&HandleFallback);
http->RegisterHandler("/debugger", &ForwardDebuggerRequest);
http->RegisterHandler("/upload_file", &HandleUploadPost);
if (!http->Listen(g_Config.iRemoteISOPort, "debugger-webserver")) {
if (!http->Listen(0, "debugger-webserver")) {
@@ -426,11 +769,14 @@ static void ExecuteWebServer() {
return;
}
}
UpdateStatus(ServerStatus::RUNNING);
g_Config.iRemoteISOPort = http->Port();
RegisterServer(http->Port());
double lastRegister = time_now_d();
INFO_LOG(Log::HTTP, "Entering web server loop. Listening on port %d", g_Config.iRemoteISOPort);
while (RetrieveStatus() == ServerStatus::RUNNING) {
constexpr double webServerSliceSeconds = 0.2f;
http->RunSlice(webServerSliceSeconds);
@@ -440,6 +786,7 @@ static void ExecuteWebServer() {
lastRegister = now;
}
}
INFO_LOG(Log::HTTP, "Leaving web server loop.");
http->Stop();
StopAllDebuggers();
@@ -448,14 +795,16 @@ static void ExecuteWebServer() {
UpdateStatus(ServerStatus::FINISHED);
}
// Only adds flags.
bool StartWebServer(WebServerFlags flags) {
std::lock_guard<std::mutex> guard(serverStatusLock);
switch (serverStatus) {
case ServerStatus::RUNNING:
if ((serverFlags & (int)flags) == (int)flags) {
if (((int)serverFlags & (int)flags) == (int)flags) {
// Already running with these flags.
return false;
}
serverFlags |= (int)flags;
serverFlags |= flags;
return true;
case ServerStatus::FINISHED:
@@ -464,8 +813,8 @@ bool StartWebServer(WebServerFlags flags) {
case ServerStatus::STOPPED:
serverStatus = ServerStatus::STARTING;
serverFlags = (int)flags;
serverThread = std::thread(&ExecuteWebServer);
serverFlags = flags;
serverThread = std::thread(&WebServerThread);
return true;
default:
@@ -473,14 +822,15 @@ bool StartWebServer(WebServerFlags flags) {
}
}
// Only removes flags.
bool StopWebServer(WebServerFlags flags) {
std::lock_guard<std::mutex> guard(serverStatusLock);
if (serverStatus != ServerStatus::RUNNING) {
return false;
}
serverFlags &= ~(int)flags;
if (serverFlags == 0) {
serverFlags &= ~flags;
if (serverFlags == WebServerFlags::NONE) {
serverStatus = ServerStatus::STOPPING;
}
return true;
@@ -494,7 +844,7 @@ bool WebServerStopping(WebServerFlags flags) {
bool WebServerStopped(WebServerFlags flags) {
std::lock_guard<std::mutex> guard(serverStatusLock);
if (serverStatus == ServerStatus::RUNNING) {
return (serverFlags & (int)flags) == 0;
return !(serverFlags & flags);
}
return serverStatus == ServerStatus::STOPPED || serverStatus == ServerStatus::FINISHED;
}
@@ -508,5 +858,9 @@ void ShutdownWebServer() {
}
bool WebServerRunning(WebServerFlags flags) {
return RetrieveStatus() == ServerStatus::RUNNING && (serverFlags & (int)flags) != 0;
return RetrieveStatus() == ServerStatus::RUNNING && (serverFlags & flags) != 0;
}
int WebServerPort() {
return g_Config.iRemoteISOPort;
}
+16 -1
View File
@@ -17,14 +17,18 @@
#pragma once
#include <vector>
#include "Common/Common.h"
class Path;
enum class WebServerFlags {
NONE = 0,
DISCS = 1,
DEBUGGER = 2,
FILE_UPLOAD = 4,
ALL = 1 | 2,
ALL = 1 | 2 | 4,
};
ENUM_CLASS_BITOPS(WebServerFlags);
@@ -36,3 +40,14 @@ bool WebServerRunning(WebServerFlags flags);
void ShutdownWebServer();
bool RemoteISOFileSupported(const std::string &filename);
void WebServerSetUploadPath(const Path &path);
int WebServerPort();
struct UploadProgress {
s64 totalBytes = 0;
s64 uploadedBytes = 0;
s64 currentFileSize = 0;
std::string filename;
};
std::vector<UploadProgress> GetUploadsInProgress();
+29 -29
View File
@@ -108,9 +108,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
[[package]]
name = "cc"
version = "1.2.41"
version = "1.2.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7"
checksum = "739eb0f94557554b3ca9a86d2d37bebd49c5e6d0c1d2bda35ba5bdac830befc2"
dependencies = [
"find-msvc-tools",
"shlex",
@@ -124,9 +124,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]]
name = "clap"
version = "4.5.49"
version = "4.5.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4512b90fa68d3a9932cea5184017c5d200f5921df706d45e853537dea51508f"
checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623"
dependencies = [
"clap_builder",
"clap_derive",
@@ -134,9 +134,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.49"
version = "4.5.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0025e98baa12e766c67ba13ff4695a887a1eba19569aad00a472546795bd6730"
checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0"
dependencies = [
"anstream",
"anstyle",
@@ -153,7 +153,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
]
[[package]]
@@ -228,7 +228,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
]
[[package]]
@@ -689,9 +689,9 @@ dependencies = [
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
version = "1.70.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
[[package]]
name = "itoa"
@@ -868,9 +868,9 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "once_cell_polyfill"
version = "1.70.1"
version = "1.70.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad"
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
[[package]]
name = "openssl"
@@ -895,7 +895,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
]
[[package]]
@@ -971,9 +971,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.101"
version = "1.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
dependencies = [
"unicode-ident",
]
@@ -1064,9 +1064,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.33"
version = "0.23.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "751e04a496ca00bb97a5e043158d23d66b5aabf2e1d5aa2a0aaebb1aafe6f82c"
checksum = "6a9586e9ee2b4f8fab52a0048ca7334d7024eef48e2cb9407e3497bb7cab7fa7"
dependencies = [
"once_cell",
"rustls-pki-types",
@@ -1166,7 +1166,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
]
[[package]]
@@ -1259,9 +1259,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.107"
version = "2.0.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a26dbd934e5451d21ef060c018dae56fc073894c5a7896f882928a76e6d081b"
checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917"
dependencies = [
"proc-macro2",
"quote",
@@ -1285,7 +1285,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
]
[[package]]
@@ -1339,7 +1339,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
]
[[package]]
@@ -1483,9 +1483,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "unicode-ident"
version = "1.0.19"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d"
checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06"
[[package]]
name = "untrusted"
@@ -1570,7 +1570,7 @@ dependencies = [
"log",
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
"wasm-bindgen-shared",
]
@@ -1605,7 +1605,7 @@ checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -2003,7 +2003,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
"synstructure",
]
@@ -2024,7 +2024,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
"synstructure",
]
@@ -2064,5 +2064,5 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
]
+3
View File
@@ -496,6 +496,9 @@ void ShaderViewScreen::CreateViews() {
LinearLayout *topbar = new LinearLayout(ORIENT_HORIZONTAL);
topbar->Add(new Choice(ImageID("I_NAVIGATE_BACK"), new LinearLayoutParams()))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
topbar->Add(new Choice(ImageID("I_FILE_COPY"), new LinearLayoutParams()))->OnClick.Add([this](UI::EventParams &e) {
System_CopyStringToClipboard(gpu->DebugGetShaderString(id_, type_, SHADER_STRING_SHORT_DESC));
});
topbar->Add(new TextView(gpu->DebugGetShaderString(id_, type_, SHADER_STRING_SHORT_DESC), FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT, false));
layout->Add(topbar);
+1
View File
@@ -150,6 +150,7 @@ bool GameInfo::Delete() {
case IdentifiedFileType::ARCHIVE_RAR:
case IdentifiedFileType::ARCHIVE_ZIP:
case IdentifiedFileType::ARCHIVE_7Z:
case IdentifiedFileType::UNKNOWN:
case IdentifiedFileType::PPSSPP_GE_DUMP:
{
const Path &fileToRemove = filePath_;
+1 -1
View File
@@ -1874,7 +1874,7 @@ void HostnameSelectScreen::CreatePopupContents(UI::ViewGroup *parent) {
}
// Add non-editable items
listIP.push_back("localhost");
net::GetIPList(listIP);
net::GetLocalIP4List(listIP);
ipRows_ = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0));
ScrollView* scrollView = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
+10
View File
@@ -62,6 +62,7 @@
#include "UI/DisplayLayoutScreen.h"
#include "UI/SavedataScreen.h"
#include "UI/Store.h"
#include "UI/UploadScreen.h"
#include "UI/InstallZipScreen.h"
#include "Core/Config.h"
#include "Core/Loaders.h"
@@ -815,6 +816,12 @@ void GameBrowser::Refresh() {
topBar->Add(new Choice(mm->T("PPSSPP Homebrew Store"), new UI::LinearLayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Handle(this, &GameBrowser::OnHomebrewStore);
}
if (browseFlags_ & BrowseFlags::UPLOAD_BUTTON) {
topBar->Add(new Choice(ImageID("I_FOLDER_UPLOAD"), new UI::LinearLayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Add([this](UI::EventParams &e) {
screenManager_->push(new UploadScreen(path_.GetPath()));
});
}
ChoiceStrip *layoutChoice = topBar->Add(new ChoiceStrip(ORIENT_HORIZONTAL));
layoutChoice->AddChoice(ImageID("I_GRID"));
layoutChoice->AddChoice(ImageID("I_LINES"));
@@ -1577,6 +1584,9 @@ void MainScreen::dialogFinished(const Screen *dialog, DialogResult result) {
} else if (tag == "IAP") {
// Gold status may have changed.
RecreateViews();
} else if (tag == "Upload") {
// Files may have been uploaded.
RecreateViews();
}
}
+2 -1
View File
@@ -38,7 +38,8 @@ enum class BrowseFlags {
ARCHIVES = 4,
PIN = 8,
HOMEBREW_STORE = 16,
STANDARD = 1 | 2 | 4 | 8,
UPLOAD_BUTTON = 32,
STANDARD = 1 | 2 | 4 | 8 | 32,
};
ENUM_CLASS_BITOPS(BrowseFlags);
+2
View File
@@ -75,6 +75,7 @@
<ClCompile Include="InstallZipScreen.cpp" />
<ClCompile Include="Theme.cpp" />
<ClCompile Include="UIAtlas.cpp" />
<ClCompile Include="UploadScreen.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AudioCommon.h" />
@@ -124,6 +125,7 @@
<ClInclude Include="InstallZipScreen.h" />
<ClInclude Include="Theme.h" />
<ClInclude Include="UIAtlas.h" />
<ClInclude Include="UploadScreen.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.vcxproj">
+6
View File
@@ -129,6 +129,9 @@
<ClCompile Include="ImDebugger\ImJitViewer.cpp">
<Filter>ImDebugger</Filter>
</ClCompile>
<ClCompile Include="UploadScreen.cpp">
<Filter>Screens</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="GameInfoCache.h" />
@@ -258,6 +261,9 @@
<ClInclude Include="ImDebugger\ImJitViewer.h">
<Filter>ImDebugger</Filter>
</ClInclude>
<ClInclude Include="UploadScreen.h">
<Filter>Screens</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Screens">
+5
View File
@@ -138,6 +138,11 @@ static const ImageMeta imageIDs[] = {
{"I_SETTINGS_DISPLAY", false},
{"I_NAVIGATE_BACK", false},
{"I_NAVIGATE_FORWARD", false},
{"I_FOLDER_UPLOAD", false},
{"I_FILE", false},
{"I_FILE_COPY", false},
{"I_WEB_BROWSER", false},
{"I_WIFI", false},
};
static std::string PNGNameFromID(std::string_view id) {
+120
View File
@@ -0,0 +1,120 @@
#include <cmath>
#include "Common/Net/Resolve.h"
#include "Common/System/Request.h"
#include "Common/File/DiskFree.h"
#include "Common/StringUtils.h"
#include "Common/Data/Text/Parsers.h"
#include "Core/WebServer.h"
#include "UI/UploadScreen.h"
// Compound view, showing a text with an icon.
class TextWithImage : public UI::LinearLayout {
public:
TextWithImage(ImageID imageID, std::string_view text, UI::LinearLayoutParams *layoutParams = nullptr);
};
TextWithImage::TextWithImage(ImageID imageID, std::string_view text, UI::LinearLayoutParams *layoutParams) : UI::LinearLayout(UI::ORIENT_HORIZONTAL, layoutParams) {
using namespace UI;
SetSpacing(8.0f);
if (!layoutParams) {
layoutParams_->width = FILL_PARENT;
layoutParams_->height = ITEM_HEIGHT;
}
if (imageID.isValid()) {
Add(new ImageView(imageID, "", UI::IS_DEFAULT, new LinearLayoutParams(0.0f, UI::Gravity::G_VCENTER)));
}
Add(new TextView(text, new LinearLayoutParams(1.0f, UI::Gravity::G_VCENTER)));
}
// Compound view, showing a copyable string.
class CopyableText : public UI::LinearLayout {
public:
CopyableText(ImageID imageID, std::string_view text, UI::LinearLayoutParams *layoutParams = nullptr);
};
CopyableText::CopyableText(ImageID imageID, std::string_view text, UI::LinearLayoutParams *layoutParams) : UI::LinearLayout(UI::ORIENT_HORIZONTAL, layoutParams) {
using namespace UI;
SetSpacing(8.0f);
if (!layoutParams) {
layoutParams_->width = FILL_PARENT;
layoutParams_->height = ITEM_HEIGHT;
}
if (imageID.isValid()) {
Add(new ImageView(imageID, "", UI::IS_DEFAULT, new LinearLayoutParams(0.0f, UI::Gravity::G_VCENTER)));
}
Add(new TextView(text, new LinearLayoutParams(1.0f, UI::Gravity::G_VCENTER)))->SetBig(true);
Add(new Choice(ImageID("I_FILE_COPY"), new LinearLayoutParams()))->OnClick.Add([text](UI::EventParams &) {
System_CopyStringToClipboard(text);
});
}
UploadScreen::UploadScreen(const Path &targetFolder) : targetFolder_(targetFolder) {
net::GetLocalIP4List(localIPs_);
WebServerSetUploadPath(targetFolder);
StartWebServer(WebServerFlags::FILE_UPLOAD);
}
UploadScreen::~UploadScreen() {
StopWebServer(WebServerFlags::FILE_UPLOAD);
}
void UploadScreen::CreateViews() {
using namespace UI;
auto n = GetI18NCategory(I18NCat::NETWORKING);
root_ = new LinearLayout(ORIENT_VERTICAL);
LinearLayout *topBar = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
root_->Add(topBar);
topBar->Add(new Choice(ImageID("I_NAVIGATE_BACK"), new LinearLayoutParams()))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
LinearLayout *container = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(500, FILL_PARENT, 0.0f, UI::Gravity::G_HCENTER, Margins(10)));
root_->Add(container);
container->Add(new TextWithImage(ImageID("I_FOLDER_UPLOAD"), targetFolder_.ToVisualString()));
container->Add(new Spacer(20.0f));
if (prevRunning_) {
container->Add(new TextWithImage(ImageID("I_WIFI"), n->T("With a web browser on the same network, go to:")));
for (const auto &ip : localIPs_) {
std::string url = StringFromFormat("http://%s:%d/upload", ip.c_str(), WebServerPort());
container->Add(new CopyableText(ImageID("I_WEB_BROWSER"), url));
}
}
statusContainer_ = new LinearLayout(ORIENT_VERTICAL);
container->Add(statusContainer_);
}
void UploadScreen::RecreateStatus() {
if (!statusContainer_) {
return;
}
using namespace UI;
statusContainer_->Clear();
// Show information about current upload streams (there can be multiple, but normally it's just one
// where files are uploaded sequentially).
std::vector<UploadProgress> uploads = GetUploadsInProgress();
for (const auto &upload : uploads) {
int percent = upload.totalBytes == 0 ? 0 : (int)(ceil(100.0 * (double)upload.uploadedBytes / (double)upload.totalBytes));
std::string uploadText = StringFromFormat("%s: %s/%s (%d%%)", upload.filename.c_str(),
NiceSizeFormat(upload.uploadedBytes).c_str(), NiceSizeFormat(upload.totalBytes).c_str(), percent);
statusContainer_->Add(new TextWithImage(ImageID("I_FILE"), uploadText));
}
}
void UploadScreen::update() {
UIScreen::update();
bool running = WebServerRunning(WebServerFlags::FILE_UPLOAD);
if (prevRunning_ != running) {
prevRunning_ = running;
RecreateViews();
}
// Update in-progress uploads approximately every quarter of a second.
if (lastUpdate_.ElapsedSeconds() > 0.25) {
RecreateStatus();
lastUpdate_ = Instant::Now();
}
}
+52
View File
@@ -0,0 +1,52 @@
#pragma once
// Copyright (c) 2013- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include <functional>
#include <string>
#include <vector>
#include "Common/UI/UIScreen.h"
#include "Common/UI/ViewGroup.h"
#include "UI/MiscScreens.h"
#include "Common/TimeUtil.h"
// Upload screen: Shows the user an ip address to go to in a web browser on the same network,
// in order to upload game files to the current directory.
class UploadScreen : public UIDialogScreenWithBackground {
public:
UploadScreen(const Path &targetFolder);
~UploadScreen();
void CreateViews() override;
protected:
void update() override;
const char *tag() const override { return "Upload"; }
private:
void RecreateStatus();
bool prevRunning_ = false;
std::vector<std::string> localIPs_;
Path targetFolder_;
Instant lastUpdate_;
UI::ViewGroup *statusContainer_ = nullptr;
};
+2
View File
@@ -132,6 +132,7 @@
<ClInclude Include="..\..\UI\TouchControlLayoutScreen.h" />
<ClInclude Include="..\..\UI\TouchControlVisibilityScreen.h" />
<ClInclude Include="..\..\UI\UIAtlas.h" />
<ClInclude Include="..\..\UI\UploadScreen.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
@@ -184,6 +185,7 @@
<ClCompile Include="..\..\UI\TouchControlLayoutScreen.cpp" />
<ClCompile Include="..\..\UI\TouchControlVisibilityScreen.cpp" />
<ClCompile Include="..\..\UI\UIAtlas.cpp" />
<ClCompile Include="..\..\UI\UploadScreen.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
+6
View File
@@ -124,6 +124,9 @@
<ClCompile Include="..\..\UI\TouchControlVisibilityScreen.cpp">
<Filter>Screens</Filter>
</ClCompile>
<ClCompile Include="..\..\UI\UploadScreen.cpp">
<Filter>Screens</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
@@ -249,6 +252,9 @@
<ClInclude Include="..\..\UI\TouchControlVisibilityScreen.h">
<Filter>Screens</Filter>
</ClInclude>
<ClInclude Include="..\..\UI\UploadScreen.h">
<Filter>Screens</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="ImDebugger">
+4
View File
@@ -311,6 +311,10 @@
<DeploymentContent>true</DeploymentContent>
<Link>Content\vfpu\%(Filename)%(Extension)</Link>
</None>
<None Include="..\Assets\upload\*.*">
<DeploymentContent>true</DeploymentContent>
<Link>Content\upload\%(Filename)%(Extension)</Link>
</None>
<None Include="..\Assets\debugger\.nojekyll">
<DeploymentContent>true</DeploymentContent>
<Link>Content\debugger\%(Filename)%(Extension)</Link>
+4 -1
View File
@@ -12,6 +12,7 @@
#include "Common/Data/Encoding/Utf8.h"
#include "Common/Log.h"
#include "Common/Thread/ThreadUtil.h"
#include "WASAPIContext.h"
using Microsoft::WRL::ComPtr;
@@ -308,6 +309,8 @@ void WASAPIContext::FrameUpdate(bool allowAutoChange) {
}
void WASAPIContext::AudioLoop() {
SetCurrentThreadName("WASAPIAudioLoop");
DWORD taskID = 0;
HANDLE mmcssHandle = nullptr;
if (latencyMode_ == LatencyMode::Aggressive) {
@@ -323,7 +326,7 @@ void WASAPIContext::AudioLoop() {
audioClient_->GetBufferSize(&available);
}
AudioFormat format = Classify(format_);
const AudioFormat format = Classify(format_);
const int nChannels = format_->nChannels;
while (running_) {
+14
View File
@@ -115,6 +115,7 @@ static std::string langRegion;
static std::string osName;
static std::string osVersion;
static std::string gpuDriverVersion;
static std::string computerName;
static std::string restartArgs;
@@ -253,6 +254,17 @@ std::string System_GetProperty(SystemProperty prop) {
return PPSSPP_GIT_VERSION;
case SYSPROP_USER_DOCUMENTS_DIR:
return Path(W32Util::UserDocumentsPath()).ToString(); // this'll reverse the slashes.
case SYSPROP_COMPUTER_NAME:
if (computerName.empty()) {
wchar_t nameBuf[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = ARRAY_SIZE(nameBuf);
if (GetComputerNameW(nameBuf, &size)) {
computerName = ConvertWStringToUTF8(std::wstring(nameBuf, size));
} else {
computerName = "(N/A)";
}
}
return computerName;
default:
return "";
}
@@ -433,6 +445,8 @@ bool System_GetPropertyBool(SystemProperty prop) {
#else
return false;
#endif
case SYSPROP_HAS_ACCELEROMETER:
return true; // for debugging
default:
return false;
}
+1
View File
@@ -4,6 +4,7 @@ cp -r ../assets/lang assets/
cp -r ../assets/shaders assets/
cp -r ../assets/themes assets/
cp -r ../assets/debugger assets/
cp -r ../assets/upload assets/
cp -r ../assets/ui_images assets/
cp ../assets/*.ini assets/
cp ../assets/Roboto-Condensed.ttf assets/Roboto-Condensed.ttf
+1
View File
@@ -922,6 +922,7 @@ LOCAL_SRC_FILES := \
$(SRC)/UI/JoystickHistoryView.cpp \
$(SRC)/UI/GameInfoCache.cpp \
$(SRC)/UI/GameScreen.cpp \
$(SRC)/UI/UploadScreen.cpp \
$(SRC)/UI/ControlMappingScreen.cpp \
$(SRC)/UI/GameSettingsScreen.cpp \
$(SRC)/UI/DeveloperToolsScreen.cpp \
+2
View File
@@ -975,6 +975,7 @@ Error = فشل
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = اکتمال نقل الملف: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = اسم المستضيف
@@ -1008,6 +1009,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = باستخدام متصفح ويب على نفس الشبكة، انتقل إلى:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Fail köçürməsi tamamlandı: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Eyni şəbəkədə veb brauzer ilə daxil olun:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -934,6 +934,7 @@ Error = Памылка
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Перадача файла завершана: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Імя хаста
@@ -967,6 +968,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = Можа працаваць не на ўсіх прыладах або ў гульнях, глядзіце вікі.
Validating address... = Праверка адраса...
With a web browser on the same network, go to: = З дапамогай вэб-браўзера ў той жа сетцы, перайдзіце па адрасе:
WLAN Channel = Канал WLAN
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Грешка
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Пренос на файл завършен: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = С веб браузър в същата мрежа, отидете на:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Transferència de fitxer completada: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Amb un navegador web a la mateixa xarxa, ves a:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Přenos souboru dokončen: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = S webovým prohlížečem ve stejné síti přejděte na:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Filoverførsel færdig: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Med en webbrowser på det samme netværk, gå til:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -957,6 +957,7 @@ Error = Fehler
Failed to Bind Localhost IP = Localhost-IP konnte nicht gebunden werden
Failed to Bind Port = Port konnte nicht gebunden werden
Failed to connect to Adhoc Server = Verbindung zum Ad-hoc-Server fehlgeschlagen
File transfer completed: %1 = Dateiübertragung abgeschlossen: %1
Forced First Connect = Erzwungene erste Verbindung (Schneller Verbinden)
GM: Data from Unknown Port = GM: Daten von unbekanntem Port
Hostname = Hostname
@@ -990,6 +991,7 @@ UPnP need to be reinitialized = UPnP muss neu initialisiert werden
UPnP use original port = UPnP-Original-Port verwenden (aktiviert = PSP-Kompatibilität)
UseOriginalPort Tip = Funktioniert möglicherweise nicht mit allen Geräten oder Spielen. Siehe Wiki.
Validating address... = Adresse wird validiert...
With a web browser on the same network, go to: = Öffnen Sie mit einem Webbrowser im gleichen Netzwerk:
WLAN Channel = WLAN-Kanal
You're in Offline Mode, go to lobby or online hall = Du bist im Offline-Modus. Gehe in die Lobby oder Online-Halle.
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Transfer file selesai: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Dengan browser web di jaringan yang sama, pergi ke:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -958,6 +958,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = File transfer completed: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -991,6 +992,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = With a web browser on the same network, go to:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -968,6 +968,7 @@ Error = Error
Failed to Bind Localhost IP = Error al unirse a la IP localhost
Failed to Bind Port = Error al vincular puerto
Failed to connect to Adhoc Server = Error al conectar al servidor Ad-Hoc
File transfer completed: %1 = Transferencia de archivo completada: %1
Forced First Connect = Primera conexión forzada (más rápida)
GM: Data from Unknown Port = GM: Datos de puerto desconocido
Hostname = Nombre de host
@@ -1001,6 +1002,7 @@ UPnP need to be reinitialized = Es necesario reiniciar UPnP
UPnP use original port = UPnP usa puerto original (activado = compatibilidad PSP)
UseOriginalPort Tip = Puede que no funcione con todos los dispositivos o juegos, consulta la wiki.
Validating address... = Validando dirección...
With a web browser on the same network, go to: = Con un navegador web en la misma red, ve a:
WLAN Channel = Canal WLAN
You're in Offline Mode, go to lobby or online hall = Estás en modo offline, ve al lobby o a la sala online
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Fallo al unirse a la IP localhost
Failed to Bind Port = Fallo al unir puerto
Failed to connect to Adhoc Server = Fallo al conectar al servidor Adhoc
File transfer completed: %1 = Transferencia de archivo completada: %1
Forced First Connect = Primera conexión forzada (más rápida)
GM: Data from Unknown Port = GM: Datos de puerto desconocido
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = La función de UPnP debe reinicializarse.
UPnP use original port = Usar puerto UPnP de PSP (activado = más compatible con PSP )
UseOriginalPort Tip = Puede que no funcione para todos los dispositivos o juegos, consulte la wiki.
Validating address... = Validando dirección ...
With a web browser on the same network, go to: = Con un navegador web en la misma red, dirígete a:
WLAN Channel = Canal WLAN
You're in Offline Mode, go to lobby or online hall = Estás en modo fuera de línea, ve al lobby o sala en línea
+2
View File
@@ -967,6 +967,7 @@ Error = خطا
Failed to Bind Localhost IP = اتصال به IP localhost شکست خورد
Failed to Bind Port = اتصال به درگاه شکست خورد
Failed to connect to Adhoc Server = اتصال به سرور ادهاک شکست خورد
File transfer completed: %1 = انتقال فایل تمام شد: %1
Forced First Connect = اتصال اول اجباری (اتصال سریع تر)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = نام میزبان
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP باید بازراه‌اندازی شود
UPnP use original port = استفاده از درگاه اصلی UPnP (فعال = سازگاری با PSP)
UseOriginalPort Tip = ممکن است برای همه دستگاه ها یا بازی ها کار نکند، ویکی را ببینید.
Validating address... = اعتبارسنجی نشانی...
With a web browser on the same network, go to: = با یک مرورگر وب در همان شبکه، به:
WLAN Channel = کانال WLAN
You're in Offline Mode, go to lobby or online hall = شما در حالت آفلاین هستید، به لابی یا سالن آنلاین بروید.
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Tiedostonsiirto valmis: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Selaimessa, joka on samassa verkossa, siirry:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Erreur
Failed to Bind Localhost IP = Échec de liaison de l'IP localhost
Failed to Bind Port = Échec de liaison du port
Failed to connect to Adhoc Server = Échec de connexion au serveur ad hoc
File transfer completed: %1 = Transfert de fichier terminé : %1
Forced First Connect = Première connexion forcée (connexion plus rapide)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP doit être réinitialisé
UPnP use original port = Utiliser les ports originaux avec UPnP (activé = compatibilité PSP)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validation de l'adresse...
With a web browser on the same network, go to: = Avec un navigateur web sur le même réseau, allez à :
WLAN Channel = Canal WLAN
You're in Offline Mode, go to lobby or online hall = Vous êtes en mode hors ligne, allez dans le hall en ligne.
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Transferencia de ficheiro completada: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Con un navegador web na mesma rede, vai a:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Η μεταφορά αρχείου ολοκληρώθηκε: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Επικύρωση διεύθυνσης...
With a web browser on the same network, go to: = Με έναν περιηγητή ιστού στο ίδιο δίκτυο, πηγαίνετε σε:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = העברת קובץ הושלמה: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = עם דפדפן אינטרנט באותה הרשת, עבור אל:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -964,6 +964,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = הושלמה העברת קובץ: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -997,6 +998,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = עם דפדפן אינטרנט באותה הרשת, עבור אל:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Prenos datoteke završen: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Provjeravanje adrese...
With a web browser on the same network, go to: = S web preglednikom na istoj mreži, idite na:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = Trenutno si u "Offline",idi u lobby ili online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Hiba
Failed to Bind Localhost IP = Nem sikerült a localhost IP kötése
Failed to Bind Port = Nem sikerült a porthoz kötés
Failed to connect to Adhoc Server = Nem sikerült csatlakozni az ad hoc szerverhez
File transfer completed: %1 = Fájlátvitel befejeződött: %1
Forced First Connect = Kényszerített első csatlakozás (gyorsabb csatlakozás)
GM: Data from Unknown Port = GM: ismeretlen portról származó adat
Hostname = Hostnév
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP újra-inicializálás szükséges
UPnP use original port = UPnP eredeti portot használja (be = PSP kompatibilitás)
UseOriginalPort Tip = Lehet, hogy nem működik az összes eszközön vagy játékhoz, lásd a wiki oldalt.
Validating address... = Cím ellenőrzése...
With a web browser on the same network, go to: = Azonos hálózaton lévő webböngészővel, lépjen a következőre:
WLAN Channel = WLAN csatorna
You're in Offline Mode, go to lobby or online hall = Offline üzemmódban vagy, menj a lobbiba vagy az online terembe!
+2
View File
@@ -967,6 +967,7 @@ Error = Kesalahan
Failed to Bind Localhost IP = Gagal memuat IP host lokal
Failed to Bind Port = Gagal memuat port
Failed to connect to Adhoc Server = Gagal terhubung ke server Ad Hoc
File transfer completed: %1 = Transfer file selesai: %1
Forced First Connect = Sambungan pertama paksa (koneksi lebih cepat)
GM: Data from Unknown Port = GM: Data dari port tidak dikenal
Hostname = Nama Host
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP perlu diinisialisasi ulang
UPnP use original port = UPnP menggunakan port asli (diaktifkan = kompatibilitas PSP)
UseOriginalPort Tip = Mungkin tidak berfungsi untuk semua perangkat atau permainan, lihat wiki.
Validating address... = Validasi alamat...
With a web browser on the same network, go to: = Dengan browser web di jaringan yang sama, buka:
WLAN Channel = Saluran WLAN
You're in Offline Mode, go to lobby or online hall = Anda dalam mode offline, pergi ke lobi atau aula online
+2
View File
@@ -935,6 +935,7 @@ Error = Errore
Failed to Bind Localhost IP = Impossibile correlare l'IP localhost
Failed to Bind Port = Impossibile correlare la porta
Failed to connect to Adhoc Server = Impossibile connettersi al sever ad hoc
File transfer completed: %1 = Trasferimento file completato: %1
Forced First Connect = Prima connessione forzata (connessione più rapida)
GM: Data from Unknown Port = GM: Dati da porta sconosciuta
Hostname = Nome host
@@ -968,6 +969,7 @@ UPnP need to be reinitialized = UPnP dev'essere reinizializzato
UPnP use original port = Usa la porta originale di UPnP (attiva = compatibilità PSP)
UseOriginalPort Tip = Potrebbe non funzionare per tutti i dispositivi o giochi, controlla la wiki.
Validating address... = Convalida indirizzo...
With a web browser on the same network, go to: = Con un browser web sulla stessa rete, vai a:
WLAN Channel = Canale WLAN
You're in Offline Mode, go to lobby or online hall = Sei in modalità offline, vai alla lobby online.
+2
View File
@@ -934,6 +934,7 @@ Error = エラー
Failed to Bind Localhost IP = ローカルホストIPのバインドに失敗しました
Failed to Bind Port = ポートのバインドに失敗しました
Failed to connect to Adhoc Server = アドホックサーバーに接続できませんでした
File transfer completed: %1 = ファイル転送が完了しました: %1
Forced First Connect = 強制初期接続 (より速い接続)
GM: Data from Unknown Port = GM: 不明なポートからのデータ
Hostname = ホストネーム
@@ -967,6 +968,7 @@ UPnP need to be reinitialized = UPnPの再初期化が必要です
UPnP use original port = UPnPでオリジナルのポートを使用する (有効 = PSP互換)
UseOriginalPort Tip = デバイスやゲームによっては動作しない場合がありますので、wikiを参照してください。
Validating address... = アドレスを検証しています...
With a web browser on the same network, go to: = 同じネットワークのWebブラウザで、次のアドレスにアクセスしてください:
WLAN Channel = WLANチャネル
You're in Offline Mode, go to lobby or online hall = オフラインモードです。ロビーかホールに移動してください
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Transfer berkas rampung: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Kanthi browser web ing jaringan sing padha, bukak:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -934,6 +934,7 @@ Error = 오류
Failed to Bind Localhost IP = 로컬 호스트 IP를 바인딩하지 못했습니다.
Failed to Bind Port = 포트를 바인딩하지 못했습니다.
Failed to connect to Adhoc Server = Ad Hoc 서버에 연결하지 못했습니다.
File transfer completed: %1 = 파일 전송 완료: %1
Forced First Connect = 강제 첫 번째 연결 (빠른 연결)
GM: Data from Unknown Port = GM: 알 수 없는 포트의 데이터
Hostname = 호스트 이름
@@ -967,6 +968,7 @@ UPnP need to be reinitialized = UPnP를 다시 초기화해야 합니다.
UPnP use original port = UPnP는 원래 포트를 사용합니다 (활성화됨 = PSP 호환성)
UseOriginalPort Tip = 일부 기기나 게임에서는 작동하지 않을 수 있으므로, 위키를 참조하세요.
Validating address... = 주소 검증하는 중...
With a web browser on the same network, go to: = 같은 네트워크의 웹 브라우저에서 다음으로 이동하세요:
WLAN Channel = 무선랜 채널
You're in Offline Mode, go to lobby or online hall = 오프라인 모드입니다. 로비 또는 온라인 홀으로 이동합니다.
+2
View File
@@ -948,6 +948,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Guhertina pelî bi serketinî: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -981,6 +982,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Bi kevneşopê webê li ser heman torê, bibe:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = ການໂອນເຟຊ໌ແລ້ວແລ້ວ: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = ກັບບຣາວເຊີບເວບເລັ່ງໃນເຄື່ອນເຊື່ອມໃນສຽງດຽວ, ເຂົ້າໄປທີ່:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Failo perkėlimas baigtas: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Naudodamiesi žiniatinklio naršykle toje pačioje tinkle, eikite į:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Pemindahan fail selesai: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Dengan pelayar web pada rangkaian yang sama, pergi ke:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Bestandsoverdracht voltooid: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Ga met een webbrowser op hetzelfde netwerk naar:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Filoverføring fullført: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Med en nettleser på samme nettverk, gå til:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -962,6 +962,7 @@ Error = Błąd
Failed to Bind Localhost IP = Błąd przy przypisywaniu adresu IP lokalnego hosta
Failed to Bind Port = Błąd przy przypisywaniu portu
Failed to connect to Adhoc Server = Błąd przy łączeniu z serwerem Ad-Hoc
File transfer completed: %1 = Transfer pliku zakończony: %1
Forced First Connect = Wymuszenie pierwszego połączenie (szybsze łączenie)
#GM = Dane z nieznanego portu
GM: Data from Unknown Port = GM: Dane z nieznanego portu
@@ -996,6 +997,7 @@ UPnP need to be reinitialized = Należy ponownie zainicjować UPnP
UPnP use original port = UPnP używa oryginalnego portu (włączone = kompatybilność z PSP)
UseOriginalPort Tip = Może nie działać ze wszystkimi grami i/lub urządzeniami. Po więcej informacji udaj się na wiki.
Validating address... = Uwierzytelnianie addresu...
With a web browser on the same network, go to: = Za pomocą przeglądarki internetowej w tej samej sieci, przejdź do:
WLAN Channel = Kanał WLAN
You're in Offline Mode, go to lobby or online hall = Jesteś w trybie offline; wejdź do lobby lub pokoju online
+2
View File
@@ -957,6 +957,7 @@ Error = Erro
Failed to Bind Localhost IP = Falhou em associar com o IP do hospedeiro local
Failed to Bind Port = Falhou em associar com a porta
Failed to connect to Adhoc Server = Falhou em conectar ao servidor ad hoc
File transfer completed: %1 = Transferência de arquivo concluída: %1
Forced First Connect = Primeira conexão forçada (conexão mais rápida)
GM: Data from Unknown Port = GM: Dados da Porta Desconhecida
Hostname = Nome do hospedeiro
@@ -990,6 +991,7 @@ UPnP need to be reinitialized = O UPnP precisa ser reinicializado
UPnP use original port = O UPnP usa a porta original (ativado = compatibilidade com o PSP)
UseOriginalPort Tip = Pode não funcionar com todos os dispositivos ou jogos, veja o wiki.
Validating address... = Validando endereço...
With a web browser on the same network, go to: = Com um navegador web na mesma rede, vá para:
WLAN Channel = Canal do WLAN
You're in Offline Mode, go to lobby or online hall = Você está no modo offline, vá pro lobby ou pro salão online
+2
View File
@@ -959,6 +959,7 @@ Error = Erro
Failed to Bind Localhost IP = Erro ao conectar ao IP do hospedeiro local
Failed to Bind Port = Erro ao conectar a porta
Failed to connect to Adhoc Server = Erro ao conectar ao servidor Adhoc
File transfer completed: %1 = Transferência de arquivo concluída: %1
Forced First Connect = Primeira conexão forçada (conexão mais rápida)
GM: Data from Unknown Port = GM: Dados da Porta Desconhecida
Hostname = Nome do Hospedeiro
@@ -993,6 +994,7 @@ UPnP use original port = O UPnP usa a porta original (ativado = compatibilidade
UseOriginalPort Tip = May not work for all devices or games, see wiki.
UseOriginalPort Tip = Poderá não funcionar com todos os dispositivos/jogos, para mais informações, vê a wiki.
Validating address... = A validar Endereço...
With a web browser on the same network, go to: = Com um navegador web na mesma rede, dirija-se a:
WLAN Channel = Canal do WLAN
You're in Offline Mode, go to lobby or online hall = Estás no modo Offline, vai para o lobby/salão Online
+2
View File
@@ -968,6 +968,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Transferul de fișiere s-a finalizat: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1001,6 +1002,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Cu un browser web pe aceeași rețea, accesați:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -934,6 +934,7 @@ Error = Ошибка
Failed to Bind Localhost IP = Не удалось привязать адрес для localhost
Failed to Bind Port = Не удалось привязать порт
Failed to connect to Adhoc Server = Не удалось подключиться к ad-hoc серверу
File transfer completed: %1 = Передача файла завершена: %1
Forced First Connect = Принудительное первое подключение (быстрое подключение)
GM: Data from Unknown Port = GM: Данные с неизвестного порта
Hostname = Имя хоста
@@ -967,6 +968,7 @@ UPnP need to be reinitialized = Необходимо перезапустить
UPnP use original port = Использовать оригинальный порт UPnP (включено = совместимость с PSP)
UseOriginalPort Tip = Может не работать для всех устройств или игр, смотрите wiki.
Validating address... = Проверка адреса...
With a web browser on the same network, go to: = С веб-браузером в той же сети, перейдите по адресу:
WLAN Channel = Канал WLAN
You're in Offline Mode, go to lobby or online hall = Вы в автономном режиме, зайдите в лобби или в комнату в Интернете
+2
View File
@@ -935,6 +935,7 @@ Error = Fel
Failed to Bind Localhost IP = Misslyckades binda localhost-IP
Failed to Bind Port = Misslyckades binda port
Failed to connect to Adhoc Server = Misslyckades koppla upp till adhoc-servern
File transfer completed: %1 = Filöverföring slutförd: %1
Forced First Connect = Tvingad första uppkopplining (snabbare uppkoppling)
GM: Data from Unknown Port = GM: Data från okänd port
Hostname = Hostname
@@ -968,6 +969,7 @@ UPnP need to be reinitialized = UPnP behöver ominitialiseras
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = Funkar eventuellt inte för alla enheter eller spel, se wiki.
Validating address... = Bekräftar adress...
With a web browser on the same network, go to: = Med en webbläsare på samma nätverk, gå till:
WLAN Channel = WLAN-kanal
You're in Offline Mode, go to lobby or online hall = Du är i offline-läge, gå till lobbyn eller online-hallen
+2
View File
@@ -968,6 +968,7 @@ Error = Error
Failed to Bind Localhost IP = Nabigong i-bind ang localhost IP
Failed to Bind Port = Nabigong i-bind ang port
Failed to connect to Adhoc Server = Nabigong kumonekta sa ad hoc server
File transfer completed: %1 = Мубодилаи файл анҷомид: %1
Forced First Connect = Pinilit muna kumonekta (mabilis kumonekta)
GM: Data from Unknown Port = GM: Data mula sa Hindi Kilalang Port
Hostname = Pangalan ng host
@@ -1001,6 +1002,7 @@ UPnP need to be reinitialized = Kailangang muling simulan ang UPnP
UPnP use original port = Gamitin ang orihinal na port ng UPnP (enabled = PSP compatibility)
UseOriginalPort Tip = Maaaring hindi gumana para sa lahat ng device o laro, tingnan ang wiki.
Validating address... = Pinapatunayan ang address...
With a web browser on the same network, go to: = Бо браузери веб дар шабаκаи ҳамон, гузаред ба:
WLAN Channel = Channel ng WLAN
You're in Offline Mode, go to lobby or online hall = Nasa offline mode ka, pumunta sa lobby o online hall
+2
View File
@@ -986,6 +986,7 @@ Error = มีข้อผิดพลาด
Failed to Bind Localhost IP = เชื่อมโยง Localhost IP ไม่สำเร็จ
Failed to Bind Port = ล้มเหลวในการเชื่อมโยงพอร์ต
Failed to connect to Adhoc Server = ล้มเหลวในการเชื่อมต่อกับเซิร์ฟเวอร์ Adhoc
File transfer completed: %1 = การถ่ายโอนไฟล์เสร็จสิ้น: %1
Forced First Connect = บังคับการเชื่อมต่อในครั้งแรกสุด
GM: Data from Unknown Port = GM: ข้อมูลมาจากพอร์ตที่ไม่รู้จัก
Hostname = ชื่อหัวห้อง
@@ -1019,6 +1020,7 @@ UPnP need to be reinitialized = UPnP จำเป็นต้องเริ่
UPnP use original port = UPnP ใช้พอร์ตค่าเริ่มต้น (เปิดใช้งาน = เล่นกับเครื่อง PSP)
UseOriginalPort Tip = อาจจะใช้ไม่ได้ในทุกอุปกรณ์หรือในบางเกม โปรดดูข้อมูลเพิ่มเติมที่ Wiki
Validating address... = กำลังตรวจสอบที่อยู่...
With a web browser on the same network, go to: = ด้วยเว็บเบราว์เซอร์ในเครือข่ายเดียวกัน ไปที่:
WLAN Channel = ช่องสัญญาณ WLAN
You're in Offline Mode, go to lobby or online hall = คุณอยู่ในโหมดออฟไลน์ ต้องเข้าไปในล็อบบี้หรือออนไลน์ฮอลล์ก่อน
+2
View File
@@ -969,6 +969,7 @@ Error = Hata
Failed to Bind Localhost IP = Yerel ana makine IP'si bağlanamadı
Failed to Bind Port = Port bağlanamadı
Failed to connect to Adhoc Server = Adhoc sunucusuna bağlanılamadı
File transfer completed: %1 = Dosya aktarımı tamamlandı: %1
Forced First Connect = Zorunlu İlk Bağlantı
GM: Data from Unknown Port = GM: Bilinmeyen Porttan Veri
Hostname = Ana makine adı
@@ -1002,6 +1003,7 @@ UPnP need to be reinitialized = UPnP yeniden başlatılmalı
UPnP use original port = UPnP Orijinal Port Kullan
UseOriginalPort Tip = Tüm cihazlar veya oyunlarda çalışmayabilir, wiki'ye bakın.
Validating address... = Adres doğrulanıyor...
With a web browser on the same network, go to: = Aynı ağda bir web tarayıcısı ile şu adrese gidin:
WLAN Channel = WLAN Kanalı
You're in Offline Mode, go to lobby or online hall = Çevrimdışı moddasınız, lobiye veya çevrimiçi salona gidin
+2
View File
@@ -967,6 +967,7 @@ Error = Помилка
Failed to Bind Localhost IP = Не вдалося прив’язати локальний хост IP
Failed to Bind Port = Не вдалося прив’язати порт
Failed to connect to Adhoc Server = Не вдалося підключитися до ad hoc сервера
File transfer completed: %1 = Передача файлу завершена: %1
Forced First Connect = Примусове перше підключення (швидше підключення)
GM: Data from Unknown Port = GM: Дані з невідомого порту
Hostname = Ім'я хоста
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP необхідно повторно іні
UPnP use original port = UPnP використовує оригінальний порт (увімкнуто = PSP сумісність)
UseOriginalPort Tip = Може працювати не для всіх пристроїв чи ігор, подив. вікі.
Validating address... = Підтвердження адреси...
With a web browser on the same network, go to: = За допомогою веб-браузера в тій же мережі перейдіть за адресою:
WLAN Channel = WLAN канал
You're in Offline Mode, go to lobby or online hall = Ви перебуваєте в офлайн-режимі, переходите у лоббі чи онлайн-режим
+2
View File
@@ -967,6 +967,7 @@ Error = Error
Failed to Bind Localhost IP = Failed to bind localhost IP
Failed to Bind Port = Failed to bind port
Failed to connect to Adhoc Server = Failed to connect to ad hoc server
File transfer completed: %1 = Chuyển file hoàn tất: %1
Forced First Connect = Forced first connect (faster connect)
GM: Data from Unknown Port = GM: Data from Unknown Port
Hostname = Hostname
@@ -1000,6 +1001,7 @@ UPnP need to be reinitialized = UPnP need to be reinitialized
UPnP use original port = UPnP use original port (enabled = PSP compatibility)
UseOriginalPort Tip = May not work for all devices or games, see wiki.
Validating address... = Validating address...
With a web browser on the same network, go to: = Với trình duyệt web trong cùng một mạng, hãy đi tới:
WLAN Channel = WLAN channel
You're in Offline Mode, go to lobby or online hall = You're in offline mode, go to lobby or online hall
+2
View File
@@ -967,6 +967,7 @@ Error = 错误
Failed to Bind Localhost IP = 无法绑定本地主机IP
Failed to Bind Port = 无法绑定端口
Failed to connect to Adhoc Server = 无法连接Adhoc服务器
File transfer completed: %1 = 文件传输完成:%1
Forced First Connect = 快速初始化连接 (耗时更短)
GM: Data from Unknown Port = GM:来自未知端口的数据
Hostname = 主机名
@@ -1001,6 +1002,7 @@ UPnP need to be reinitialized = UPnP 需要重新初始化
UPnP use original port = UPnP 使用原始端口 (启用=兼容PSP)
UseOriginalPort Tip = 可能不适合某些游戏或设备,详见百科页面
Validating address... = 正在验证地址…
With a web browser on the same network, go to: = 在同一网络的Web浏览器中,访问:
WLAN Channel = WLAN信道
You're in Offline Mode, go to lobby or online hall = 您现在处于离线模式,请进入房间或在线大厅
+2
View File
@@ -934,6 +934,7 @@ Error = 錯誤
Failed to Bind Localhost IP = 無法繫結本機主機 IP
Failed to Bind Port = 無法繫結連接埠
Failed to connect to Adhoc Server = 無法連線至臨機操作伺服器
File transfer completed: %1 = 檔案傳輸完成:%1
Forced First Connect = 強制首次連線 (更快連線)
GM: Data from Unknown Port = GM:來自不明連接埠的資料
Hostname = 主機名稱
@@ -967,6 +968,7 @@ UPnP need to be reinitialized = UPnP 需要重新初始化
UPnP use original port = UPnP 使用原始連接埠 (已啟用 = PSP 相容性)
UseOriginalPort Tip = 可能不適用於所有裝置或遊戲,請參閱維基。
Validating address... = 正在驗證位址…
With a web browser on the same network, go to: = 在同一網絡的網頁瀏覽器上,前往:
WLAN Channel = WLAN 頻道
You're in Offline Mode, go to lobby or online hall = 您目前處於離線模式,請前往大廳或線上大廳
+55 -14
View File
@@ -24,15 +24,15 @@
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="px"
inkscape:zoom="2.8284272"
inkscape:cx="322.97101"
inkscape:cy="372.46849"
inkscape:zoom="2.0000001"
inkscape:cx="355.74999"
inkscape:cy="544.74999"
inkscape:window-width="3379"
inkscape:window-height="1941"
inkscape:window-x="-9"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg1"
inkscape:current-layer="layer1"
showgrid="false" /><defs
id="defs1"><inkscape:path-effect
effect="fillet_chamfer"
@@ -3083,7 +3083,7 @@
id="I_HOME"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
transform="matrix(0.26458333,0,0,0.26458333,5.0473301,79.356161)"><path
transform="matrix(0.26458333,0,0,0.26458333,-5.9908997,79.356161)"><path
style="color:#000000;fill:#ffffff;-inkscape-stroke:none"
d="m 154.41016,251.21289 h -3.10743 v 16.09766 h -19.04687 v -16.09766 h -2.42969 c 0,0 11.30045,-11.07641 12.1072,-11.88316 z m -12.47434,-15.43751 -18.13699,17.93751 h 5.95703 v 16.09766 h 24.04687 v -16.09766 h 6.21094 z"
id="path5204"
@@ -3187,7 +3187,7 @@
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" /></g><g
id="I_SPEAKER_MAX"
transform="matrix(0.44009307,0,0,0.44009307,-62.491119,1.9213872)"
transform="matrix(0.44009307,0,0,0.44009307,-76.896945,1.9213872)"
inkscape:export-xdpi="135"
inkscape:export-ydpi="135"><g
transform="matrix(1.1742907,0,0,1.1742907,225.4342,162.52437)"
@@ -3242,14 +3242,14 @@
inkscape:export-xdpi="135"
inkscape:export-filename="speaker.png"
id="I_SPEAKER"
transform="matrix(0.51679723,0,0,0.51679723,64.418875,73.447233)"><path
transform="matrix(0.51679723,0,0,0.51679723,50.013049,73.447233)"><path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:0.670213;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
d="m 40.140311,135.92727 h 4.054542 l 3.801958,-2.99163 -0.04448,15.5982 -3.757475,-3.39096 h -4.054542 z"
id="path2639"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" /></g><g
id="I_SPEAKER_OFF"
transform="matrix(0.44009307,0,0,0.44009307,-63.536334,1.7642172)"
transform="matrix(0.44009307,0,0,0.44009307,-77.94216,1.7642172)"
inkscape:export-xdpi="135"
inkscape:export-ydpi="135"><g
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
@@ -3267,7 +3267,7 @@
id="rect2643"
d="m 319.32217,324.08362 -0.31055,0.31055 3.69727,3.69726 -3.61719,3.61719 0.31055,0.31055 3.61718,-3.61719 3.61524,3.61719 0.31055,-0.31055 -3.61524,-3.61719 3.69727,-3.69726 -0.31055,-0.31055 -3.69727,3.69727 z"
style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.35233;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" /></g><g
transform="matrix(0.39414007,0,0,0.39414007,-45.596736,29.857907)"
transform="matrix(0.39414007,0,0,0.39414007,-51.396484,29.857907)"
id="I_WARNING"
inkscape:export-xdpi="135"
inkscape:export-ydpi="135"><path
@@ -3292,7 +3292,7 @@
id="I_TRASHCAN"
inkscape:export-xdpi="135"
inkscape:export-ydpi="135"
transform="matrix(0.39414007,0,0,0.39414007,-38.179785,14.443237)"><rect
transform="matrix(0.39414007,0,0,0.39414007,-46.785863,14.443237)"><rect
style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
id="rect5029"
width="1.6071385"
@@ -3317,7 +3317,7 @@
transform="matrix(0.93415882,0,0,0.87040224,11.368845,44.781213)"
sodipodi:nodetypes="ccccccccccccccccccccccc" /></g><g
id="I_THREE_DOTS"
transform="matrix(0.42098793,0,0,0.42098793,-52.570448,27.877317)"
transform="matrix(0.42098793,0,0,0.42098793,-65.292476,27.877317)"
inkscape:export-xdpi="135"
inkscape:export-ydpi="135"><path
inkscape:export-ydpi="135"
@@ -3941,14 +3941,14 @@
id="I_FLAG_US"
transform="matrix(8.4810893e-4,0,0,0.00107427,3.571875,87.312501)"><path
d="M 0,0 H 7410 V 3900 H 0"
fill="#b31942"
fill="#bf0a30"
id="path43" /><path
d="m 0,450 h 7410 m 0,600 H 0 m 0,600 h 7410 m 0,600 H 0 m 0,600 h 7410 m 0,600 H 0"
stroke="#ffffff"
stroke-width="300"
id="path44" /><path
d="M 0,0 H 2964 V 2100 H 0"
fill="#0a3161"
fill="#002868"
id="path45" /><g
fill="#ffffff"
id="g95"><path
@@ -4197,7 +4197,44 @@
style="color:#000000;fill:#ececec;stroke-width:0.788011;stroke-miterlimit:4.8;-inkscape-stroke:none"
d="m 77.896652,80.722753 2.657871,2.704643 -2.552633,2.645661 -0.727756,-0.714513 1.41025,-1.409734 h -3.050491 c -1.344769,0 -2.424142,1.079372 -2.424142,2.424142 v 0.304891 c 0,1.27712 1.024032,2.300634 2.301153,2.300634 h 3.379638 v 1.042314 h -3.379638 c -1.840515,0 -3.342949,-1.502434 -3.342949,-3.342948 v -0.304891 c 0,-1.908164 1.557775,-3.467489 3.465938,-3.467489 h 3.049974 l -1.444812,-1.491584 z"
sodipodi:nodetypes="cccccssssccssssccc" />
<path
id="I_FOLDER_UPLOAD"
style="baseline-shift:baseline;display:inline;overflow:visible;opacity:1;vector-effect:none;fill:#ffffff;marker:none;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="m 86.729062,77.137918 -1.122929,2.205033 v 7.861758 h 3.798734 v -0.586011 h -3.21324 v -7.139322 l 0.894519,-1.757515 h 3.847827 l 0.834057,1.704805 h 4.701005 l 0.101802,0.06821 v 7.123819 h -3.166731 v 0.586011 h 3.750675 v -8.016271 l -0.503845,-0.347782 h -4.517553 l -0.836125,-1.702738 z m 4.603853,3.505211 -2.634981,2.80293 2.04587,0.01912 v 4.252363 h 1.193208 v -4.252363 l 2.031917,-0.01912 z"
sodipodi:nodetypes="ccccccccccccccccccccccccccccc" /><path
id="I_FILE"
style="color:#000000;fill:#ffffff;stroke-miterlimit:4.8;-inkscape-stroke:none"
d="m 81.915403,142.76852 v 10.86136 h 8.347293 v -7.85741 l -2.925402,-3.00395 z m 0.740007,0.74208 h 4.109309 v 2.89284 h 2.757971 v 6.48643 h -6.86728 z m 4.849832,0.49299 1.615922,1.65778 h -1.615922 z m -3.549137,3.50521 -0.0036,0.74208 4.325834,0.0238 0.0041,-0.74259 z m 0,1.63659 -0.0036,0.7426 4.325834,0.0232 0.0041,-0.74207 z m 0,1.70739 -0.0057,0.74208 3.087666,0.0232 0.0062,-0.74207 z" /><path
id="I_FILE_COPY"
style="color:#000000;fill:#ffffff;stroke-width:0.898414;stroke-miterlimit:4.8;-inkscape-stroke:none"
d="M 96.308838 142.38664 L 96.308838 144.03563 L 94.392159 144.03563 L 94.392159 153.79369 L 101.89144 153.79369 L 101.89144 152.1447 L 103.80812 152.1447 L 103.80812 145.08518 L 101.17986 142.38664 L 96.308838 142.38664 z M 96.973914 143.05327 L 100.66568 143.05327 L 100.66568 145.65207 L 103.14356 145.65207 L 103.14356 151.47962 L 96.973914 151.47962 L 96.973914 143.05327 z M 101.33075 143.49613 L 102.78286 144.98545 L 101.33075 144.98545 L 101.33075 143.49613 z M 95.057235 144.70226 L 96.308838 144.70226 L 96.308838 152.1447 L 101.22688 152.1447 L 101.22688 153.12862 L 95.057235 153.12862 L 95.057235 144.70226 z M 98.142318 146.64529 L 98.1387 147.31192 L 102.02528 147.33311 L 102.02942 146.66596 L 98.142318 146.64529 z M 98.142318 148.11549 L 98.1387 148.78263 L 102.02528 148.80382 L 102.02942 148.13719 L 98.142318 148.11549 z M 98.142318 149.64976 L 98.13715 150.31639 L 100.91114 150.33706 L 100.91579 149.67043 L 98.142318 149.64976 z " /><g
id="I_WEB_BROWSER"
transform="matrix(0.02185176,0,0,0.02185176,130.36271,116.47656)"
style="fill:#ffffff;fill-opacity:1">
<path
class="st0"
d="M 464,32 H 48 C 21.492,32 0,53.492 0,80 v 352 c 0,26.508 21.492,48 48,48 h 416 c 26.508,0 48,-21.492 48,-48 V 80 C 512,53.492 490.508,32 464,32 Z m -19.336,35 c 10.492,0 19,8.508 19,19 0,10.492 -8.508,19 -19,19 -10.492,0 -19,-8.508 -19,-19 0,-10.492 8.508,-19 19,-19 z m -70.5,0 c 10.492,0 19,8.508 19,19 0,10.492 -8.508,19 -19,19 -10.492,0 -19,-8.508 -19,-19 0,-10.492 8.508,-19 19,-19 z m -70.5,0 c 10.492,0 19,8.508 19,19 0,10.492 -8.508,19 -19,19 -10.492,0 -19,-8.508 -19,-19 0,-10.492 8.508,-19 19,-19 z M 472,432 c 0,4.406 -3.586,8 -8,8 H 48 c -4.414,0 -8,-3.594 -8,-8 V 136 h 432 z"
id="path1-6"
style="fill:#ffffff;fill-opacity:1" />
<path
class="st0"
d="m 97.477,326.656 h 16.031 c 0.977,0 1.625,-0.633 1.93,-1.562 l 13.774,-44 h 0.336 l 13.43,44 c 0.328,0.93 0.984,1.562 1.945,1.562 h 16.188 c 0.984,0 1.633,-0.633 1.938,-1.562 l 25.117,-72.656 c 0.313,-0.93 -0.187,-1.562 -1.305,-1.562 h -19.913 c -1.149,0 -1.79,0.484 -2.102,1.562 l -12.313,45.094 h -0.312 l -13.766,-45.094 c -0.336,-1.078 -0.977,-1.562 -2.11,-1.562 h -13.602 c -1.14,0 -1.954,0.484 -2.258,1.562 l -13.454,45.094 h -0.328 L 93.757,252.438 c -0.328,-1.078 -0.953,-1.562 -2.266,-1.562 H 71.586 c -0.992,0 -1.454,0.633 -1.157,1.562 l 25.118,72.656 c 0.32,0.929 0.969,1.562 1.93,1.562 z"
id="path2-1"
style="fill:#ffffff;fill-opacity:1" />
<path
class="st0"
d="m 224.078,326.656 h 16.054 c 0.961,0 1.618,-0.633 1.93,-1.562 l 13.766,-44 h 0.328 l 13.43,44 c 0.336,0.93 0.984,1.562 1.953,1.562 h 16.18 c 0.984,0 1.625,-0.633 1.953,-1.562 l 25.102,-72.656 c 0.313,-0.93 -0.172,-1.562 -1.297,-1.562 H 293.57 c -1.156,0 -1.805,0.484 -2.117,1.562 l -12.313,45.094 h -0.32 l -13.758,-45.094 c -0.336,-1.078 -0.976,-1.562 -2.102,-1.562 h -13.609 c -1.133,0 -1.946,0.484 -2.258,1.562 l -13.445,45.094 h -0.321 l -12.961,-45.094 c -0.313,-1.078 -0.969,-1.562 -2.258,-1.562 h -19.914 c -0.992,0 -1.469,0.633 -1.133,1.562 l 25.094,72.656 c 0.322,0.929 0.97,1.562 1.923,1.562 z"
id="path3-9"
style="fill:#ffffff;fill-opacity:1" />
<path
class="st0"
d="m 350.875,326.656 h 16.047 c 0.953,0 1.601,-0.633 1.922,-1.562 l 13.766,-44 h 0.336 l 13.429,44 c 0.328,0.93 0.969,1.562 1.938,1.562 h 16.195 c 0.977,0 1.625,-0.633 1.946,-1.562 l 25.117,-72.656 c 0.297,-0.93 -0.187,-1.562 -1.296,-1.562 h -19.938 c -1.133,0 -1.782,0.484 -2.094,1.562 l -12.304,45.094 h -0.32 l -13.766,-45.094 c -0.336,-1.078 -0.977,-1.562 -2.102,-1.562 h -13.618 c -1.133,0 -1.938,0.484 -2.25,1.562 l -13.462,45.094 h -0.304 l -12.954,-45.094 c -0.336,-1.078 -0.961,-1.562 -2.266,-1.562 h -19.922 c -0.969,0 -1.454,0.633 -1.141,1.562 l 25.118,72.656 c 0.306,0.929 0.954,1.562 1.923,1.562 z"
id="path4-9"
style="fill:#ffffff;fill-opacity:1" />
</g><path
id="I_WIFI"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.457348"
d="m 91.031704,67.566834 c -1.65526,0 -3.310304,0.625455 -4.57316,1.875848 l 0.65303,0.646386 c 2.161668,-2.139935 5.679067,-2.139935 7.840261,0 l 0.65342,-0.646386 c -1.263086,-1.250393 -2.918291,-1.875848 -4.573551,-1.875848 z m 0,1.829734 c -1.182354,0 -2.364671,0.446301 -3.26671,1.339277 l 0.653029,0.646777 c 1.44142,-1.42647 3.786403,-1.42647 5.227363,0 l 0.653029,-0.646777 c -0.90204,-0.892976 -2.084357,-1.339277 -3.266711,-1.339277 z m 3.91e-4,1.829341 c -0.709389,0 -1.419034,0.267868 -1.96026,0.803879 l 0.653419,0.646777 c 0.72025,-0.713465 1.892588,-0.713465 2.613291,0 l 0.65342,-0.646777 c -0.541222,-0.536011 -1.250481,-0.803879 -1.95987,-0.803879 z m -3.91e-4,1.829344 c -0.236424,0 -0.47301,0.08949 -0.65342,0.268089 l 0.65342,0.646386 0.653421,-0.646386 c -0.180407,-0.178595 -0.416996,-0.268089 -0.653421,-0.268089 z" /></g><path
id="I_GEAR"
style="fill:#ececec;fill-opacity:1;stroke-width:0.019487"
class="st0"
@@ -4205,4 +4242,8 @@
id="I_GEAR_SMALL"
style="fill:#ececec;fill-opacity:1;stroke-width:0.010717"
class="st0"
d="m 151.0159,123.87219 c -0.0724,0 -0.13541,0.0498 -0.15205,0.12023 l -0.13584,0.57634 c -0.22788,0.0528 -0.44164,0.14237 -0.63434,0.2626 l -0.5036,-0.3112 c -0.0616,-0.038 -0.14136,-0.0288 -0.1924,0.0221 l -0.26658,0.26659 c -0.0513,0.0513 -0.0606,0.13083 -0.0225,0.1924 l 0.31148,0.50388 c -0.12024,0.19282 -0.21006,0.40617 -0.26289,0.63405 l -0.57606,0.13614 c -0.0704,0.0167 -0.1205,0.0795 -0.1205,0.15175 v 0.37685 c 0,0.0725 0.05,0.13542 0.1205,0.15205 l 0.57606,0.13612 c 0.0528,0.22789 0.14266,0.44124 0.26289,0.63406 l -0.31148,0.50359 c -0.038,0.0616 -0.0286,0.14165 0.0225,0.19269 l 0.2663,0.26629 c 0.0513,0.0513 0.13101,0.0606 0.19268,0.0225 l 0.5036,-0.31119 c 0.19272,0.12024 0.40646,0.20977 0.63434,0.2626 l 0.13584,0.57635 c 0.0167,0.0705 0.0797,0.12022 0.15205,0.12022 h 0.37685 c 0.0722,0 0.13541,-0.0497 0.15205,-0.12022 l 0.13583,-0.57635 c 0.22778,-0.0528 0.4416,-0.14236 0.63434,-0.2626 l 0.5036,0.31119 c 0.0616,0.0381 0.14126,0.0287 0.1924,-0.0225 l 0.26658,-0.26629 c 0.0512,-0.0512 0.0606,-0.13082 0.0225,-0.1924 l -0.31148,-0.50388 c 0.12024,-0.19273 0.20977,-0.40626 0.26261,-0.63406 l 0.57634,-0.13612 c 0.0706,-0.0167 0.12022,-0.0797 0.12022,-0.15205 v -0.37656 c -1e-5,-0.0724 -0.0497,-0.13541 -0.12022,-0.15204 l -0.57634,-0.13585 c -0.0528,-0.22788 -0.14237,-0.44153 -0.26261,-0.63434 l 0.31148,-0.50388 c 0.0381,-0.0617 0.0288,-0.14116 -0.0225,-0.1924 l -0.26658,-0.2663 c -0.0512,-0.0512 -0.13074,-0.0606 -0.1924,-0.0225 l -0.5036,0.31119 c -0.19282,-0.12023 -0.40646,-0.20977 -0.63434,-0.2626 l -0.13583,-0.57635 c -0.0167,-0.0704 -0.0798,-0.12022 -0.15205,-0.12022 z m 0.18842,1.30078 c 0.79691,0 1.44259,0.64585 1.44259,1.4426 0,0.79672 -0.64568,1.44286 -1.44259,1.44286 -0.79664,0 -1.44259,-0.64614 -1.44259,-1.44286 0,-0.79674 0.64595,-1.4426 1.44259,-1.4426 z m 0,0.68264 c -0.41969,0 -0.75995,0.34019 -0.75995,0.75996 0,0.41976 0.34026,0.76022 0.75995,0.76022 0.41977,0 0.75994,-0.34045 0.75994,-0.76022 0,-0.41978 -0.34017,-0.75996 -0.75994,-0.75996 z" /></svg>
d="m 151.0159,123.87219 c -0.0724,0 -0.13541,0.0498 -0.15205,0.12023 l -0.13584,0.57634 c -0.22788,0.0528 -0.44164,0.14237 -0.63434,0.2626 l -0.5036,-0.3112 c -0.0616,-0.038 -0.14136,-0.0288 -0.1924,0.0221 l -0.26658,0.26659 c -0.0513,0.0513 -0.0606,0.13083 -0.0225,0.1924 l 0.31148,0.50388 c -0.12024,0.19282 -0.21006,0.40617 -0.26289,0.63405 l -0.57606,0.13614 c -0.0704,0.0167 -0.1205,0.0795 -0.1205,0.15175 v 0.37685 c 0,0.0725 0.05,0.13542 0.1205,0.15205 l 0.57606,0.13612 c 0.0528,0.22789 0.14266,0.44124 0.26289,0.63406 l -0.31148,0.50359 c -0.038,0.0616 -0.0286,0.14165 0.0225,0.19269 l 0.2663,0.26629 c 0.0513,0.0513 0.13101,0.0606 0.19268,0.0225 l 0.5036,-0.31119 c 0.19272,0.12024 0.40646,0.20977 0.63434,0.2626 l 0.13584,0.57635 c 0.0167,0.0705 0.0797,0.12022 0.15205,0.12022 h 0.37685 c 0.0722,0 0.13541,-0.0497 0.15205,-0.12022 l 0.13583,-0.57635 c 0.22778,-0.0528 0.4416,-0.14236 0.63434,-0.2626 l 0.5036,0.31119 c 0.0616,0.0381 0.14126,0.0287 0.1924,-0.0225 l 0.26658,-0.26629 c 0.0512,-0.0512 0.0606,-0.13082 0.0225,-0.1924 l -0.31148,-0.50388 c 0.12024,-0.19273 0.20977,-0.40626 0.26261,-0.63406 l 0.57634,-0.13612 c 0.0706,-0.0167 0.12022,-0.0797 0.12022,-0.15205 v -0.37656 c -1e-5,-0.0724 -0.0497,-0.13541 -0.12022,-0.15204 l -0.57634,-0.13585 c -0.0528,-0.22788 -0.14237,-0.44153 -0.26261,-0.63434 l 0.31148,-0.50388 c 0.0381,-0.0617 0.0288,-0.14116 -0.0225,-0.1924 l -0.26658,-0.2663 c -0.0512,-0.0512 -0.13074,-0.0606 -0.1924,-0.0225 l -0.5036,0.31119 c -0.19282,-0.12023 -0.40646,-0.20977 -0.63434,-0.2626 l -0.13583,-0.57635 c -0.0167,-0.0704 -0.0798,-0.12022 -0.15205,-0.12022 z m 0.18842,1.30078 c 0.79691,0 1.44259,0.64585 1.44259,1.4426 0,0.79672 -0.64568,1.44286 -1.44259,1.44286 -0.79664,0 -1.44259,-0.64614 -1.44259,-1.44286 0,-0.79674 0.64595,-1.4426 1.44259,-1.4426 z m 0,0.68264 c -0.41969,0 -0.75995,0.34019 -0.75995,0.75996 0,0.41976 0.34026,0.76022 0.75995,0.76022 0.41977,0 0.75994,-0.34045 0.75994,-0.76022 0,-0.41978 -0.34017,-0.75996 -0.75994,-0.75996 z" /><style
type="text/css"
id="style1">
.st0{fill:#000000;}
</style></svg>

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 208 KiB

+409
View File
@@ -0,0 +1,409 @@
<!DOCTYPE html>
<!--upload-->
<!--TODO: Make localizable somehow.-->
<html lang="en">
<head>
<meta charset="UTF-8">
<title>File Uploader</title>
<style>
body {
font-family: system-ui, sans-serif;
background: #e7f1ff;
color: #333;
padding: 2em;
max-width: 600px;
margin: auto;
}
h1 {
text-align: center;
color: #444;
}
.section {
margin-bottom: 1em;
}
input[type="file"] {
display: block;
margin: 0.5em 0;
}
button {
display: inline-block;
padding: 0.6em 1.2em;
font-size: 1em;
border: none;
border-radius: 6px;
background-color: #4a90e2;
color: white;
cursor: pointer;
transition: background 0.2s;
margin-right: 0.5em;
}
#uploadBtn:enabled {
background-color: #3aa270;
}
button:disabled {
background-color: #ccc;
cursor: not-allowed;
}
button:hover:not(:disabled) {
background-color: #357ab8;
}
.btn {
display: inline-block;
padding: 0.6em 1.2em;
font-size: 1em;
border: none;
border-radius: 6px;
background-color: #4a90e2;
color: white;
cursor: pointer;
transition: background 0.2s;
margin-right: 0.5em;
}
.btn:hover {
background-color: #357ab8;
}
#fileList {
margin-top: 0.5em;
font-size: 0.95em;
color: #333;
}
progress {
width: 100%;
height: 20px;
margin-top: 0.5em;
display: none;
}
#status {
margin-top: 0.5em;
font-weight: 500;
}
#error {
color: #d33;
margin-top: 0.5em;
}
.btn input[type="file"] {
display: none; /* hide the native control */
}
#resetBtn {
display: none; /* initially hidden */
}
.drag-over {
border: 2px dashed #4a90e2;
background-color: #f0f8ff;
}
.drop-zone {
border: 2px dashed #ccc;
border-radius: 10px;
padding: 40px 20px;
text-align: center;
margin: 1em 0;
background-color: #fafafa;
transition: all 0.3s ease;
display: none; /* initially hidden, shown only on supported platforms */
}
.drop-zone-text {
color: #666;
font-size: 1.1em;
margin: 0.5em 0;
}
.fixed-width {
font-family: monospace;
background: #eee;
padding: 2px 4px;
border-radius: 4px;
}
</style>
</head>
<body>
<h1>Upload files to {{ device_name }}</h1>
<p>Destination folder: <span class="fixed-width">{{ upload_path }}</span></p>
<div class="section">
<label class="btn">
Choose individual files...
<input type="file" id="fileInput" multiple hidden>
</label>
<label class="btn">
Choose folder...
<input type="file" id="folderInput" webkitdirectory multiple>
</label>
<button id="resetBtn">
Reset
</button>
</div>
<div id="dropZone" class="drop-zone">
<div class="drop-zone-text">
📁 Drop files here or use the buttons above
</div>
</div>
<div id="fileList"></div>
<div id="uploadedSection" style="display: none;">
<h3>Uploaded Files:</h3>
<div id="uploadedList"></div>
</div>
<div class="section">
<button id="uploadBtn" disabled>Start upload!</button>
</div>
<progress id="progressBar" value="0" max="100"></progress>
<div id="status"></div>
<div id="error"></div>
<script>
(() => {
const fileInput = document.getElementById("fileInput");
const folderInput = document.getElementById("folderInput");
const uploadBtn = document.getElementById("uploadBtn");
const resetBtn = document.getElementById("resetBtn");
const fileListDiv = document.getElementById("fileList");
const uploadedSection = document.getElementById("uploadedSection");
const uploadedListDiv = document.getElementById("uploadedList");
const dropZone = document.getElementById("dropZone");
const progressBar = document.getElementById("progressBar");
const statusDiv = document.getElementById("status");
const errorDiv = document.getElementById("error");
let files = [];
let uploadedFiles = [];
let droppedFiles = [];
// Feature detection for drag and drop support
function isDragDropSupported() {
// Check for basic drag and drop API support
const div = document.createElement('div');
const hasBasicSupport = ('draggable' in div) && ('ondrop' in div);
// Check if it's a mobile device (where drag/drop from file system is limited)
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
// Check if it's a touch-only device
const isTouchOnly = ('ontouchstart' in window) && !window.matchMedia('(pointer: fine)').matches;
return hasBasicSupport && !isMobile && !isTouchOnly;
}
// Show drop zone only if drag and drop is supported
if (isDragDropSupported()) {
dropZone.style.display = 'block';
}
function formatBytes(bytes, decimals = 2) {
if (bytes === 0) return '0 B';
const k = 1024;
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
const size = parseFloat((bytes / Math.pow(k, i)).toFixed(decimals));
return `${size} ${units[i]}`;
}
function updateUploadedList() {
uploadedListDiv.innerHTML = "";
if (uploadedFiles.length > 0) {
uploadedSection.style.display = "block";
const list = document.createElement("ul");
uploadedFiles.forEach(f => {
const li = document.createElement("li");
const formattedBytes = formatBytes(f.size, 2);
const name = f.webkitRelativePath || f.name;
li.textContent = `${name} (${formattedBytes}) - ✓ Uploaded`;
li.style.color = "#2d7a2d";
list.appendChild(li);
});
uploadedListDiv.appendChild(list);
} else {
uploadedSection.style.display = "none";
}
}
function updateFileList() {
files = [...fileInput.files, ...folderInput.files, ...droppedFiles];
fileListDiv.innerHTML = "";
if (files.length > 0) {
uploadBtn.disabled = false;
resetBtn.style.display = "inline-block";
const list = document.createElement("ul");
files.forEach(f => {
const li = document.createElement("li");
const formattedBytes = formatBytes(f.size, 2);
const name = f.webkitRelativePath || f.name;
li.textContent = `${name} (${formattedBytes} bytes)`;
list.appendChild(li);
});
fileListDiv.appendChild(list);
} else {
uploadBtn.disabled = true;
resetBtn.style.display = "none";
}
}
fileInput.addEventListener("change", updateFileList);
folderInput.addEventListener("change", updateFileList);
// Drag and drop functionality
dropZone.addEventListener("dragover", (e) => {
e.preventDefault();
dropZone.classList.add("drag-over");
});
dropZone.addEventListener("dragleave", (e) => {
e.preventDefault();
dropZone.classList.remove("drag-over");
});
dropZone.addEventListener("drop", (e) => {
e.preventDefault();
dropZone.classList.remove("drag-over");
const dt = e.dataTransfer;
const allFiles = Array.from(dt.files);
// Filter out zero-byte entries (usually folders or invalid entries)
const validFiles = allFiles.filter(file => file.size > 0);
// Show a message if some files were filtered out
if (allFiles.length > validFiles.length) {
const filteredCount = allFiles.length - validFiles.length;
statusDiv.textContent = `Note: ${filteredCount} folder(s) or empty file(s) were skipped. Only files can be drag/dropped.`;
setTimeout(() => {
if (statusDiv.textContent.includes("folder(s) or empty file(s) were skipped")) {
statusDiv.textContent = "";
}
}, 8000);
}
// Add valid dropped files to the existing array
droppedFiles = [...droppedFiles, ...validFiles];
updateFileList();
});
// Also handle drag/drop on the entire document to prevent browser default behavior
document.addEventListener("dragover", (e) => {
e.preventDefault();
});
document.addEventListener("drop", (e) => {
e.preventDefault();
});
resetBtn.addEventListener("click", () => {
// Clear the file inputs
fileInput.value = "";
folderInput.value = "";
// Clear all arrays and update displays
files = [];
droppedFiles = [];
uploadedFiles = [];
updateFileList();
updateUploadedList();
});
uploadBtn.addEventListener("click", async () => {
if (files.length === 0) return;
uploadBtn.disabled = true;
errorDiv.textContent = "";
statusDiv.textContent = "";
progressBar.style.display = "block";
progressBar.value = 0;
const filesToUpload = [...files]; // Create a copy to iterate over
// Clear all file sources so files disappear from pending list as they upload
fileInput.value = "";
folderInput.value = "";
droppedFiles = [];
files = [];
for (let i = 0; i < filesToUpload.length; i++) {
const file = filesToUpload[i];
statusDiv.textContent = `Uploading ${file.webkitRelativePath || file.name} (${i + 1}/${filesToUpload.length})`;
try {
await uploadFile(file);
// Move successfully uploaded file to uploaded list
uploadedFiles.push(file);
updateUploadedList();
} catch (err) {
// If upload fails, add remaining files back to pending list
files = filesToUpload.slice(i);
updateFileList();
errorDiv.textContent = err.message;
progressBar.style.display = "none";
uploadBtn.disabled = false;
return;
}
}
// Update the pending files list (should be empty now)
updateFileList();
statusDiv.textContent = "All files uploaded successfully.";
progressBar.style.display = "none";
// Note: uploadBtn state is managed by updateFileList() - disabled when no files
});
function uploadFile(file) {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open("POST", "/upload_file");
// Add custom metadata headers if needed:
xhr.setRequestHeader("X-Client-Version", "1.0");
xhr.setRequestHeader("X-Upload-Timestamp", new Date().toISOString());
xhr.setRequestHeader("X-File-Size", file.size.toString());
xhr.upload.onprogress = e => {
if (e.lengthComputable) {
progressBar.value = (e.loaded / e.total) * 100;
}
};
xhr.onload = () => {
if (xhr.status >= 200 && xhr.status < 300) {
resolve();
} else {
let msg;
switch (xhr.status) {
case 400: msg = "Malformed request (boundary or headers invalid)."; break;
case 500: msg = "Target is probably out of disk space."; break;
default: msg = `Upload failed with status ${xhr.status}.`; break;
}
reject(new Error(msg));
}
};
xhr.onerror = () => reject(new Error("Connection error during upload."));
// Try to preserve any directory structure, if supported.
const formData = new FormData();
formData.append("file", file, file.webkitRelativePath || file.name);
xhr.send(formData);
});
}
})();
</script>
</body>
</html>
+1
View File
@@ -99,6 +99,7 @@ Source: "assets\*.*"; DestDir: "{app}\assets"
Source: "assets\shaders\*.*"; DestDir: "{app}\assets\shaders"
Source: "assets\themes\*.*"; DestDir: "{app}\assets\themes"
Source: "assets\debugger\*"; DestDir: "{app}\assets\debugger"; Flags: recursesubdirs
Source: "assets\upload\*"; DestDir: "{app}\assets\upload"; Flags: recursesubdirs
Source: "assets\lang\*.ini"; DestDir: "{app}\assets\lang"
Source: "assets\flash0\font\*.*"; DestDir: "{app}\assets\flash0\font"
Source: "assets\vfpu\*.*"; DestDir: "{app}\assets\vfpu"
+18
View File
@@ -1232,6 +1232,23 @@ bool TestVolumeFunc() {
return true;
}
bool TestSplitSearch() {
std::string part1 = "The quick brown fox jumps";
std::string part2 = " over the lazy dog.";
size_t offset = SplitSearch("jumps over", part1, part2);
EXPECT_EQ_INT(offset, 20);
offset = SplitSearch("quick", part1, part2);
EXPECT_EQ_INT(offset, 4);
offset = SplitSearch(" over", part1, part2);
EXPECT_EQ_INT(offset, 25);
offset = SplitSearch("fox jumps", part1, part2);
EXPECT_EQ_INT(offset, 16);
offset = SplitSearch("dog.", part1, part2);
EXPECT_EQ_INT(offset, 40);
return true;
}
typedef bool (*TestFunc)();
struct TestItem {
const char *name;
@@ -1301,6 +1318,7 @@ TestItem availableTests[] = {
TEST_ITEM(SIMD),
TEST_ITEM(CrossSIMD),
TEST_ITEM(VolumeFunc),
TEST_ITEM(SplitSearch),
};
int main(int argc, const char *argv[]) {