Commit Graph

479 Commits

Author SHA1 Message Date
Tamás Bálint Misius
4f01130ecc
Restrict saved version to 95.0 if signs with macros are present 2020-02-23 23:37:01 +01:00
Tamás Bálint Misius
5dfda0c528
Only make the request a POST if POST parameters are present
This is a compatibility thing, eww. This also fixes handling ptsave from the command line.
2020-01-21 22:54:52 +01:00
Tamás Bálint Misius
7330d0412a
Fix random warnings from clang 8.0.0 2020-01-21 14:43:22 +01:00
jacob1
467be1dcb9 change to 1L because technically the argument is a long 2020-01-20 11:16:33 -05:00
jacob1
0c588c48fe allow making POST requests with empty body 2020-01-20 11:11:56 -05:00
Tamás Bálint Misius
194c50ae3c
Much good #defining ENFORCE_HTTPS does if we don't include Config.h 2020-01-16 20:33:54 +01:00
Tamás Bálint Misius
fe87203eb4
Add HTTP API for Lua
Also fix a bug with Requests where any connection that took
longer to finish than 15 seconds would be killed. Should have
used CURLOPT_CONNECTTIMEOUT instead of CURLOPT_TIMEOUT when
specifying the timeout, oops.
2020-01-16 20:05:31 +01:00
Tamás Bálint Misius
4d52531889
Ditch element and tool classes 2020-01-09 19:22:11 +01:00
jacob1
bf7d182de5 Add CreateAllowed and ChangeType events
Used in create_part, kill_part, and part_change_type, allows us to remove element-specific stuff in those functions
Note: difference between Create and ChangeType is that Create is called when we want to initialize default element properties, but ChangeType is called every time a particle is changed to that type, even if it doesn't need default properties set. ChangeType is mainly used for things that need accurate state tracking, like the stkm spawn status.
ChangeType is called every time a particle is changed to or from its type, which includes if the particle is deleted, and also Lua.

Neither of these functions are called when loading saves, that's probably an oversight, will fix later
2019-11-29 19:32:33 -05:00
jacob1
0078fb4c6f Add DefaultProperties, replaces some of the case statements in create_part
The rest will will in a commit soon that adds the Create event and some other stuff
Lua events will come after that
PLSM default temp lowered to MAX_TEMP
2019-11-25 22:08:18 -05:00
jacob1
7af51b55ac Fix STK2 rocket boots not saving in saves 2019-11-03 10:31:18 -05:00
jacob1
5dd4897fa4 Add somewhat ugly --nohttp option
used for the renderer to not include libcurl, because it isn't installed on the tpt server
2019-08-29 23:33:45 -04:00
jacob1
41d54857f2 Fix cipher list on Windows. Lock cipher changes behind a define, not going to define it for now 2019-08-09 22:52:29 -04:00
jacob1
ec0be1cdc9 Fix CELL size check when loading OPS saves 2019-08-05 00:22:37 -04:00
Tamás Bálint Misius
ee2a765758
Only allow strong ciphers to be used
How fun it will be to keep this list up to date...
2019-08-03 00:16:12 +02:00
Tamás Bálint Misius
7158a00f44
Prevent protocol downgrade attacks 2019-08-02 01:31:02 +02:00
jacob1
a73d1f97f6 Fix stamps not saving properly to stamps.def. Make "Rescan Stamps" sort stamps by time created 2019-07-26 23:09:27 -04:00
Ian Bastos
4383de7ad5 Implement file drop handler (#666) 2019-07-24 00:04:41 -04:00
jacob1
9faf95a858 misc whitespace changes 2019-07-23 00:11:48 -04:00
jacob1
fb06e0028b Add disable-network command line argument 2019-07-23 00:11:26 -04:00
Tamás Bálint Misius
23337862a4
Use current rendering modes when placing a save (fixes #446) 2019-07-22 10:38:13 +02:00
Tamás Bálint Misius
c193e88c28
Leave only the 'wants pressure' check in Simulation::Load for QRTZ/GLAS/TUNG 2019-05-07 21:15:41 +02:00
Tamás Bálint Misius
0179cefc78
Flatten include trees 2019-04-20 15:36:11 +02:00
Tamás Bálint Misius
5810a19dbc
Get GetUserName out of the way on Windows 2019-04-17 01:16:45 +02:00
Tamás Bálint Misius
2e76b10619
Use C++11 threads 2019-04-17 00:23:57 +02:00
Tamás Bálint Misius
ff39c82e48
Print libcurl error buffer to stderr on client error 2019-04-05 21:22:51 +02:00
jacob1
ea4c355748 better capitalization 2019-04-03 20:19:25 -04:00
Tamás Bálint Misius
6468a51ac1
Add more SSL client error strings 2019-04-04 01:39:11 +02:00
Tamás Bálint Misius
c8960d1358
Add more sign macros (fixes #578) 2019-03-31 21:44:54 +02:00
Tamás Bálint Misius
3de92f5ef4
Fix pavg loading behaviour of QRTZ/GLAS/TUNG (fixes #607)
Those particles now save/load pavg if pressure is being saved/loaded.
This means they won't ever break again when being loaded as part of
a stamp.

They actually save pavg01 * 64 because pavg is saved as an integer and
these elements are too sensitive to pressure changes for integer pavg
values to be adequate.
2019-03-31 12:18:41 +02:00
jacob1
d22d22e662 Fix pressure / ambient heat being saved as 0 instead of not at all when shift is held 2019-03-30 20:25:51 -04:00
jacob1
4cf0fe5aab Fix sim.deleteStamp not updating stamps.def 2019-03-25 23:52:48 -04:00
jacob1
c7ae820f1c Add MotD when using a broken alternate update server 2019-03-23 11:01:32 -04:00
Tamás Bálint Misius
e07b133e5a
Another curl version-dependent feature thing
Seriously, who thought doubles were a good idea?
2019-03-23 10:30:26 +01:00
Tamás Bálint Misius
bd7aa33286
Only use curl mime feature if it actually exists 2019-03-22 22:27:11 +01:00
jacob1
ed2eac627b Fix msvc compile 2019-03-18 23:50:38 -04:00
Tamás Bálint Misius
296b758193 Follow redirects and fix save loading by ptsave parameter 2019-03-18 23:50:38 -04:00
Tamás Bálint Misius
341e75cdfe Fix thumbnails sometimes not being resized in the save browser
This was because ImageRequest::Finish used its Width and Height members after calling Request::Finish,
after which the ImageRequest object may get deleted at any time by RequestManager. One solution to this
is to copy (or preferably move) important members to local variables in the Finish functions of
objects derived from Request and use only those after calling Request::Finish (or anything that
in turn calls that).
2019-03-18 23:50:38 -04:00
Tamás Bálint Misius
5916c9db9c Fix a bunch of threading-related issues 2019-03-18 23:50:38 -04:00
Tamás Bálint Misius
263f756a20 Add STATICSCHEME macro to be used with requests to STATICSERVER
Make up your mind, jacob1!
2019-03-18 23:50:38 -04:00
Tamás Bálint Misius
5bc3c03082 Change scheme to https everywhere 2019-03-18 23:50:38 -04:00
Tamás Bálint Misius
fc8740f7d5 Add curl, rework Request and RequestManager a bit 2019-03-18 23:50:38 -04:00
Tamás Bálint Misius
3d22c1ed4e Fix dumb things that aren't necessarily lethal but are eyesores 2019-03-18 23:50:38 -04:00
Tamás Bálint Misius
d3fe7e39a5 Turn ThumbnailRendererTask into an AbandonableTask 2019-03-09 20:40:11 -05:00
jacob1
c09a7bb8d9 Fix compile error in some older versions of clang 2019-03-08 00:05:05 -05:00
Tamás Bálint Misius
7fb0b52d79 More renaming, remove a few useless .c_str()s and fix a URL that had previously contained Download and thus fell victim to my mindless text replacement tricks 2019-03-07 22:56:08 -05:00
Tamás Bálint Misius
d958adf487 Fix filename field in multipart content-disposition headers
All the multipart stuff is going to be handled by curl so this split-by-':' code is going to move into Request.cpp later.
2019-03-07 22:56:08 -05:00
Tamás Bálint Misius
30c7f6ded7 Rename Download* to Request* and move HTTP stuff inside src/client/http 2019-03-07 22:56:08 -05:00
Tamás Bálint Misius
1864a8649d Turn RequestBroker::Get/SaveUserInfoAsync into a request derived from Download
Also move everything http_ into Download and DownloadManager and nuke RequestBroker.
2019-03-07 22:56:08 -05:00
Tamás Bálint Misius
af4d022087 Add RequestMonitor 2019-03-07 22:56:08 -05:00
Tamás Bálint Misius
66c49203f2 Use the new thumbnail renderer task everywhere 2019-03-07 22:56:08 -05:00
Tamás Bálint Misius
3a76a3a514 Turn RequestBroker::RetrieveThumbnail into a request derived from Download
Also start moving RenderThumbnail out of RequestBroker into its own Task. Add mutex to SaveRenderer to guard Render().
2019-03-07 22:56:08 -05:00
Tamás Bálint Misius
53f2018c7e Turn RequestBroker::RetrieveAvatar into a request derived from Download
Also add http namespace because classes clashed a lot.
2019-03-07 22:56:08 -05:00
Tamás Bálint Misius
8b5cf394e0 Replace http_* calls with Download calls in non-RequestBroker stuff 2019-03-07 22:56:08 -05:00
jacob1
772148900e Fix stamp and local save thumbnails being stretched 2019-03-03 23:45:33 -05:00
jacob1
768202ca9b Version 94.1 2019-02-21 00:23:45 -05:00
jacob1
0c6ce20880 Add "Force Integer Scaling" option for fullscreen
Also:
recreate the window when enabling resizable window, same workaround I applied to my mod for jacob1/The-Powder-Toy#24
recreate the window when toggling fullscreen, to work around some bugs where the window is sized incorrectly or the mouse position doesn't match where the cursor is
Don't capture mouse cursor when this is a debug build
2019-02-18 22:18:29 -05:00
jacob1
240bb3bd92 restrict saves to version 94.0 when they use newer elements / features 2019-02-10 22:02:17 -05:00
wolfy1339
a2bb531c46 Remove inclusion of deprecated C++ headers 2019-01-31 20:09:15 -05:00
jacob1
87fb94ce94 Delete unused Thumbnail handling code 2018-11-27 22:13:29 -05:00
jacob1
48bc6e02ba Fix gcc 8 warnings 2018-11-03 19:36:07 -04:00
nunom2005
31b45312b2 Add a message a message while fetching the motd (#603) 2018-10-30 21:01:17 -04:00
jacob1
3707ecd563 fix "publish" button in save browser 2018-08-24 23:11:09 -04:00
krawthekrow
11d33d5b77 call rayt linear detector 2018-06-24 10:37:11 -04:00
jacob1
38fac7046a add #define NOMINMAX before windows.h includes 2018-05-17 21:49:46 -04:00
jacob1
6ef0f065a6 fix .what methods on exceptions 2018-05-17 20:55:29 -04:00
mniip
30dd49235d Add ToLower/ToUpper 2018-05-14 05:12:32 +03:00
mniip
32aaafee94 Move data into either cpp files or const arrays 2018-05-08 07:38:55 +03:00
mniip
f8586ea3a2 Remove ByteString::Stream 2018-05-04 23:10:39 +03:00
mniip
1485ae5a21 Fix incorrect uses of String(char[]) 2018-05-04 20:05:26 +03:00
mniip
6c9cb174fb Change some uses of String::Stream to StringBuilder 2018-05-02 22:11:41 +03:00
mniip
a121c62c3b Add some helper methods and rewrite some of the string manipulation code 2018-05-02 01:32:04 +03:00
mniip
ff27d69424 Switch from std::string to String/ByteString in most of the code
Also switch SimulationData from weird arrays to std::vector
2018-04-30 21:13:24 +03:00
jacob1
de757bc2c3 made sure the windows version actually compiled 2018-04-23 22:32:03 -04:00
jacob1
6731fa16b7 fix memory leaks when loading stamps ('l') and viewing saves 2018-04-21 00:15:15 -04:00
moonheart08
22b9bf4953 Adds RAYT (#540) 2018-04-10 21:32:19 -04:00
wolfy1339
27f6a6b297 Strip whitespace from files in repo (#553) 2018-04-03 21:46:01 -04:00
jacob1
dfc5bd1d85 don't restrict containing certain new 93.0 features to 93.0 (so renderer can render them) 2018-04-01 15:28:54 -04:00
jacob1
67bc12de97 Fix issue where TPT was bought by EA 2018-04-01 15:26:13 -04:00
jacob1
40d2850ff7 TPT has now gone free to play! Many elements are unlocked by default, but by using Powdercoins you can unlock new elements and promote your saves to front page! 2018-03-31 22:40:23 -04:00
jacob1
b89ea68acd remove fromNewerVersion TODOs in GameSave.cpp 2018-03-24 14:38:26 -04:00
jacob1
fac996722b save stickmen rocket boots / fan flag in saves 2018-03-24 13:09:02 -04:00
jacob1
3bd35ce83f fix STKM + fan wall 2018-03-21 23:58:27 -04:00
jacob1
126acb7db5 change TSNS/HSWC/PSNS/PUMP .tmp to 0 in older saves 2018-03-18 19:59:48 -04:00
jacob1
f45d0d1683 save palette now works for elements stored in ctype/tmp/tmp2 2018-03-17 21:46:35 -04:00
jacob1
01741b05ce betas should still look for stable updates 2018-03-12 23:32:37 -04:00
jacob1
6d515c3009 remove debug thing, blame jacob1 2018-03-11 23:03:11 -04:00
jacob1
138410c41f blame simon
render compatibility stuff, allow renderer to open saves with elements it doesn't understand, because something is better than nothing
2018-03-11 23:02:12 -04:00
jacob1
3b95ff7983 93.0 save loading fix (todo: remove this stuff on 93.0 release) 2018-03-10 20:30:20 -05:00
jacob1
c861d69f9c add RESTRICT_VERSION check to digitation stuff, update readme date 2018-03-10 17:03:44 -05:00
jacob1
3d66b7e263 remove hardcoded op 2018-02-03 17:38:47 -05:00
jacob1
5012c3cfe6 fix build error when UPDATESERVER is defined 2018-01-01 12:12:43 -05:00
jacob1
b5159ab74e Changes to save format and PIPE
Update save format to optionally store type as two bits
PIPE now stores element in ctype
Disallow uploading saves using two bytes in type or other fields
update save format to store pmapbits and automatically convert data
2017-12-31 23:55:41 -05:00
jacob1
ac24810da5 add some defines to reduce usages of hardcoded r>>8 2017-12-28 12:03:26 -05:00
jacob1
c31267b06f use unique_ptr in GameSave::readPsv, rename variables 2017-12-27 16:57:32 -05:00
jacob1
ae9b416f2f use c++11 (unique_ptr) in GameSave::readOPS 2017-12-27 13:00:48 -05:00
jacob1
887d60628d use c++11, use unique_ptr in GameSave::SerializeOPS 2017-12-27 11:50:09 -05:00
jacob1
3529f6f468 fix ambient heat not loading in ctrl+c paste, fix pressure resetting to 0 when loading saves without pressure 2017-11-23 22:09:33 -05:00
wolfy1339
255ca13fab Remove unused code in src/Config.h (Fixes #516)
- Remove commented out code as it was not used anywhere in the code
2017-11-23 00:18:44 -05:00
jacob1
97c4123533 translate wall grids when shifting stamps by more than 4 pixels 2017-10-04 21:07:00 -04:00