Commit graph

230 commits

Author SHA1 Message Date
SupSuper
c9d67e48a9 BACKENDS: Use FSNode::getName in string operations 2021-08-23 21:22:27 +01:00
Orgad Shaneh
89f05c4bf1 BACKENDS: Fix compiler warning
size is int64, lu is for unsigned long, which depends on the platform.
2021-07-17 09:20:44 +03:00
D G Turner
696de01630 BACKENDS: NETWORKING: Fix for GCC Warnings from 64-bit Stream API Changes 2021-07-09 04:35:47 +01:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Thierry Crozat
bbff87e74e NETWORKING: Fix unknow key error when using local server 2021-03-31 22:01:23 +01:00
SupSuper
70dc08f46e JANITORIAL: Cleanup inconsistent includes 2021-02-22 10:54:07 +00:00
Vladimir Serbinenko
68a9136e4d
COMMON: Rewrite Encoder and drop dependency on iconv (#2586)
Different platforms have different levels of support of encodings and
often have slight variations. We already have tables for most encoding
with only CJK missing. Full transcoding inclusion allows us to get reliable
encoding results independently of platform. The biggest con is the need for
external tables encoding.dat.

It removes a duplicate table for korean in graphics/korfont.cpp
2020-11-15 16:20:35 +01:00
antoniou
8d261d559e BACKENDS: NETWORKING: Add fringe case for hasPermittedPrefix() return clause
Android port was failing because the normalized prefix ended in '/' and the normalized path was identical except for the trailing '/'
2020-10-07 23:44:08 +03:00
aryanrawlani28
c87d0d6834 BACKENDS: NETWORKING: Remove unused toUtf8 helper
- All conversions are handled by Common:: helpers.
2020-08-30 14:43:41 +02:00
aryanrawlani28
68d01321d6 GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.

- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-08-30 14:43:41 +02:00
aryanrawlani28
e22b32abfe GUI: U32: Use Common::U32String::format where necessary and GUIError to u32
- Where necessary as in, where translated messages are used.
- GUIErrorMessage now takes in U32String
- error messages across some engines use U32Strings. they are changed because they show a message dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28
b9a449480b GUI: U32: Remove u32::format references
- Removed because implicit conversion can simply handle this usecase
2020-08-30 14:43:41 +02:00
aryanrawlani28
160a1320cc GUI: U32: Rename more temp code and fix issues
- Remove convertFromU32.. where necessary
- Replace convertFromU32 to .encode() for better readability
- Fix spacing issues in tabs
- Fix spacing issues in popups
- Fix weird font rendering in certain menus.
- Fix dialog changing sizes by huge amount when changing languages
- Some minor changes from String::format to U32String::Format
2020-08-30 14:43:41 +02:00
aryanrawlani28
f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00
rsn8887
68fad60eb6 PSP2: Fix cloud integration 2020-04-27 23:02:18 -05:00
SupSuper
22943ee368 NETWORKING: Fix delete instead of free 2020-03-20 16:02:16 +00:00
Thanasis Antoniou
ad046b1589 NETWORKING: Fix compiler warning about always false comparison
warning: comparison is always false due to limited range of data type [-Wtype-limits]

s is Common::String. s[i] is thus a "char". If char is signed 8bit then the comparison will indeed always be false.
2020-02-01 18:22:38 +02:00
Eugene Sandulenko
1584c36410 NETWORKING: Fix compilation for lower versions of libcurl 2019-11-05 21:42:53 +01:00
Alexander Tkachev
99e21f4320 NETWORKING: Enter Session
Session allows to reuse SessionRequests to the same host by making them
keeping alive connection. Turns out, though, that libcurl already does
that for us, and we didn't gain any speedup we thought we'd get.

Usage:
```
Networking::Session s;
Networking::SessionRequest *request = s.get(url);
request->startAndWait();
warning("HTTP GET: %s", request->text());
s.close();
```

You can still use SessionRequest without Session (but you can't put them
on stack!):
```
Networking::SessionRequest *request = new
Networking::SessionRequest(url);
request->startAndWait();
warning("HTTP GET: %s", request->text());
request->close();
```
2019-11-05 01:47:00 +01:00
Alexander Tkachev
f7d9156967 NETWORKING: Enter SessionRequest
It is to be used in a Session, though it might be used separately. It
must implement keep-alive, but it does not yet.

You must not put it to ConnMan by yourself (instead, use start()) and
you must call close() after you've finished using this request.

You can either work with it in callback, or wait() and simply use its
methods (check it's success() and then, for example, use text()). Like
this:
```
Networking::SessionRequest *rq = new Networking::SessionRequest(url);
rq->startAndWait();
if (rq->success())
warning("HTTP GET: %s", rq->text());
rq->close();
```
2019-11-05 01:47:00 +01:00
Alexander Tkachev
bc63abd3e1 NETWORKING: Add CurlRequest::wait() 2019-11-05 01:47:00 +01:00
Alexander Tkachev
2acb8e2215 JANITORIAL: Fix Networking::DataResponse typedef naming 2019-11-05 01:47:00 +01:00
Bastien Bouclet
6fa7322a6a NETWORKING: Try loading the CA bundle from DATA_PATH 2019-11-03 19:48:34 +02:00
Bastien Bouclet
47b67342d6 NETWORKING: Improve libcurl error handling
Error messages for failed requests are now printed as warnings.
2019-11-03 19:48:34 +02:00
Thanasis Antoniou
4eecfb8da9 ANDROID: Disable verification of certificates validity for cloud saving
Also added macros for the plain (non-SDL) Android port __ANDROID_PLAIN_PORT__ and ANDROID_PLAIN_PORT

The workaround of this commit uses the same logic as for the Nintendo Switch port and should suffice for testing purposes. It should be replaced by more elaborate code of installing and maintaining a certificates pem file.
2019-11-01 19:13:27 +02:00
Eugene Sandulenko
7533375b55 NETWORKING: Remove unnesessary check 2019-10-25 00:55:51 +02:00
Eugene Sandulenko
bbaebe594e NETWORKING: Reworked PostRequest to a more universal API 2019-10-24 17:41:28 +02:00
Eugene Sandulenko
a0c58a53b3 NETWORKING: Changed PostRequest to accept JSONValue 2019-10-24 00:15:33 +02:00
Eugene Sandulenko
0ad210a5a4 NETWORKING: Added simple request handler 2019-10-24 00:15:33 +02:00
rsn8887
cdbcb29609 SWITCH: Fix cloud integration 2019-10-13 14:19:05 -05:00
D G Turner
07ce549664 NETWORKING: Fix Signed vs. Unsigned Compiler Warnings 2019-10-05 02:07:54 +01:00
Thierry Crozat
caf0968078 NETWORKING: Convert translation results to UTF-8 for local webserver pages 2019-09-21 22:15:26 +03:00
Eugene Sandulenko
f86f96e188 NETWORKING: Clarify where to put wwwroot.zip 2019-09-14 22:45:17 +02:00
Eugene Sandulenko
b2fff44647 NETWORKING: Clarify message when web server resources are not available 2019-09-14 22:23:04 +02:00
Alexander Tkachev
5b5a89e3e7 CLOUD: Make Network::ErrorResponse messages more verbose
This commit updates all usages of Network::ErrorResponse to specify at
least method name if not precise reason why operation failed.
2019-08-25 12:15:14 +03:00
Alexander Tkachev
24b1ec0ded CLOUD: Handle HTTP response headers case-insensitively
RFC 2616 states that HTTP headers are not case-sensitive and also allows
arbitrary number of whitespace characters around header value. Previous
implementation was dependant on headers to be in "Title-Case" and to
have only one space before header value. That has lead to cloud sync
failure on Debian x64 (user's network environment was probably the
reason though).

This commit adds a new method, which parses headers name-value pairs
into HashMap. To ensure case-insensitivity, all headers names are
converted to lowercase, and thus code that uses this method should
specify headers in lowercase. All usages of raw headers contents were
updated to use this method.
2019-08-25 12:15:14 +03:00
Cameron Cawley
66ef50cfeb BACKENDS: Rename and simplify AbstractFSNode::create() 2019-08-06 07:17:29 +03:00
Alexander Tkachev
99c2418d1a GUI: Rewrite Cloud tab
- StorageWizardDialog is removed, along with bmps it was using;
- EditTextWidget now accepts custom font in constructor;
- ScrollContainer scrollbar now jumps to top when content height changes
so it's "overscrolled";
- IndexPageHandler now does not awaits for `code` GET-parameter, as
local webserver is no longer used to connect Storages;
- CloudManager and all corresponding Storages are updated to support
disconnecting and to notify about successful connection.
2019-07-30 14:51:41 -04:00
Alexander Tkachev
c1124c9cda CLOUD: Handle Cloud requests more frequently
ConnectionManager used to poll Cloud requests every second, while curl
requests were polled every 1/20th of a second. If curl request was over
at, say, frame #21, corresponding Cloud request would've only work with
that at frame #40 (950 ms later), which was making everything
cloud-related slower than it could be. This commit fixes it by making
Cloud polling period the same as curl polling period, and additionally
raises FPS to 25.
2019-07-30 14:51:41 -04:00
Cameron Cawley
b9e29cedfc ANDROID: Move isConnectionLimited into OSystem 2019-06-21 08:19:37 +03:00
SupSuper
272d4105b2 WIN32: Fix libcurl redefining ARRAYSIZE
libcurl pulls in Windows headers, so let's include it first to avoid clashing with common headers
2018-12-17 12:28:33 +02:00
Bastien Bouclet
4890dd4466 NETWORKING: Fix mismatched curl callback declaration and definition 2017-09-24 08:24:40 +02:00
Bastien Bouclet
2832332e74 NETWORKING: Changed NetworkReadStream not to subclass MemoryReadWriteStream
Also fix the MemoryReadWriteStream managed buffer being leaked.
Fixes #9718.
2017-09-22 07:05:59 +02:00
Eugene Sandulenko
bb58647588 NETWORKING: Fix warning 2017-08-11 22:05:35 +02:00
Eugene Sandulenko
addcdd5ae8 NETWORKING: Fix data type cast in comparison. char is usually signed 2017-08-11 22:00:15 +02:00
Torbjörn Andersson
665f5c99b2 JANITORIAL: Silence some more GCC 7 fall through warnings
I think these are the last one that were already flagged as being
deliberate.
2017-08-06 16:54:38 +02:00
Schrijvers Luc
a2792531f6 NETWORKING: fix missing SIOCGIFCONF for Haiku (#973) 2017-07-17 21:35:23 +02:00
Eugene Sandulenko
940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat
eefa72afa1 COMMON: Change way the Singleton instances are instantiated
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
2017-07-10 21:11:20 +02:00
Thierry Crozat
9a8aea0585 CLOUD: Fix compilation with old curl vesions 2017-04-29 22:10:16 +01:00