mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
Compare commits
776 Commits
fix-visual
...
anti-cheat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31f25a963f | ||
|
|
30030031b2 | ||
|
|
dfeafef1a9 | ||
|
|
71ce482587 | ||
|
|
94672e2fc0 | ||
|
|
3405b7692c | ||
|
|
ed11bf58a3 | ||
|
|
f237694d21 | ||
|
|
de1f850cfd | ||
|
|
1286c0802c | ||
|
|
35034b4e9f | ||
|
|
6f52c4b39d | ||
|
|
aa2c9c08e0 | ||
|
|
c6e4bc90f9 | ||
|
|
e0053aedd0 | ||
|
|
559ed8a72c | ||
|
|
7e525786fc | ||
|
|
0734d17b1e | ||
|
|
2a7c021572 | ||
|
|
9d3f5bfab5 | ||
|
|
b505a4ea41 | ||
|
|
94f93391d0 | ||
|
|
297c6fad79 | ||
|
|
acdded3d97 | ||
|
|
ad25c04cb2 | ||
|
|
c4fc48b1da | ||
|
|
9bce4f98fb | ||
|
|
4e0ead101d | ||
|
|
339ce72b53 | ||
|
|
d5a09c33c2 | ||
|
|
4e7a361271 | ||
|
|
613d521adf | ||
|
|
493014e350 | ||
|
|
7c1996b02b | ||
|
|
abe7200237 | ||
|
|
3d1d586224 | ||
|
|
e8abd8a66e | ||
|
|
8629fd4be9 | ||
|
|
05d3c4ab0b | ||
|
|
5bd303eb05 | ||
|
|
a8d7140e0d | ||
|
|
16a4be63e3 | ||
|
|
7c3a3b6eb2 | ||
|
|
af655ea2a3 | ||
|
|
ed7cb17370 | ||
|
|
0d7207ae29 | ||
|
|
60be50a75a | ||
|
|
619c60c402 | ||
|
|
d45bf048eb | ||
|
|
8e9b1cee73 | ||
|
|
9679580b1e | ||
|
|
1b37a12dc4 | ||
|
|
f5813f4897 | ||
|
|
e23ba310c5 | ||
|
|
65459a8c28 | ||
|
|
61ff33f6eb | ||
|
|
c94a220f1d | ||
|
|
342673ee60 | ||
|
|
e2a4b1575a | ||
|
|
a5fb4d8761 | ||
|
|
dfa31e8501 | ||
|
|
2603a0454a | ||
|
|
e7526d56ec | ||
|
|
6bd38fcfc1 | ||
|
|
a10d781d4b | ||
|
|
3c8d66b0cd | ||
|
|
bb36bbaca6 | ||
|
|
6f2ca0edc5 | ||
|
|
1ddc1ca6ef | ||
|
|
c6a89e52b0 | ||
|
|
275492e96c | ||
|
|
ccccb852d0 | ||
|
|
2638d996e6 | ||
|
|
b51eb8b88e | ||
|
|
86858e629a | ||
|
|
ed83ff3e0e | ||
|
|
a44d104368 | ||
|
|
4be6aff55e | ||
|
|
0e66d836c8 | ||
|
|
c0b44dd808 | ||
|
|
600c3fee23 | ||
|
|
2e2983f527 | ||
|
|
ce3f6c683b | ||
|
|
54be36ded1 | ||
|
|
3a3ba9e15e | ||
|
|
f1674682ca | ||
|
|
4bc7b06cdf | ||
|
|
e50a5c8abe | ||
|
|
becfe04039 | ||
|
|
0d013f051c | ||
|
|
f8c47f5db2 | ||
|
|
44863a8cce | ||
|
|
50e9de92b5 | ||
|
|
a543c2e0c9 | ||
|
|
e38b8b8a62 | ||
|
|
2dd73a7bd7 | ||
|
|
9796dcf14f | ||
|
|
a273e3e7cc | ||
|
|
4c4e4b8f87 | ||
|
|
93a1bbe799 | ||
|
|
bacdc49475 | ||
|
|
9d8202c6c2 | ||
|
|
c2da850956 | ||
|
|
c5f455dd3d | ||
|
|
96eddd238c | ||
|
|
9024a4cb88 | ||
|
|
6aab08e63b | ||
|
|
37d9825380 | ||
|
|
3244a981bb | ||
|
|
6b85391ea5 | ||
|
|
076bd83f48 | ||
|
|
d89051b156 | ||
|
|
f7cbeb29cd | ||
|
|
0e8cf13c7b | ||
|
|
8ec4acc5fe | ||
|
|
ecc4d2ef56 | ||
|
|
b7c367a127 | ||
|
|
3b29116878 | ||
|
|
c4014ca1b8 | ||
|
|
a326797635 | ||
|
|
82908628e1 | ||
|
|
9e5831bbcd | ||
|
|
d0eae0a787 | ||
|
|
6240295643 | ||
|
|
0ce66f250c | ||
|
|
1f84e9688e | ||
|
|
864a2de665 | ||
|
|
b0365a4fb3 | ||
|
|
52b0f50813 | ||
|
|
4ae7c7e9b6 | ||
|
|
1c525cafc0 | ||
|
|
306089c2cf | ||
|
|
432149f832 | ||
|
|
835a3a2de9 | ||
|
|
d778703497 | ||
|
|
dd1fd5c99a | ||
|
|
d18b9a9f4b | ||
|
|
bedc4028a4 | ||
|
|
bf139e00b8 | ||
|
|
12c409723a | ||
|
|
c098baee3d | ||
|
|
eda9cadfb2 | ||
|
|
b30c118ed2 | ||
|
|
c409f95440 | ||
|
|
c49cf502e2 | ||
|
|
7de790a43c | ||
|
|
e63ae7f231 | ||
|
|
a42cc9848f | ||
|
|
14011b2512 | ||
|
|
0a14d737d6 | ||
|
|
a23e6e3961 | ||
|
|
0af2e2bb47 | ||
|
|
b24339d5bf | ||
|
|
13dbe214e8 | ||
|
|
30c34aa23a | ||
|
|
dc3b6e8a9a | ||
|
|
0440de6040 | ||
|
|
049b4923c5 | ||
|
|
729745d9b7 | ||
|
|
1ea442978c | ||
|
|
ee8fc07bd5 | ||
|
|
53942408fe | ||
|
|
da3600c64e | ||
|
|
b6b59156c8 | ||
|
|
0ba4b4e986 | ||
|
|
84d9e84819 | ||
|
|
9d766567ed | ||
|
|
7bcabc2b8a | ||
|
|
0a4fa6a66c | ||
|
|
ce3e0abfb1 | ||
|
|
b77fd7b6b8 | ||
|
|
9e4633ddc9 | ||
|
|
a18ffd913f | ||
|
|
8fe35fb802 | ||
|
|
6080a5c667 | ||
|
|
5da0007e34 | ||
|
|
948c7eab32 | ||
|
|
77c228f4d7 | ||
|
|
fdeba4db23 | ||
|
|
0ab3237f41 | ||
|
|
4045acadbf | ||
|
|
de4d1013ca | ||
|
|
72957d74c6 | ||
|
|
48ec4290f9 | ||
|
|
5f98f09924 | ||
|
|
b2099b24ef | ||
|
|
31c309e25c | ||
|
|
0294078887 | ||
|
|
dc8e933fc1 | ||
|
|
f84939d540 | ||
|
|
a635cd9124 | ||
|
|
7551af1ef3 | ||
|
|
9ed794211b | ||
|
|
34a21a117d | ||
|
|
7d67052e5b | ||
|
|
c9afe544f6 | ||
|
|
712b358dca | ||
|
|
9a1cc68e9b | ||
|
|
ae26fff462 | ||
|
|
99c2c91320 | ||
|
|
63c6433182 | ||
|
|
6e550282c3 | ||
|
|
74cdcc35eb | ||
|
|
bbad939e48 | ||
|
|
b71bbbaa31 | ||
|
|
4dd86f9091 | ||
|
|
95d93bb95c | ||
|
|
7f4e97905e | ||
|
|
0ebfd13818 | ||
|
|
b1d24ec3a6 | ||
|
|
80021fc4b4 | ||
|
|
fd9ba71635 | ||
|
|
4f1cfcfc16 | ||
|
|
e4af9b137f | ||
|
|
1c20a251d1 | ||
|
|
74b24fc1cf | ||
|
|
e9e49d6b5f | ||
|
|
d9e643c74d | ||
|
|
af1acf6242 | ||
|
|
fbcc9cfbc9 | ||
|
|
45a5796aa5 | ||
|
|
4214186be6 | ||
|
|
5760a3215f | ||
|
|
19e63a1452 | ||
|
|
f4eaf5009d | ||
|
|
d5e3211f56 | ||
|
|
dcdd747f9a | ||
|
|
dc010dffd2 | ||
|
|
b5ec8028ab | ||
|
|
c4261edbe9 | ||
|
|
d5ae67a609 | ||
|
|
ae17446a71 | ||
|
|
e47c43298c | ||
|
|
b0729b9f14 | ||
|
|
fbf5c4a43f | ||
|
|
a03544cac4 | ||
|
|
34c64bc7b2 | ||
|
|
aa4297c290 | ||
|
|
b51ab87986 | ||
|
|
71e99e7d33 | ||
|
|
4921a15f75 | ||
|
|
e2f6169576 | ||
|
|
91cc24a6d7 | ||
|
|
c372d88f01 | ||
|
|
992aeaf1b1 | ||
|
|
469dbf0850 | ||
|
|
57c16b5081 | ||
|
|
35da35512c | ||
|
|
d1c2e582bf | ||
|
|
44a423297a | ||
|
|
81bc3ff6a0 | ||
|
|
17db1d77e6 | ||
|
|
476c1f0688 | ||
|
|
530da597bb | ||
|
|
cd1650da2b | ||
|
|
f6c608f95e | ||
|
|
1a0d02c1b1 | ||
|
|
84aa4c3637 | ||
|
|
e4467d006a | ||
|
|
f66685533e | ||
|
|
8271d76a61 | ||
|
|
e9b46bea86 | ||
|
|
c9b21f8af8 | ||
|
|
6499d247f8 | ||
|
|
90fdce0759 | ||
|
|
2a4de617b8 | ||
|
|
c368190ceb | ||
|
|
66aea0b0cb | ||
|
|
328eea4fbb | ||
|
|
d73cde51a7 | ||
|
|
9a70eb3d6c | ||
|
|
3d0bfa15ba | ||
|
|
4f3fc4b4d3 | ||
|
|
76fc648a5f | ||
|
|
2c0b9d699e | ||
|
|
b4710cf7bf | ||
|
|
20b0910845 | ||
|
|
6fb4aadb0e | ||
|
|
ccd4e202d2 | ||
|
|
2077e3707f | ||
|
|
f37db77423 | ||
|
|
5836f0bf8a | ||
|
|
486c8a903c | ||
|
|
5e230c4700 | ||
|
|
807b95ae38 | ||
|
|
21bbdcd9ba | ||
|
|
a536ec0012 | ||
|
|
0cd5e0daf7 | ||
|
|
9c97207f7c | ||
|
|
491b15a95a | ||
|
|
56d1b22f66 | ||
|
|
db1605abc0 | ||
|
|
0279612052 | ||
|
|
45a7fd5ea6 | ||
|
|
b52670bc44 | ||
|
|
a7c34e0832 | ||
|
|
1fc86e9ed6 | ||
|
|
619a531279 | ||
|
|
6562a72e55 | ||
|
|
09f5292e46 | ||
|
|
0d021faaed | ||
|
|
6c5baa93b8 | ||
|
|
666f7e7c35 | ||
|
|
7e56886659 | ||
|
|
1d5513fba3 | ||
|
|
76e307a836 | ||
|
|
517225e30f | ||
|
|
c49fc826af | ||
|
|
1eca0493d8 | ||
|
|
9c2a1ca590 | ||
|
|
5481be03e6 | ||
|
|
f5d70d6f56 | ||
|
|
5ab714bb01 | ||
|
|
409a67b5be | ||
|
|
4e1a6ad392 | ||
|
|
9d1e63bd90 | ||
|
|
62724cdd71 | ||
|
|
176d4a3072 | ||
|
|
f771864875 | ||
|
|
4a6707c7a8 | ||
|
|
14ee38edf2 | ||
|
|
a8e2462e47 | ||
|
|
3faf696f46 | ||
|
|
d22530938d | ||
|
|
9bfe080447 | ||
|
|
b083b47781 | ||
|
|
0fc7709584 | ||
|
|
f31382698f | ||
|
|
358594d9e4 | ||
|
|
6ced7c4c39 | ||
|
|
dc83dd2d95 | ||
|
|
e3b56d85cd | ||
|
|
448610894a | ||
|
|
9953b315b5 | ||
|
|
8f669e0a33 | ||
|
|
9fbafa29a2 | ||
|
|
461c40ed8c | ||
|
|
a3401f05b4 | ||
|
|
2e3c134e09 | ||
|
|
e3b03fa3e5 | ||
|
|
d25d7916b0 | ||
|
|
1a43fad4bb | ||
|
|
c5e1806b9f | ||
|
|
dee12635a1 | ||
|
|
5fac187f80 | ||
|
|
4d18951e94 | ||
|
|
4986bbd9a2 | ||
|
|
48ac678c9c | ||
|
|
3a343b12ee | ||
|
|
1174495f67 | ||
|
|
e0b62484f4 | ||
|
|
a2c41fd470 | ||
|
|
6633bf15e6 | ||
|
|
64644ca5be | ||
|
|
31d83b0f44 | ||
|
|
98ceed6ea6 | ||
|
|
85c71fb49f | ||
|
|
b91388c085 | ||
|
|
6faf448a29 | ||
|
|
fbe17cdeab | ||
|
|
d6fe78132a | ||
|
|
58b52e9069 | ||
|
|
7359e55047 | ||
|
|
a5a97bedba | ||
|
|
bcb317d799 | ||
|
|
521358a8b8 | ||
|
|
901bc3ba43 | ||
|
|
3ea543213a | ||
|
|
e54ddf5d6c | ||
|
|
6dac9a365d | ||
|
|
349baa17d3 | ||
|
|
00b84109c8 | ||
|
|
01f2bcc8c6 | ||
|
|
78308b5d98 | ||
|
|
891664c8ff | ||
|
|
07dd3d81ff | ||
|
|
9196b56a3d | ||
|
|
fa70ba8fb6 | ||
|
|
6e4e60a713 | ||
|
|
2caff38db9 | ||
|
|
103cefad0d | ||
|
|
1b6d1ce5f1 | ||
|
|
8fcd6c73b6 | ||
|
|
b5eb47aff8 | ||
|
|
87ddae5571 | ||
|
|
58a47ad70c | ||
|
|
e06de09e15 | ||
|
|
9ca3833117 | ||
|
|
bd4efa9434 | ||
|
|
c07bbb8ef6 | ||
|
|
503a0725b9 | ||
|
|
2760e081ac | ||
|
|
8e2bea1f35 | ||
|
|
4369a3dfb3 | ||
|
|
a844e05946 | ||
|
|
401b79fcf3 | ||
|
|
0cf139035a | ||
|
|
a332b06266 | ||
|
|
0eb4a1512f | ||
|
|
0ecda7eb62 | ||
|
|
4cacf8de1e | ||
|
|
6086a54f0f | ||
|
|
f376bd3445 | ||
|
|
e722852f93 | ||
|
|
9e9102fdc0 | ||
|
|
491e95e4a1 | ||
|
|
31755b480a | ||
|
|
d89aed8dc5 | ||
|
|
931597abcb | ||
|
|
77ab35da91 | ||
|
|
0684fd8e25 | ||
|
|
97cabf62b8 | ||
|
|
53a1b513fb | ||
|
|
053336faca | ||
|
|
dbe096a8d5 | ||
|
|
f78d1a6d84 | ||
|
|
01d1cb6212 | ||
|
|
c606e7c296 | ||
|
|
5ac2f44d52 | ||
|
|
9b7b79ac9f | ||
|
|
99deee6a14 | ||
|
|
196302ed3e | ||
|
|
f40589a461 | ||
|
|
ef2e01085a | ||
|
|
8f939fd4af | ||
|
|
4a546d9ff1 | ||
|
|
d75c99f7ee | ||
|
|
f10a3d99c5 | ||
|
|
fb23e577e8 | ||
|
|
6861451f8f | ||
|
|
770082a811 | ||
|
|
43cf2b1105 | ||
|
|
88e2a65b5d | ||
|
|
1333610ef0 | ||
|
|
731411cdfa | ||
|
|
10da65860a | ||
|
|
6f637e01b6 | ||
|
|
a356a456d5 | ||
|
|
55f4141157 | ||
|
|
b2a3c926c5 | ||
|
|
e79c26e234 | ||
|
|
cb293885e2 | ||
|
|
92db832044 | ||
|
|
42f20efe3b | ||
|
|
14866a1432 | ||
|
|
7d61704575 | ||
|
|
c8e8d0b7b9 | ||
|
|
dda03b21d7 | ||
|
|
64e8bf3abb | ||
|
|
da671b00cf | ||
|
|
6d918bd3d5 | ||
|
|
dbf4e05d59 | ||
|
|
9224cf8b99 | ||
|
|
00051ec7fe | ||
|
|
44686c6459 | ||
|
|
09f3a7f27e | ||
|
|
51a09a7a99 | ||
|
|
ebdea1e9b1 | ||
|
|
f3d3adac2e | ||
|
|
b55f90efde | ||
|
|
c5e6e09071 | ||
|
|
9895847f8b | ||
|
|
992f265292 | ||
|
|
f4a4a7c124 | ||
|
|
129d037379 | ||
|
|
f0e438044f | ||
|
|
9ef0e56aa8 | ||
|
|
6b74350edf | ||
|
|
5f6e38de30 | ||
|
|
1ee940c40c | ||
|
|
2ca5dd9b31 | ||
|
|
08a4c18c8f | ||
|
|
e4cc3bb89c | ||
|
|
6f56e1fb3d | ||
|
|
c49b63b50e | ||
|
|
0fcb5aa2c6 | ||
|
|
d8c055dbb4 | ||
|
|
280c636823 | ||
|
|
bce6cdb618 | ||
|
|
3486f95a81 | ||
|
|
ea427419ef | ||
|
|
38467803b8 | ||
|
|
6a25253698 | ||
|
|
31b15baf90 | ||
|
|
b906e4dd99 | ||
|
|
5022c94a13 | ||
|
|
f6f3c2041b | ||
|
|
5c3bdf40f9 | ||
|
|
db3335513a | ||
|
|
a815562f82 | ||
|
|
36d4cb716e | ||
|
|
2a62f69623 | ||
|
|
6d1ffdedc8 | ||
|
|
7f67ff266c | ||
|
|
5afdbd82bb | ||
|
|
21763301ca | ||
|
|
0268f4e707 | ||
|
|
b66e75027d | ||
|
|
934755cf4e | ||
|
|
148280d29e | ||
|
|
0cc89d6e86 | ||
|
|
395bb7b213 | ||
|
|
af5a992cfc | ||
|
|
c76ae59ae2 | ||
|
|
2a884b7c7c | ||
|
|
3a87e6159b | ||
|
|
6ec5273d21 | ||
|
|
bff5215bb9 | ||
|
|
f609d4132a | ||
|
|
6cc3e428d3 | ||
|
|
28eb643f49 | ||
|
|
b7d9dc08ec | ||
|
|
2ca9a78280 | ||
|
|
2df651f342 | ||
|
|
b16129abfa | ||
|
|
787b739fa3 | ||
|
|
f4d62d1590 | ||
|
|
03ca432a36 | ||
|
|
28804f9034 | ||
|
|
7b276046ed | ||
|
|
c538088760 | ||
|
|
1074bbb09e | ||
|
|
2c503bdf88 | ||
|
|
2f242e6607 | ||
|
|
0cee97e5f6 | ||
|
|
90f12a94a8 | ||
|
|
91fb604806 | ||
|
|
a54df11cc7 | ||
|
|
b8e903af3e | ||
|
|
2c4491c707 | ||
|
|
d13865f599 | ||
|
|
a0bfee0c6a | ||
|
|
69eb9eda25 | ||
|
|
ba3b37a0a3 | ||
|
|
bf13c485bd | ||
|
|
c537e7554a | ||
|
|
7b030434b9 | ||
|
|
03c45bf7f4 | ||
|
|
daed8ccfa7 | ||
|
|
32b19fbb33 | ||
|
|
130c694c8d | ||
|
|
c6801505c2 | ||
|
|
abb8998117 | ||
|
|
9ca1188baa | ||
|
|
61267a502a | ||
|
|
9dd287f16e | ||
|
|
55989a4d55 | ||
|
|
0b0d433043 | ||
|
|
a6480db012 | ||
|
|
7c5b89766a | ||
|
|
1c8145116f | ||
|
|
fdbf58dfa3 | ||
|
|
8730ebf67a | ||
|
|
4c1e1d68b5 | ||
|
|
b8c3119481 | ||
|
|
15f3fd1206 | ||
|
|
7853718f29 | ||
|
|
5510d88988 | ||
|
|
803e9a33e0 | ||
|
|
b346f32e77 | ||
|
|
6fcc65acd7 | ||
|
|
19c67b23f1 | ||
|
|
bd59044951 | ||
|
|
6255808ed0 | ||
|
|
77476364cc | ||
|
|
25a6f050ef | ||
|
|
990dd40414 | ||
|
|
0d2574d31b | ||
|
|
01dac76b85 | ||
|
|
d9602a5e41 | ||
|
|
5a0a90ca60 | ||
|
|
10284e801f | ||
|
|
a060552907 | ||
|
|
01a2cadcd3 | ||
|
|
fdf8a71acb | ||
|
|
9d46fa2583 | ||
|
|
11196ce1d4 | ||
|
|
db0cfd430c | ||
|
|
7353f44265 | ||
|
|
3b19458c3d | ||
|
|
f2d1f8144c | ||
|
|
f39de931c8 | ||
|
|
b1a25b485f | ||
|
|
98830faed4 | ||
|
|
198ab0c927 | ||
|
|
6e8f45b32b | ||
|
|
5d534c9b0a | ||
|
|
15ba35fbb2 | ||
|
|
5258ffebbe | ||
|
|
2733ccdf8a | ||
|
|
52ec176455 | ||
|
|
a24aaeb7e8 | ||
|
|
837dbf8393 | ||
|
|
da97a0857b | ||
|
|
df30d586e2 | ||
|
|
49d7b2fbff | ||
|
|
beec49c9e5 | ||
|
|
3cdc6ae8c1 | ||
|
|
0dcb04e46b | ||
|
|
60fe0f38bf | ||
|
|
0cf8cdd4c1 | ||
|
|
2d7c1ed049 | ||
|
|
49f816be4e | ||
|
|
433230dc19 | ||
|
|
59399e7819 | ||
|
|
8342f05fb4 | ||
|
|
881f556c29 | ||
|
|
09808990ee | ||
|
|
80d54af2a0 | ||
|
|
282fc90f98 | ||
|
|
f093b2d3ac | ||
|
|
87ba301091 | ||
|
|
58eb2066f5 | ||
|
|
e43cead809 | ||
|
|
7f90039de7 | ||
|
|
8bafff9855 | ||
|
|
dc28c9787d | ||
|
|
4bc9e3e2bf | ||
|
|
dd71112dc6 | ||
|
|
29411ae0e8 | ||
|
|
ceb85adcd6 | ||
|
|
960525bb40 | ||
|
|
f9f46e38b4 | ||
|
|
64220c320b | ||
|
|
28262aeedf | ||
|
|
4b5af87739 | ||
|
|
0d901b2472 | ||
|
|
a98c621931 | ||
|
|
83360aebc7 | ||
|
|
f47112c52e | ||
|
|
19bf9b0c3d | ||
|
|
a4f1cb7cfd | ||
|
|
aed7a92340 | ||
|
|
3f6397a2a9 | ||
|
|
326a518630 | ||
|
|
1d5c1edad9 | ||
|
|
5b0e8d1d25 | ||
|
|
3a75b08962 | ||
|
|
5c0aa7acbb | ||
|
|
b89cd7abc0 | ||
|
|
77659f6539 | ||
|
|
48343162f9 | ||
|
|
d1be8b88d4 | ||
|
|
2aeea3aa13 | ||
|
|
f7ff8949c4 | ||
|
|
565b69489a | ||
|
|
d5142d7f0a | ||
|
|
c83dbccdb7 | ||
|
|
c8d30efc63 | ||
|
|
274ae1d826 | ||
|
|
085c66b7a4 | ||
|
|
07ebbbd682 | ||
|
|
8e4f5a6ae7 | ||
|
|
cac8cf9d38 | ||
|
|
4861557cdb | ||
|
|
1f71f60bf9 | ||
|
|
9547e10def | ||
|
|
d51dfec557 | ||
|
|
89f46e67bf | ||
|
|
d180e233c5 | ||
|
|
e0f7318ef3 | ||
|
|
29be76dcd5 | ||
|
|
32a9480fc0 | ||
|
|
e4c14dc6bb | ||
|
|
4ef8e254c3 | ||
|
|
53d1cbc4a9 | ||
|
|
b2c345d052 | ||
|
|
383118f8ef | ||
|
|
8953854bb3 | ||
|
|
d378681461 | ||
|
|
039bbe5308 | ||
|
|
ffa6a0d7d9 | ||
|
|
8e9ceeb61a | ||
|
|
dccba37195 | ||
|
|
7fc785c0a2 | ||
|
|
c5826dac0c | ||
|
|
a4986a87a3 | ||
|
|
e26b7ae6dd | ||
|
|
190ea5dfe2 | ||
|
|
984892ea85 | ||
|
|
e52177fe5c | ||
|
|
7e24bfc9d1 | ||
|
|
a52c01087e | ||
|
|
a300a8f426 | ||
|
|
ed4ed55854 | ||
|
|
5889f57731 | ||
|
|
44e4de191e | ||
|
|
16f10facc3 | ||
|
|
efa8547c2a | ||
|
|
7037f0574b | ||
|
|
e59108291b | ||
|
|
55c671cc4b | ||
|
|
d8b6530e69 | ||
|
|
5d46a0419b | ||
|
|
d012f79822 | ||
|
|
818883a98a | ||
|
|
79669cb581 | ||
|
|
47f436e288 | ||
|
|
71ac706449 | ||
|
|
128c753057 | ||
|
|
b6a8074657 | ||
|
|
c2a347fb00 | ||
|
|
70709e0bf8 | ||
|
|
16992d9d43 | ||
|
|
aa819d7737 | ||
|
|
790749df12 | ||
|
|
a2cb909b52 | ||
|
|
4058450016 | ||
|
|
6233bad209 | ||
|
|
e52887b074 | ||
|
|
f9f53d18fb | ||
|
|
d4b30ecb15 | ||
|
|
1c0bafba6e | ||
|
|
67fd45ea54 | ||
|
|
12cefe3d84 | ||
|
|
3d24e79b9a | ||
|
|
43bbd1d95c | ||
|
|
2065a29d04 | ||
|
|
c45fae6ab1 | ||
|
|
0d3ee38d0e | ||
|
|
7de1fe0f75 | ||
|
|
f499ee52a9 | ||
|
|
0b9dd43505 | ||
|
|
09a856944d | ||
|
|
ef6e997665 | ||
|
|
f62ab4ca00 | ||
|
|
bd084d6a44 | ||
|
|
0462d8c85d | ||
|
|
b5444303b9 | ||
|
|
5ea73d795d | ||
|
|
5c7d4db3a7 | ||
|
|
d0df9b88e8 | ||
|
|
9adb719b13 | ||
|
|
ba101cf562 | ||
|
|
d6fe5c9fb8 | ||
|
|
cbdc47335c | ||
|
|
1d5c3efd83 | ||
|
|
64f7b3ff26 | ||
|
|
da604679de | ||
|
|
8a057b66a0 | ||
|
|
d3ad383d83 | ||
|
|
ff003eff27 | ||
|
|
56ec8e02b5 | ||
|
|
ca9aba5ec1 | ||
|
|
d88832677f | ||
|
|
1f1e4302ae | ||
|
|
e8ea1e391c | ||
|
|
1b80638e78 | ||
|
|
b3a5564585 | ||
|
|
675ff6f979 | ||
|
|
995ee74fce | ||
|
|
f1afbb6b1c | ||
|
|
3cf383a0d1 | ||
|
|
39f5100c50 | ||
|
|
21ae554f42 | ||
|
|
f77bb731bf | ||
|
|
e879aeea24 | ||
|
|
aa41356aa7 | ||
|
|
05e51309ba | ||
|
|
82212cbb13 | ||
|
|
42d68399d8 | ||
|
|
19c5957601 | ||
|
|
8a16efa9f6 | ||
|
|
ba6d541682 | ||
|
|
ccc3bc0b0d | ||
|
|
9778aabaed | ||
|
|
d7db07529e | ||
|
|
f7ff05e6e9 | ||
|
|
b1497a3f79 | ||
|
|
8640cf5f28 | ||
|
|
86be492cee | ||
|
|
e105dc68dd | ||
|
|
e17197d518 | ||
|
|
106b43b7fd | ||
|
|
1821fffc3b | ||
|
|
1a3a5842dc |
@@ -3,8 +3,8 @@
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.gpl.rpg.AndorsTrail"
|
||||
android:versionCode="78"
|
||||
android:versionName="0.8.12dev"
|
||||
android:versionCode="80"
|
||||
android:versionName="0.8.13dev"
|
||||
android:installLocation="auto"
|
||||
>
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ public final class AndorsTrailApplication extends Application {
|
||||
public static final boolean DEVELOPMENT_FASTSPEED = false;
|
||||
public static final boolean DEVELOPMENT_VALIDATEDATA = true;
|
||||
public static final boolean DEVELOPMENT_DEBUGMESSAGES = true;
|
||||
public static final String CURRENT_VERSION_DISPLAY = "0.8.12dev";
|
||||
public static final String CURRENT_VERSION_DISPLAY = "0.8.13dev";
|
||||
public static final boolean IS_RELEASE_VERSION = !CURRENT_VERSION_DISPLAY.matches(".*[a-d].*");
|
||||
public static final boolean DEVELOPMENT_INCOMPATIBLE_SAVEGAMES = DEVELOPMENT_DEBUGRESOURCES || DEVELOPMENT_DEBUGBUTTONS || DEVELOPMENT_FASTSPEED || !IS_RELEASE_VERSION;
|
||||
public static final int DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION = 999;
|
||||
public static final int CURRENT_VERSION = DEVELOPMENT_INCOMPATIBLE_SAVEGAMES ? DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION : 78;
|
||||
public static final int CURRENT_VERSION = DEVELOPMENT_INCOMPATIBLE_SAVEGAMES ? DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION : 81;
|
||||
|
||||
private final AndorsTrailPreferences preferences = new AndorsTrailPreferences();
|
||||
private WorldContext world = new WorldContext();
|
||||
|
||||
@@ -38,6 +38,10 @@ public final class ActorConditionInfoActivity extends AndorsTrailBaseActivity {
|
||||
tv.setText(conditionType.name);
|
||||
world.tileManager.setImageViewTile(getResources(), tv, conditionType);
|
||||
|
||||
TextView descriptionTv = (TextView) findViewById(R.id.actorconditioninfo_description);
|
||||
if(conditionType.description != null && !conditionType.description.isEmpty()) descriptionTv.setText(conditionType.description);
|
||||
else descriptionTv.setVisibility(View.GONE);
|
||||
|
||||
Button b = (Button) findViewById(R.id.actorconditioninfo_close);
|
||||
b.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -387,35 +387,35 @@ public final class DebugInterface {
|
||||
,new DebugButton("#5", new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "island1", "south2", 0, 0);
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "waytogalmore1", "entrance2", 0, 0);
|
||||
}
|
||||
})
|
||||
|
||||
,new DebugButton("#6", new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "laerothmanor1", "down2", 0, 0);
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "galmore_32", "south", 19, 0);
|
||||
}
|
||||
})
|
||||
|
||||
,new DebugButton("#7", new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "final_cave1", "up", 0, 0);
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "cabin_norcity_road1", "north", 5, 0);
|
||||
}
|
||||
})
|
||||
|
||||
,new DebugButton("#8", new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "bwmfill3", "north2", 0, 0);
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "galmore_86", "west", 0, 5);
|
||||
}
|
||||
})
|
||||
|
||||
,new DebugButton("#9", new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "island2", "down", 0, 0);
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "galmore_68", "north", 5, 0);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gpl.rpg.AndorsTrail.context;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
import com.gpl.rpg.AndorsTrail.model.ModelContainer;
|
||||
import com.gpl.rpg.AndorsTrail.model.ability.ActorConditionTypeCollection;
|
||||
import com.gpl.rpg.AndorsTrail.model.ability.SkillCollection;
|
||||
@@ -13,6 +14,8 @@ import com.gpl.rpg.AndorsTrail.resource.ConversationLoader;
|
||||
import com.gpl.rpg.AndorsTrail.resource.VisualEffectCollection;
|
||||
import com.gpl.rpg.AndorsTrail.resource.tiles.TileManager;
|
||||
|
||||
import java.security.DigestException;
|
||||
|
||||
public final class WorldContext {
|
||||
//Objectcollections
|
||||
public final ConversationLoader conversationLoader;
|
||||
@@ -62,4 +65,11 @@ public final class WorldContext {
|
||||
public void resetForNewGame() {
|
||||
maps.resetForNewGame();
|
||||
}
|
||||
|
||||
public byte[] getChecksum() throws DigestException {
|
||||
ChecksumBuilder checksumBuilder = new ChecksumBuilder();
|
||||
model.addToChecksum(checksumBuilder);
|
||||
maps.addToChecksum(checksumBuilder, this);
|
||||
return checksumBuilder.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,8 +76,7 @@ public final class ActorStatsController {
|
||||
c.magnitude -= magnitude;
|
||||
actorConditionListeners.onActorConditionMagnitudeChanged(actor, c);
|
||||
} else {
|
||||
actor.conditions.remove(i);
|
||||
actorConditionListeners.onActorConditionRemoved(actor, c);
|
||||
actorConditionsRemove(actor, c, i);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -232,9 +231,9 @@ public final class ActorStatsController {
|
||||
public void removeAllTemporaryConditions(final Actor actor) {
|
||||
for(int i = actor.conditions.size() - 1; i >= 0; --i) {
|
||||
ActorCondition c = actor.conditions.get(i);
|
||||
if (!c.isTemporaryEffect()) continue;
|
||||
actor.conditions.remove(i);
|
||||
actorConditionListeners.onActorConditionRemoved(actor, c);
|
||||
if (c.isTemporaryEffect() || c.isDurationForeverUntilSleep()) {
|
||||
actorConditionsRemove(actor, c, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,8 +241,7 @@ public final class ActorStatsController {
|
||||
for(int i = actor.conditions.size() - 1; i >= 0; --i) {
|
||||
ActorCondition c = actor.conditions.get(i);
|
||||
if (!c.conditionType.conditionTypeID.equals(conditionTypeID)) continue;
|
||||
actor.conditions.remove(i);
|
||||
actorConditionListeners.onActorConditionRemoved(actor, c);
|
||||
actorConditionsRemove(actor, c, i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,14 +404,14 @@ public final class ActorStatsController {
|
||||
ActorCondition c = actor.conditions.get(i);
|
||||
if (!c.isTemporaryEffect()) continue;
|
||||
if (c.duration <= 1) {
|
||||
actor.conditions.remove(i);
|
||||
actorConditionListeners.onActorConditionRemoved(actor, c);
|
||||
actorConditionsRemove(actor, c, i);
|
||||
removedAnyConditions = true;
|
||||
} else {
|
||||
c.duration -= 1;
|
||||
actorConditionListeners.onActorConditionDurationChanged(actor, c);
|
||||
}
|
||||
}
|
||||
// Immunities
|
||||
for(int i = actor.immunities.size() - 1; i >= 0; --i) {
|
||||
ActorCondition c = actor.immunities.get(i);
|
||||
if (!c.isTemporaryEffect()) continue;
|
||||
@@ -457,6 +455,50 @@ public final class ActorStatsController {
|
||||
}
|
||||
}
|
||||
|
||||
int actorConditionsRemove(Actor actor, ActorCondition c, int i) {
|
||||
int magnitude = 0; //default: No condition from worn items
|
||||
|
||||
if (actor instanceof Player) {
|
||||
Player player = (Player) actor;
|
||||
magnitude = gotConditionFromWornItem(player, c);
|
||||
if (magnitude > 0) { //condition from worn items?
|
||||
c.magnitude = magnitude; // -> readd condition
|
||||
actorConditionListeners.onActorConditionMagnitudeChanged(actor, c);
|
||||
c.duration = ActorCondition.DURATION_FOREVER;
|
||||
actorConditionListeners.onActorConditionDurationChanged(actor, c);
|
||||
}
|
||||
}
|
||||
if (magnitude == 0) {
|
||||
actor.conditions.remove(i);
|
||||
actorConditionListeners.onActorConditionRemoved(actor, c);
|
||||
}
|
||||
|
||||
return magnitude;
|
||||
}
|
||||
|
||||
int gotConditionFromWornItem(Player player, ActorCondition c) {
|
||||
int magnitude = 0; //Default: No worn item with this condition
|
||||
|
||||
for (Inventory.WearSlot slot : Inventory.WearSlot.values()) {
|
||||
ItemType t = player.inventory.getItemTypeInWearSlot(slot);
|
||||
if (t == null) continue;
|
||||
ItemTraits_OnEquip equipEffects = t.effects_equip;
|
||||
if (equipEffects == null) continue;
|
||||
if (equipEffects.addedConditions == null) continue;
|
||||
for (ActorConditionEffect e : equipEffects.addedConditions) {
|
||||
if (e.conditionType.conditionTypeID.equals(c.conditionType.conditionTypeID)) {
|
||||
if (e.magnitude == ActorCondition.MAGNITUDE_REMOVE_ALL) {
|
||||
return 0; //On an item-based immunity the result is always 0
|
||||
}
|
||||
if (magnitude < e.magnitude) {
|
||||
magnitude = e.magnitude;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return magnitude;
|
||||
}
|
||||
|
||||
public void applyUseEffect(Actor source, Actor target, ItemTraits_OnUse effect) {
|
||||
if (effect == null) return;
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@ import java.util.List;
|
||||
|
||||
public final class VisualEffectController {
|
||||
private static final long EFFECT_UPDATE_INTERVAL = 25;
|
||||
private int effectCount = 0;
|
||||
|
||||
private final ControllerContext controllers;
|
||||
private final WorldContext world;
|
||||
private final VisualEffectCollection effectTypes;
|
||||
@@ -46,7 +44,6 @@ public final class VisualEffectController {
|
||||
}
|
||||
|
||||
public void startEffect(Coord position, VisualEffectCollection.VisualEffectID effectID, String displayValue, VisualEffectCompletedCallback callback, int callbackValue) {
|
||||
++effectCount;
|
||||
VisualEffectAnimation animation = new VisualEffectAnimation(effectTypes.getVisualEffect(effectID), position, displayValue, callback, callbackValue);
|
||||
animation.start();
|
||||
}
|
||||
@@ -64,17 +61,16 @@ public final class VisualEffectController {
|
||||
public void run() {
|
||||
if(!activeAnimations.isEmpty()) {
|
||||
long updateInterval = getEffectUpdateInterval();
|
||||
animationHandler.postDelayed(this, updateInterval);
|
||||
if(updateInterval > 0) animationHandler.postDelayed(this, updateInterval);
|
||||
|
||||
for (int i = 0; i < activeAnimations.size(); i++) {
|
||||
VisualEffectAnimation animation = activeAnimations.get(i);
|
||||
animation.durationPassed += updateInterval;
|
||||
animation.updateFrame();
|
||||
animation.update();
|
||||
if (animation.currentFrame >= animation.effect.lastFrame) {
|
||||
if (controllers.preferences.attackspeed_milliseconds <= 0 || animation.currentFrame >= animation.effect.lastFrame) {
|
||||
animation.onCompleted();
|
||||
activeAnimations.remove(i);
|
||||
effectCount--;
|
||||
i--;
|
||||
}
|
||||
}
|
||||
@@ -101,7 +97,6 @@ public final class VisualEffectController {
|
||||
}
|
||||
|
||||
public void startActorMoveEffect(Actor actor, PredefinedMap map, Coord origin, Coord destination, int duration, VisualEffectCompletedCallback callback, int callbackValue) {
|
||||
++effectCount;
|
||||
(new SpriteMoveAnimation(origin, destination, duration, actor, map, callback, callbackValue))
|
||||
.start();
|
||||
}
|
||||
@@ -136,7 +131,6 @@ public final class VisualEffectController {
|
||||
}
|
||||
|
||||
private void onCompleted() {
|
||||
--effectCount;
|
||||
actor.hasVFXRunning = false;
|
||||
if (callback != null) callback.onVisualEffectCompleted(callbackValue);
|
||||
visualEffectFrameListeners.onSpriteMoveCompleted(this);
|
||||
@@ -161,6 +155,7 @@ public final class VisualEffectController {
|
||||
textPaint.setTextAlign(Align.CENTER);
|
||||
}
|
||||
|
||||
/// only for combat effects, movement & blood splatters etc. are handled elsewhere.
|
||||
public final class VisualEffectAnimation {
|
||||
public int tileID;
|
||||
public int textYOffset;
|
||||
@@ -168,7 +163,7 @@ public final class VisualEffectController {
|
||||
|
||||
private void updateFrame() {
|
||||
long frameDuration = (long) effect.millisecondPerFrame * controllers.preferences.attackspeed_milliseconds / AndorsTrailPreferences.ATTACKSPEED_DEFAULT_MILLISECONDS;
|
||||
while (durationPassed > frameDuration) {
|
||||
while (frameDuration > 0 && durationPassed > frameDuration) {
|
||||
currentFrame++;
|
||||
durationPassed -= frameDuration;
|
||||
}
|
||||
@@ -194,8 +189,10 @@ public final class VisualEffectController {
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (!controllers.preferences.enableUiAnimations) onCompleted();
|
||||
else startAnimation(this);
|
||||
if (!controllers.preferences.enableUiAnimations
|
||||
|| effect.duration == 0
|
||||
|| controllers.preferences.attackspeed_milliseconds <= 0) onCompleted();
|
||||
else startAnimation(this);
|
||||
}
|
||||
|
||||
private int currentFrame = 0;
|
||||
@@ -235,7 +232,7 @@ public final class VisualEffectController {
|
||||
}
|
||||
|
||||
public boolean isRunningVisualEffect() {
|
||||
return effectCount > 0;
|
||||
return !activeAnimations.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
@@ -295,10 +292,10 @@ public final class VisualEffectController {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void asyncUpdateArea(CoordRect area) {
|
||||
visualEffectFrameListeners.onAsyncAreaUpdate(area);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.LayeredTileMap;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.MapLayer;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.PredefinedMap;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.TMXMapTranslator;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.WorldMapSegment;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.WorldMapSegment.NamedWorldMapArea;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.WorldMapSegment.WorldMapSegmentMap;
|
||||
@@ -314,4 +315,32 @@ public final class WorldMapController {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void populateWorldMap(Context context, WorldContext world, Resources res) throws IOException {
|
||||
ensureWorldmapDirectoryExists(context);
|
||||
File dir = getWorldmapDirectory(context);
|
||||
|
||||
File idFile = new File(dir, world.model.player.id);
|
||||
if (idFile.exists()) return;
|
||||
idFile.createNewFile();
|
||||
|
||||
for (PredefinedMap map : world.maps.getAllMaps()) {
|
||||
if (!map.visited) continue;
|
||||
|
||||
String worldMapSegmentName = world.maps.getWorldMapSegmentNameForMap(map.name);
|
||||
if (worldMapSegmentName == null) continue;
|
||||
|
||||
boolean mapFileExists = fileForMapExists(context, map);
|
||||
File worldMapFile = getCombinedWorldMapFile(context, worldMapSegmentName);
|
||||
if (mapFileExists && worldMapFile.exists()) continue;
|
||||
|
||||
LayeredTileMap mapTiles = TMXMapTranslator.readLayeredTileMap(res, world.tileManager.tileCache, map);
|
||||
mapTiles.changeColorFilter(map.currentColorFilter);
|
||||
TileCollection cachedTiles = world.tileManager.loadTilesFor(map, mapTiles, world, res);
|
||||
|
||||
MapRenderer renderer = new MapRenderer(world, map, mapTiles, cachedTiles);
|
||||
updateCachedBitmap(context, map, renderer);
|
||||
updateWorldMapSegment(context, res, world, worldMapSegmentName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.gpl.rpg.AndorsTrail.model;
|
||||
|
||||
import android.os.Build;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.DigestException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class ChecksumBuilder {
|
||||
|
||||
public static final int CHECKSUM_LENGTH = 32;// 256 bits (depends on the hash algorithm)
|
||||
public static final String CHECKSUM_ALGORITHM = "SHA-256"; //Should be available in all Android versions
|
||||
private ByteBuffer buffer;
|
||||
private final MessageDigest digest;
|
||||
|
||||
private ChecksumBuilder(int initialCapacity, ByteOrder byteOrder) {
|
||||
buffer = ByteBuffer.allocate(initialCapacity);
|
||||
buffer.order(byteOrder);
|
||||
try {
|
||||
digest = MessageDigest.getInstance(CHECKSUM_ALGORITHM); // Or SHA-512 for even stronger hash
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException("Hash algorithm not found", e);
|
||||
}
|
||||
}
|
||||
|
||||
private ChecksumBuilder(int initialCapacity) {
|
||||
this(initialCapacity, ByteOrder.BIG_ENDIAN); // Default to big-endian
|
||||
}
|
||||
|
||||
public ChecksumBuilder() {
|
||||
this(1024*10); // A reasonable default initial capacity
|
||||
}
|
||||
|
||||
// --- Methods for adding different data types ---
|
||||
|
||||
public ChecksumBuilder add(String value) {
|
||||
if (value != null) {
|
||||
byte[] bytes;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
bytes = value.getBytes(StandardCharsets.UTF_8);
|
||||
} else {
|
||||
bytes = value.getBytes();
|
||||
}
|
||||
add(bytes);
|
||||
} else {
|
||||
add(-1); // Use -1 to represent a null string
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ChecksumBuilder add(byte[] bytes) {
|
||||
add(bytes.length); // Add length prefix
|
||||
ensureCapacity(bytes.length + 4); // +4 for length prefix (int)
|
||||
buffer.put(bytes);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ChecksumBuilder add(boolean value) {
|
||||
ensureCapacity(1);
|
||||
buffer.put(value ? (byte) 1 : (byte) 0);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ChecksumBuilder add(long value) {
|
||||
ensureCapacity(8);
|
||||
buffer.putLong(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ChecksumBuilder add(int value) {
|
||||
ensureCapacity(4);
|
||||
buffer.putInt(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ChecksumBuilder add(float value) {
|
||||
ensureCapacity(8);
|
||||
buffer.putFloat(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ChecksumBuilder add(double value) {
|
||||
ensureCapacity(4);
|
||||
buffer.putDouble(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
// --- Method to finalize and get the checksum ---
|
||||
|
||||
public byte[] build() throws DigestException {
|
||||
buffer.flip(); // Prepare for reading
|
||||
digest.update(buffer);// Only use the actually used part of the buffer
|
||||
buffer.flip(); // Prepare for further writing
|
||||
return digest.digest();
|
||||
}
|
||||
|
||||
|
||||
// --- Utility method to ensure sufficient capacity ---
|
||||
private void ensureCapacity(int required) {
|
||||
if (buffer.remaining() < required) {
|
||||
int newCapacity = Math.max(buffer.capacity() * 2, buffer.capacity() + required);
|
||||
ByteBuffer newBuffer = ByteBuffer.allocate(newCapacity);
|
||||
newBuffer.order(buffer.order());
|
||||
buffer.flip(); // Prepare for reading
|
||||
newBuffer.put(buffer); // Copy existing data
|
||||
buffer = newBuffer; // Assign the new buffer to the field
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.gpl.rpg.AndorsTrail.model;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
@@ -22,6 +23,8 @@ import com.gpl.rpg.AndorsTrail.model.quest.Quest;
|
||||
import com.gpl.rpg.AndorsTrail.util.HashMapHelper;
|
||||
|
||||
public final class GameStatistics {
|
||||
private boolean isAlteredSavegame = false;
|
||||
private byte[] checksum = new byte[ChecksumBuilder.CHECKSUM_LENGTH];
|
||||
private int deaths = 0;
|
||||
private final HashMap<String, Integer> killedMonstersByTypeID = new HashMap<String, Integer>();
|
||||
private final HashMap<String, Integer> killedMonstersByName = new HashMap<String, Integer>();
|
||||
@@ -67,6 +70,7 @@ public final class GameStatistics {
|
||||
public boolean hasUnlimitedLives() { return startLives == -1; }
|
||||
|
||||
public int getStartLives() { return startLives; }
|
||||
public boolean getIsAlteredSavegame() { return isAlteredSavegame; }
|
||||
|
||||
public int getLivesLeft() { return hasUnlimitedLives() ? -1 : startLives - deaths; }
|
||||
|
||||
@@ -158,6 +162,18 @@ public final class GameStatistics {
|
||||
}
|
||||
};
|
||||
|
||||
public void setChecksum(byte[] checksum) {
|
||||
if (checksum.length != ChecksumBuilder.CHECKSUM_LENGTH) throw new IllegalArgumentException("Invalid checksum length.");
|
||||
this.checksum = checksum;
|
||||
}
|
||||
|
||||
public boolean compareChecksum(byte[] checksum) {
|
||||
return this.checksum.length == checksum.length && MessageDigest.isEqual(this.checksum, checksum);
|
||||
}
|
||||
|
||||
public void markAsAlteredSavegame() {
|
||||
isAlteredSavegame = true;
|
||||
}
|
||||
|
||||
// ====== PARCELABLE ===================================================================
|
||||
|
||||
@@ -194,6 +210,11 @@ public final class GameStatistics {
|
||||
|
||||
this.startLives = src.readInt();
|
||||
this.unlimitedSaves = src.readBoolean();
|
||||
if (fileversion < 81) return;
|
||||
this.isAlteredSavegame = src.readBoolean();
|
||||
final int checksumLength = src.readInt();
|
||||
this.checksum = new byte[checksumLength];
|
||||
if( src.read(checksum) != checksumLength) throw new IOException("Failed to read full checksum.");
|
||||
}
|
||||
|
||||
public void writeToParcel(DataOutputStream dest) throws IOException {
|
||||
@@ -213,5 +234,29 @@ public final class GameStatistics {
|
||||
dest.writeInt(spentGold);
|
||||
dest.writeInt(startLives);
|
||||
dest.writeBoolean(unlimitedSaves);
|
||||
dest.writeBoolean(isAlteredSavegame);
|
||||
dest.writeInt(checksum.length);
|
||||
dest.write(checksum);
|
||||
}
|
||||
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(deaths);
|
||||
Set<Entry<String, Integer> > set = killedMonstersByTypeID.entrySet();
|
||||
builder.add(set.size());
|
||||
for (Entry<String, Integer> e : set) {
|
||||
builder.add(e.getKey());
|
||||
builder.add(e.getValue());
|
||||
}
|
||||
set = usedItems.entrySet();
|
||||
builder.add(set.size());
|
||||
for (Entry<String, Integer> e : set) {
|
||||
builder.add(e.getKey());
|
||||
builder.add(e.getValue());
|
||||
}
|
||||
builder.add(spentGold);
|
||||
builder.add(startLives);
|
||||
builder.add(unlimitedSaves);
|
||||
builder.add(isAlteredSavegame);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,4 +51,12 @@ public final class InterfaceData {
|
||||
}
|
||||
dest.writeUTF(selectedTabHeroInfo);
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(isMainActivityVisible);
|
||||
builder.add(isInCombat);
|
||||
builder.add(selectedPosition != null);
|
||||
if (selectedPosition != null) selectedPosition.addToChecksum(builder);
|
||||
builder.add(selectedTabHeroInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,4 +49,11 @@ public final class ModelContainer {
|
||||
statistics.writeToParcel(dest);
|
||||
worldData.writeToParcel(dest);
|
||||
}
|
||||
public void addToChecksum(ChecksumBuilder builder){
|
||||
player.addToChecksum(builder);
|
||||
builder.add(currentMaps.map.name);
|
||||
uiSelections.addToChecksum(builder);
|
||||
statistics.addToChecksum(builder);
|
||||
worldData.addToChecksum(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,4 +114,13 @@ public final class WorldData {
|
||||
dest.writeLong(e.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(worldTime);
|
||||
builder.add(timers.size());
|
||||
for(Map.Entry<String, Long> e : timers.entrySet()) {
|
||||
builder.add(e.getKey());
|
||||
builder.add(e.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,12 @@ import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
|
||||
public final class ActorCondition {
|
||||
public static final int MAGNITUDE_REMOVE_ALL = -99;
|
||||
public static final int DURATION_FOREVER = 999;
|
||||
public static final int DURATION_FOREVER_UNTIL_SLEEP = 998;
|
||||
public static final int DURATION_NONE = 0;
|
||||
|
||||
public final ActorConditionType conditionType;
|
||||
@@ -27,7 +29,12 @@ public final class ActorCondition {
|
||||
|
||||
public boolean isTemporaryEffect() { return isTemporaryEffect(duration); }
|
||||
public static boolean isTemporaryEffect(int duration) {
|
||||
return duration != DURATION_FOREVER;
|
||||
return ( duration != DURATION_FOREVER && duration != DURATION_FOREVER_UNTIL_SLEEP );
|
||||
}
|
||||
|
||||
public boolean isDurationForeverUntilSleep() { return isDurationForeverUntilSleep(duration); }
|
||||
public static boolean isDurationForeverUntilSleep(int duration) {
|
||||
return ( duration == DURATION_FOREVER_UNTIL_SLEEP );
|
||||
}
|
||||
|
||||
|
||||
@@ -45,4 +52,11 @@ public final class ActorCondition {
|
||||
dest.writeInt(magnitude);
|
||||
dest.writeInt(duration);
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(conditionType.conditionTypeID);
|
||||
builder.add(magnitude);
|
||||
builder.add(duration);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public final class ActorConditionType {
|
||||
|
||||
public final String conditionTypeID;
|
||||
public final String name;
|
||||
public final String description;
|
||||
public final int iconID;
|
||||
public final ConditionCategory conditionCategory;
|
||||
public final boolean isStacking;
|
||||
@@ -21,6 +22,7 @@ public final class ActorConditionType {
|
||||
public ActorConditionType(
|
||||
String conditionTypeID
|
||||
, String name
|
||||
, String description
|
||||
, int iconID
|
||||
, ConditionCategory conditionCategory
|
||||
, boolean isStacking
|
||||
@@ -31,6 +33,7 @@ public final class ActorConditionType {
|
||||
) {
|
||||
this.conditionTypeID = conditionTypeID;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.iconID = iconID;
|
||||
this.conditionCategory = conditionCategory;
|
||||
this.isStacking = isStacking;
|
||||
|
||||
@@ -187,12 +187,12 @@ public final class SkillCollection {
|
||||
initializeSkill(new SkillInfo(SkillID.resistanceBlood, MAX_LEVEL_RESISTANCE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.shadowBless, 1, SkillInfo.LevelUpType.onlyByQuests, SkillCategory.immunity, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.crit1, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.criticals, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.moreCriticals, 3)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.betterCriticals, 3)
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.moreCriticals, 2)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.betterCriticals, 2)
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.crit2, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.criticals, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.moreCriticals, 6)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.betterCriticals, 6)
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.moreCriticals, 4)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.betterCriticals, 4)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.crit1, 1)
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.rejuvenation, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, new SkillLevelRequirement[] {
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.io.IOException;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.controller.Constants;
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
import com.gpl.rpg.AndorsTrail.model.ability.ActorCondition;
|
||||
import com.gpl.rpg.AndorsTrail.model.ability.SkillCollection;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.DropList;
|
||||
@@ -193,4 +194,43 @@ public final class Monster extends Actor {
|
||||
dest.writeBoolean(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(getMonsterTypeID());
|
||||
if (attackCost == monsterType.attackCost
|
||||
&& attackChance == monsterType.attackChance
|
||||
&& criticalSkill == monsterType.criticalSkill
|
||||
&& criticalMultiplier == monsterType.criticalMultiplier
|
||||
&& damagePotential.equals(monsterType.damagePotential)
|
||||
&& blockChance == monsterType.blockChance
|
||||
&& damageResistance == monsterType.damageResistance
|
||||
) {
|
||||
builder.add(false);
|
||||
} else {
|
||||
builder.add(true);
|
||||
builder.add(attackCost);
|
||||
builder.add(attackChance);
|
||||
builder.add(criticalSkill);
|
||||
builder.add(criticalMultiplier);
|
||||
damagePotential.addToChecksum(builder);
|
||||
builder.add(blockChance);
|
||||
builder.add(damageResistance);
|
||||
}
|
||||
ap.addToChecksum(builder);
|
||||
health.addToChecksum(builder);
|
||||
position.addToChecksum(builder);
|
||||
builder.add(conditions.size());
|
||||
for (ActorCondition c : conditions) {
|
||||
c.addToChecksum(builder);
|
||||
}
|
||||
builder.add(moveCost);
|
||||
|
||||
builder.add(forceAggressive);
|
||||
if (shopItems != null) {
|
||||
builder.add(true);
|
||||
shopItems.addToChecksum(builder);
|
||||
} else {
|
||||
builder.add(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.context.ControllerContext;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.controller.Constants;
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
import com.gpl.rpg.AndorsTrail.model.ability.ActorCondition;
|
||||
import com.gpl.rpg.AndorsTrail.model.ability.SkillCollection;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.DropListCollection;
|
||||
@@ -475,5 +476,62 @@ public final class Player extends Actor {
|
||||
dest.writeUTF(id);
|
||||
dest.writeLong(savedVersion);
|
||||
}
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
//builder.add(baseTraits.iconID);// Do not add to checksum so that it can be changed without invalidating checksums
|
||||
builder.add(baseTraits.maxAP);
|
||||
builder.add(baseTraits.maxHP);
|
||||
//builder.add(name);// Do not add to checksum so that it can be changed without invalidating checksums
|
||||
builder.add(moveCost); // TODO: Should we really write this?
|
||||
builder.add(baseTraits.attackCost);
|
||||
builder.add(baseTraits.attackChance);
|
||||
builder.add(baseTraits.criticalSkill);
|
||||
builder.add(baseTraits.criticalMultiplier);
|
||||
baseTraits.damagePotential.addToChecksum(builder);
|
||||
builder.add(baseTraits.blockChance);
|
||||
builder.add(baseTraits.damageResistance);
|
||||
builder.add(baseTraits.moveCost);
|
||||
|
||||
ap.addToChecksum(builder);
|
||||
health.addToChecksum(builder);
|
||||
position.addToChecksum(builder);
|
||||
builder.add(conditions.size());
|
||||
for (ActorCondition c : conditions) {
|
||||
c.addToChecksum(builder);
|
||||
}
|
||||
builder.add(immunities.size());
|
||||
for (ActorCondition c : immunities) {
|
||||
c.addToChecksum(builder);
|
||||
}
|
||||
lastPosition.addToChecksum(builder);
|
||||
nextPosition.addToChecksum(builder);
|
||||
builder.add(level);
|
||||
builder.add(totalExperience);
|
||||
inventory.addToChecksum(builder);
|
||||
builder.add(baseTraits.useItemCost);
|
||||
builder.add(baseTraits.reequipCost);
|
||||
builder.add(skillLevels.size());
|
||||
for (int i = 0; i < skillLevels.size(); ++i) {
|
||||
builder.add(skillLevels.keyAt(i));
|
||||
builder.add(skillLevels.valueAt(i));
|
||||
}
|
||||
builder.add(spawnMap);
|
||||
builder.add(spawnPlace);
|
||||
builder.add(questProgress.size());
|
||||
for(Entry<String, LinkedHashSet<Integer> > e : questProgress.entrySet()) {
|
||||
builder.add(e.getKey());
|
||||
builder.add(e.getValue().size());
|
||||
for(int progress : e.getValue()) {
|
||||
builder.add(progress);
|
||||
}
|
||||
}
|
||||
builder.add(availableSkillIncreases);
|
||||
builder.add(alignments.size());
|
||||
for(Entry<String, Integer> e : alignments.entrySet()) {
|
||||
builder.add(e.getKey());
|
||||
builder.add(e.getValue());
|
||||
}
|
||||
builder.add(id);
|
||||
builder.add(savedVersion);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
import com.gpl.rpg.AndorsTrail.savegames.LegacySavegameFormatReaderForItemContainer;
|
||||
|
||||
public final class Inventory extends ItemContainer {
|
||||
@@ -208,4 +209,21 @@ public final class Inventory extends ItemContainer {
|
||||
}
|
||||
}
|
||||
}
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
super.addToChecksum(builder);
|
||||
builder.add(gold);
|
||||
builder.add(NUM_WORN_SLOTS);
|
||||
for(int i = 0; i < NUM_WORN_SLOTS; ++i) {
|
||||
if (wear[i] != null) {
|
||||
builder.add(wear[i].id);
|
||||
}
|
||||
}
|
||||
builder.add(NUM_QUICK_SLOTS);
|
||||
for(int i = 0; i < NUM_QUICK_SLOTS; ++i) {
|
||||
if (quickitem[i] != null) {
|
||||
builder.add(quickitem[i].id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Player;
|
||||
|
||||
public class ItemContainer {
|
||||
@@ -42,6 +43,10 @@ public class ItemContainer {
|
||||
dest.writeUTF(itemType.id);
|
||||
dest.writeInt(quantity);
|
||||
}
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(itemType.id);
|
||||
builder.add(quantity);
|
||||
}
|
||||
}
|
||||
|
||||
public void addItem(ItemType itemType, int quantity) {
|
||||
@@ -280,4 +285,10 @@ public class ItemContainer {
|
||||
e.writeToParcel(dest);
|
||||
}
|
||||
}
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(items.size());
|
||||
for (ItemEntry e : items) {
|
||||
e.addToChecksum(builder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
import com.gpl.rpg.AndorsTrail.savegames.LegacySavegameFormatReaderForItemContainer;
|
||||
import com.gpl.rpg.AndorsTrail.util.Coord;
|
||||
|
||||
@@ -88,4 +89,12 @@ public final class Loot {
|
||||
position.writeToParcel(dest);
|
||||
dest.writeBoolean(isVisible);
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(exp);
|
||||
builder.add(gold);
|
||||
items.addToChecksum(builder);
|
||||
position.addToChecksum(builder);
|
||||
builder.add(isVisible);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.List;
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.context.ControllerContext;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
import com.gpl.rpg.AndorsTrail.savegames.LegacySavegameFormatReaderForMap;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
|
||||
@@ -99,4 +100,16 @@ public final class MapCollection {
|
||||
map.writeToParcel(dest, world);
|
||||
}
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder checksumBuilder, WorldContext world) {
|
||||
List<PredefinedMap> mapsToExport = new ArrayList<PredefinedMap>();
|
||||
for(PredefinedMap map : getAllMaps()) {
|
||||
if (shouldSaveMap(world, map)) mapsToExport.add(map);
|
||||
}
|
||||
checksumBuilder.add(mapsToExport.size());
|
||||
for(PredefinedMap map : mapsToExport) {
|
||||
checksumBuilder.add(map.name);
|
||||
map.addToChecksum(checksumBuilder, world);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.controller.Constants;
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Monster;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.MonsterType;
|
||||
import com.gpl.rpg.AndorsTrail.util.Coord;
|
||||
@@ -140,4 +141,12 @@ public final class MonsterSpawnArea {
|
||||
m.writeToParcel(dest);
|
||||
}
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(isSpawning);
|
||||
builder.add(monsters.size());
|
||||
for (Monster m : monsters) {
|
||||
m.addToChecksum(builder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.gpl.rpg.AndorsTrail.context.ControllerContext;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.controller.Constants;
|
||||
import com.gpl.rpg.AndorsTrail.controller.VisualEffectController.BloodSplatter;
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Monster;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemType;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.Loot;
|
||||
@@ -398,4 +399,30 @@ public final class PredefinedMap {
|
||||
dest.writeBoolean(visited);
|
||||
dest.writeUTF(lastSeenLayoutHash);
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder, WorldContext world) {
|
||||
if (shouldSaveMapData(world)) {
|
||||
builder.add(true);
|
||||
builder.add(spawnAreas.length);
|
||||
for(MonsterSpawnArea a : spawnAreas) {
|
||||
builder.add(a.areaID);
|
||||
a.addToChecksum(builder);
|
||||
}
|
||||
builder.add(activeMapObjectGroups.size());
|
||||
for(String s : activeMapObjectGroups) {
|
||||
builder.add(s);
|
||||
}
|
||||
builder.add(groundBags.size());
|
||||
for(Loot l : groundBags) {
|
||||
l.addToChecksum(builder);
|
||||
}
|
||||
builder.add(currentColorFilter != null);
|
||||
if (currentColorFilter != null) builder.add(currentColorFilter);
|
||||
builder.add(lastVisitTime);
|
||||
} else {
|
||||
builder.add(false);
|
||||
}
|
||||
builder.add(visited);
|
||||
builder.add(lastSeenLayoutHash);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,11 +256,14 @@ public final class ResourceLoader {
|
||||
final Size sz2x2 = new Size(2, 2);
|
||||
final Size sz2x3 = new Size(2, 3);
|
||||
final Size sz3x1 = new Size(3, 1);
|
||||
final Size sz4x1 = new Size(4, 1);
|
||||
final Size sz5x1 = new Size(5, 1);
|
||||
final Size sz6x1 = new Size(6, 1);
|
||||
final Size sz7x1 = new Size(7, 1);
|
||||
final Size sz7x4 = new Size(7, 4);
|
||||
final Size sz8x3 = new Size(8, 3);
|
||||
final Size sz16x8 = new Size(16, 8);
|
||||
final Size sz16x10 = new Size(16, 10);
|
||||
final Size sz20x12 = new Size(20, 12);
|
||||
final Size mapTileSize = new Size(16, 8);
|
||||
final Size sz8x8 = new Size(8, 8);
|
||||
@@ -280,6 +283,7 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.actorconditions_1, "actorconditions_1", new Size(14, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_2, "actorconditions_2", sz3x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_japozero, "actorconditions_japozero", new Size(16, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_newb, "actorconditions_newb", new Size(20, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_omi1, "actorconditions_omi1", sz2x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_omi2, "actorconditions_omi2", sz5x1, sz1x1, mTileSize);
|
||||
/*INSERT_ACTORCONDITIONS_TILESETS_HERE*/
|
||||
@@ -321,7 +325,7 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.monsters_cyclops, "monsters_cyclops", sz1x1, sz2x3, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_demon1, "monsters_demon1", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_demon2, "monsters_demon2", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_dogs, "monsters_dogs", sz7x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_dogs, "monsters_dogs", sz7x4, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye1, "monsters_eye1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye2, "monsters_eye2", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye3, "monsters_eye3", sz1x1, sz1x1, mTileSize);
|
||||
@@ -329,10 +333,11 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.monsters_ghost1, "monsters_ghost1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_hydra1, "monsters_hydra1", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_insects, "monsters_insects", sz6x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_johny, "monsters_johny", sz20x12, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_karvis1, "monsters_karvis1", sz2x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_karvis2, "monsters_karvis2", new Size(9, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ld1, "monsters_ld1", new Size(20, 12), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ld2, "monsters_ld2", new Size(20, 12), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ld1, "monsters_ld1", sz20x12, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ld2, "monsters_ld2", sz20x12, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_liches, "monsters_liches", new Size(4, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_mage, "monsters_mage", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_mage2, "monsters_mage2", sz1x1, sz1x1, mTileSize);
|
||||
@@ -342,7 +347,7 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.monsters_misc, "monsters_misc", new Size(13, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_newb_1, "monsters_newb_1", new Size(40, 34), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_newb_2, "monsters_newb_2", new Size(8, 2), sz1x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_newb_3, "monsters_newb_3", new Size(10, 2), sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_newb_3, "monsters_newb_3", new Size(10, 10), sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_newb_4, "monsters_newb_4", new Size(4, 1), sz2x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rats, "monsters_rats", new Size(5, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_redshrike1, "monsters_redshrike1", sz7x1, sz1x1, mTileSize);
|
||||
@@ -373,7 +378,7 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.monsters_omi1_b, "monsters_omi1_b", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_unknown, "monsters_unknown", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_arulirs, "monsters_arulirs", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_fatboy73, "monsters_fatboy73", new Size(20, 12), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_fatboy73, "monsters_fatboy73", sz20x12, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_giantbasilisk, "monsters_giantbasilisk", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_gisons, "monsters_gisons", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_bosses_2x2, "monsters_bosses_2x2", sz1x1, sz2x2, mTileSize);
|
||||
@@ -382,12 +387,12 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.monsters_cats, "monsters_cats", new Size(10, 2), sz1x1, mTileSize);
|
||||
/*INSERT_NPCS_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.map_bed_1, "map_bed_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_boats_1, "map_boats_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_bed_1, "map_bed_1", sz16x10, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_boats_1, "map_boats_1", new Size(16, 9), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_border_1, "map_border_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_bridge_1, "map_bridge_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_bridge_2, "map_bridge_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_brightport, "map_brightport", new Size(7, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_brightport, "map_brightport", new Size(16, 7), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_broken_1, "map_broken_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_1, "map_cavewall_1", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_2, "map_cavewall_2", new Size(18, 6), sz1x1, mTileSize);
|
||||
|
||||
@@ -26,6 +26,7 @@ public final class ActorConditionsTypeParser extends JsonCollectionParserFor<Act
|
||||
ActorConditionType result = new ActorConditionType(
|
||||
conditionTypeID
|
||||
,translationLoader.translateActorConditionName(o.getString(JsonFieldNames.ActorCondition.name))
|
||||
,translationLoader.translateActorConditionName(o.optString(JsonFieldNames.ActorCondition.description))
|
||||
,ResourceParserUtils.parseImageID(tileLoader, o.getString(JsonFieldNames.ActorCondition.iconID))
|
||||
,ActorConditionType.ConditionCategory.valueOf(o.getString(JsonFieldNames.ActorCondition.category))
|
||||
,o.optInt(JsonFieldNames.ActorCondition.isStacking) > 0
|
||||
|
||||
@@ -4,6 +4,7 @@ public final class JsonFieldNames {
|
||||
public static final class ActorCondition {
|
||||
public static final String conditionTypeID = "id";
|
||||
public static final String name = "name";
|
||||
public static final String description = "description";
|
||||
public static final String iconID = "iconID";
|
||||
public static final String category = "category";
|
||||
public static final String isStacking = "isStacking";
|
||||
|
||||
@@ -76,14 +76,17 @@ public final class TileCache {
|
||||
ResourceFileTile tile = resourceTiles[tileID];
|
||||
if(tile == null && AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES){
|
||||
L.log("could not find resourceTiles for id: " + tileID);
|
||||
L.log("iconIDs: " + iconIDs);
|
||||
}
|
||||
SparseArray<ResourceFileTile> tiles = tilesToLoadPerSourceFile.get(tile.tileset);
|
||||
if (tiles == null) {
|
||||
tiles = new SparseArray<TileCache.ResourceFileTile>();
|
||||
tilesToLoadPerSourceFile.put(tile.tileset, tiles);
|
||||
if(tile != null || AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA){
|
||||
SparseArray<ResourceFileTile> tiles = tilesToLoadPerSourceFile.get(tile.tileset);
|
||||
if (tiles == null) {
|
||||
tiles = new SparseArray<TileCache.ResourceFileTile>();
|
||||
tilesToLoadPerSourceFile.put(tile.tileset, tiles);
|
||||
}
|
||||
tiles.put(tileID, tile);
|
||||
maxTileID = Math.max(maxTileID, tileID);
|
||||
}
|
||||
tiles.put(tileID, tile);
|
||||
maxTileID = Math.max(maxTileID, tileID);
|
||||
}
|
||||
|
||||
boolean hasLoadedTiles = false;
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.security.DigestException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -27,6 +28,7 @@ import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.ControllerContext;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.controller.Constants;
|
||||
import com.gpl.rpg.AndorsTrail.controller.WorldMapController;
|
||||
import com.gpl.rpg.AndorsTrail.model.ModelContainer;
|
||||
import com.gpl.rpg.AndorsTrail.resource.tiles.TileManager;
|
||||
import com.gpl.rpg.AndorsTrail.util.AndroidStorage;
|
||||
@@ -78,7 +80,7 @@ public final class Savegames {
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
} catch (IOException | DigestException e) {
|
||||
L.log("Error saving world: " + e.toString());
|
||||
return false;
|
||||
}
|
||||
@@ -86,7 +88,7 @@ public final class Savegames {
|
||||
|
||||
private static void writeBackup(Context androidContext, byte[] savegame, String playerId) throws IOException {
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
ensureDirExists(cheatDetectionFolder);
|
||||
ensureDirExists(cheatDetectionFolder);
|
||||
File backupFile = new File(cheatDetectionFolder, playerId + "X");
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(backupFile);
|
||||
fileOutputStream.write(savegame);
|
||||
@@ -104,18 +106,18 @@ public final class Savegames {
|
||||
}
|
||||
|
||||
FileInputStream fos = getInputFile(androidContext, slot);
|
||||
LoadSavegameResult result = loadWorld(androidContext.getResources(), world, controllers, fos, fh);
|
||||
LoadSavegameResult result = loadWorld(androidContext.getResources(), world, controllers, androidContext, fos, fh);
|
||||
fos.close();
|
||||
if (result == LoadSavegameResult.success && slot != SLOT_QUICKSAVE && !world.model.statistics.hasUnlimitedSaves()) {
|
||||
// save to the quicksave slot before deleting the file
|
||||
if (!saveWorld(world, androidContext, SLOT_QUICKSAVE)) {
|
||||
// save to the quicksave slot before deleting the file
|
||||
if (!saveWorld(world, androidContext, SLOT_QUICKSAVE)) {
|
||||
return LoadSavegameResult.unknownError;
|
||||
}
|
||||
getSlotFile(slot, androidContext).delete();
|
||||
writeCheatCheck(androidContext, DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED, fh.playerId);
|
||||
}
|
||||
return result;
|
||||
} catch (IOException e) {
|
||||
} catch (IOException | DigestException e) {
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
|
||||
L.log("Error loading world: " + e.toString());
|
||||
StringWriter sw = new StringWriter();
|
||||
@@ -127,33 +129,33 @@ public final class Savegames {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean triedToCheat(Context androidContext, FileHeader fh) throws IOException {
|
||||
long savedVersionToCheck = 0;
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
ensureDirExists(cheatDetectionFolder);
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, fh.playerId);
|
||||
if (cheatDetectionFile.exists()) {
|
||||
FileInputStream fileInputStream = new FileInputStream(cheatDetectionFile);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
dataInputStream.close();
|
||||
fileInputStream.close();
|
||||
}
|
||||
private static boolean triedToCheat(Context androidContext, FileHeader fh) throws IOException {
|
||||
long savedVersionToCheck = 0;
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
ensureDirExists(cheatDetectionFolder);
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, fh.playerId);
|
||||
if (cheatDetectionFile.exists()) {
|
||||
FileInputStream fileInputStream = new FileInputStream(cheatDetectionFile);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
dataInputStream.close();
|
||||
fileInputStream.close();
|
||||
}
|
||||
|
||||
if (savedVersionToCheck == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (androidContext.getFileStreamPath(fh.playerId).exists()) {
|
||||
FileInputStream fileInputStream = androidContext.openFileInput(fh.playerId);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
if (cheatDetection.savedVersion == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED) {
|
||||
savedVersionToCheck = DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED;
|
||||
} else if (cheatDetection.savedVersion > savedVersionToCheck) {
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
}
|
||||
if (androidContext.getFileStreamPath(fh.playerId).exists()) {
|
||||
FileInputStream fileInputStream = androidContext.openFileInput(fh.playerId);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
if (cheatDetection.savedVersion == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED) {
|
||||
savedVersionToCheck = DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED;
|
||||
} else if (cheatDetection.savedVersion > savedVersionToCheck) {
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
}
|
||||
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
|
||||
L.log("Internal cheatcheck file savedVersion: " + cheatDetection.savedVersion);
|
||||
@@ -166,82 +168,98 @@ public final class Savegames {
|
||||
return (savedVersionToCheck == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED || fh.savedVersion < savedVersionToCheck);
|
||||
}
|
||||
|
||||
private static FileOutputStream getOutputFile(Context androidContext, int slot) throws IOException {
|
||||
if (slot == SLOT_QUICKSAVE) {
|
||||
return androidContext.openFileOutput(Constants.FILENAME_SAVEGAME_QUICKSAVE, Context.MODE_PRIVATE);
|
||||
} else {
|
||||
ensureSavegameDirectoryExists(androidContext);
|
||||
return new FileOutputStream(getSlotFile(slot, androidContext));
|
||||
}
|
||||
}
|
||||
private static FileOutputStream getOutputFile(Context androidContext, int slot) throws IOException {
|
||||
if (slot == SLOT_QUICKSAVE) {
|
||||
return androidContext.openFileOutput(Constants.FILENAME_SAVEGAME_QUICKSAVE, Context.MODE_PRIVATE);
|
||||
} else {
|
||||
ensureSavegameDirectoryExists(androidContext);
|
||||
return new FileOutputStream(getSlotFile(slot, androidContext));
|
||||
}
|
||||
}
|
||||
|
||||
private static void ensureSavegameDirectoryExists(Context context) {
|
||||
File dir = AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
ensureDirExists(dir);
|
||||
}
|
||||
private static void ensureSavegameDirectoryExists(Context context) {
|
||||
File dir = AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
ensureDirExists(dir);
|
||||
}
|
||||
|
||||
public static boolean ensureDirExists(File dir) {
|
||||
if (!dir.exists()) {
|
||||
boolean worked = dir.mkdir();
|
||||
return worked;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public static boolean ensureDirExists(File dir) {
|
||||
if (!dir.exists()) {
|
||||
boolean worked = dir.mkdir();
|
||||
return worked;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static FileInputStream getInputFile(Context androidContext, int slot) throws IOException {
|
||||
if (slot == SLOT_QUICKSAVE) {
|
||||
return androidContext.openFileInput(Constants.FILENAME_SAVEGAME_QUICKSAVE);
|
||||
} else {
|
||||
return new FileInputStream(getSlotFile(slot, androidContext));
|
||||
}
|
||||
}
|
||||
private static FileInputStream getInputFile(Context androidContext, int slot) throws IOException {
|
||||
if (slot == SLOT_QUICKSAVE) {
|
||||
return androidContext.openFileInput(Constants.FILENAME_SAVEGAME_QUICKSAVE);
|
||||
} else {
|
||||
return new FileInputStream(getSlotFile(slot, androidContext));
|
||||
}
|
||||
}
|
||||
|
||||
public static File getSlotFile(int slot, Context context) {
|
||||
File root = AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
return getSlotFile(slot, root);
|
||||
}
|
||||
public static File getSlotFile(int slot, Context context) {
|
||||
File root = AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
return getSlotFile(slot, root);
|
||||
}
|
||||
|
||||
public static File getSlotFile(int slot, File directory) {
|
||||
return new File(directory, getSlotFileName(slot));
|
||||
}
|
||||
public static File getSlotFile(int slot, File directory) {
|
||||
return new File(directory, getSlotFileName(slot));
|
||||
}
|
||||
|
||||
public static String getSlotFileName(int slot) {
|
||||
return Constants.FILENAME_SAVEGAME_FILENAME_PREFIX + slot;
|
||||
}
|
||||
public static String getSlotFileName(int slot) {
|
||||
return Constants.FILENAME_SAVEGAME_FILENAME_PREFIX + slot;
|
||||
}
|
||||
|
||||
|
||||
public static void saveWorld(WorldContext world, OutputStream outStream, String displayInfo) throws IOException {
|
||||
public static void saveWorld(WorldContext world, OutputStream outStream, String displayInfo) throws IOException, DigestException {
|
||||
DataOutputStream dest = new DataOutputStream(outStream);
|
||||
FileHeader.writeToParcel(dest, world.model.player.getName(),
|
||||
displayInfo, world.model.player.iconID,
|
||||
world.model.statistics.isDead(),
|
||||
world.model.statistics.hasUnlimitedSaves(),
|
||||
world.model.player.id,
|
||||
world.model.player.savedVersion);
|
||||
world.model.player.savedVersion,
|
||||
world.model.statistics.getIsAlteredSavegame());
|
||||
|
||||
byte[] checksum = world.getChecksum();
|
||||
world.model.statistics.setChecksum(checksum);
|
||||
|
||||
world.maps.writeToParcel(dest, world);
|
||||
world.model.writeToParcel(dest);
|
||||
dest.close();
|
||||
}
|
||||
|
||||
public static LoadSavegameResult loadWorld(Resources res, WorldContext world, ControllerContext controllers, InputStream inState, FileHeader fh) throws IOException {
|
||||
DataInputStream src = new DataInputStream(inState);
|
||||
final FileHeader header = new FileHeader(src, fh.skipIcon);
|
||||
if (header.fileversion > AndorsTrailApplication.CURRENT_VERSION)
|
||||
return LoadSavegameResult.savegameIsFromAFutureVersion;
|
||||
public static LoadSavegameResult loadWorld(Resources res, WorldContext world, ControllerContext controllers, Context androidContext, InputStream inState, FileHeader fh) throws IOException, DigestException {
|
||||
DataInputStream src = new DataInputStream(inState);
|
||||
final FileHeader header = new FileHeader(src, fh.skipIcon);
|
||||
if (header.fileversion > AndorsTrailApplication.CURRENT_VERSION)
|
||||
return LoadSavegameResult.savegameIsFromAFutureVersion;
|
||||
|
||||
world.maps.readFromParcel(src, world, controllers, header.fileversion);
|
||||
world.model = new ModelContainer(src, world, controllers, header.fileversion);
|
||||
src.close();
|
||||
|
||||
if (header.fileversion >= 81) {
|
||||
checkChecksum(world);
|
||||
}
|
||||
WorldMapController.populateWorldMap(androidContext, world, controllers.getResources());
|
||||
|
||||
if (header.fileversion < 45) {
|
||||
LegacySavegamesContentAdaptations.adaptToNewContentForVersion45(world, controllers, res);
|
||||
}
|
||||
|
||||
|
||||
onWorldLoaded(res, world, controllers);
|
||||
|
||||
return LoadSavegameResult.success;
|
||||
}
|
||||
|
||||
private static void checkChecksum(WorldContext world) throws DigestException {
|
||||
byte[] checksum = world.getChecksum();
|
||||
if (!world.model.statistics.compareChecksum(checksum)) {
|
||||
world.model.statistics.markAsAlteredSavegame();
|
||||
}
|
||||
}
|
||||
|
||||
private static void onWorldLoaded(Resources res, WorldContext world, ControllerContext controllers) {
|
||||
controllers.actorStatsController.recalculatePlayerStats(world.model.player);
|
||||
controllers.mapController.resetMapsNotRecentlyVisited();
|
||||
@@ -266,15 +284,15 @@ public final class Savegames {
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeCheatCheck(Context androidContext, long savedVersion, String playerId) throws IOException {
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
ensureDirExists(cheatDetectionFolder);
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, playerId);
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(cheatDetectionFile);
|
||||
DataOutputStream dataOutputStream = new DataOutputStream(fileOutputStream);
|
||||
CheatDetection.writeToParcel(dataOutputStream, savedVersion);
|
||||
dataOutputStream.close();
|
||||
fileOutputStream.close();
|
||||
private static void writeCheatCheck(Context androidContext, long savedVersion, String playerId) throws IOException {
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
ensureDirExists(cheatDetectionFolder);
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, playerId);
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(cheatDetectionFile);
|
||||
DataOutputStream dataOutputStream = new DataOutputStream(fileOutputStream);
|
||||
CheatDetection.writeToParcel(dataOutputStream, savedVersion);
|
||||
dataOutputStream.close();
|
||||
fileOutputStream.close();
|
||||
|
||||
fileOutputStream = androidContext.openFileOutput(playerId, Context.MODE_PRIVATE);
|
||||
dataOutputStream = new DataOutputStream(fileOutputStream);
|
||||
@@ -285,26 +303,26 @@ public final class Savegames {
|
||||
|
||||
private static final Pattern savegameFilenamePattern = Pattern.compile(Constants.FILENAME_SAVEGAME_FILENAME_PREFIX + "(\\d+)");
|
||||
|
||||
public static List<Integer> getUsedSavegameSlots(Context context) {
|
||||
try {
|
||||
final List<Integer> result = new ArrayList<Integer>();
|
||||
AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY).listFiles(new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File f, String filename) {
|
||||
Matcher m = savegameFilenamePattern.matcher(filename);
|
||||
if (m != null && m.matches()) {
|
||||
result.add(Integer.parseInt(m.group(1)));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Collections.sort(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
return new ArrayList<Integer>();
|
||||
}
|
||||
}
|
||||
public static List<Integer> getUsedSavegameSlots(Context context) {
|
||||
try {
|
||||
final List<Integer> result = new ArrayList<Integer>();
|
||||
AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY).listFiles(new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File f, String filename) {
|
||||
Matcher m = savegameFilenamePattern.matcher(filename);
|
||||
if (m != null && m.matches()) {
|
||||
result.add(Integer.parseInt(m.group(1)));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Collections.sort(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
return new ArrayList<Integer>();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class CheatDetection {
|
||||
public final int fileversion;
|
||||
@@ -324,16 +342,17 @@ public final class Savegames {
|
||||
}
|
||||
|
||||
|
||||
public static final class FileHeader {
|
||||
public final int fileversion;
|
||||
public final String playerName;
|
||||
public final String displayInfo;
|
||||
public final int iconID;
|
||||
public boolean skipIcon = false;
|
||||
public final boolean isDead;
|
||||
public final boolean hasUnlimitedSaves;
|
||||
public final String playerId;
|
||||
public final long savedVersion;
|
||||
public static final class FileHeader {
|
||||
public final int fileversion;
|
||||
public final String playerName;
|
||||
public final String displayInfo;
|
||||
public final int iconID;
|
||||
public final boolean isAlteredSavegame;
|
||||
public boolean skipIcon = false;
|
||||
public final boolean isDead;
|
||||
public final boolean hasUnlimitedSaves;
|
||||
public final String playerId;
|
||||
public final long savedVersion;
|
||||
|
||||
public String describe() {
|
||||
return (fileversion == AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION ? "(D) " : "") + playerName + ", " + displayInfo;
|
||||
@@ -342,18 +361,18 @@ public final class Savegames {
|
||||
|
||||
// ====== PARCELABLE ===================================================================
|
||||
|
||||
public FileHeader(DataInputStream src, boolean skipIcon) throws IOException {
|
||||
int fileversion = src.readInt();
|
||||
if (fileversion == 11)
|
||||
fileversion = 5; // Fileversion 5 had no version identifier, but the first byte was 11.
|
||||
this.fileversion = fileversion;
|
||||
if (fileversion >= 14) { // Before fileversion 14 (0.6.7), we had no file header.
|
||||
this.playerName = src.readUTF();
|
||||
this.displayInfo = src.readUTF();
|
||||
} else {
|
||||
this.playerName = null;
|
||||
this.displayInfo = null;
|
||||
}
|
||||
public FileHeader(DataInputStream src, boolean skipIcon) throws IOException {
|
||||
int fileversion = src.readInt();
|
||||
if (fileversion == 11)
|
||||
fileversion = 5; // Fileversion 5 had no version identifier, but the first byte was 11.
|
||||
this.fileversion = fileversion;
|
||||
if (fileversion >= 14) { // Before fileversion 14 (0.6.7), we had no file header.
|
||||
this.playerName = src.readUTF();
|
||||
this.displayInfo = src.readUTF();
|
||||
} else {
|
||||
this.playerName = null;
|
||||
this.displayInfo = null;
|
||||
}
|
||||
|
||||
if (fileversion >= 43) {
|
||||
int id = src.readInt();
|
||||
@@ -378,9 +397,14 @@ public final class Savegames {
|
||||
this.playerId = "";
|
||||
this.savedVersion = 0;
|
||||
}
|
||||
if(fileversion >= 81){
|
||||
this.isAlteredSavegame = src.readBoolean();
|
||||
}else{
|
||||
this.isAlteredSavegame = false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeToParcel(DataOutputStream dest, String playerName, String displayInfo, int iconID, boolean isDead, boolean hasUnlimitedSaves, String playerId, long savedVersion) throws IOException {
|
||||
public static void writeToParcel(DataOutputStream dest, String playerName, String displayInfo, int iconID, boolean isDead, boolean hasUnlimitedSaves, String playerId, long savedVersion, boolean isAlteredSavegame) throws IOException {
|
||||
dest.writeInt(AndorsTrailApplication.CURRENT_VERSION);
|
||||
dest.writeUTF(playerName);
|
||||
dest.writeUTF(displayInfo);
|
||||
@@ -389,6 +413,7 @@ public final class Savegames {
|
||||
dest.writeBoolean(hasUnlimitedSaves);
|
||||
dest.writeUTF(playerId);
|
||||
dest.writeLong(savedVersion);
|
||||
dest.writeBoolean(isAlteredSavegame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gpl.rpg.AndorsTrail.util;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -47,4 +49,9 @@ public final class Coord {
|
||||
dest.writeInt(x);
|
||||
dest.writeInt(y);
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(x);
|
||||
builder.add(y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gpl.rpg.AndorsTrail.util;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.model.ChecksumBuilder;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -99,4 +101,9 @@ public final class Range {
|
||||
dest.writeInt(max);
|
||||
dest.writeInt(current);
|
||||
}
|
||||
|
||||
public void addToChecksum(ChecksumBuilder builder) {
|
||||
builder.add(max);
|
||||
builder.add(current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,6 +292,8 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
}
|
||||
if (condition.duration == ActorCondition.DURATION_FOREVER || condition.duration == ActorCondition.DURATION_NONE) {
|
||||
duration = "\u221e";
|
||||
} else if (condition.duration == ActorCondition.DURATION_FOREVER_UNTIL_SLEEP) {
|
||||
duration = "";
|
||||
} else {
|
||||
duration = Integer.toString(condition.duration);
|
||||
}
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user