mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Compare commits
631 Commits
feature/st
...
v0.80.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd2a0f97eb | ||
|
|
eaf74f11d1 | ||
|
|
64a6fc9b03 | ||
|
|
8e6bc1651e | ||
|
|
fde83f0838 | ||
|
|
c67d8ba795 | ||
|
|
08d47feb97 | ||
|
|
4c2ea93624 | ||
|
|
d430df07f7 | ||
|
|
3f0dfe7f73 | ||
|
|
95ef1853b6 | ||
|
|
2e456a6bc0 | ||
|
|
50de6b4866 | ||
|
|
191519932e | ||
|
|
cb11afd777 | ||
|
|
3ef6af58da | ||
|
|
8a1d092af5 | ||
|
|
90708000f5 | ||
|
|
45295d4b49 | ||
|
|
59d40eb56c | ||
|
|
18a579947f | ||
|
|
c74c99d3e3 | ||
|
|
cfd7e5575b | ||
|
|
74445de12b | ||
|
|
8361162959 | ||
|
|
8ec32eb6bb | ||
|
|
9bbd1d28b1 | ||
|
|
3d1ca2eed9 | ||
|
|
4cff5774d2 | ||
|
|
d9c0c84efa | ||
|
|
a323f2ef84 | ||
|
|
987d76b53d | ||
|
|
2776b4caa4 | ||
|
|
d90a365fa5 | ||
|
|
0c9fe010b1 | ||
|
|
af7e9150bb | ||
|
|
fb0907a1a4 | ||
|
|
7522737d90 | ||
|
|
ec5f07b372 | ||
|
|
a015e8722e | ||
|
|
8cf3b519e7 | ||
|
|
d56bf7739b | ||
|
|
084cc1a073 | ||
|
|
9125d99ec1 | ||
|
|
d9f602ee91 | ||
|
|
d518d55897 | ||
|
|
01e96ebcb9 | ||
|
|
cb69facebf | ||
|
|
c9b942635a | ||
|
|
7857e3a195 | ||
|
|
e0cfb24f1b | ||
|
|
24622eb548 | ||
|
|
66577acd1f | ||
|
|
f3364a196c | ||
|
|
504f3f16d8 | ||
|
|
0a2735a60d | ||
|
|
6c4b71e06b | ||
|
|
360db24f0a | ||
|
|
e0878096f4 | ||
|
|
f73babd869 | ||
|
|
61e193466c | ||
|
|
6836816649 | ||
|
|
054a908efd | ||
|
|
ace8500240 | ||
|
|
d8d68480c3 | ||
|
|
5284f3c2fb | ||
|
|
5c1d753a8d | ||
|
|
27e0c22fe2 | ||
|
|
b9f7733c67 | ||
|
|
b09ddf986c | ||
|
|
589d56fe67 | ||
|
|
fdbb85dfe0 | ||
|
|
d33076b782 | ||
|
|
91f5cfdf35 | ||
|
|
037f702097 | ||
|
|
e5dde1c7ad | ||
|
|
272c3f8e84 | ||
|
|
9c831b3bda | ||
|
|
9573e4e6c7 | ||
|
|
3330870a43 | ||
|
|
1c86d2a6ea | ||
|
|
5ec72082bb | ||
|
|
ce4a0eb8bb | ||
|
|
fdfe0949ab | ||
|
|
bafbdb6363 | ||
|
|
a0b067a062 | ||
|
|
ef0c0d0082 | ||
|
|
3393658953 | ||
|
|
78a75daea2 | ||
|
|
1bbfd6b38f | ||
|
|
20bbe30a23 | ||
|
|
8c5e790cb5 | ||
|
|
ddbd34aee2 | ||
|
|
7e2a05ab65 | ||
|
|
e3108d22ac | ||
|
|
4f7f43e193 | ||
|
|
84733a335c | ||
|
|
2aafb21772 | ||
|
|
20c8eca6bf | ||
|
|
be72dd4107 | ||
|
|
187c158e6b | ||
|
|
53fb9d01e0 | ||
|
|
bcf825d112 | ||
|
|
ab07c75966 | ||
|
|
b5747f7003 | ||
|
|
44da2fe738 | ||
|
|
2995baca6f | ||
|
|
a86a539c15 | ||
|
|
de486207b3 | ||
|
|
d1eb70da07 | ||
|
|
52588bee92 | ||
|
|
ec26ef1e42 | ||
|
|
67381c369c | ||
|
|
b05b9949e6 | ||
|
|
89ac6f0a43 | ||
|
|
3bcd53d7c5 | ||
|
|
248e9240c1 | ||
|
|
e64d499000 | ||
|
|
5f03465879 | ||
|
|
2a7920adaf | ||
|
|
a16731c957 | ||
|
|
0688cd0202 | ||
|
|
0c5b43d5af | ||
|
|
8e70afd235 | ||
|
|
7623c8357b | ||
|
|
2e7dce5f08 | ||
|
|
2b03a2c550 | ||
|
|
b39adf0095 | ||
|
|
3c168f5a31 | ||
|
|
fef963e77a | ||
|
|
b39f92f1fa | ||
|
|
f6d4389f52 | ||
|
|
23233c59df | ||
|
|
a243c4c795 | ||
|
|
349438358c | ||
|
|
9a844ae413 | ||
|
|
6b076645db | ||
|
|
445a3aa8fb | ||
|
|
ca83543f9e | ||
|
|
9b42527de3 | ||
|
|
f98d8707c9 | ||
|
|
55fd79eb36 | ||
|
|
509aca8c03 | ||
|
|
1e2756e4f7 | ||
|
|
7175f49fa6 | ||
|
|
31c4a331ab | ||
|
|
e71cab167b | ||
|
|
c2de890441 | ||
|
|
6fe3d7cff5 | ||
|
|
f51b7bbd99 | ||
|
|
a3e9dea8d8 | ||
|
|
6db41a05c2 | ||
|
|
ea2aab739f | ||
|
|
17a623222d | ||
|
|
55d2c4a066 | ||
|
|
db1e85e69d | ||
|
|
22fe99ac99 | ||
|
|
be46a97849 | ||
|
|
9307298313 | ||
|
|
a12233ea4a | ||
|
|
3f86f5f5dd | ||
|
|
342d9ed2cd | ||
|
|
36f781d05b | ||
|
|
1799ecaa68 | ||
|
|
f573143e29 | ||
|
|
5e08ef69aa | ||
|
|
5d2cfcff66 | ||
|
|
e112938998 | ||
|
|
5aa8aa120c | ||
|
|
dd2697fbe5 | ||
|
|
fa94ef0df2 | ||
|
|
af7d8c4601 | ||
|
|
c0f384ac96 | ||
|
|
6c1f8a86d7 | ||
|
|
5cdae85e9f | ||
|
|
89331f6948 | ||
|
|
cf6f52c1fa | ||
|
|
86ffed9afb | ||
|
|
cb29e6e19d | ||
|
|
5fed38fecd | ||
|
|
ada056dcdf | ||
|
|
3a05a82934 | ||
|
|
e6f2d36d50 | ||
|
|
f856ac0efa | ||
|
|
c34cbcdfa7 | ||
|
|
b791a5e815 | ||
|
|
be8147a722 | ||
|
|
c5ebe2c252 | ||
|
|
e418ab96b9 | ||
|
|
025fa95854 | ||
|
|
32bdc152d7 | ||
|
|
fef46f7856 | ||
|
|
11492ff62f | ||
|
|
b7d460cee6 | ||
|
|
c62d0ecfd0 | ||
|
|
1dfa6587b1 | ||
|
|
78bea7312e | ||
|
|
03363296db | ||
|
|
7e9f3dd5e6 | ||
|
|
54a29a030e | ||
|
|
733097c1f4 | ||
|
|
187d8865db | ||
|
|
9841b74936 | ||
|
|
d5faceca21 | ||
|
|
5b62ddeca4 | ||
|
|
8a4f186fd5 | ||
|
|
b14d461e9b | ||
|
|
3bfb23f35d | ||
|
|
846cc3fa48 | ||
|
|
01673fb155 | ||
|
|
15d30eacd0 | ||
|
|
615b1ae2af | ||
|
|
85f99e6303 | ||
|
|
5e3a5a0d0c | ||
|
|
8dfc779611 | ||
|
|
3ba7238076 | ||
|
|
7b59fbd3ef | ||
|
|
d87963206c | ||
|
|
9dd13245ef | ||
|
|
1c3905a8f4 | ||
|
|
762cd786ea | ||
|
|
120c90862b | ||
|
|
4e0deb2e42 | ||
|
|
6bc831eb05 | ||
|
|
e0be355707 | ||
|
|
ec3485e741 | ||
|
|
fb0ed471a0 | ||
|
|
509ba2ec4b | ||
|
|
8121c3c41b | ||
|
|
4a003eaec0 | ||
|
|
47f7b73ea0 | ||
|
|
8a898adaa2 | ||
|
|
031dceeb48 | ||
|
|
bf6928703f | ||
|
|
75288ba5e7 | ||
|
|
96938ca85a | ||
|
|
a60011d612 | ||
|
|
60e0c0b804 | ||
|
|
a0c23c7fee | ||
|
|
46183aa41a | ||
|
|
3f175a8d2a | ||
|
|
fac1b2c469 | ||
|
|
bb137d69a2 | ||
|
|
1723be3d5b | ||
|
|
a35632d89e | ||
|
|
f956ad2008 | ||
|
|
1646297039 | ||
|
|
c26c8fb81e | ||
|
|
38f2808816 | ||
|
|
7994935b23 | ||
|
|
7120000ef5 | ||
|
|
7c3fd3eaa9 | ||
|
|
8bd47cd7f8 | ||
|
|
1068458beb | ||
|
|
54db524e53 | ||
|
|
9265af75bf | ||
|
|
037bff9099 | ||
|
|
6de1b41d9c | ||
|
|
0ab9f34046 | ||
|
|
2746dccfc6 | ||
|
|
eae54d0327 | ||
|
|
c1195d1f1d | ||
|
|
5a02c5c03f | ||
|
|
d9c59164f2 | ||
|
|
72a952fbdd | ||
|
|
45e58c1ed8 | ||
|
|
127d1d7eaf | ||
|
|
18c9c6bf0a | ||
|
|
89ec06468f | ||
|
|
9920e409ca | ||
|
|
f1681b2128 | ||
|
|
490a4efff8 | ||
|
|
a416eedff0 | ||
|
|
2fe0c94d84 | ||
|
|
2f22de4eff | ||
|
|
2017d943fb | ||
|
|
e34935c9e2 | ||
|
|
db95c6284b | ||
|
|
6255ee6e96 | ||
|
|
d1b16d9a52 | ||
|
|
708b3b2acf | ||
|
|
2e471366b7 | ||
|
|
ca9ce7c7ed | ||
|
|
81cd43f988 | ||
|
|
cf5c72e7ea | ||
|
|
2629fd3efb | ||
|
|
338fcd5fcb | ||
|
|
b5395c0bc0 | ||
|
|
97bdc1edee | ||
|
|
8a0464ed35 | ||
|
|
31d68dcd49 | ||
|
|
3b337bf88d | ||
|
|
f3e0706488 | ||
|
|
3378f1ff98 | ||
|
|
f160508da3 | ||
|
|
1ba5c9120f | ||
|
|
701606c75a | ||
|
|
efa0fa3f1b | ||
|
|
63b9b56006 | ||
|
|
4b082baf37 | ||
|
|
698d65c5af | ||
|
|
c9dd27658e | ||
|
|
266223c3fd | ||
|
|
521e4746c6 | ||
|
|
72efbe543c | ||
|
|
b69ccc2241 | ||
|
|
656992ae5f | ||
|
|
947f04ebb9 | ||
|
|
603b88c77a | ||
|
|
108e270f9e | ||
|
|
d3edd10714 | ||
|
|
125d138e16 | ||
|
|
f5c210b990 | ||
|
|
4521dc37f5 | ||
|
|
adcdb9f736 | ||
|
|
2116230f58 | ||
|
|
dd0d186314 | ||
|
|
329e2b0cdc | ||
|
|
a562675553 | ||
|
|
89a1d32e1d | ||
|
|
05fb110f40 | ||
|
|
c6896e9bd9 | ||
|
|
2678fad629 | ||
|
|
7d0e9f9635 | ||
|
|
7a5df9a718 | ||
|
|
856fbd0480 | ||
|
|
828ac48f7c | ||
|
|
d0e11a755c | ||
|
|
b637967163 | ||
|
|
50dce4d56b | ||
|
|
e9af594448 | ||
|
|
b5662007d5 | ||
|
|
03acded657 | ||
|
|
6b0e2deede | ||
|
|
ffe1689be6 | ||
|
|
2f3f7976f1 | ||
|
|
df7933b890 | ||
|
|
5778ca87e7 | ||
|
|
af8a21df53 | ||
|
|
cd02dddd5d | ||
|
|
e44805cd20 | ||
|
|
635387a23e | ||
|
|
2b594f6356 | ||
|
|
cec14ae861 | ||
|
|
a12a973a26 | ||
|
|
45a315bb69 | ||
|
|
1e843bf3a2 | ||
|
|
26c85725a5 | ||
|
|
467d391ec8 | ||
|
|
601feb7cc0 | ||
|
|
cd1466cdc0 | ||
|
|
94aeb309b2 | ||
|
|
3fba59eb6c | ||
|
|
508754f4bc | ||
|
|
3f4ae0f02a | ||
|
|
b0daf64d94 | ||
|
|
c4223f015d | ||
|
|
33ebb99b9c | ||
|
|
dad176aca1 | ||
|
|
cac1f3e018 | ||
|
|
49dfb2d2f1 | ||
|
|
4e0821c6c1 | ||
|
|
39800d57d1 | ||
|
|
52b9729bb8 | ||
|
|
5a49ce1812 | ||
|
|
c3d27fb338 | ||
|
|
07378f4503 | ||
|
|
ae2f3fe70c | ||
|
|
6edd5d8a63 | ||
|
|
08c6e52806 | ||
|
|
f13a066bdd | ||
|
|
c478ef3a4b | ||
|
|
1d3bf8d072 | ||
|
|
12f40d951d | ||
|
|
c98e409ad8 | ||
|
|
ef6efd3c68 | ||
|
|
c4b0534240 | ||
|
|
ff0dbecbee | ||
|
|
b0d59e5e3f | ||
|
|
e3d29ae28f | ||
|
|
9aebaa3749 | ||
|
|
2bae6abbc0 | ||
|
|
880160e7af | ||
|
|
801b513cde | ||
|
|
bd284cc945 | ||
|
|
c481b50a8b | ||
|
|
c889c2b2aa | ||
|
|
60c150269e | ||
|
|
8dffeef261 | ||
|
|
6943693d3f | ||
|
|
964ab60020 | ||
|
|
8fad4d291f | ||
|
|
d3adcb83db | ||
|
|
3c046b5f6f | ||
|
|
dd567a4cc8 | ||
|
|
fe78883a93 | ||
|
|
1d0c9e9512 | ||
|
|
1a61f1925c | ||
|
|
18567c7051 | ||
|
|
4932487859 | ||
|
|
506f0b0a1e | ||
|
|
ae2e6bca82 | ||
|
|
0b19d04c1c | ||
|
|
8344e8ba10 | ||
|
|
5dd1b58357 | ||
|
|
537e1ab4f9 | ||
|
|
7247171b4b | ||
|
|
155a35ab06 | ||
|
|
3c50db8b5e | ||
|
|
78ba02432e | ||
|
|
32f8b6f4b8 | ||
|
|
97d52393ed | ||
|
|
576abe7adb | ||
|
|
d404494018 | ||
|
|
80e390a74b | ||
|
|
cf912d8c07 | ||
|
|
ae8a7481bc | ||
|
|
dbcb9bde3d | ||
|
|
6dc06e7690 | ||
|
|
f2cbfbf705 | ||
|
|
ca79d1fc13 | ||
|
|
2bcfca3d78 | ||
|
|
74c86bf08c | ||
|
|
b8397a1a27 | ||
|
|
4c2da94a58 | ||
|
|
42c6b9976a | ||
|
|
cd40916df0 | ||
|
|
95525a549a | ||
|
|
07c5c0ca0e | ||
|
|
c8e36eadf7 | ||
|
|
b3df54d2bb | ||
|
|
007bfe4447 | ||
|
|
ea1691c7f5 | ||
|
|
f82e3e8432 | ||
|
|
59d8cb37f0 | ||
|
|
cf52985eaf | ||
|
|
aa412c2b47 | ||
|
|
917280b4d7 | ||
|
|
51c6ff934e | ||
|
|
e534fcd800 | ||
|
|
6105be4b14 | ||
|
|
205147c0f0 | ||
|
|
f6d722f7c3 | ||
|
|
d1c1bffc4f | ||
|
|
54316b7255 | ||
|
|
2d7cd49dbc | ||
|
|
5832cb3866 | ||
|
|
818ea1a629 | ||
|
|
58c0f7796b | ||
|
|
55217c982d | ||
|
|
036951ae62 | ||
|
|
ebaa8d9ac3 | ||
|
|
e222f82059 | ||
|
|
d867661c24 | ||
|
|
ac7c44ab2e | ||
|
|
b861182846 | ||
|
|
1f3e42b013 | ||
|
|
7b0c4dd7fb | ||
|
|
2898e1413b | ||
|
|
ba3525c0c0 | ||
|
|
5ff11980b7 | ||
|
|
29274986f8 | ||
|
|
57d862f9fc | ||
|
|
31da2557d5 | ||
|
|
9752996497 | ||
|
|
7c7c8d23fb | ||
|
|
e1dc83a573 | ||
|
|
520461ff95 | ||
|
|
7c2a010c71 | ||
|
|
c17faedccf | ||
|
|
36495fe81b | ||
|
|
9e3851b847 | ||
|
|
582e705088 | ||
|
|
cf893c3c32 | ||
|
|
3a5cc20a88 | ||
|
|
cb209df0e5 | ||
|
|
eb64f55ce5 | ||
|
|
00ab9c6474 | ||
|
|
26eaa38e89 | ||
|
|
42bc16d4c9 | ||
|
|
498ce86176 | ||
|
|
3104678140 | ||
|
|
c63984eaca | ||
|
|
078b81d495 | ||
|
|
4c341f0289 | ||
|
|
bb4461587e | ||
|
|
fe45af151a | ||
|
|
ae2b0e9d8f | ||
|
|
ddf4828bf9 | ||
|
|
b1d0dbf03c | ||
|
|
a91b134c5d | ||
|
|
660b0b05d3 | ||
|
|
e14493246e | ||
|
|
d93a35b620 | ||
|
|
2e12a712fa | ||
|
|
29a84a6621 | ||
|
|
51f00d4b3b | ||
|
|
a67b22cce8 | ||
|
|
cfbfdbf420 | ||
|
|
a76d053818 | ||
|
|
1587ee3c93 | ||
|
|
662808d0d3 | ||
|
|
9d88857b55 | ||
|
|
3c92794aed | ||
|
|
527879c048 | ||
|
|
d2494bcdc7 | ||
|
|
486aa1423b | ||
|
|
20659789b0 | ||
|
|
d87d6f7f8c | ||
|
|
fa5fdcb5a5 | ||
|
|
e6af084c22 | ||
|
|
de01b9d8cb | ||
|
|
c9aa2c61bd | ||
|
|
8200f1d942 | ||
|
|
1af0ebca6c | ||
|
|
fe5957bb91 | ||
|
|
be08f1787f | ||
|
|
ea35e6c03f | ||
|
|
a6c6b22393 | ||
|
|
5e6e5cb5ea | ||
|
|
64d2a3ca28 | ||
|
|
bee4e499a8 | ||
|
|
55da2dc5e5 | ||
|
|
177eca0f90 | ||
|
|
ae229a03d8 | ||
|
|
2dc8093660 | ||
|
|
071acbc818 | ||
|
|
3f5982cac0 | ||
|
|
6f387402fe | ||
|
|
363e28561c | ||
|
|
4d63b54259 | ||
|
|
7fa05c7db3 | ||
|
|
c466f5f17f | ||
|
|
b6f302b71e | ||
|
|
7d9db6f7b2 | ||
|
|
8bedba2da7 | ||
|
|
837dde78c9 | ||
|
|
a01629969d | ||
|
|
15e13c7f92 | ||
|
|
3dd80b90eb | ||
|
|
cb8e295ad9 | ||
|
|
909163a923 | ||
|
|
6aa2408364 | ||
|
|
afc1eed7ae | ||
|
|
85c8dc05fe | ||
|
|
710371d7d1 | ||
|
|
9f651646d7 | ||
|
|
d2860c80a9 | ||
|
|
e1b9ae22b6 | ||
|
|
5d64f35c96 | ||
|
|
5cfea0cd97 | ||
|
|
a165556bf5 | ||
|
|
dee2881203 | ||
|
|
da0891a5f4 | ||
|
|
1ed9796700 | ||
|
|
578a967a31 | ||
|
|
14c0c58e87 | ||
|
|
766d909a08 | ||
|
|
9c50a217da | ||
|
|
4f9db0cdb7 | ||
|
|
3c19937750 | ||
|
|
c509764014 | ||
|
|
75e06e4060 | ||
|
|
1b909f71a1 | ||
|
|
1a8764f54b | ||
|
|
9152c97de7 | ||
|
|
45cb04f928 | ||
|
|
a700750d9e | ||
|
|
07d327eb8b | ||
|
|
2275ec9573 | ||
|
|
5848b449f6 | ||
|
|
67aa32e694 | ||
|
|
dbd2961b9f | ||
|
|
b77b49c667 | ||
|
|
0eabe62bdb | ||
|
|
31e2ea2770 | ||
|
|
7a636b3b87 | ||
|
|
98ce017b4a | ||
|
|
26b04f0d66 | ||
|
|
f4f2dea688 | ||
|
|
e9a0f9a4c1 | ||
|
|
de438ae94c | ||
|
|
9ec77f20ee | ||
|
|
da01040b52 | ||
|
|
dce2a5ddb2 | ||
|
|
5c99fbabf2 | ||
|
|
9d0846c0e9 | ||
|
|
035ecfb098 | ||
|
|
3693f5aee7 | ||
|
|
b859815b07 | ||
|
|
3701ca83e4 | ||
|
|
1473f1d34c | ||
|
|
889c140fb9 | ||
|
|
c8259915f8 | ||
|
|
a2a25fb296 | ||
|
|
938a9929ea | ||
|
|
7726075b9b | ||
|
|
03b3d1bbe7 | ||
|
|
17ec51b74c | ||
|
|
e92998d1ec | ||
|
|
6691512136 | ||
|
|
a80f4ad76c | ||
|
|
2c6f4cd80c | ||
|
|
51a4c6dcf2 | ||
|
|
1f402e581a | ||
|
|
17ea92bfda | ||
|
|
6a8266af7e | ||
|
|
f6b7606648 | ||
|
|
9cd8adae93 | ||
|
|
c5ba8b75c8 | ||
|
|
3d73cc7289 | ||
|
|
11aa062ee0 | ||
|
|
b4358a9e33 | ||
|
|
0cce4714a1 | ||
|
|
9c4e6a6595 | ||
|
|
1ddd541fe9 | ||
|
|
e45aa3f2fe | ||
|
|
99efdb6061 | ||
|
|
32f0ffdc79 | ||
|
|
cf166483c9 | ||
|
|
49631867f4 | ||
|
|
9f56eaec9a | ||
|
|
04f2b732a5 | ||
|
|
b8cfabc339 | ||
|
|
1cdd39202f | ||
|
|
3290720b4c | ||
|
|
49badb06cb | ||
|
|
2c6941e73b | ||
|
|
5e5883cb88 | ||
|
|
02c504445e | ||
|
|
4d5075a792 |
30
.github/workflows/benchmarks.yml
vendored
30
.github/workflows/benchmarks.yml
vendored
@@ -9,14 +9,6 @@ on:
|
||||
|
||||
concurrency: benchmarks
|
||||
|
||||
env:
|
||||
ROBUST_BENCHMARKS_ENABLE_SQL: 1
|
||||
ROBUST_BENCHMARKS_SQL_ADDRESS: ${{ secrets.BENCHMARKS_WRITE_ADDRESS }}
|
||||
ROBUST_BENCHMARKS_SQL_PORT: ${{ secrets.BENCHMARKS_WRITE_PORT }}
|
||||
ROBUST_BENCHMARKS_SQL_USER: ${{ secrets.BENCHMARKS_WRITE_USER }}
|
||||
ROBUST_BENCHMARKS_SQL_PASSWORD: ${{ secrets.BENCHMARKS_WRITE_PASSWORD }}
|
||||
ROBUST_BENCHMARKS_SQL_DATABASE: benchmarks
|
||||
|
||||
jobs:
|
||||
benchmark:
|
||||
name: Run Benchmarks
|
||||
@@ -28,8 +20,22 @@ jobs:
|
||||
host: centcomm.spacestation14.io
|
||||
username: robust-benchmark-runner
|
||||
key: ${{ secrets.CENTCOMM_ROBUST_BENCHMARK_RUNNER_KEY }}
|
||||
command_timeout: 100000m
|
||||
command_timeout: 100000m
|
||||
script: |
|
||||
wget https://raw.githubusercontent.com/space-wizards/RobustToolbox/${{ github.sha }}/Tools/run_benchmarks.py
|
||||
python3 run_benchmarks.py "${{ secrets.BENCHMARKS_WRITE_ADDRESS }}" "${{ secrets.BENCHMARKS_WRITE_PORT }}" "${{ secrets.BENCHMARKS_WRITE_USER }}" "${{ secrets.BENCHMARKS_WRITE_PASSWORD }}" "${{ github.sha }}"
|
||||
rm run_benchmarks.py
|
||||
mkdir benchmark_run_${{ github.sha }}
|
||||
cd benchmark_run_${{ github.sha }}
|
||||
git clone https://github.com/space-wizards/RobustToolbox.git repo_dir --recursive
|
||||
cd repo_dir
|
||||
git checkout ${{ github.sha }}
|
||||
cd Robust.Benchmarks
|
||||
dotnet restore
|
||||
export ROBUST_BENCHMARKS_ENABLE_SQL=1
|
||||
export ROBUST_BENCHMARKS_SQL_ADDRESS="${{ secrets.BENCHMARKS_WRITE_ADDRESS }}"
|
||||
export ROBUST_BENCHMARKS_SQL_PORT="${{ secrets.BENCHMARKS_WRITE_PORT }}"
|
||||
export ROBUST_BENCHMARKS_SQL_USER="${{ secrets.BENCHMARKS_WRITE_USER }}"
|
||||
export ROBUST_BENCHMARKS_SQL_PASSWORD="${{ secrets.BENCHMARKS_WRITE_PASSWORD }}"
|
||||
export ROBUST_BENCHMARKS_SQL_DATABASE="benchmarks"
|
||||
export GITHUB_SHA="${{ github.sha }}"
|
||||
dotnet run --filter '*' --configuration Release
|
||||
cd ../../..
|
||||
rm -rf benchmark_run_${{ github.sha }}
|
||||
|
||||
16
.github/workflows/build-docfx.yml
vendored
16
.github/workflows/build-docfx.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
jobs:
|
||||
docfx:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
@@ -14,21 +14,21 @@ jobs:
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
|
||||
dotnet-version: 7.0.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
|
||||
|
||||
- name: Build Project
|
||||
run: dotnet build --no-restore /p:WarningsAsErrors=nullable
|
||||
|
||||
- name: Build DocFX
|
||||
uses: nikeee/docfx-action@v1.0.0
|
||||
uses: nikeee/docfx-action@v1.0.0
|
||||
with:
|
||||
args: Robust.Docfx/docfx.json
|
||||
|
||||
|
||||
- name: Publish Docfx Documentation on GitHub Pages
|
||||
uses: maxheld83/ghpages@master
|
||||
env:
|
||||
BUILD_DIR: Robust.Docfx/_robust-site
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
BUILD_DIR: Robust.Docfx/_robust-site
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
|
||||
4
.github/workflows/build-test.yml
vendored
4
.github/workflows/build-test.yml
vendored
@@ -22,12 +22,12 @@ jobs:
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 7.0.x
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --no-restore /p:WarningsAsErrors=nullable
|
||||
- name: Test Engine
|
||||
run: dotnet test --no-build Robust.UnitTesting/Robust.UnitTesting.csproj -- NUnit.ConsoleOut=0
|
||||
|
||||
|
||||
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 6.0.100
|
||||
dotnet-version: 7.0.x
|
||||
|
||||
- name: Build
|
||||
run: dotnet build
|
||||
|
||||
2
.github/workflows/publish-client.yml
vendored
2
.github/workflows/publish-client.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 6.0.100
|
||||
dotnet-version: 7.0.x
|
||||
|
||||
- name: Package client
|
||||
run: Tools/package_client_build.py -p windows mac linux
|
||||
|
||||
2
.github/workflows/test-content.yml
vendored
2
.github/workflows/test-content.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
- name: Setup .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 6.0.100
|
||||
dotnet-version: 7.0.x
|
||||
- name: Disable submodule autoupdate
|
||||
run: touch BuildChecker/DISABLE_SUBMODULE_AUTOUPDATE
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\MSBuild\Robust.Properties.targets" />
|
||||
</Project>
|
||||
|
||||
Submodule Lidgren.Network/Lidgren.Network updated: 1e7fb3c2b6...13bd6f1ad2
@@ -1,7 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>SpaceWizards.Lidgren.Network</AssemblyName>
|
||||
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
<DefaultItemExcludes>Lidgren.Network/**/*</DefaultItemExcludes>
|
||||
@@ -13,6 +15,7 @@
|
||||
<Compile Include="Lidgren.Network\Lidgren.Network\**\*.cs">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
</Compile>
|
||||
<Compile Remove="Lidgren.Network\Lidgren.Network\obj\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -20,10 +20,16 @@
|
||||
<PropertyGroup Condition="'$(FullRelease)' == 'True'">
|
||||
<DefineConstants>$(DefineConstants);FULL_RELEASE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(FullRelease)' != 'True'">
|
||||
<DefineConstants>$(DefineConstants);DEVELOPMENT</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||
<DefineConstants>$(DefineConstants);EXCEPTION_TOLERANCE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(EnableClientScripting)' == 'True'">
|
||||
<DefineConstants>$(DefineConstants);CLIENT_SCRIPTING</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(UseSystemSqlite)' == 'True'">
|
||||
<DefineConstants>$(DefineConstants);USE_SYSTEM_SQLITE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project>
|
||||
<!-- This file automatically reset by Tools/version.py -->
|
||||
<PropertyGroup><Version>0.40.3.0</Version></PropertyGroup>
|
||||
</Project>
|
||||
<Project>
|
||||
|
||||
<!-- This file automatically reset by Tools/version.py -->
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project>
|
||||
<!-- Engine-specific properties. Content should not use this file. -->
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<LangVersion>11</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<WarningsAsErrors>nullable</WarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
<ActualOS>MacOS</ActualOS>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="$([MSBuild]::IsOSPlatform('FreeBSD'))">
|
||||
<PropertyGroup>
|
||||
<ActualOS>FreeBSD</ActualOS>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<ActualOS>Linux</ActualOS>
|
||||
@@ -26,9 +31,10 @@
|
||||
<TargetOS Condition="'$(TargetOS)' == ''">$(ActualOS)</TargetOS>
|
||||
<Python>python3</Python>
|
||||
<Python Condition="'$(ActualOS)' == 'Windows'">py -3</Python>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<EnableClientScripting>True</EnableClientScripting>
|
||||
<!-- Client scripting is disabled on full release builds for security and size reasons. -->
|
||||
<EnableClientScripting Condition="'$(FullRelease)' == 'True'">False</EnableClientScripting>
|
||||
<UseSystemSqlite Condition="'$(TargetOS)' == 'FreeBSD'">True</UseSystemSqlite>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
Submodule NetSerializer updated: 3b28e38d23...7224829e87
@@ -25,7 +25,7 @@ namespace OpenToolkit.GraphicsLibraryFramework
|
||||
}
|
||||
|
||||
string rName = null;
|
||||
if (OperatingSystem.IsLinux()) rName = "libglfw.so.3";
|
||||
if (OperatingSystem.IsLinux() || OperatingSystem.IsFreeBSD()) rName = "libglfw.so.3";
|
||||
else if (OperatingSystem.IsMacOS()) rName = "libglfw.3.dylib";
|
||||
|
||||
if ((rName != null) && NativeLibrary.TryLoad(rName, assembly, path, out var handle))
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- Work around https://github.com/dotnet/project-system/issues/4314 -->
|
||||
<TargetFramework>$(TargetFramework)</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\MSBuild\Robust.DefineConstants.targets" />
|
||||
|
||||
@@ -18,7 +18,7 @@ We are happy to accept contributions from anybody. Get in Discord or IRC if you
|
||||
|
||||
## Building
|
||||
|
||||
This repository is the **engine** part of SS14. It's the base engine all SS14 servers will be built on. As such, it does not start on its own: it needs the [content repo](https://github.com/space-wizards/space-station-14). Think of Robust Toolbox as BYOND in the context of Spacestation 13.
|
||||
This repository is the **engine** part of SS14. It's the base engine all SS14 servers will be built on. As such, it does not start on its own: it needs the [content repo](https://github.com/space-wizards/space-station-14). Think of Robust Toolbox as BYOND in the context of Space Station 13.
|
||||
|
||||
## Legal Info
|
||||
|
||||
|
||||
954
RELEASE-NOTES.md
Normal file
954
RELEASE-NOTES.md
Normal file
@@ -0,0 +1,954 @@
|
||||
# Release notes for RobustToolbox.
|
||||
|
||||
<!--
|
||||
NOTE: automatically updated sometimes by version.py.
|
||||
Don't change the format without looking at the script!
|
||||
-->
|
||||
|
||||
<!--START TEMPLATE
|
||||
## Master
|
||||
|
||||
### Breaking changes
|
||||
|
||||
*None yet*
|
||||
|
||||
### New features
|
||||
|
||||
*None yet*
|
||||
|
||||
### Bugfixes
|
||||
|
||||
*None yet*
|
||||
|
||||
### Other
|
||||
|
||||
*None yet*
|
||||
|
||||
### Internal
|
||||
|
||||
*None yet*
|
||||
|
||||
|
||||
END TEMPLATE-->
|
||||
|
||||
## Master
|
||||
|
||||
### Breaking changes
|
||||
|
||||
*None yet*
|
||||
|
||||
### New features
|
||||
|
||||
*None yet*
|
||||
|
||||
### Bugfixes
|
||||
|
||||
*None yet*
|
||||
|
||||
### Other
|
||||
|
||||
*None yet*
|
||||
|
||||
### Internal
|
||||
|
||||
*None yet*
|
||||
|
||||
|
||||
## 0.80.2.0
|
||||
|
||||
### New features
|
||||
|
||||
* Tooltips now provide the option to track the mouse cursor.
|
||||
|
||||
|
||||
## 0.80.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Added location of compile errors to XAML UI.
|
||||
* Add CC-BY to RSI.json
|
||||
* Allow customising radio buttons for RadioOptions.
|
||||
* Added CVar to override CEF useragent.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix incorrect size of second window in split container.
|
||||
* Fix PreventCollideEvent fixture ordering.
|
||||
|
||||
### Other
|
||||
|
||||
* Obsoleted .Owner for future work in removing components storing a reference to their entityuid.
|
||||
|
||||
|
||||
## 0.80.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Moved ConvexHullPolygons and MaxPolygonVertices cvars to constants.
|
||||
* Moved the PhysicsMap Gravity property to its own controller.
|
||||
* Made some layout changes to Split Container.
|
||||
|
||||
### New features
|
||||
|
||||
* Added the colliding fixtures to PreventCollideEvent.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Grids overlapping entities will now flag the entity for grid traversal.
|
||||
|
||||
### Other
|
||||
|
||||
* The split container `Measure()` override now more accurately reflects the space available to children. Additionally, the split position is now publicly settable.
|
||||
|
||||
### Internal
|
||||
|
||||
* Removed manual component registrations.
|
||||
|
||||
|
||||
## 0.79.0.1
|
||||
|
||||
### New features
|
||||
|
||||
* Add helper GetDirection to SharedMapSystem that offsets a Vector2i in the specified direction by the specified distance.
|
||||
* UIController now implements IEntityEventSubscriber
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* The fast TryFindGridAt overload will now also return the queried map's MapGridComponent if it exists.
|
||||
|
||||
### Other
|
||||
|
||||
* Updated window dragging movement constraints. By default windows can now be partially dragged off-screen to the left. This is configurable per window. This also fixes a bug where windows could become unreachable.
|
||||
|
||||
### Internal
|
||||
|
||||
* Remove 2 TryGetComponents per physics contact per tick.
|
||||
|
||||
|
||||
## 0.79.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* EntityInitializedMessage has been removed; the C# event invoked on EntityManager (EntityInitialized) should be used in its place.
|
||||
* TileChangedEventArgs has been removed.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix tooltip panels being incorrectly sized for their first frame.
|
||||
* Client will no longer predict physics sleeping on bodies that are unable to sleep.
|
||||
* Style box texture scaling has been fixed.
|
||||
|
||||
### Other
|
||||
|
||||
* Added TaskCompletionSource to the sandbox.
|
||||
|
||||
### Internal
|
||||
|
||||
* IPhysManager has been removed for a slight physics contacts optimisation.
|
||||
* Optimise TryFindGridAt, particularly for grid traversals.
|
||||
* MapGridComponent now uses delta component states.
|
||||
* Removed some TryGetComponent from IsMapPaused, speeding up entity initialization in some instances.
|
||||
|
||||
|
||||
## 0.78.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Removed the obsoleted `GlobalLinearVelocity()` EntityUid helper method.
|
||||
* INetConfigurationManager now has client & server side variants. Clients can now properly set server authoritative cvars when in singleplayer mode
|
||||
* IPhysBody has been removed. Just use the physics component.
|
||||
* Physics joints haven been slightly refactored and some method signatures have changed.
|
||||
|
||||
### New features
|
||||
|
||||
* Added a new cvar to limit audio occlusion raycast lengths ("audio.raycast_length").
|
||||
* IRobustSerializer has new public methods for getting hashes and setting string serializer data.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed broken click bound checks in the `Tree` UI Control.
|
||||
* Removed erroneous debug assert in render code that was causing issued in debug mode.
|
||||
* Fixed some instances where rotation-less entities were gaining non-zero local rotation.
|
||||
|
||||
### Other
|
||||
|
||||
* Tickrate is now shown in the f3 debug monitors
|
||||
|
||||
|
||||
## 0.77.0.2
|
||||
|
||||
### New features
|
||||
|
||||
* Scroll containers now have public methods to get & set their scroll positions.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed entity spawn menu sometimes not properly updating when filtering entities.
|
||||
|
||||
### Other
|
||||
|
||||
* Physics contacts are now stored per-world rather than per-map. This allows the multi-threading to be applicable to every contact rather than per-map.
|
||||
* Contacts will no longer implicitly be destroyed upon bodies changing maps.
|
||||
|
||||
|
||||
## 0.77.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix AttachToGridOrMap not retaining an entity's map position.
|
||||
|
||||
|
||||
## 0.77.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* ClientOccluderComponent has been removed & OccluderComponent component functions have been moved to the occluder system.
|
||||
* The OccluderDirectionsEvent namespace and properties have changed.
|
||||
* The rendering and occluder trees have been refactored to use generic render tree systems.
|
||||
* Several pointlight and occluder component properties now need to be set via system methods.
|
||||
* SharedPhysicsMap and PhysicsMap have been combined.
|
||||
* RunDeferred has been removed from transformcomponent and updates are no longer deferred.
|
||||
|
||||
## 0.76.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Physics contact multi-threading cvars have been removed as the parallelism is now handled by IParallelManager.
|
||||
|
||||
### New features
|
||||
|
||||
* Physics now supports substepping, this is under physics.target_minimum_tickrate. This means physics steps will run at a constant rate and not be affected by the server's tickrate which can reduce the prevalence of tunneling.
|
||||
* FastNoise API is now public.
|
||||
|
||||
### Other
|
||||
|
||||
* UPnP port forwarding now has better logging.
|
||||
* Physics solver has been refactored to take more advantage of parallelism and ECS some internal code.
|
||||
* Sprite processing & bounding box calculations should be slightly faster now.
|
||||
* Nullspace maps no longer have entities attached.
|
||||
|
||||
|
||||
## 0.75.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Serv4's notNullableOverride parameter is now enforced by analyzer. For more info, see [the docs](https://docs.spacestation14.io/en/engine/serialization).
|
||||
* Added command to dump injector cache list.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix generic visualisers not working because of recent appearance system changes in v0.75.0.0
|
||||
* Fix physics not working properly on moving grids (transform matrix deferral).
|
||||
|
||||
### Other
|
||||
|
||||
* Transform matrix dirtying is deferred again (undo change in v0.75.0.0
|
||||
* Added two new serv3 analysers (NotNullableFlagAnalyzer and PreferGenericVariantAnalyzer)
|
||||
|
||||
|
||||
## 0.75.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Changed default for `net.buffer_size` to `2`.
|
||||
* Changed default for `auth.mode` to `Required`. On development builds, the default is overriden to remain at `Optional`, so this only affects published servers.
|
||||
* The default value for the `outsidePrediction` argument of the `InputCmdHandler.FromDelegate()` has changed from false to true.
|
||||
|
||||
### New features
|
||||
|
||||
* Appearance system now has generic `TryGetData<T>()` functions.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Mapped string serializer once again is initialized with prototype strongs, reducing bandwidth usage.
|
||||
* Fixed various keybindings not working while prediction was disabled.
|
||||
* Fixed a bug causing rendering trees to not properly recursively update when entities move.
|
||||
|
||||
### Other
|
||||
|
||||
* Transform matrix dirtying is no longer deferred.
|
||||
* Cleaned up some `FULL_RELEASE` CVar default value overrides into `CVarDefaultOverrides.cs`.
|
||||
* VVRead now attempts to serialize data to yaml
|
||||
|
||||
|
||||
## 0.74.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* `ITypeReader<,>.Read(...)` and `ITypeCopier<>.Copy(...)` have had their `bool skipHook` parameter replaced with a `SerializationHookContext` to facilitate multithreaded prototype loading.
|
||||
* Prototypes are now loaded in parallel across multiple threads. Type serializers, property setters, etc... must be thread safe and not rely on an active IoC instance.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Mapped string serializer once again is initialized with prototype strongs, reducing bandwidth usage.
|
||||
|
||||
### Other
|
||||
|
||||
* Drastically improved startup time by running prototype loading in parallel.
|
||||
* `AfterDeserialization` hooks are still ran on the main thread during load to avoid issues.
|
||||
* Various systems in the serialization system such as `SerializationManager` or `ReflectionManager` have had various methods made thread safe.
|
||||
* `TileAliasPrototype` no longer has a load priority set.
|
||||
* Straightened out terminology in prototypes: to refer to the type of a prototype (e.g. `EntityPrototype` itself), use "kind".
|
||||
* This was previously mixed between "type" and "variant".
|
||||
|
||||
### Internal
|
||||
|
||||
* `SpanSplitExtensions` has been taken behind the shed for being horrifically wrong unsafe code that should never have been entered into a keyboard ever. A simpler helper method replaces its use in `Box2Serializer`.
|
||||
* `PrototypeManager.cs` has been split apart into multiple files.
|
||||
|
||||
## 0.73.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* The entity lookup flag `LookupFlags.Anchored` has been replaced with `LookupFlags.Static`.
|
||||
* We are now using **.NET 7**.
|
||||
* `IDependencyCollection`/`IoCManager` `RegisterInstance` does not automatically add the instance to object graph, so `BuildGraph()` must now be called to see the new instances.
|
||||
* `deferInject` parameteres have been removed.
|
||||
|
||||
### New features
|
||||
|
||||
* The server will now check for any unknown CVars at startup, to possibly locate typos in your config file.
|
||||
* `IDependencyCollection` is now thread safe.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed config files not being truncated before write, resulting in corruption.
|
||||
|
||||
### Other
|
||||
|
||||
* Removed some cruft from the `server_config.toml` default config file that ships with Robust.
|
||||
* Most usages of x86 SIMD intrinsics have been replaced with cross-platform versions using the new .NET cross-platform intrinsics.
|
||||
* This reduces code to maintain and improves performance on ARM.
|
||||
* Tiny optimization to rendering code.
|
||||
* `RobustSerializer` no longer needs to be called from threads with an active IoC context.
|
||||
* This makes it possible to use from thread pool threads without `IoCManager.InitThread`.
|
||||
* Removed finalizer dispose from `Overlay`.
|
||||
* Stopped integration tests watching for prototype reload file changes, speeding stuff up.
|
||||
|
||||
### Internal
|
||||
|
||||
* Moved `SerializationManager`'s data definition storage over to a `ConcurrentDictionary` to improve GC behavior in integration tests.
|
||||
|
||||
## 0.72.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* EntityPausedEvent has been split into EntityPausedEvent and EntityUnpausedEvent. The unpaused version now has information about how long an entity has been paused.
|
||||
|
||||
## 0.71.1.4
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed CVars not being saved correctly to config file.
|
||||
|
||||
### Other
|
||||
|
||||
* Mark `validate_rsis.py` as `+x` in Git.
|
||||
* Made config system more robust against accidental corruption when saving.
|
||||
|
||||
|
||||
## 0.71.1.3
|
||||
|
||||
|
||||
## 0.71.1.2
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed UI ScrollContainer infinite loop freezing client.
|
||||
|
||||
|
||||
## 0.71.1.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed client memory leaks and improved performance in integration testing.
|
||||
|
||||
|
||||
## 0.71.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Better RSI validator script.
|
||||
* When a new map file is loaded onto an existing map the entities will be transferred over.
|
||||
* Add an API to get the hard layer / mask for a particular physics body.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed non-filled circle drawing via world handle.
|
||||
* Fix max_connections in the default server config.
|
||||
* Fix removal of PVS states for players without ingame status.
|
||||
* Fix max rotation from the physics solver.
|
||||
|
||||
### Internal
|
||||
|
||||
* Wrap window rendering in a try-catch.
|
||||
|
||||
|
||||
## 0.71.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* `DebugTimePanel`, `DebugNetPanel` and `DebugNetBandwidthPanel` have been made internal.
|
||||
* RSIs with trailing commas in the JSON metadata are no longer allowed.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* `csi` doesn't throw a `NullReferenceException` anymore.
|
||||
|
||||
### Other
|
||||
|
||||
* The `game.maxplayers` CVar has been deprecated in favor of the new `net.max_connections` CVar. Functionality is the same, just renamed to avoid confusion. The old CVar still exists, so if `game.maxplayers` is set it will be preferred over the new one.
|
||||
* The new default for `net.max_connections` is 256.
|
||||
* Debug monitors (F3) now have margin between them.
|
||||
* F3 (clyde monitor) now lists the windowing API and version in use.
|
||||
* Added system monitor to F3 with various info like OS version, .NET runtime version, etc...
|
||||
* The engine now warns when loading `.png` textures inside a `.rsi`. This will be blocked in the future.
|
||||
|
||||
|
||||
## 0.70.0.0
|
||||
|
||||
### New features
|
||||
|
||||
* `game.desc` CVar for a server description to show in the launcher.
|
||||
* New system for exposing links to e.g. a Discord in the launcher.
|
||||
* The engine does not have a built-in method for configuring these, but it does now have a `StatusHostHelpers.AddLink` method to correctly format these from content. The idea is that content wires the types of links (with icon names) up itself via `IStatusHost.OnInfoRequest`.
|
||||
* See also [the HTTP API documentation](https://docs.spacestation14.io/en/engine/http-api) for reference.
|
||||
* `GameShared` now has a `Dependencies` property to allow access to the game's `IDependencyCollection`. This makes it possible to avoid using static `IoCManager` in `EntryPoint`-type content code.
|
||||
* A new define constant `DEVELOPMENT` has been defined, equivalent to `!FULL_RELEASE`. See [the docs](https://docs.spacestation14.io/en/technical-docs/preprocessor-defines) for details.
|
||||
* `IConfigurationManager` has new functions for reading and writing CVar directly from a TOML file `Stream`.
|
||||
* New `IConfigurationManager.LoadDefaultsFromTomlStream` to load a TOML file as CVar default overrides.
|
||||
* Added new serializers to support Queue<T> data-fields.
|
||||
* Added a `FromParent()` function to `IDependencyCollection`, enabling dependencies to be passed to parallel threads.
|
||||
* `IClientStateManager` now has a `PartialStateReset()` function to make it easier for content to rewind to previous game states.
|
||||
* Added `IClientNetManager.DispatchLocalNetMessage()`, which allows a client to raise a local message that triggers networked event subscriptions.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* `IPlayerSession.OnConnect()` now actually gets called when players connect.
|
||||
* `MapLoaderSystem.TryLoad(.., out rootUids)` now properly only returns entities parented to the map.
|
||||
|
||||
### Other
|
||||
|
||||
* Invalid placement types for the entity spawn menu now log warnings.
|
||||
* Slightly improved sprite y-sorting performance.
|
||||
|
||||
### Internal
|
||||
|
||||
* The current physics map that an entity is on is now cached in the transform component alongside other cached broadphase data. This helps to fix some broadphase/lookup bugs.
|
||||
|
||||
## 0.69.0.0
|
||||
|
||||
|
||||
## 0.68.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Updated yml schema validator to remove the `grids` node.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed position-less audio playing.
|
||||
* Stop mapgrids from serializing their fixtures.
|
||||
|
||||
### Other
|
||||
|
||||
* Removed the `restart` command, since it never worked properly and just confused people.
|
||||
* Add virtual to some UIScreen methods.
|
||||
* Add public parameterless ctor to MenuBar.
|
||||
|
||||
|
||||
## 0.67.2.2
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix double MapGrid chunk subscription.
|
||||
* Fix grid contacts short-circuiting collision.
|
||||
|
||||
|
||||
## 0.67.2.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix MapChunks not being subscribed to by MapGridComponents in some instances.
|
||||
|
||||
|
||||
## 0.67.2.0
|
||||
|
||||
### New features
|
||||
|
||||
* Add submenu support to menubar controls.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix gridtree returning mapgrid maps twice.
|
||||
|
||||
|
||||
## 0.67.1.3
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix Map regression so now they can be MapGrids again without the client crashing.
|
||||
|
||||
|
||||
## 0.67.1.2
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix some mapgrids not being marked as dirty and never being sent to clients (thanks checkraze).
|
||||
|
||||
|
||||
## 0.67.1.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix some merge artifacts from mapgrid support for maps.
|
||||
|
||||
|
||||
## 0.67.1.0
|
||||
|
||||
### New features
|
||||
|
||||
- Maps can now have MapGridComponent added to them.
|
||||
|
||||
|
||||
## 0.67.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* MapGrid is deprecated and has been merged into MapGridComponent. This is subject to further changes as it gets ECSd more in future.
|
||||
* The `grids` yaml node on map files is deprecated and has been merged onto MapGridComponent. Loading maps is backwards compatible for now but is subject to change in future. Saving maps will save in the new format.
|
||||
|
||||
|
||||
## 0.66.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* AudioSystem functions for playing audio have changed. Functions that take in filters now require an additional argument that will determine whether sounds are recorded by replays. Additionally, there are several new overrides that take in a recipient session or entity.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Script globals for C# interactive were not having dependencies injected correctly.
|
||||
* GetWorldPosition() now returns the correct positions even prior to transform initialization.
|
||||
* Fix map loading not properly offsetting some entities that were directly parented to the map.
|
||||
|
||||
### Internal
|
||||
|
||||
* Added lookup/broadphase re-parenting tests.
|
||||
|
||||
|
||||
## 0.65.2.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix empty MetaData components being serialized to map files.
|
||||
* Fix saving a grid as a map not marking it as pre-mapinit.
|
||||
|
||||
### Other
|
||||
|
||||
* Set `ValidateExecutableReferencesMatchSelfContained` in the server project, which may help with publishing issues. I hope.
|
||||
* Move pinned font data over to Pinned Object Heap.
|
||||
* Improved shader code generation for uniform arrays to be more compatible.
|
||||
* Server now has server GC enabled by default.
|
||||
|
||||
### Internal
|
||||
|
||||
* Remove some unnecessary dependency resolves from filters making audio much more performant.
|
||||
|
||||
|
||||
## 0.65.2.0
|
||||
|
||||
### New features
|
||||
|
||||
* Added ClydeAudio.StopAllAudio()
|
||||
* Expose more tick logic to content.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix bad reference in WebView.
|
||||
|
||||
### Internal
|
||||
|
||||
* Add Robust.Packaging to solution.
|
||||
* Add WebView to solution.
|
||||
* Physics contacts are now parallel and much faster.
|
||||
|
||||
## 0.65.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Implement value prototype id dictionary serializer.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixes lerping clean up issue added in #3472.
|
||||
|
||||
### Internal
|
||||
|
||||
* Add test for (de)serializing data record structs.
|
||||
|
||||
|
||||
## 0.65.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
- Fix SetLocalPositionRotation raising 2 moveevents. This should help physics performance significantly.
|
||||
- Fix tpgrid responses and command error.
|
||||
|
||||
|
||||
## 0.65.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Rename transform lerping properties alongside other minor internal changes.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix physics testbeds.
|
||||
* Force grids to always be collidable for now and stop them clipping.
|
||||
|
||||
### Other
|
||||
|
||||
* Slight optimization to `OutputPanel`'s handling of internal `RichTextEntry`s.
|
||||
* Force non-collidable contacts to be destroyed. Previously these hung around until both entities became collidable again.
|
||||
|
||||
### Internal
|
||||
|
||||
* `Tools/version.py` has been updated to automatically update `RELEASE-NOTES.md`.
|
||||
* General cleanup to `Tools/version.py`.
|
||||
|
||||
## 0.64.1.0
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Word-wrapping in `OutputPanel` and `RichTextLabel` has been fixed.
|
||||
|
||||
## 0.64.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* IMapLoader has been refactored into MapLoaderSystem. The API is similar for now but is subject to change in the future.
|
||||
|
||||
## 0.63.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Thanks to new IME support with SDL2, `IClyde.TextInputStart()` and `IClyde.TextInputStop()` must now be appropriately called to start/stop receiving text input when focusing/unfocusing a UI control. This restriction is applied even on the (default) GLFW backend, to enforce consistent usage of these APIs.
|
||||
* `[GUI]TextEventArgs` have been renamed to `[GUI]TextEnteredEventArgs`, turned into records, and made to carry a `string` rather than a single text `Rune`.
|
||||
* IoC and `DependencyCollection` `Register` methods now have a `TInterface : class` constraint.
|
||||
* [ABI] `IoCManager.InitThread` now returns the `IDependencyCollection`.
|
||||
|
||||
### New features
|
||||
|
||||
* Fixes for compiling & running on .NET 7. You'll still have to edit a bunch of project files to enable this though.
|
||||
* `FormattedMessage.EnumerateRunes()`
|
||||
* `OSWindow.Shown()` virtual function for child classes to hook into.
|
||||
* `IUserInterfaceManager.DeferAction(...)` for running UI logic "not right now because that would cause an enumeration exception".
|
||||
* New `TextEdit` control for multi-line editable text, complete with word-wrapping!
|
||||
* `Rope` data structure for representing large editable text, used by the new `TextEdit`.
|
||||
* Robust now has IME support matching SDL2's API. This only works on the SDL2 backend (which is not currently enabled by default) but the API is there:
|
||||
* `IClyde.TextInputStart()`, `IClyde.TextInputStop()`, `IClyde.TextInputSetRect()` APIs to control text input behavior.
|
||||
* `TextEditing` events for reporting in-progress IME compositions.
|
||||
* `LineEdit` and `TextEdit` have functional IME support when the game is running on SDL2. If you provide a font file with the relevant glyphs, CJK text input should now be usable.
|
||||
* `Register<T>` (single type parameter) extension method for `IDependencyCollection`.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixes erroneous literal "\\n" inside the Clyde debug panel.
|
||||
* Fixed Lidgren connection status changes potentially getting mislogged.
|
||||
* Fixed missing components not being correctly saved for maps
|
||||
* Fixed map saving sometimes not including new components.
|
||||
* Fix hot reload unit tests.
|
||||
|
||||
### Other
|
||||
|
||||
* Properly re-use `HttpClient` in `NetManager` meaning we properly pool connections to the auth server, improving performance.
|
||||
* Hub advertisements have extended keep-alive pool timeout, so the connection can be kept active between advertisements.
|
||||
* All HTTP requests from the engine now have appropriate `User-Agent` header.
|
||||
* `bind` command has been made somewhat more clear thanks to a bit of help text and some basic completions.
|
||||
* `BoundKeyEventArgs` and derivatives now have a `[DebuggerDisplay]`.
|
||||
* Text cursors now have a fancy blinking animation.
|
||||
* `SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH` is set on the SDL2 windowing backend, so clicking on the game window to focus it will pass clicks through into the game itself, matching GLFW's behavior.
|
||||
* Windows clipboard history paste now works.
|
||||
* Improved multi-window UI keyboard focusing system: a single focused control is now tracked per UI root (OS window), and is saved/restored when switching between focused window. This means that you (ideally) only ever have a UI control focused on the current OS window.
|
||||
|
||||
### Internal
|
||||
|
||||
* `uitest2` is a new command that's like `uitest` but opens an OS window instead. It can also be passed an argument to open a specific tab immediately.
|
||||
* Word-wrapping logic has been split off from `RichTextEntry`, into a new helper struct `WordWrap`.
|
||||
* Some internal logic in `LineEdit` has been shared with `TextEdit` by moving it to a new `TextEditShared` file.
|
||||
* SDL2 backend now uses `[UnmanagedCallersOnly]` instead of `GetFunctionPointerForDelegate`-style P/Invoke marshalling.
|
||||
* Entity prototype reloading logic has been moved out of `PrototypeManager` and into a new `PrototypeReloadSystem`.
|
||||
* Most usages of `IoCManager.` statically have been removed in favor of dependency injection.
|
||||
|
||||
## 0.62.1.0
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed a PVS issue causing entities to be sent to clients without first sending their parents.
|
||||
* Improved client-side state handling exception tolerance.
|
||||
|
||||
### Other
|
||||
|
||||
* Removed null-space map entities.
|
||||
|
||||
### Internal
|
||||
|
||||
* Added some more anchoring tests.
|
||||
|
||||
## 0.62.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed sprites not animating when directly toggling layer visibility,
|
||||
* Fixed anchored entities not being added to the anchored lookups.
|
||||
|
||||
## 0.62.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Removed some obsolete map event handlers.
|
||||
|
||||
### New features
|
||||
|
||||
* Added entity query struct enumerators
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Improved error tolerance during client state application.
|
||||
* Added better error logs when a client deletes a predicted entity.
|
||||
* Fixes command permissions not getting sent to clients.
|
||||
* Fixes a broad-phase bug were entities were not properly updating their positions.
|
||||
|
||||
### Other
|
||||
|
||||
* Added the LocalizedCommands class, which automatically infer help and description loc strings from the commands name.
|
||||
|
||||
## 0.61.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* IMap and IMapGrid have been removed. Just use the associated components directly.
|
||||
|
||||
### Other
|
||||
|
||||
* AudioSystem has been refactored.
|
||||
|
||||
## 0.60.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* ISerializationHooks.BeforeSerialization() has been removed. Use custom type serializers instead.
|
||||
|
||||
### New features
|
||||
|
||||
* Added function to UserInterfaceSystem that returns list of BUIs that a client has open.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed various container related broadphase bugs which could result in entities getting stuck with a null-broadphase.
|
||||
* Fixed client fixture state handling bug that caused the client to incorrectly disable collision.
|
||||
|
||||
### Other
|
||||
|
||||
* Misc PVS optimisations
|
||||
|
||||
### Internal
|
||||
|
||||
* Removed redundant grid-init physics logic
|
||||
* Modified garbage collection for entity spawning profiling.
|
||||
|
||||
## 0.59.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Various transform related methods have been removed from MapGrids
|
||||
* TransformSystem.SetCoordinates() arguments have changed and now allow an entity to be sent to nullspace
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed an entity lookup bug that sometimes failed to return entities in StaticSundriesTrees
|
||||
|
||||
### Other
|
||||
|
||||
* The EntitySystem.Resolve<> methods have been change to protected
|
||||
|
||||
## 0.58.1.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed some container shutdown errors
|
||||
* Fixed LookupFlags.Static not acting as a full replacement for LookupFlags.Anchored
|
||||
|
||||
## 0.58.1.0
|
||||
|
||||
### Other
|
||||
|
||||
* Physics collision changed and body type changed events no longer get raised before initialisation
|
||||
|
||||
## 0.58.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Some TransformComponent functions have been moved to the system.
|
||||
* Container insert, remove, and shutdown function arguments and functionality has changed.
|
||||
* Physics entities without fixtures now automatically disable collision.
|
||||
|
||||
### New features
|
||||
|
||||
* Added command to profile entity spawning
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* EntityLookup/BroadphaseComponent tracking has been overhauled, which should hopefully fix various broadphase bugs.
|
||||
|
||||
### Other
|
||||
|
||||
* Component.Owner is now marked as obsolete.
|
||||
|
||||
## 0.57.0.4
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Made entity deletion more resilient against exceptions. Should fix several bugs.
|
||||
|
||||
## 0.57.0.2 and 0.57.0.3
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed more entity-lookup bugs.
|
||||
|
||||
## 0.57.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed entity lookup bug that was causing crashes.
|
||||
|
||||
### 0.57.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* EntityLookupComponent has been merged into BroadphaseComponent. The data that was previously stored in this tree is now stored across the 3 trees on BroadphaseComponent.
|
||||
|
||||
### New features
|
||||
|
||||
* EntityLookup has had its flags updated to reflect the merge of EntityLookupComponent and BroadphaseComponent, with the new flags reflecting each tree: Dynamic, Static, and Sundries. Dynamic and Static store physics bodies that are collidable and Sundries stores everything else (apart from grids).
|
||||
|
||||
### Internal
|
||||
|
||||
* EntityLookup and Broadphase have had their data de-duplicated, dropping the AABBs stored on the server by half. This also means MoveEvent updates will be much faster.
|
||||
* PVS mover updates has had their performance improved slightly.
|
||||
* Physics LinkedList nodes for contacts will no longer be re-made for every contact and will just be cleared when re-used.
|
||||
* Sprite / Light dynamictree allocations on the client have been dropped by using static lambdas.
|
||||
* The physics contact buffer for each FixtureProxy is now pooled.
|
||||
|
||||
## 0.56.1.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix PVS sometimes not sending an entity's parents.
|
||||
* Fix velocity preservation on parenting changes.
|
||||
|
||||
## 0.56.1.0
|
||||
|
||||
### New features
|
||||
|
||||
* Update pt-BR locale with more localizations
|
||||
* Separated PVS entity budget into an entity creation budget and a pvs-entry budget.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix VV type handler removal.
|
||||
* System errors during component removal should no longer result in undeletable entities.
|
||||
|
||||
### Other
|
||||
|
||||
* The ordering of component removals and shutdowns during entity deltion has changed (see #3355).
|
||||
* Improved Box2Serializer
|
||||
* Removed uses IEnumerables from EntityLookupSystem.
|
||||
* Optimized client entity spawning by 15%.
|
||||
* Modified how the rendering tree handles entity movement.
|
||||
* Improved grid enumeration allocs.
|
||||
* Fixed a bunch of build warnings (see #3329 and #3289 for details)
|
||||
|
||||
## 0.56.0.2
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Rename \_lib.ftl to \_engine_lib.ftl to avoid overwriting
|
||||
|
||||
## 0.56.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fix instantiation of data records containing value types
|
||||
|
||||
## 0.56.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* `CastShadows` moved to `SharedPointLightComponent` from clientside, now networked
|
||||
|
||||
### New features
|
||||
|
||||
* New type handler helpers added to V^3
|
||||
* Added pt-BR locale
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Fixed audio fallback coords
|
||||
|
||||
### Other
|
||||
|
||||
* Improved PVS performance by using `for` over `forEach`
|
||||
* Improved Vec2 inverse allocations
|
||||
|
||||
## 0.55.5.0
|
||||
|
||||
### New features
|
||||
|
||||
* Added a method to pass in physics transforms for getting nearest point.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Prevent singular sprite matrices.
|
||||
* Fix obsolete warnings in tests.
|
||||
|
||||
### Other
|
||||
|
||||
* Significantly reduce physics contact allocations.
|
||||
|
||||
## 0.55.4.1
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Removed `SI`, `SIoC`, `I`, `IoC`, `SE` and `CE` VV command prefixes.
|
||||
* `SI`, `SIoC`, `I` and `IoC` are replaced by VV paths under `/ioc/` and `/c/ioc/`.
|
||||
* `SE` and `CE` are replaced by VV paths under `/system/` and `/c/system`.
|
||||
|
||||
### New features
|
||||
|
||||
* Added CVars to control Lidgren's <abbr title="Maximum Transmission Unit">MTU</abbr> parameters:
|
||||
* `net.mtu`
|
||||
* `net.mtu_expand`
|
||||
* `net.mtu_expand_frequency`
|
||||
* `net.mtu_expand_fail_attempts`
|
||||
* Added a whole load of features to ViewVariables.
|
||||
* Added VV Paths, which allow you to refer to an object by a path, e.g. `/entity/1234/Transform/WorldPosition`
|
||||
* Added VV Domains, which allow you to add "handlers" for the top-most VV Path segment, e.g. `/entity` is a domain and so is `/player`...
|
||||
* Added VV Type Handlers, which allow you to add "custom paths" under specific types, even dynamically!
|
||||
* Added VV Path networking, which allows you to read/write/invoke paths remotely, both from server to client and from client to server.
|
||||
* Added `vvread`, `vvwrite` and `vvinvoke` commands, which allow you to read, write and invoke VV paths.
|
||||
* Added autocompletion to all VV commands.
|
||||
* Please note that the VV GUI still remains the same. It will be updated to use these new features in the future.
|
||||
|
||||
### Other
|
||||
|
||||
* Changed Lidgren to be compiled against `net6.0`. This unlocks `Half` read/write methods.
|
||||
* Lidgren has been updated to [0.2.2](https://github.com/space-wizards/SpaceWizards.Lidgren.Network/blob/v0.2.2/RELEASE-NOTES.md). Not all the changes since 0.1.0 are new here, since this is the first version where we're properly tracking this in release notes.
|
||||
* Robust.Client now uses our own [NFluidsynth](https://github.com/space-wizards/SpaceWizards.NFluidsynth) [nuget package](https://www.nuget.org/packages/SpaceWizards.NFluidsynth).
|
||||
|
||||
### Internal
|
||||
|
||||
* Renamed Lidgren's assembly to `SpaceWizards.Lidgren.Network`.
|
||||
* Rogue `obj/` folders inside Lidgren no longer break the build.
|
||||
* Renamed NFluidsynth's assembly to `SpaceWizards.NFluidsynth`
|
||||
3
Resources/EnginePrototypes/UserInterface/uiThemes.yml
Normal file
3
Resources/EnginePrototypes/UserInterface/uiThemes.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
- type: uiTheme
|
||||
id: Default
|
||||
path: /textures/interface/Default
|
||||
63
Resources/Locale/en-US/_engine_lib.ftl
Normal file
63
Resources/Locale/en-US/_engine_lib.ftl
Normal file
@@ -0,0 +1,63 @@
|
||||
# Used internally by the THE() function.
|
||||
zzzz-the = { PROPER($ent) ->
|
||||
*[false] the { $ent }
|
||||
[true] { $ent }
|
||||
}
|
||||
|
||||
# Used internally by the SUBJECT() function.
|
||||
zzzz-subject-pronoun = { GENDER($ent) ->
|
||||
[male] he
|
||||
[female] she
|
||||
[epicene] they
|
||||
*[neuter] it
|
||||
}
|
||||
|
||||
# Used internally by the OBJECT() function.
|
||||
zzzz-object-pronoun = { GENDER($ent) ->
|
||||
[male] him
|
||||
[female] her
|
||||
[epicene] them
|
||||
*[neuter] it
|
||||
}
|
||||
|
||||
# Used internally by the POSS-PRONOUN() function.
|
||||
zzzz-possessive-pronoun = { GENDER($ent) ->
|
||||
[male] his
|
||||
[female] hers
|
||||
[epicene] theirs
|
||||
*[neuter] its
|
||||
}
|
||||
|
||||
# Used internally by the POSS-ADJ() function.
|
||||
zzzz-possessive-adjective = { GENDER($ent) ->
|
||||
[male] his
|
||||
[female] her
|
||||
[epicene] their
|
||||
*[neuter] its
|
||||
}
|
||||
|
||||
# Used internally by the REFLEXIVE() function.
|
||||
zzzz-reflexive-pronoun = { GENDER($ent) ->
|
||||
[male] himself
|
||||
[female] herself
|
||||
[epicene] themselves
|
||||
*[neuter] itself
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-BE() function.
|
||||
zzzz-conjugate-be = { GENDER($ent) ->
|
||||
[epicene] are
|
||||
*[other] is
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-HAVE() function.
|
||||
zzzz-conjugate-have = { GENDER($ent) ->
|
||||
[epicene] have
|
||||
*[other] has
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-BASIC() function.
|
||||
zzzz-conjugate-basic = { GENDER($ent) ->
|
||||
[epicene] { $first }
|
||||
*[other] { $second }
|
||||
}
|
||||
16
Resources/Locale/en-US/client-state-commands.ftl
Normal file
16
Resources/Locale/en-US/client-state-commands.ftl
Normal file
@@ -0,0 +1,16 @@
|
||||
# Loc strings for various entity state & client-side PVS related commands
|
||||
|
||||
cmd-reset-ent-help = Usage: resetent <Entity UID>
|
||||
cmd-reset-ent-desc = Reset an entity to the most recently received server state. This will also reset entities that have been detached to null-space.
|
||||
|
||||
cmd-reset-all-ents-help = Usage: resetallents
|
||||
cmd-reset-all-ents-desc = Resets all entities to the most recently received server state. This only impacts entities that have not been detached to null-space.
|
||||
|
||||
cmd-detach-ent-help = Usage: detachent <Entity UID>
|
||||
cmd-detach-ent-desc = Detach an entity to null-space, as if it had left PVS range.
|
||||
|
||||
cmd-local-delete-help = Usage: localdelete <Entity UID>
|
||||
cmd-local-delete-desc = Deletes an entity. Unlike the normal delete command, this is CLIENT-SIDE. Unless the entity is a client-side entity, this will likely cause errors.
|
||||
|
||||
cmd-full-state-reset-help = Usage: fullstatereset
|
||||
cmd-full-state-reset-desc = Discards any entity state information and requests a full-state from the server.
|
||||
@@ -1,10 +1,15 @@
|
||||
### Localization for engine console commands
|
||||
|
||||
## generic
|
||||
## generic command errors
|
||||
|
||||
cmd-invalid-arg-number-error = Invalid number of arguments.
|
||||
|
||||
cmd-parse-failure-integer = {$arg} is not a valid integer.
|
||||
cmd-parse-failure-float = {$arg} is not a valid float.
|
||||
cmd-parse-failure-bool = {$arg} is not a valid bool.
|
||||
cmd-parse-failure-uid = {$arg} is not a valid entity UID.
|
||||
cmd-parse-failure-mapid = {$arg} is not a valid MapId.
|
||||
cmd-parse-failure-entity-exist = UID {$arg} does not correspond to an existing entity.
|
||||
|
||||
|
||||
## 'help' command
|
||||
@@ -124,6 +129,11 @@ cmd-monitor-minus-all-hint = Hides all monitors
|
||||
cmd-monitor-plus-all-hint = Shows all monitors
|
||||
|
||||
|
||||
## 'setambientlight' command
|
||||
cmd-set-ambient-light-desc = Allows you to set the ambient light for the specified map, in SRGB.
|
||||
cmd-set-ambient-light-help = setambientlight [mapid] [r g b a]
|
||||
cmd-set-ambient-light-parse = Unable to parse args as a byte values for a color.
|
||||
|
||||
## Mapping commands
|
||||
|
||||
cmd-savemap-desc = Serializes a map to disk. Will not save a post-init map unless forced.
|
||||
@@ -147,9 +157,379 @@ cmd-hint-loadmap-y-position = [y-position]
|
||||
cmd-hint-loadmap-rotation = [rotation]
|
||||
cmd-hint-loadmap-uids = [float]
|
||||
|
||||
cmd-hint-savebp-id = <Grid EntityID>
|
||||
|
||||
## 'flushcookies' command
|
||||
# Note: the flushcookies command is from Robust.Client.WebView, it's not in the main engine code.
|
||||
|
||||
cmd-flushcookies-desc = Flush CEF cookie storage to disk
|
||||
cmd-flushcookies-help = This ensure cookies are properly saved to disk in the event of unclean shutdowns.
|
||||
Note that the actual operation is asynchronous.
|
||||
|
||||
cmd-ldrsc-desc = Pre-caches a resource.
|
||||
cmd-ldrsc-help = Usage: ldrsc <path> <type>
|
||||
|
||||
cmd-rldrsc-desc = Reloads a resource.
|
||||
cmd-rldrsc-help = Usage: rldrsc <path> <type>
|
||||
|
||||
cmd-gridtc-desc = Gets the tile count of a grid.
|
||||
cmd-gridtc-help = Usage: gridtc <gridId>
|
||||
|
||||
|
||||
# Client-side commands
|
||||
cmd-guidump-desc = Dump GUI tree to /guidump.txt in user data.
|
||||
cmd-guidump-help = Usage: guidump
|
||||
|
||||
cmd-uitest-desc = Open a dummy UI testing window
|
||||
cmd-uitest-help = Usage: uitest
|
||||
|
||||
## 'uitest2' command
|
||||
cmd-uitest2-desc = Opens a UI control testing OS window
|
||||
cmd-uitest2-help = Usage: uitest2 <tab>
|
||||
cmd-uitest2-arg-tab = <tab>
|
||||
cmd-uitest2-error-args = Expected at most one argument
|
||||
cmd-uitest2-error-tab = Invalid tab: '{$value}'
|
||||
cmd-uitest2-title = UITest2
|
||||
|
||||
|
||||
cmd-setclipboard-desc = Sets the system clipboard
|
||||
cmd-setclipboard-help = Usage: setclipboard <text>
|
||||
|
||||
cmd-getclipboard-desc = Gets the system clipboard
|
||||
cmd-getclipboard-help = Usage: Getclipboard
|
||||
|
||||
cmd-togglelight-desc = Toggles light rendering.
|
||||
cmd-togglelight-help = Usage: togglelight
|
||||
|
||||
cmd-togglefov-desc = Toggles fov for client.
|
||||
cmd-togglefov-help = Usage: togglefov
|
||||
|
||||
cmd-togglehardfov-desc = Toggles hard fov for client. (for debugging space-station-14#2353)
|
||||
cmd-togglehardfov-help = Usage: togglehardfov
|
||||
|
||||
cmd-toggleshadows-desc = Toggles shadow rendering.
|
||||
cmd-toggleshadows-help = Usage: toggleshadows
|
||||
|
||||
cmd-togglelightbuf-desc = Toggles lighting rendering. This includes shadows but not FOV.
|
||||
cmd-togglelightbuf-help = Usage: togglelightbuf
|
||||
|
||||
cmd-chunkinfo-desc = Gets info about a chunk under your mouse cursor.
|
||||
cmd-chunkinfo-help = Usage: chunkinfo
|
||||
|
||||
cmd-rldshader-desc = Reloads all shaders.
|
||||
cmd-rldshader-help = Usage: rldshader
|
||||
|
||||
cmd-cldbglyr-desc = Toggle fov and light debug layers.
|
||||
cmd-cldbglyr-help= Usage: cldbglyr <layer>: Toggle <layer>
|
||||
cldbglyr: Turn all Layers off
|
||||
|
||||
cmd-key-info-desc = Keys key info for a key.
|
||||
cmd-key-info-help = Usage: keyinfo <Key>
|
||||
|
||||
## 'bind' command
|
||||
cmd-bind-desc = Binds an input key combination to an input command.
|
||||
cmd-bind-help = Usage: bind { cmd-bind-arg-key } { cmd-bind-arg-mode } { cmd-bind-arg-command }
|
||||
Note that this DOES NOT automatically save bindings.
|
||||
Use the 'svbind' command to save binding configuration.
|
||||
|
||||
cmd-bind-arg-key = <KeyName>
|
||||
cmd-bind-arg-mode = <BindMode>
|
||||
cmd-bind-arg-command = <InputCommand>
|
||||
|
||||
cmd-net-draw-interp-desc = Toggles the debug drawing of the network interpolation.
|
||||
cmd-net-draw-interp-help = Usage: net_draw_interp
|
||||
|
||||
cmd-net-draw-interp-desc = Toggles the debug drawing of the network interpolation.
|
||||
cmd-net-draw-interp-help = Usage: net_draw_interp
|
||||
|
||||
cmd-net-watch-ent-desc = Dumps all network updates for an EntityId to the console.
|
||||
cmd-net-watch-ent-help = Usage: net_watchent <0|EntityUid>
|
||||
|
||||
cmd-net-refresh-desc = Requests a full server state.
|
||||
cmd-net-refresh-help = Usage: net_refresh
|
||||
|
||||
cmd-net-entity-report-desc = Toggles the net entity report panel.
|
||||
cmd-net-entity-report-help = Usage: net_entityreport
|
||||
|
||||
cmd-fill-desc = Fill up the console for debugging.
|
||||
cmd-fill-help = Fills the console with some nonsense for debugging.
|
||||
|
||||
cmd-cls-desc = Clears the console.
|
||||
cmd-cls-help = Clears the debug console of all messages.
|
||||
|
||||
cmd-sendgarbage-desc = Sends garbage to the server.
|
||||
cmd-sendgarbage-help = The server will reply with 'no u'
|
||||
|
||||
cmd-loadgrid-desc = Loads a grid from a file into an existing map.
|
||||
cmd-loadgrid-help = loadgrid <MapID> <Path> [x y] [rotation] [storeUids]
|
||||
|
||||
cmd-loc-desc = Prints the absolute location of the player's entity to console.
|
||||
cmd-loc-help = loc
|
||||
|
||||
cmd-tpgrid-desc = Teleports a grid to a new location.
|
||||
cmd-tpgrid-help = tpgrid <gridId> <X> <Y> [<MapId>]
|
||||
|
||||
cmd-rmgrid-desc = Removes a grid from a map. You cannot remove the default grid.
|
||||
cmd-rmgrid-help = rmgrid <gridId>
|
||||
|
||||
cmd-mapinit-desc = Runs map init on a map.
|
||||
cmd-mapinit-help = mapinit <mapID>
|
||||
|
||||
cmd-lsmap-desc = Lists maps.
|
||||
cmd-lsmap-help = lsmap
|
||||
|
||||
cmd-lsgrid-desc = Lists grids.
|
||||
cmd-lsgrid-help = lsgrid
|
||||
|
||||
cmd-addmap-desc = Adds a new empty map to the round. If the mapID already exists, this command does nothing.
|
||||
cmd-addmap-help = addmap <mapID> [initialize]
|
||||
|
||||
cmd-rmmap-desc = Removes a map from the world. You cannot remove nullspace.
|
||||
cmd-rmmap-help = rmmap <mapId>
|
||||
|
||||
cmd-savegrid-desc = Serializes a grid to disk.
|
||||
cmd-savegrid-help = savegrid <gridID> <Path>
|
||||
|
||||
cmd-testbed-desc = Loads a physics testbed on the specified map.
|
||||
cmd-testbed-help = testbed <mapid> <test>
|
||||
|
||||
cmd-saveconfig-desc = Saves the client configuration to the config file.
|
||||
cmd-saveconfig-help = saveconfig
|
||||
|
||||
## 'flushcookies' command
|
||||
# Note: the flushcookies command is from Robust.Client.WebView, it's not in the main engine code.
|
||||
|
||||
cmd-flushcookies-desc = Flush CEF cookie storage to disk
|
||||
cmd-flushcookies-help = This ensure cookies are properly saved to disk in the event of unclean shutdowns.
|
||||
Note that the actual operation is asynchronous.
|
||||
|
||||
## 'addcomp' command
|
||||
cmd-addcomp-desc = Adds a component to an entity.
|
||||
cmd-addcomp-help = addcomp <uid> <componentName>
|
||||
cmd-addcompc-desc = Adds a component to an entity on the client.
|
||||
cmd-addcompc-help = addcompc <uid> <componentName>
|
||||
|
||||
## 'rmcomp' command
|
||||
cmd-rmcomp-desc = Removes a component from an entity.
|
||||
cmd-rmcomp-help = rmcomp <uid> <componentName>
|
||||
cmd-rmcompc-desc = Removes a component from an entity on the client.
|
||||
cmd-rmcompc-help = rmcomp <uid> <componentName>
|
||||
|
||||
## 'addview' command
|
||||
cmd-addview-desc = Allows you to subscribe to an entity's view for debugging purposes.
|
||||
cmd-addview-help = addview <entityUid>
|
||||
cmd-addviewc-desc = Allows you to subscribe to an entity's view for debugging purposes.
|
||||
cmd-addviewc-help = addview <entityUid>
|
||||
|
||||
## 'removeview' command
|
||||
cmd-removeview-desc = Allows you to unsubscribe to an entity's view for debugging purposes.
|
||||
cmd-removeview-help = removeview <entityUid>
|
||||
|
||||
## 'loglevel' command
|
||||
cmd-loglevel-desc = Changes the log level for a provided sawmill.
|
||||
cmd-loglevel-help = Usage: loglevel <sawmill> <level>
|
||||
sawmill: A label prefixing log messages. This is the one you're setting the level for.
|
||||
level: The log level. Must match one of the values of the LogLevel enum.
|
||||
|
||||
cmd-testlog-desc = Writes a test log to a sawmill.
|
||||
cmd-testlog-help = Usage: testlog <sawmill> <level> <message>
|
||||
sawmill: A label prefixing the logged message.
|
||||
level: The log level. Must match one of the values of the LogLevel enum.
|
||||
message: The message to be logged. Wrap this in double quotes if you want to use spaces.
|
||||
|
||||
## 'vv' command
|
||||
cmd-vv-desc = Opens View Variables.
|
||||
cmd-vv-help = Usage: vv <entity ID|IoC interface name|SIoC interface name>
|
||||
|
||||
## 'showvelocities' command
|
||||
cmd-showvelocities-desc = Displays your angular and linear velocities.
|
||||
cmd-showvelocities-help = Usage: showvelocities
|
||||
|
||||
## 'setinputcontext' command
|
||||
cmd-setinputcontext-desc = Sets the active input context.
|
||||
cmd-setinputcontext-help = Usage: setinputcontext <context>
|
||||
|
||||
## 'forall' command
|
||||
cmd-forall-desc = Runs a command over all entities with a given component.
|
||||
cmd-forall-help = Usage: forall <bql query> do <command...>
|
||||
|
||||
## 'delete' command
|
||||
cmd-delete-desc = Deletes the entity with the specified ID.
|
||||
cmd-delete-help = delete <entity UID>
|
||||
|
||||
# System commands
|
||||
cmd-showtime-desc = Shows the server time.
|
||||
cmd-showtime-help = showtime
|
||||
|
||||
cmd-restart-desc = Gracefully restarts the server (not just the round).
|
||||
cmd-restart-help = restart
|
||||
|
||||
cmd-shutdown-desc = Gracefully shuts down the server.
|
||||
cmd-shutdown-help = shutdown
|
||||
|
||||
cmd-saveconfig-desc = Saves the server configuration to the config file.
|
||||
cmd-saveconfig-help = saveconfig
|
||||
|
||||
cmd-netaudit-desc = Prints into about NetMsg security.
|
||||
cmd-netaudit-help = netaudit
|
||||
|
||||
# Player commands
|
||||
cmd-tp-desc = Teleports a player to any location in the round.
|
||||
cmd-tp-help = tp <x> <y> [<mapID>]
|
||||
|
||||
cmd-tpto-desc = Teleports the current player or the specified players/entities to the location of last player/entity specified.d.
|
||||
cmd-tpto-help = tpto <username|uid> [username|uid]...
|
||||
|
||||
cmd-listplayers-desc = Lists all players currently connected.
|
||||
cmd-listplayers-help = listplayers
|
||||
|
||||
cmd-kick-desc = Kicks a connected player out of the server, disconnecting them.
|
||||
cmd-kick-help = kick <PlayerIndex> [<Reason>]
|
||||
|
||||
# Spin command
|
||||
cmd-spin-desc = Causes an entity to spin. Default entity is the attached player's parent.
|
||||
cmd-spin-help = spin velocity [drag] [entityUid]
|
||||
|
||||
# Localization command
|
||||
cmd-rldloc-desc = Reloads localization (client & server).
|
||||
cmd-rldloc-help = Usage: rldloc
|
||||
|
||||
# Debug entity controls
|
||||
cmd-spawn-desc = Spawns an entity with specific type.
|
||||
cmd-spawn-help = spawn <prototype> OR spawn <prototype> <relative entity ID> OR spawn <prototype> <x> <y>
|
||||
cmd-cspawn-desc = Spawns a client-side entity with specific type at your feet.
|
||||
cmd-cspawn-help = cspawn <entity type>
|
||||
|
||||
cmd-scale-desc = Increases or decreases an entity's size naively.
|
||||
cmd-scale-help = scale <entityUid> <float>
|
||||
|
||||
cmd-dumpentities-desc = Dump entity list.
|
||||
cmd-dumpentities-help = Dumps entity list of UIDs and prototype.
|
||||
|
||||
cmd-getcomponentregistration-desc = Gets component registration information.
|
||||
cmd-getcomponentregistration-help = Usage: getcomponentregistration <componentName>
|
||||
|
||||
cmd-showrays-desc = Toggles debug drawing of physics rays. An integer for <raylifetime> must be provided.
|
||||
cmd-showrays-help = Usage: showrays <raylifetime>
|
||||
|
||||
cmd-disconnect-desc = Immediately disconnect from the server and go back to the main menu.
|
||||
cmd-disconnect-help = Usage: disconnect
|
||||
|
||||
cmd-entfo-desc = Displays verbose diagnostics for an entity.
|
||||
cmd-entfo-help = Usage: entfo <entityuid>
|
||||
The entity UID can be prefixed with 'c' to convert it to a client entity UID.
|
||||
|
||||
cmd-fuck-desc = Throws an exception
|
||||
cmd-fuck-help = Throws an exception
|
||||
|
||||
cmd-showpos-desc = Enables debug drawing over all entity positions in the game.
|
||||
cmd-showpos-help = Usage: showpos
|
||||
|
||||
cmd-sggcell-desc = Lists entities on a snap grid cell.
|
||||
cmd-sggcell-help = Usage: sggcell <gridID> <vector2i>\nThat vector2i param is in the form x<int>,y<int>.
|
||||
|
||||
cmd-overrideplayername-desc = Changes the name used when attempting to connect to the server.
|
||||
cmd-overrideplayername-help = Usage: overrideplayername <name>
|
||||
|
||||
cmd-showanchored-desc = Shows anchored entities on a particular tile
|
||||
cmd-showanchored-help = Usage: showanchored
|
||||
|
||||
cmd-dmetamem-desc = Dumps a type's members in a format suitable for the sandbox configuration file.
|
||||
cmd-dmetamem-help = Usage: dmetamem <type>
|
||||
|
||||
cmd-dmetamem-desc = Displays chunk bounds for the purposes of rendering.
|
||||
cmd-dmetamem-help = Usage: showchunkbb <type>
|
||||
|
||||
cmd-launchauth-desc = Load authentication tokens from launcher data to aid in testing of live servers.
|
||||
cmd-launchauth-help = Usage: launchauth <account name>
|
||||
|
||||
cmd-lightbb-desc = Toggles whether to show light bounding boxes.
|
||||
cmd-lightbb-help = Usage: lightbb
|
||||
|
||||
cmd-monitorinfo-desc = Monitors info
|
||||
cmd-monitorinfo-help = Usage: monitorinfo <id>
|
||||
|
||||
cmd-setmonitor-desc = Set monitor
|
||||
cmd-setmonitor-help = Usage: setmonitor <id>
|
||||
|
||||
cmd-physics-desc = Shows a debug physics overlay. The arg supplied specifies the overlay.
|
||||
cmd-physics-help = Usage: physics <aabbs / com / contactnormals / contactpoints / distance / joints / shapeinfo / shapes>
|
||||
|
||||
cmd-hardquit-desc = Kills the game client instantly.
|
||||
cmd-hardquit-help = Kills the game client instantly, leaving no traces. No telling the server goodbye.
|
||||
|
||||
cmd-quit-desc = Shuts down the game client gracefully.
|
||||
cmd-quit-help = Properly shuts down the game client, notifying the connected server and such.
|
||||
|
||||
cmd-csi-desc = Opens a C# interactive console.
|
||||
cmd-csi-help = Usage: csi
|
||||
|
||||
cmd-scsi-desc = Opens a C# interactive console on the server.
|
||||
cmd-scsi-help = Usage: scsi
|
||||
|
||||
cmd-watch-desc = Opens a variable watch window.
|
||||
cmd-watch-help = Usage: watch
|
||||
|
||||
cmd-showspritebb-desc = Toggle whether sprite bounds are shown
|
||||
cmd-showspritebb-help = Usage: showspritebb
|
||||
|
||||
cmd-togglelookup-desc = Shows / hides entitylookup bounds via an overlay.
|
||||
cmd-togglelookup-help = Usage: togglelookup
|
||||
|
||||
cmd-net_entityreport-desc = Toggles the net entity report panel.
|
||||
cmd-net_entityreport-help = Usage: net_entityreport
|
||||
|
||||
cmd-net_refresh-desc = Requests a full server state.
|
||||
cmd-net_refresh-help = Usage: net_refresh
|
||||
|
||||
cmd-net_graph-desc = Toggles the net statistics pannel.
|
||||
cmd-net_graph-help = Usage: net_graph
|
||||
|
||||
cmd-net_watchent-desc = Dumps all network updates for an EntityId to the console.
|
||||
cmd-net_watchent-help = Usage: net_watchent <0|EntityUid>
|
||||
|
||||
cmd-net_draw_interp-desc = Toggles the debug drawing of the network interpolation.
|
||||
cmd-net_draw_interp-help = Usage: net_draw_interp <0|EntityUid>
|
||||
|
||||
cmd-vram-desc = Displays video memory usage statics by the game.
|
||||
cmd-vram-help = Usage: vram
|
||||
|
||||
cmd-showislands-desc = Shows the current physics bodies involved in each physics island.
|
||||
cmd-showislands-help = Usage: showislands
|
||||
|
||||
cmd-showgridnodes-desc = Shows the nodes for grid split purposes.
|
||||
cmd-showgridnodes-help = Usage: showgridnodes
|
||||
|
||||
cmd-profsnap-desc = Make a profiling snapshot.
|
||||
cmd-profsnap-help = Usage: profsnap
|
||||
|
||||
cmd-devwindow-desc = Dev Window
|
||||
cmd-devwindow-help = Usage: devwindow
|
||||
|
||||
cmd-devwindow-desc = Open file
|
||||
cmd-devwindow-help = Usage: testopenfile
|
||||
|
||||
cmd-scene-desc = Immediately changes the UI scene/state.
|
||||
cmd-scene-help = Usage: scene <className>
|
||||
|
||||
cmd-szr_stats-desc = Report serializer statistics.
|
||||
cmd-szr_stats-help = Usage: szr_stats
|
||||
|
||||
cmd-hwid-desc = Returns the current HWID (HardWare ID).
|
||||
cmd-hwid-help = Usage: hwid
|
||||
|
||||
cmd-vvread-desc = Retrieve a path's value using VV (View Variables).
|
||||
cmd-vvread-desc = Usage: vvread <path>
|
||||
|
||||
cmd-vvwrite-desc = Modify a path's value using VV (View Variables).
|
||||
cmd-vvwrite-desc = Usage: vvwrite <path>
|
||||
|
||||
cmd-vv-desc = Opens View Variables (VV).
|
||||
cmd-vv-desc = Usage: vv <path|entity ID|guihover>
|
||||
|
||||
cmd-vvinvoke-desc = Invoke/Call a path with arguments using VV.
|
||||
cmd-vvinvoke-desc = Usage: vvinvoke <path> [arguments...]
|
||||
|
||||
cmd-dump_dependency_injectors-desc = Dump IoCManager's dependency injector cache.
|
||||
cmd-dump_dependency_injectors-help = Usage: dump_dependency_injectors
|
||||
cmd-dump_dependency_injectors-total-count = Total count: { $total }
|
||||
|
||||
@@ -1 +1 @@
|
||||
midi-panic-command-description = Turns off every note for every active MIDI renderer.
|
||||
cmd-midipanic-desc = Turns off every note for every active MIDI renderer.
|
||||
|
||||
63
Resources/Locale/pt-BR/_engine_lib.ftl
Normal file
63
Resources/Locale/pt-BR/_engine_lib.ftl
Normal file
@@ -0,0 +1,63 @@
|
||||
# Used internally by the THE() function.
|
||||
zzzz-the = { PROPER($ent) ->
|
||||
*[false] a { $ent }
|
||||
[true] { $ent }
|
||||
}
|
||||
|
||||
# Used internally by the SUBJECT() function.
|
||||
zzzz-subject-pronoun = { GENDER($ent) ->
|
||||
[male] ele
|
||||
[female] ela
|
||||
[epicene] eles
|
||||
*[neuter] ele
|
||||
}
|
||||
|
||||
# Used internally by the OBJECT() function.
|
||||
zzzz-object-pronoun = { GENDER($ent) ->
|
||||
[male] ele
|
||||
[female] ela
|
||||
[epicene] eles
|
||||
*[neuter] isso
|
||||
}
|
||||
|
||||
# Used internally by the POSS-PRONOUN() function.
|
||||
zzzz-possessive-pronoun = { GENDER($ent) ->
|
||||
[male] dele
|
||||
[female] dela
|
||||
[epicene] deles
|
||||
*[neuter] dele
|
||||
}
|
||||
|
||||
# Used internally by the POSS-ADJ() function.
|
||||
zzzz-possessive-adjective = { GENDER($ent) ->
|
||||
[male] dele
|
||||
[female] dela
|
||||
[epicene] deles
|
||||
*[neuter] dele
|
||||
}
|
||||
|
||||
# Used internally by the REFLEXIVE() function.
|
||||
zzzz-reflexive-pronoun = { GENDER($ent) ->
|
||||
[male] ele mesmo
|
||||
[female] ela mesmo
|
||||
[epicene] eles mesmos
|
||||
*[neuter] ele mesmo
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-BE() function.
|
||||
zzzz-conjugate-be = { GENDER($ent) ->
|
||||
[epicene] é
|
||||
*[other] é
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-HAVE() function.
|
||||
zzzz-conjugate-have = { GENDER($ent) ->
|
||||
[epicene] tenho
|
||||
*[other] tem
|
||||
}
|
||||
|
||||
# Used internally by the CONJUGATE-BASIC() function.
|
||||
zzzz-conjugate-basic = { GENDER($ent) ->
|
||||
[epicene] { $first }
|
||||
*[other] { $second }
|
||||
}
|
||||
16
Resources/Locale/pt-BR/client-state-commands.ftl
Normal file
16
Resources/Locale/pt-BR/client-state-commands.ftl
Normal file
@@ -0,0 +1,16 @@
|
||||
# Strings Loc para vários comandos relacionados ao estado da entidade e ao PVS do lado do cliente
|
||||
|
||||
cmd-reset-ent-help = Uso: resetent <Entity UID>
|
||||
cmd-reset-ent-desc = Redefina uma entidade para o estado do servidor recebido mais recentemente. Isso também redefinirá as entidades que foram desanexadas para espaço nulo.
|
||||
|
||||
cmd-reset-all-ents-help = Uso: resetallents
|
||||
cmd-reset-all-ents-desc = Redefine todas as entidades para o estado do servidor recebido mais recentemente. Isso afeta apenas as entidades que não foram desanexadas ao espaço nulo.
|
||||
|
||||
cmd-detach-ent-help = Uso: detachent <Entity UID>
|
||||
cmd-detach-ent-desc = Desanexar uma entidade para espaço nulo, como se tivesse saído do intervalo PVS.
|
||||
|
||||
cmd-local-delete-help = Uso: localdelete <Entity UID>
|
||||
cmd-local-delete-desc = Exclui uma entidade. Ao contrário do comando delete normal, este é CLIENT-SIDE. A menos que a entidade seja uma entidade do lado do cliente, isso provavelmente causará erros.
|
||||
|
||||
cmd-full-state-reset-help = Uso: fullstatereset
|
||||
cmd-full-state-reset-desc = Descarta qualquer informação de estado da entidade e solicita um estado completo do servidor.
|
||||
161
Resources/Locale/pt-BR/commands.ftl
Normal file
161
Resources/Locale/pt-BR/commands.ftl
Normal file
@@ -0,0 +1,161 @@
|
||||
### Localization for engine console commands
|
||||
|
||||
## generic
|
||||
|
||||
cmd-invalid-arg-number-error = Número inválido de argumentos.
|
||||
|
||||
cmd-parse-failure-integer = {$arg} não é um inteiro válido.
|
||||
cmd-parse-failure-float = {$arg} não é um float válido.
|
||||
cmd-parse-failure-bool = {$arg} não é um booleano válido.
|
||||
cmd-parse-failure-uid = {$arg} não é um UID de entidade válido.
|
||||
cmd-parse-failure-entity-exist = UID {$arg} não corresponde a uma entidade existente.
|
||||
|
||||
|
||||
## 'help' command
|
||||
cmd-help-desc = Exibir ajuda geral ou texto de ajuda para um comando específico
|
||||
cmd-help-help = Uso: help [command name]
|
||||
Quando nenhum nome de comando é fornecido, exibe o texto de ajuda geral. Se um nome de comando for fornecido, exibe o texto de ajuda para esse comando.
|
||||
|
||||
cmd-help-no-args = Para exibir a ajuda de um comando específico, escreva 'help <command>'. Para listar todos os comandos disponíveis, escreva 'list'. Para procurar comandos, use 'list <filter>'.
|
||||
cmd-help-unknown = Comando desconhecido: { $command }
|
||||
cmd-help-top = { $command } - { $description }
|
||||
cmd-help-invalid-args = Quantidade de argumentos inválida.
|
||||
cmd-help-arg-cmdname = [command name]
|
||||
|
||||
## 'cvar' command
|
||||
cmd-cvar-desc = Obtém ou define um CVar.
|
||||
cmd-cvar-help = Uso: cvar <name | ?> [value]
|
||||
Se um valor for passado, o valor será analisado e armazenado como o novo valor do CVar.
|
||||
Caso contrário, o valor atual do CVar é exibido.
|
||||
Use 'cvar ?' para obter uma lista de todos os CVars registrados.
|
||||
|
||||
cmd-cvar-invalid-args = Deve fornecer exatamente um ou dois argumentos.
|
||||
cmd-cvar-not-registered = CVar '{ $cvar }' não está registrado. Use 'cvar ?' para obter uma lista de todos os CVars registrados.
|
||||
cmd-cvar-parse-error = O valor de entrada está no formato incorreto para o tipo { $type }
|
||||
cmd-cvar-compl-list = Listar CVars disponíveis
|
||||
cmd-cvar-arg-name = <name | ?>
|
||||
cmd-cvar-value-hidden = <value hidden>
|
||||
|
||||
## 'list' command
|
||||
cmd-list-desc = Lista os comandos disponíveis, com filtro de pesquisa opcional
|
||||
cmd-list-help = Uso: list [filter]
|
||||
Lista todos os comandos disponíveis. Se um argumento for fornecido, ele será usado para filtrar comandos por nome.
|
||||
|
||||
cmd-list-heading = NOME DESC{"\u000A"}-------------------------{"\u000A"}
|
||||
|
||||
cmd-list-arg-filter = [filter]
|
||||
|
||||
## '>' command, aka remote exec
|
||||
cmd-remoteexec-desc = Executa comandos do lado do servidor
|
||||
cmd-remoteexec-help = Uso: > <command> [arg] [arg] [arg...]
|
||||
Executa um comando no servidor. Isso é necessário se um comando com o mesmo nome existir no cliente, pois a simples execução do comando executaria o comando do cliente primeiro.
|
||||
|
||||
## 'gc' command
|
||||
cmd-gc-desc = Execute o GC (coletor de lixo)
|
||||
cmd-gc-help = Uso: gc [generation]
|
||||
Usa GC.Collect() para executar o Garbage Collector.
|
||||
Se um argumento for fornecido, ele será analisado como um número de geração do GC e GC.Collect(int) será usado.
|
||||
Use o comando 'gfc' para fazer um GC completo compactando LOH.
|
||||
cmd-gc-failed-parse = Falha ao analisar o argumento.
|
||||
cmd-gc-arg-generation = [generation]
|
||||
|
||||
## 'gcf' command
|
||||
cmd-gcf-desc = Execute o GC, totalmente, compactando LOH e tudo.
|
||||
cmd-gcf-help = Uso: gcf
|
||||
Faz um GC.Collect(2, GCCollectionMode.Forced, true, true) completo enquanto também compacta LOH.
|
||||
Isso provavelmente será bloqueado por centenas de milissegundos, esteja avisado.
|
||||
|
||||
## 'gc_mode' command
|
||||
cmd-gc_mode-desc = Alterar/ler o modo de latência do GC
|
||||
cmd-gc_mode-help = Uso: gc_mode [type]
|
||||
Se nenhum argumento for fornecido, retornará o modo de latência do GC atual.
|
||||
Se um argumento for passado, ele será analisado como GCLatencyMode e definido como o modo de latência do GC.
|
||||
|
||||
cmd-gc_mode-current = modo de latência atual do gc: { $prevMode }
|
||||
cmd-gc_mode-possible = modos possíveis:
|
||||
cmd-gc_mode-option = - { $mode }
|
||||
cmd-gc_mode-unknown = modo de latência gc desconhecido: { $arg }
|
||||
cmd-gc_mode-attempt = tentando alterar o modo de latência do gc: { $prevMode } -> { $mode }
|
||||
cmd-gc_mode-result = modo de latência gc resultante: { $mode }
|
||||
cmd-gc_mode-arg-type = [type]
|
||||
|
||||
## 'mem' command
|
||||
cmd-mem-desc = Imprime informações de memória gerenciada
|
||||
cmd-mem-help = Uso: mem
|
||||
|
||||
cmd-mem-report = Tamanho da pilha: { TOSTRING($heapSize, "N0") }
|
||||
Total alocado: { TOSTRING($totalAllocated, "N0") }
|
||||
|
||||
## 'physics' command
|
||||
cmd-physics-overlay = {$overlay} não é uma sobreposição reconhecida
|
||||
|
||||
## 'lsasm' command
|
||||
cmd-lsasm-desc = Lista assemblies carregados por contexto de carregamento
|
||||
cmd-lsasm-help = Uso: lsasm
|
||||
|
||||
## 'exec' command
|
||||
cmd-exec-desc = Executa um arquivo de script dos dados de usuário graváveis do jogo
|
||||
cmd-exec-help = Uso: exec <fileName>
|
||||
Cada linha no arquivo é executada como um único comando, a menos que comece com um #
|
||||
|
||||
cmd-exec-arg-filename = <fileName>
|
||||
|
||||
## 'dump_net_comps' command
|
||||
cmd-dump_net_comps-desc = Imprime a tabela de componentes em rede.
|
||||
cmd-dump_net_comps-help = Uso: dump_net-comps
|
||||
|
||||
cmd-dump_net_comps-error-writeable = Registro ainda gravável, IDs de rede não foram gerados.
|
||||
cmd-dump_net_comps-header = Registros de componentes em rede:
|
||||
|
||||
## 'dump_event_tables' command
|
||||
cmd-dump_event_tables-desc = Imprime tabelas de eventos direcionados para uma entidade.
|
||||
cmd-dump_event_tables-help = Uso: dump_event_tables <entityUid>
|
||||
|
||||
cmd-dump_event_tables-missing-arg-entity = Argumento de entidade ausente
|
||||
cmd-dump_event_tables-error-entity = Entidade inválida
|
||||
cmd-dump_event_tables-arg-entity = <entityUid>
|
||||
|
||||
## 'monitor' command
|
||||
cmd-monitor-desc = Alterna um monitor de depuração no menu F3.
|
||||
cmd-monitor-help = Uso: monitor <name>
|
||||
Os monitores possíveis são: { $monitors }
|
||||
Você também pode usar os valores especiais "-all" e "+all" para ocultar ou mostrar todos os monitores, respectivamente.
|
||||
|
||||
cmd-monitor-arg-monitor = <monitor>
|
||||
cmd-monitor-invalid-name = Nome do monitor inválido
|
||||
cmd-monitor-arg-count = Argumento do monitor ausente
|
||||
cmd-monitor-minus-all-hint = Esconde todos os monitores
|
||||
cmd-monitor-plus-all-hint = Mostra todos os monitores
|
||||
|
||||
|
||||
## Mapping commands
|
||||
|
||||
cmd-savemap-desc = Serializa um mapa para o disco. Não salvará um mapa pós-inicialização a menos que seja forçado.
|
||||
cmd-savemap-help = savemap <MapID> <Path> [force]
|
||||
cmd-savemap-not-exist = O mapa de destino não existe.
|
||||
cmd-savemap-init-warning = Tentativa de salvar um mapa pós-inicialização sem forçar o salvamento.
|
||||
cmd-savemap-attempt = Tentando salvar o mapa {$mapId} em {$path}.
|
||||
cmd-savemap-success = Mapa salvo com sucesso.
|
||||
cmd-hint-savemap-id = <MapID>
|
||||
cmd-hint-savemap-path = <Path>
|
||||
cmd-hint-savemap-force = [bool]
|
||||
|
||||
cmd-loadmap-desc = Carrega um mapa do disco para o jogo.
|
||||
cmd-loadmap-help = loadmap <MapID> <Path> [x] [y] [rotation] [consistentUids]
|
||||
cmd-loadmap-nullspace = Você não pode carregar no mapa 0.
|
||||
cmd-loadmap-exists = Mapa {$mapId} já existe.
|
||||
cmd-loadmap-success = Mapa {$mapId} foi carregado em {$path}.
|
||||
cmd-loadmap-error = Ocorreu um erro ao carregar o mapa de {$path}.
|
||||
cmd-hint-loadmap-x-position = [x-position]
|
||||
cmd-hint-loadmap-y-position = [y-position]
|
||||
cmd-hint-loadmap-rotation = [rotation]
|
||||
cmd-hint-loadmap-uids = [float]
|
||||
|
||||
cmd-hint-savebp-id = <Grid EntityID>
|
||||
|
||||
## 'flushcookies' command
|
||||
# Note: the flushcookies command is from Robust.Client.WebView, it's not in the main engine code.
|
||||
|
||||
cmd-flushcookies-desc = Liberar o armazenamento de cookies CEF para o disco
|
||||
cmd-flushcookies-help = Isso garante que os cookies sejam salvos corretamente no disco no caso de desligamentos impróprios.
|
||||
Observe que a operação real é assíncrona.
|
||||
10
Resources/Locale/pt-BR/controls.ftl
Normal file
10
Resources/Locale/pt-BR/controls.ftl
Normal file
@@ -0,0 +1,10 @@
|
||||
color-selector-sliders-red = R
|
||||
color-selector-sliders-green = G
|
||||
color-selector-sliders-blue = B
|
||||
color-selector-sliders-hue = H
|
||||
color-selector-sliders-saturation = S
|
||||
color-selector-sliders-value = V
|
||||
color-selector-sliders-alpha = A
|
||||
|
||||
color-selector-sliders-rgb = RGB
|
||||
color-selector-sliders-hsv = HSV
|
||||
11
Resources/Locale/pt-BR/custom-controls.ftl
Normal file
11
Resources/Locale/pt-BR/custom-controls.ftl
Normal file
@@ -0,0 +1,11 @@
|
||||
## EntitySpawnWindow
|
||||
|
||||
entity-spawn-window-title = Painel de Criação de Entidade
|
||||
entity-spawn-window-search-bar-placeholder = pesquisar
|
||||
entity-spawn-window-clear-button = Limpar
|
||||
entity-spawn-window-erase-button-text = Modo Apagar
|
||||
entity-spawn-window-override-menu-tooltip = Substituir posicionamento
|
||||
|
||||
## Console
|
||||
|
||||
console-line-edit-placeholder = Comando aqui
|
||||
1
Resources/Locale/pt-BR/defaultwindow.ftl
Normal file
1
Resources/Locale/pt-BR/defaultwindow.ftl
Normal file
@@ -0,0 +1 @@
|
||||
defaultwindow-placeholder-title = Exemplo de título de janela aqui
|
||||
54
Resources/Locale/pt-BR/input.ftl
Normal file
54
Resources/Locale/pt-BR/input.ftl
Normal file
@@ -0,0 +1,54 @@
|
||||
input-key-Escape = Escape
|
||||
input-key-Control = Control
|
||||
input-key-Shift = Shift
|
||||
input-key-Alt = Alt
|
||||
input-key-Menu = Menu
|
||||
input-key-F1 = F1
|
||||
input-key-F2 = F2
|
||||
input-key-F3 = F3
|
||||
input-key-F4 = F4
|
||||
input-key-F5 = F5
|
||||
input-key-F6 = F6
|
||||
input-key-F7 = F7
|
||||
input-key-F8 = F8
|
||||
input-key-F9 = F9
|
||||
input-key-F10 = F10
|
||||
input-key-F11 = F11
|
||||
input-key-F12 = F12
|
||||
input-key-F13 = F13
|
||||
input-key-F14 = F14
|
||||
input-key-F15 = F15
|
||||
input-key-Pause = Pause
|
||||
input-key-Left = Left
|
||||
input-key-Up = Up
|
||||
input-key-Down = Down
|
||||
input-key-Right = Right
|
||||
input-key-Space = Space
|
||||
input-key-Return = Return
|
||||
input-key-NumpadEnter = Num Enter
|
||||
input-key-BackSpace = Backspace
|
||||
input-key-Tab = Tab
|
||||
input-key-PageUp = Page Up
|
||||
input-key-PageDown = Page Down
|
||||
input-key-End = End
|
||||
input-key-Home = Home
|
||||
input-key-Insert = Insert
|
||||
input-key-Delete = Delete
|
||||
input-key-MouseLeft = Mouse Left
|
||||
input-key-MouseRight = Mouse Right
|
||||
input-key-MouseMiddle = Mouse Middle
|
||||
input-key-MouseButton4 = Mouse 4
|
||||
input-key-MouseButton5 = Mouse 5
|
||||
input-key-MouseButton6 = Mouse 6
|
||||
input-key-MouseButton7 = Mouse 7
|
||||
input-key-MouseButton8 = Mouse 8
|
||||
input-key-MouseButton9 = Mouse 9
|
||||
|
||||
input-key-LSystem-win = Left Win
|
||||
input-key-RSystem-win = Right Win
|
||||
input-key-LSystem-mac = Left Cmd
|
||||
input-key-RSystem-mac = Right Cmd
|
||||
input-key-LSystem-linux = Left Meta
|
||||
input-key-RSystem-linux = Right Meta
|
||||
|
||||
input-key-unknown = <unknown key>
|
||||
1
Resources/Locale/pt-BR/midi-commands.ftl
Normal file
1
Resources/Locale/pt-BR/midi-commands.ftl
Normal file
@@ -0,0 +1 @@
|
||||
cmd-midipanic-desc = Desliga cada nota para cada renderizador MIDI ativo.
|
||||
1
Resources/Locale/pt-BR/tab-container.ftl
Normal file
1
Resources/Locale/pt-BR/tab-container.ftl
Normal file
@@ -0,0 +1 @@
|
||||
tab-container-not-tab-title-provided = Sem título
|
||||
11
Resources/Locale/pt-BR/view-variables.ftl
Normal file
11
Resources/Locale/pt-BR/view-variables.ftl
Normal file
@@ -0,0 +1,11 @@
|
||||
## ViewVariablesInstanceEntity
|
||||
|
||||
view-variable-instance-entity-server-components-add-component-button-placeholder = Adicionar Componente
|
||||
view-variable-instance-entity-client-variables-tab-title = Variávies do Cliente
|
||||
view-variable-instance-entity-client-components-tab-title = Componentes do Cliente
|
||||
view-variable-instance-entity-server-variables-tab-title = Variávies do Servidor
|
||||
view-variable-instance-entity-server-components-tab-title = Componentes do Servidor
|
||||
view-variable-instance-entity-client-components-search-bar-placeholder = Pesquisar
|
||||
view-variable-instance-entity-server-components-search-bar-placeholder = Pesquisar
|
||||
view-variable-instance-entity-add-window-server-components = Adicionar Componente [S]
|
||||
view-variable-instance-entity-add-window-client-components = Adicionar Componente [C]
|
||||
@@ -9,6 +9,14 @@ public static class Diagnostics
|
||||
public const string IdAccess = "RA0002";
|
||||
public const string IdExplicitVirtual = "RA0003";
|
||||
public const string IdTaskResult = "RA0004";
|
||||
public const string IdUseGenericVariant = "RA0005";
|
||||
public const string IdUseGenericVariantInvalidUsage = "RA0006";
|
||||
public const string IdUseGenericVariantAttributeValueError = "RA0007";
|
||||
public const string IdNotNullableFlagNotSet = "RA0008";
|
||||
public const string IdInvalidNotNullableFlagValue = "RA0009";
|
||||
public const string IdInvalidNotNullableFlagImplementation = "RA0010";
|
||||
public const string IdInvalidNotNullableFlagType = "RA0011";
|
||||
public const string IdNotNullableFlagValueType = "RA0012";
|
||||
|
||||
public static SuppressionDescriptor MeansImplicitAssignment =>
|
||||
new SuppressionDescriptor("RADC1000", "CS0649", "Marked as implicitly assigned.");
|
||||
|
||||
171
Robust.Analyzers/NotNullableFlagAnalyzer.cs
Normal file
171
Robust.Analyzers/NotNullableFlagAnalyzer.cs
Normal file
@@ -0,0 +1,171 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.CodeAnalysis.Operations;
|
||||
|
||||
namespace Robust.Analyzers;
|
||||
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
||||
public sealed class NotNullableFlagAnalyzer : DiagnosticAnalyzer
|
||||
{
|
||||
private const string Attribute = "Robust.Shared.Analyzers.NotNullableFlagAttribute";
|
||||
|
||||
private static readonly DiagnosticDescriptor NotNullableNotSetRule = new (
|
||||
Diagnostics.IdNotNullableFlagNotSet,
|
||||
"Not Nullable Flag not set",
|
||||
"Class type parameter {0} is not annotated as nullable and notNullableOverride is not set to true",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
"Assign true to notNullableOverride or specify the type parameter as nullable.");
|
||||
|
||||
private static readonly DiagnosticDescriptor InvalidNotNullableValueRule = new (
|
||||
Diagnostics.IdInvalidNotNullableFlagValue,
|
||||
"Not Nullable Flag wrongfully set",
|
||||
"Class type parameter {0} is annotated as nullable but notNullableOverride is set to true",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
"Remove the true assignment to notNullableOverride or remove the nullable specifier of the type parameter.");
|
||||
|
||||
private static readonly DiagnosticDescriptor InvalidNotNullableImplementationRule = new (
|
||||
Diagnostics.IdInvalidNotNullableFlagImplementation,
|
||||
"Invalid NotNullable flag implementation.",
|
||||
"NotNullable flag is either not typed as bool, or does not have a default value equaling false",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
"Ensure that the notNullable flag is typed bool and has false set as a default value.");
|
||||
|
||||
private static readonly DiagnosticDescriptor InvalidNotNullableTypeRule = new (
|
||||
Diagnostics.IdInvalidNotNullableFlagType,
|
||||
"Failed to resolve type parameter",
|
||||
"Failed to resolve type parameter \"{0}\".",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
"Use nameof to avoid typos.");
|
||||
|
||||
private static readonly DiagnosticDescriptor NotNullableFlagValueTypeRule = new (
|
||||
Diagnostics.IdNotNullableFlagValueType,
|
||||
"NotNullable flag not supported for value types.",
|
||||
"Value types as generic arguments are not supported for NotNullable flags",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
"Nullable value types are distinct at runtime when inspected with reflection. Therefore they are not supported for NotNullable flags.");
|
||||
|
||||
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics =>
|
||||
ImmutableArray.Create(
|
||||
NotNullableNotSetRule,
|
||||
InvalidNotNullableValueRule,
|
||||
InvalidNotNullableImplementationRule,
|
||||
InvalidNotNullableTypeRule,
|
||||
NotNullableFlagValueTypeRule);
|
||||
|
||||
public override void Initialize(AnalysisContext context)
|
||||
{
|
||||
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
|
||||
context.EnableConcurrentExecution();
|
||||
context.RegisterOperationAction(CheckNotNullableFlag, OperationKind.Invocation);
|
||||
}
|
||||
|
||||
private bool TryGetTypeArgument(IMethodSymbol methodSymbol, string typeParamName, out ITypeSymbol typeArgument)
|
||||
{
|
||||
for (var index = 0; index < methodSymbol.TypeParameters.Length; index++)
|
||||
{
|
||||
if (methodSymbol.TypeParameters[index].Name != typeParamName)
|
||||
continue;
|
||||
|
||||
typeArgument = methodSymbol.TypeArguments[index];
|
||||
return true;
|
||||
}
|
||||
|
||||
typeArgument = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
private void CheckNotNullableFlag(OperationAnalysisContext context)
|
||||
{
|
||||
if (context.Operation is not IInvocationOperation invocationOperation || !invocationOperation.TargetMethod.IsGenericMethod)
|
||||
return;
|
||||
|
||||
var attribute = context.Compilation.GetTypeByMetadataName(Attribute);
|
||||
var @bool = context.Compilation.GetSpecialType(SpecialType.System_Boolean);
|
||||
|
||||
foreach (var argument in invocationOperation.Arguments)
|
||||
{
|
||||
if(argument.Parameter == null) continue;
|
||||
|
||||
foreach (var attributeData in argument.Parameter.GetAttributes())
|
||||
{
|
||||
if (!SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, attribute))
|
||||
continue;
|
||||
|
||||
if (!SymbolEqualityComparer.Default.Equals(argument.Parameter.Type, @bool) ||
|
||||
!argument.Parameter.HasExplicitDefaultValue ||
|
||||
argument.Parameter.ExplicitDefaultValue as bool? != false)
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(
|
||||
InvalidNotNullableImplementationRule,
|
||||
argument.Parameter.Locations[0]));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!TryGetTypeArgument(invocationOperation.TargetMethod,
|
||||
attributeData.ConstructorArguments[0].Value as string, out var typeArgument))
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(
|
||||
InvalidNotNullableTypeRule,
|
||||
argument.Parameter.Locations[0],
|
||||
attributeData.ConstructorArguments[0].Value as string));
|
||||
break;
|
||||
}
|
||||
|
||||
//until i find a way to implement it sanely, generic calls are exempt from this attribute
|
||||
if(typeArgument is ITypeParameterSymbol) break;
|
||||
|
||||
//dont ask me why, argument.ConstantValue just straight up doesnt work.
|
||||
//i still kept it in here as a fallback, incase it ever starts working again lol -<paul
|
||||
var constantValue = (argument.Value as ILiteralOperation)?.ConstantValue ?? argument.ConstantValue;
|
||||
|
||||
if (typeArgument.IsValueType)
|
||||
{
|
||||
if (argument.ArgumentKind != ArgumentKind.DefaultValue)
|
||||
{
|
||||
//todo diagnostic only use for struct types
|
||||
context.ReportDiagnostic(Diagnostic.Create(
|
||||
NotNullableFlagValueTypeRule,
|
||||
argument.Syntax.GetLocation()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (typeArgument.NullableAnnotation == NullableAnnotation.None ||
|
||||
(argument.ArgumentKind != ArgumentKind.DefaultValue && !constantValue.HasValue))
|
||||
break;
|
||||
|
||||
var flagValue = argument.ArgumentKind != ArgumentKind.DefaultValue ||
|
||||
constantValue.Value as bool? == true;
|
||||
|
||||
var nullable = typeArgument.NullableAnnotation == NullableAnnotation.Annotated;
|
||||
|
||||
if (nullable && flagValue)
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(InvalidNotNullableValueRule,
|
||||
argument.Syntax.GetLocation(),
|
||||
typeArgument));
|
||||
}
|
||||
else if (!nullable && !flagValue)
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(NotNullableNotSetRule,
|
||||
argument.Syntax.GetLocation(),
|
||||
typeArgument));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
238
Robust.Analyzers/PreferGenericVariantAnalyzer.cs
Normal file
238
Robust.Analyzers/PreferGenericVariantAnalyzer.cs
Normal file
@@ -0,0 +1,238 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CodeActions;
|
||||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.CodeAnalysis.Operations;
|
||||
|
||||
namespace Robust.Analyzers;
|
||||
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
||||
public sealed class PreferGenericVariantAnalyzer : DiagnosticAnalyzer
|
||||
{
|
||||
private const string AttributeType = "Robust.Shared.Analyzers.PreferGenericVariantAttribute";
|
||||
|
||||
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(
|
||||
UseGenericVariantDescriptor, UseGenericVariantInvalidUsageDescriptor,
|
||||
UseGenericVariantAttributeValueErrorDescriptor);
|
||||
|
||||
private static readonly DiagnosticDescriptor UseGenericVariantDescriptor = new(
|
||||
Diagnostics.IdUseGenericVariant,
|
||||
"Consider using the generic variant of this method",
|
||||
"Consider using the generic variant of this method to avoid potential allocations",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Warning,
|
||||
true,
|
||||
"Consider using the generic variant of this method to avoid potential allocations.");
|
||||
|
||||
private static readonly DiagnosticDescriptor UseGenericVariantInvalidUsageDescriptor = new(
|
||||
Diagnostics.IdUseGenericVariantInvalidUsage,
|
||||
"Invalid generic variant provided",
|
||||
"Generic variant provided mismatches the amount of type parameters of non-generic variant",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
"The non-generic variant should have at least as many type parameter at the beginning of the method as there are generic type parameters on the generic variant.");
|
||||
|
||||
private static readonly DiagnosticDescriptor UseGenericVariantAttributeValueErrorDescriptor = new(
|
||||
Diagnostics.IdUseGenericVariantAttributeValueError,
|
||||
"Failed resolving generic variant value",
|
||||
"Failed resolving generic variant value: {0}",
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true,
|
||||
"Consider using nameof to avoid any typos.");
|
||||
|
||||
public override void Initialize(AnalysisContext context)
|
||||
{
|
||||
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.ReportDiagnostics | GeneratedCodeAnalysisFlags.Analyze);
|
||||
context.EnableConcurrentExecution();
|
||||
context.RegisterOperationAction(CheckForGenericVariant, OperationKind.Invocation);
|
||||
}
|
||||
|
||||
private void CheckForGenericVariant(OperationAnalysisContext obj)
|
||||
{
|
||||
if(obj.Operation is not IInvocationOperation invocationOperation) return;
|
||||
|
||||
var preferGenericAttribute = obj.Compilation.GetTypeByMetadataName(AttributeType);
|
||||
|
||||
string genericVariant = null;
|
||||
AttributeData foundAttribute = null;
|
||||
foreach (var attribute in invocationOperation.TargetMethod.GetAttributes())
|
||||
{
|
||||
if (!SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, preferGenericAttribute))
|
||||
continue;
|
||||
|
||||
genericVariant = attribute.ConstructorArguments[0].Value as string ?? invocationOperation.TargetMethod.Name;
|
||||
foundAttribute = attribute;
|
||||
break;
|
||||
}
|
||||
|
||||
if(genericVariant == null) return;
|
||||
|
||||
var maxTypeParams = 0;
|
||||
var typeTypeSymbol = obj.Compilation.GetTypeByMetadataName("System.Type");
|
||||
foreach (var parameter in invocationOperation.TargetMethod.Parameters)
|
||||
{
|
||||
if(!SymbolEqualityComparer.Default.Equals(parameter.Type, typeTypeSymbol)) break;
|
||||
|
||||
maxTypeParams++;
|
||||
}
|
||||
|
||||
if (maxTypeParams == 0)
|
||||
{
|
||||
obj.ReportDiagnostic(
|
||||
Diagnostic.Create(UseGenericVariantInvalidUsageDescriptor,
|
||||
foundAttribute.ApplicationSyntaxReference?.GetSyntax().GetLocation()));
|
||||
return;
|
||||
}
|
||||
|
||||
IMethodSymbol genericVariantMethod = null;
|
||||
foreach (var member in invocationOperation.TargetMethod.ContainingType.GetMembers())
|
||||
{
|
||||
if (member is not IMethodSymbol methodSymbol
|
||||
|| methodSymbol.Name != genericVariant
|
||||
|| !methodSymbol.IsGenericMethod
|
||||
|| methodSymbol.TypeParameters.Length > maxTypeParams
|
||||
|| methodSymbol.Parameters.Length > invocationOperation.TargetMethod.Parameters.Length - methodSymbol.TypeParameters.Length
|
||||
) continue;
|
||||
|
||||
var typeParamCount = methodSymbol.TypeParameters.Length;
|
||||
var failedParamComparison = false;
|
||||
var objType = obj.Compilation.GetSpecialType(SpecialType.System_Object);
|
||||
for (int i = 0; i < methodSymbol.Parameters.Length; i++)
|
||||
{
|
||||
if (methodSymbol.Parameters[i].Type is ITypeParameterSymbol && SymbolEqualityComparer.Default.Equals(invocationOperation.TargetMethod.Parameters[i + typeParamCount].Type, objType))
|
||||
continue;
|
||||
|
||||
if (!SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[i].Type,
|
||||
invocationOperation.TargetMethod.Parameters[i + typeParamCount].Type))
|
||||
{
|
||||
failedParamComparison = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(failedParamComparison) continue;
|
||||
|
||||
genericVariantMethod = methodSymbol;
|
||||
}
|
||||
|
||||
if (genericVariantMethod == null)
|
||||
{
|
||||
obj.ReportDiagnostic(Diagnostic.Create(
|
||||
UseGenericVariantAttributeValueErrorDescriptor,
|
||||
foundAttribute.ApplicationSyntaxReference?.GetSyntax().GetLocation(),
|
||||
genericVariant));
|
||||
return;
|
||||
}
|
||||
|
||||
var typeOperands = new string[genericVariantMethod.TypeParameters.Length];
|
||||
for (var i = 0; i < genericVariantMethod.TypeParameters.Length; i++)
|
||||
{
|
||||
switch (invocationOperation.Arguments[i].Value)
|
||||
{
|
||||
//todo figure out if ILocalReferenceOperation, IPropertyReferenceOperation or IFieldReferenceOperation is referencing static typeof assignments
|
||||
case ITypeOfOperation typeOfOperation:
|
||||
typeOperands[i] = typeOfOperation.TypeOperand.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
|
||||
continue;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
obj.ReportDiagnostic(Diagnostic.Create(
|
||||
UseGenericVariantDescriptor,
|
||||
invocationOperation.Syntax.GetLocation(),
|
||||
ImmutableDictionary.CreateRange(new Dictionary<string, string>()
|
||||
{
|
||||
{"typeOperands", string.Join(",", typeOperands)}
|
||||
})));
|
||||
}
|
||||
}
|
||||
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp)]
|
||||
public class PreferGenericVariantCodeFixProvider : CodeFixProvider
|
||||
{
|
||||
private static string Title(string method, string[] types) => $"Use {method}<{string.Join(",", types)}>.";
|
||||
|
||||
public override FixAllProvider GetFixAllProvider()
|
||||
{
|
||||
return WellKnownFixAllProviders.BatchFixer;
|
||||
}
|
||||
|
||||
public override async Task RegisterCodeFixesAsync(CodeFixContext context)
|
||||
{
|
||||
var root = await context.Document.GetSyntaxRootAsync();
|
||||
if(root == null) return;
|
||||
|
||||
foreach (var diagnostic in context.Diagnostics)
|
||||
{
|
||||
if (!diagnostic.Properties.TryGetValue("typeOperands", out var typeOperandsRaw)
|
||||
|| typeOperandsRaw == null) continue;
|
||||
|
||||
var node = root.FindNode(diagnostic.Location.SourceSpan);
|
||||
if (node is ArgumentSyntax argumentSyntax)
|
||||
node = argumentSyntax.Expression;
|
||||
|
||||
if(node is not InvocationExpressionSyntax invocationExpression)
|
||||
continue;
|
||||
|
||||
var typeOperands = typeOperandsRaw.Split(',');
|
||||
|
||||
context.RegisterCodeFix(
|
||||
CodeAction.Create(
|
||||
Title(invocationExpression.Expression.ToString(), typeOperands),
|
||||
c => FixAsync(context.Document, invocationExpression, typeOperands, c),
|
||||
Title(invocationExpression.Expression.ToString(), typeOperands)),
|
||||
diagnostic);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<Document> FixAsync(
|
||||
Document contextDocument,
|
||||
InvocationExpressionSyntax invocationExpression,
|
||||
string[] typeOperands,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var memberAccess = (MemberAccessExpressionSyntax)invocationExpression.Expression;
|
||||
|
||||
var root = (CompilationUnitSyntax) await contextDocument.GetSyntaxRootAsync(cancellationToken);
|
||||
|
||||
var arguments = new ArgumentSyntax[invocationExpression.ArgumentList.Arguments.Count - typeOperands.Length];
|
||||
var types = new TypeSyntax[typeOperands.Length];
|
||||
|
||||
for (int i = 0; i < typeOperands.Length; i++)
|
||||
{
|
||||
types[i] = ((TypeOfExpressionSyntax)invocationExpression.ArgumentList.Arguments[i].Expression).Type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Array.Copy(
|
||||
invocationExpression.ArgumentList.Arguments.ToArray(),
|
||||
typeOperands.Length,
|
||||
arguments,
|
||||
0,
|
||||
arguments.Length);
|
||||
|
||||
memberAccess = memberAccess.WithName(SyntaxFactory.GenericName(memberAccess.Name.Identifier,
|
||||
SyntaxFactory.TypeArgumentList(SyntaxFactory.SeparatedList(types))));
|
||||
|
||||
root = root!.ReplaceNode(invocationExpression,
|
||||
invocationExpression.WithArgumentList(invocationExpression.ArgumentList.WithArguments(SyntaxFactory.SeparatedList(arguments)))
|
||||
.WithExpression(memberAccess));
|
||||
|
||||
return contextDocument.WithSyntaxRoot(root);
|
||||
}
|
||||
|
||||
public override ImmutableArray<string> FixableDiagnosticIds =>
|
||||
ImmutableArray.Create(Diagnostics.IdUseGenericVariant);
|
||||
}
|
||||
@@ -11,10 +11,20 @@
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Needed for NotNullableFlagAnalyzer. -->
|
||||
<Compile Include="..\Robust.Shared\Analyzers\NotNullableFlagAttribute.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Needed for FriendAnalyzer. -->
|
||||
<Compile Include="..\Robust.Shared\Analyzers\AccessAttribute.cs" />
|
||||
<Compile Include="..\Robust.Shared\Analyzers\AccessPermissions.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Needed for PreferGenericVariantAnalyzer. -->
|
||||
<Compile Include="..\Robust.Shared\Analyzers\PreferGenericVariantAttribute.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
1081
Robust.Benchmarks/EntityManager/ArchetypeComponentAccessBenchmark.cs
Normal file
1081
Robust.Benchmarks/EntityManager/ArchetypeComponentAccessBenchmark.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,11 +3,13 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using BenchmarkDotNet.Exporters;
|
||||
using BenchmarkDotNet.Loggers;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using BenchmarkDotNet.Parameters;
|
||||
using BenchmarkDotNet.Reports;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
@@ -20,6 +22,11 @@ namespace Robust.Benchmarks.Exporters;
|
||||
|
||||
public sealed class SQLExporter : IExporter
|
||||
{
|
||||
private static readonly JsonSerializerOptions JsonSerializerOptions = new JsonSerializerOptions
|
||||
{
|
||||
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals
|
||||
};
|
||||
|
||||
public static readonly IExporter Default = new SQLExporter();
|
||||
|
||||
private SQLExporter(){}
|
||||
@@ -74,13 +81,13 @@ public sealed class SQLExporter : IExporter
|
||||
{
|
||||
ctx.Database.OpenConnection();
|
||||
var con = (NpgsqlConnection) ctx.Database.GetDbConnection();
|
||||
con.TypeMapper.AddTypeResolverFactory(new JsonOverrideTypeHandlerResolverFactory(new JsonSerializerOptions
|
||||
{
|
||||
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals
|
||||
}));
|
||||
con.TypeMapper.AddTypeResolverFactory(new JsonOverrideTypeHandlerResolverFactory(JsonSerializerOptions));
|
||||
|
||||
ctx.Database.Migrate();
|
||||
ctx.BenchmarkRuns.Add(BenchmarkRun.FromSummary(summary, gitHash));
|
||||
foreach (var run in BenchmarkRun.FromSummary(summary, gitHash))
|
||||
{
|
||||
ctx.BenchmarkRuns.Add(run);
|
||||
}
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
finally
|
||||
@@ -131,6 +138,7 @@ class JsonOverrideTypeHandlerResolverFactory : TypeHandlerResolverFactory
|
||||
=> null; // Let the built-in resolver do this
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DesignTimeContextFactoryPostgres : IDesignTimeDbContextFactory<BenchmarkContext>
|
||||
{
|
||||
public BenchmarkContext CreateDbContext(string[] args)
|
||||
@@ -154,42 +162,66 @@ public class BenchmarkRun
|
||||
public int Id { get; set; }
|
||||
public string GitHash { get; set; } = string.Empty;
|
||||
|
||||
[Column(TypeName = "timestamptz")]
|
||||
public DateTime RunDate { get; set; }
|
||||
[Column(TypeName = "timestamptz")] public DateTime RunDate { get; set; }
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[Column(TypeName = "jsonb")]
|
||||
public BenchmarkRunReport[] Reports { get; set; } = Array.Empty<BenchmarkRunReport>();
|
||||
public string? ParameterMapping { get; set; }
|
||||
|
||||
public static BenchmarkRun FromSummary(Summary summary, string gitHash)
|
||||
[Column(TypeName = "jsonb")]
|
||||
public BenchmarkRunParameter[]? ParameterMappingJson { get; set; }
|
||||
|
||||
[Column(TypeName = "jsonb")]
|
||||
public Statistics Statistics { get; set; } = default!;
|
||||
|
||||
public static IEnumerable<BenchmarkRun> FromSummary(Summary summary, string gitHash)
|
||||
{
|
||||
return new BenchmarkRun
|
||||
var runDate = DateTime.UtcNow;
|
||||
|
||||
foreach (var benchmarkReport in summary.Reports)
|
||||
{
|
||||
Reports = summary.Reports.Select(r => new BenchmarkRunReport
|
||||
var paramString = new StringBuilder();
|
||||
var parametersItems = benchmarkReport.BenchmarkCase.Parameters.Items;
|
||||
var runParameters = new BenchmarkRunParameter[parametersItems.Count];
|
||||
for (var i = 0; i < parametersItems.Count; i++)
|
||||
{
|
||||
Parameters = r.BenchmarkCase.Parameters.Items.Select(p => new BenchmarkRunParameter
|
||||
{
|
||||
Name = p.Name,
|
||||
Value = p.Value
|
||||
}).ToArray(),
|
||||
Statistics = r.ResultStatistics
|
||||
}).ToArray(),
|
||||
Name = summary.BenchmarksCases.First().FolderInfo,
|
||||
RunDate = DateTime.UtcNow,
|
||||
GitHash = gitHash
|
||||
};
|
||||
runParameters[i] = new BenchmarkRunParameter(parametersItems[i]);
|
||||
paramString.Append(runParameters[i].ToString());
|
||||
if (i < parametersItems.Count - 1) paramString.Append(',');
|
||||
}
|
||||
|
||||
if (benchmarkReport.ResultStatistics == null)
|
||||
{
|
||||
Console.WriteLine($"err: No statistics available for {benchmarkReport.BenchmarkCase.Descriptor.DisplayInfo}!");
|
||||
continue;
|
||||
}
|
||||
|
||||
yield return new BenchmarkRun
|
||||
{
|
||||
Name = benchmarkReport.BenchmarkCase.Descriptor.DisplayInfo,
|
||||
RunDate = runDate,
|
||||
GitHash = gitHash,
|
||||
ParameterMapping = runParameters.Length > 0 ? paramString.ToString() : null,
|
||||
ParameterMappingJson = runParameters.Length > 0 ? runParameters : null,
|
||||
Statistics = benchmarkReport.ResultStatistics
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BenchmarkRunReport
|
||||
{
|
||||
public BenchmarkRunParameter[] Parameters { get; set; } = Array.Empty<BenchmarkRunParameter>();
|
||||
public Statistics Statistics { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class BenchmarkRunParameter
|
||||
public struct BenchmarkRunParameter
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public object Value { get; set; } = default!;
|
||||
|
||||
public BenchmarkRunParameter(ParameterInstance instance)
|
||||
{
|
||||
Name = instance.Name;
|
||||
Value = instance.Value;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Name}={Value}";
|
||||
}
|
||||
}
|
||||
|
||||
62
Robust.Benchmarks/Migrations/20221009235705_db.Designer.cs
generated
Normal file
62
Robust.Benchmarks/Migrations/20221009235705_db.Designer.cs
generated
Normal file
@@ -0,0 +1,62 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using Robust.Benchmarks.Exporters;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
[DbContext(typeof(BenchmarkContext))]
|
||||
[Migration("20221009235705_db")]
|
||||
partial class db
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Robust.Benchmarks.Exporters.BenchmarkRun", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("GitHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ParameterMapping")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RunDate")
|
||||
.HasColumnType("timestamptz");
|
||||
|
||||
b.Property<Statistics>("Statistics")
|
||||
.IsRequired()
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BenchmarkRuns");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Robust.Benchmarks/Migrations/20221009235705_db.cs
Normal file
36
Robust.Benchmarks/Migrations/20221009235705_db.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
public partial class db : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Reports",
|
||||
table: "BenchmarkRuns",
|
||||
newName: "Statistics");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ParameterMapping",
|
||||
table: "BenchmarkRuns",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ParameterMapping",
|
||||
table: "BenchmarkRuns");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Statistics",
|
||||
table: "BenchmarkRuns",
|
||||
newName: "Reports");
|
||||
}
|
||||
}
|
||||
}
|
||||
64
Robust.Benchmarks/Migrations/20221010144620_param_work.Designer.cs
generated
Normal file
64
Robust.Benchmarks/Migrations/20221010144620_param_work.Designer.cs
generated
Normal file
@@ -0,0 +1,64 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using Robust.Benchmarks.Exporters;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
[DbContext(typeof(BenchmarkContext))]
|
||||
[Migration("20221010144620_param_work")]
|
||||
partial class param_work
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Robust.Benchmarks.Exporters.BenchmarkRun", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("GitHash")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ParameterMapping")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<BenchmarkRunParameter[]>("ParameterMappingJson")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.Property<DateTime>("RunDate")
|
||||
.HasColumnType("timestamptz");
|
||||
|
||||
b.Property<Statistics>("Statistics")
|
||||
.IsRequired()
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BenchmarkRuns");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Robust.Benchmarks/Migrations/20221010144620_param_work.cs
Normal file
44
Robust.Benchmarks/Migrations/20221010144620_param_work.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Robust.Benchmarks.Exporters;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
public partial class param_work : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ParameterMapping",
|
||||
table: "BenchmarkRuns",
|
||||
type: "text",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "text");
|
||||
|
||||
migrationBuilder.AddColumn<BenchmarkRunParameter[]>(
|
||||
name: "ParameterMappingJson",
|
||||
table: "BenchmarkRuns",
|
||||
type: "jsonb",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ParameterMappingJson",
|
||||
table: "BenchmarkRuns");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ParameterMapping",
|
||||
table: "BenchmarkRuns",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "text",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
@@ -17,7 +18,7 @@ namespace Robust.Benchmarks.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.0")
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
@@ -38,13 +39,19 @@ namespace Robust.Benchmarks.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<BenchmarkRunReport[]>("Reports")
|
||||
.IsRequired()
|
||||
b.Property<string>("ParameterMapping")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<BenchmarkRunParameter[]>("ParameterMappingJson")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.Property<DateTime>("RunDate")
|
||||
.HasColumnType("timestamptz");
|
||||
|
||||
b.Property<Statistics>("Statistics")
|
||||
.IsRequired()
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BenchmarkRuns");
|
||||
|
||||
11
Robust.Benchmarks/Migrations/TypeIApparentlyHaveToKeep.cs
Normal file
11
Robust.Benchmarks/Migrations/TypeIApparentlyHaveToKeep.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using BenchmarkDotNet.Mathematics;
|
||||
using Robust.Benchmarks.Exporters;
|
||||
|
||||
namespace Robust.Benchmarks.Migrations;
|
||||
|
||||
public class BenchmarkRunReport
|
||||
{
|
||||
public BenchmarkRunParameter[] Parameters { get; set; } = Array.Empty<BenchmarkRunParameter>();
|
||||
public Statistics Statistics { get; set; } = default!;
|
||||
}
|
||||
26
Robust.Benchmarks/NumericsHelpers/HorizontalAddBenchmark.cs
Normal file
26
Robust.Benchmarks/NumericsHelpers/HorizontalAddBenchmark.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Robust.Shared.Analyzers;
|
||||
|
||||
namespace Robust.Benchmarks.NumericsHelpers;
|
||||
|
||||
[Virtual]
|
||||
[DisassemblyDiagnoser()]
|
||||
public class HorizontalAddBenchmark
|
||||
{
|
||||
[Params(8, 32, 128)]
|
||||
public int N { get; set; }
|
||||
|
||||
private float[] _inputA = default!;
|
||||
|
||||
[GlobalSetup]
|
||||
public void Setup()
|
||||
{
|
||||
_inputA = new float[N];
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public float Bench()
|
||||
{
|
||||
return Shared.Maths.NumericsHelpers.HorizontalAdd(_inputA);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
using BenchmarkDotNet.Configs;
|
||||
using BenchmarkDotNet.Running;
|
||||
#if DEBUG
|
||||
using BenchmarkDotNet.Configs;
|
||||
#endif
|
||||
using System;
|
||||
using BenchmarkDotNet.Running;
|
||||
using Robust.Benchmarks.Configs;
|
||||
using Robust.Benchmarks.Exporters;
|
||||
|
||||
namespace Robust.Benchmarks
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Globalization;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager;
|
||||
using Robust.Shared.Serialization.Markdown;
|
||||
using Robust.Shared.Serialization.Markdown.Validation;
|
||||
@@ -8,7 +9,7 @@ using Robust.Shared.Serialization.TypeSerializers.Interfaces;
|
||||
|
||||
namespace Robust.Benchmarks.Serialization
|
||||
{
|
||||
public sealed class BenchmarkIntSerializer : ITypeSerializer<int, ValueDataNode>
|
||||
public sealed class BenchmarkIntSerializer : ITypeSerializer<int, ValueDataNode>, ITypeCopyCreator<int>
|
||||
{
|
||||
public ValidationNode Validate(ISerializationManager serializationManager, ValueDataNode node,
|
||||
IDependencyCollection dependencies, ISerializationContext? context = null)
|
||||
@@ -19,18 +20,20 @@ namespace Robust.Benchmarks.Serialization
|
||||
}
|
||||
|
||||
public int Read(ISerializationManager serializationManager, ValueDataNode node,
|
||||
IDependencyCollection dependencies, bool skipHook, ISerializationContext? context = null, int _ = default)
|
||||
IDependencyCollection dependencies, SerializationHookContext hookCtx, ISerializationContext? context = null,
|
||||
ISerializationManager.InstantiationDelegate<int>? instanceProvider = null)
|
||||
{
|
||||
return int.Parse(node.Value, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public DataNode Write(ISerializationManager serializationManager, int value, bool alwaysWrite = false,
|
||||
public DataNode Write(ISerializationManager serializationManager, int value, IDependencyCollection dependencies,
|
||||
bool alwaysWrite = false,
|
||||
ISerializationContext? context = null)
|
||||
{
|
||||
return new ValueDataNode(value.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
public int Copy(ISerializationManager serializationManager, int source, int target, bool skipHook,
|
||||
public int CreateCopy(ISerializationManager serializationManager, int source, SerializationHookContext hookCtx,
|
||||
ISerializationContext? context = null)
|
||||
{
|
||||
return source;
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Linq;
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Robust.Benchmarks.Serialization.Definitions;
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.Serialization.Manager;
|
||||
using Robust.Shared.Serialization.Markdown;
|
||||
using Robust.Shared.Serialization.Markdown.Mapping;
|
||||
using Robust.Shared.Serialization.Markdown.Sequence;
|
||||
@@ -28,7 +27,7 @@ namespace Robust.Benchmarks.Serialization.Copy
|
||||
|
||||
var seedMapping = yamlStream.Documents[0].RootNode.ToDataNodeCast<SequenceDataNode>().Cast<MappingDataNode>(0);
|
||||
|
||||
Seed = SerializationManager.Read<SeedDataDefinition>(seedMapping);
|
||||
Seed = SerializationManager.Read<SeedDataDefinition>(seedMapping, notNullableOverride: true);
|
||||
}
|
||||
|
||||
private const string String = "ABC";
|
||||
@@ -46,25 +45,25 @@ namespace Robust.Benchmarks.Serialization.Copy
|
||||
[Benchmark]
|
||||
public string? CreateCopyString()
|
||||
{
|
||||
return SerializationManager.Copy(String);
|
||||
return SerializationManager.CreateCopy(String, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public int? CreateCopyInteger()
|
||||
{
|
||||
return SerializationManager.Copy(Integer);
|
||||
return SerializationManager.CreateCopy(Integer);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public DataDefinitionWithString? CreateCopyDataDefinitionWithString()
|
||||
{
|
||||
return SerializationManager.Copy(DataDefinitionWithString);
|
||||
return SerializationManager.CreateCopy(DataDefinitionWithString, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public SeedDataDefinition? CreateCopySeedDataDefinition()
|
||||
{
|
||||
return SerializationManager.Copy(Seed);
|
||||
return SerializationManager.CreateCopy(Seed, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
@@ -124,30 +123,21 @@ namespace Robust.Benchmarks.Serialization.Copy
|
||||
[BenchmarkCategory("flag")]
|
||||
public object? CopyFlagZero()
|
||||
{
|
||||
return SerializationManager.CopyWithTypeSerializer(
|
||||
typeof(FlagSerializer<BenchmarkFlags>),
|
||||
(int) FlagZero,
|
||||
(int) FlagZero);
|
||||
return SerializationManager.CreateCopy<int, FlagSerializer<BenchmarkFlags>>((int) FlagZero);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("flag")]
|
||||
public object? CopyFlagThirtyOne()
|
||||
{
|
||||
return SerializationManager.CopyWithTypeSerializer(
|
||||
typeof(FlagSerializer<BenchmarkFlags>),
|
||||
(int) FlagThirtyOne,
|
||||
(int) FlagThirtyOne);
|
||||
return SerializationManager.CreateCopy<int, FlagSerializer<BenchmarkFlags>>((int) FlagThirtyOne);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("customTypeSerializer")]
|
||||
public object? CopyIntegerCustomSerializer()
|
||||
{
|
||||
return SerializationManager.CopyWithTypeSerializer(
|
||||
typeof(BenchmarkIntSerializer),
|
||||
Integer,
|
||||
Integer);
|
||||
return SerializationManager.CreateCopy<int, BenchmarkIntSerializer>(Integer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Robust.Benchmarks.Serialization.Read
|
||||
[Benchmark]
|
||||
public string ReadString()
|
||||
{
|
||||
return SerializationManager.Read<string>(StringNode);
|
||||
return SerializationManager.Read<string>(StringNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
@@ -55,43 +55,34 @@ namespace Robust.Benchmarks.Serialization.Read
|
||||
[Benchmark]
|
||||
public DataDefinitionWithString ReadDataDefinitionWithString()
|
||||
{
|
||||
return SerializationManager.Read<DataDefinitionWithString>(StringDataDefNode);
|
||||
return SerializationManager.Read<DataDefinitionWithString>(StringDataDefNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public SeedDataDefinition ReadSeedDataDefinition()
|
||||
{
|
||||
return SerializationManager.Read<SeedDataDefinition>(SeedNode);
|
||||
return SerializationManager.Read<SeedDataDefinition>(SeedNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("flag")]
|
||||
public object? ReadFlagZero()
|
||||
{
|
||||
return SerializationManager.ReadWithTypeSerializer(
|
||||
typeof(int),
|
||||
typeof(FlagSerializer<BenchmarkFlags>),
|
||||
FlagZero);
|
||||
return SerializationManager.Read<int, ValueDataNode, FlagSerializer<BenchmarkFlags>>(FlagZero);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("flag")]
|
||||
public object? ReadThirtyOne()
|
||||
{
|
||||
return SerializationManager.ReadWithTypeSerializer(
|
||||
typeof(int),
|
||||
typeof(FlagSerializer<BenchmarkFlags>),
|
||||
FlagThirtyOne);
|
||||
return SerializationManager.Read<int, ValueDataNode, FlagSerializer<BenchmarkFlags>>(FlagThirtyOne);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("customTypeSerializer")]
|
||||
public object? ReadIntegerCustomSerializer()
|
||||
{
|
||||
return SerializationManager.ReadWithTypeSerializer(
|
||||
typeof(int),
|
||||
typeof(BenchmarkIntSerializer),
|
||||
IntNode);
|
||||
return SerializationManager.Read<int, ValueDataNode, BenchmarkIntSerializer>(IntNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,84 +46,84 @@ namespace Robust.Benchmarks.Serialization
|
||||
[BenchmarkCategory("read")]
|
||||
public string[]? ReadEmptyString()
|
||||
{
|
||||
return SerializationManager.Read<string[]>(EmptyNode);
|
||||
return SerializationManager.Read<string[]>(EmptyNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public string[]? ReadOneString()
|
||||
{
|
||||
return SerializationManager.Read<string[]>(OneIntNode);
|
||||
return SerializationManager.Read<string[]>(OneIntNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public string[]? ReadTenStrings()
|
||||
{
|
||||
return SerializationManager.Read<string[]>(TenIntsNode);
|
||||
return SerializationManager.Read<string[]>(TenIntsNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public int[]? ReadEmptyInt()
|
||||
{
|
||||
return SerializationManager.Read<int[]>(EmptyNode);
|
||||
return SerializationManager.Read<int[]>(EmptyNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public int[]? ReadOneInt()
|
||||
{
|
||||
return SerializationManager.Read<int[]>(OneIntNode);
|
||||
return SerializationManager.Read<int[]>(OneIntNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public int[]? ReadTenInts()
|
||||
{
|
||||
return SerializationManager.Read<int[]>(TenIntsNode);
|
||||
return SerializationManager.Read<int[]>(TenIntsNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public DataDefinitionWithString[]? ReadEmptyStringDataDef()
|
||||
{
|
||||
return SerializationManager.Read<DataDefinitionWithString[]>(EmptyNode);
|
||||
return SerializationManager.Read<DataDefinitionWithString[]>(EmptyNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public DataDefinitionWithString[]? ReadOneStringDataDef()
|
||||
{
|
||||
return SerializationManager.Read<DataDefinitionWithString[]>(OneStringDefNode);
|
||||
return SerializationManager.Read<DataDefinitionWithString[]>(OneStringDefNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public DataDefinitionWithString[]? ReadTenStringDataDefs()
|
||||
{
|
||||
return SerializationManager.Read<DataDefinitionWithString[]>(TenStringDefsNode);
|
||||
return SerializationManager.Read<DataDefinitionWithString[]>(TenStringDefsNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public SealedDataDefinitionWithString[]? ReadEmptySealedStringDataDef()
|
||||
{
|
||||
return SerializationManager.Read<SealedDataDefinitionWithString[]>(EmptyNode);
|
||||
return SerializationManager.Read<SealedDataDefinitionWithString[]>(EmptyNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public SealedDataDefinitionWithString[]? ReadOneSealedStringDataDef()
|
||||
{
|
||||
return SerializationManager.Read<SealedDataDefinitionWithString[]>(OneStringDefNode);
|
||||
return SerializationManager.Read<SealedDataDefinitionWithString[]>(OneStringDefNode, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("read")]
|
||||
public SealedDataDefinitionWithString[]? ReadTenSealedStringDataDefs()
|
||||
{
|
||||
return SerializationManager.Read<SealedDataDefinitionWithString[]>(TenStringDefsNode);
|
||||
return SerializationManager.Read<SealedDataDefinitionWithString[]>(TenStringDefsNode, notNullableOverride: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace Robust.Benchmarks.Serialization
|
||||
{
|
||||
public SerializationBenchmark()
|
||||
{
|
||||
IoCManager.InitThread();
|
||||
ServerIoC.RegisterIoC();
|
||||
IoCManager.BuildGraph();
|
||||
var deps = IoCManager.InitThread();
|
||||
ServerIoC.RegisterIoC(deps);
|
||||
deps.BuildGraph();
|
||||
|
||||
var assemblies = new[]
|
||||
{
|
||||
@@ -25,12 +25,12 @@ namespace Robust.Benchmarks.Serialization
|
||||
|
||||
foreach (var assembly in assemblies)
|
||||
{
|
||||
IoCManager.Resolve<IConfigurationManagerInternal>().LoadCVarsFromAssembly(assembly);
|
||||
deps.Resolve<IConfigurationManagerInternal>().LoadCVarsFromAssembly(assembly);
|
||||
}
|
||||
|
||||
IoCManager.Resolve<IReflectionManager>().LoadAssemblies(assemblies);
|
||||
deps.Resolve<IReflectionManager>().LoadAssemblies(assemblies);
|
||||
|
||||
SerializationManager = IoCManager.Resolve<ISerializationManager>();
|
||||
SerializationManager = deps.Resolve<ISerializationManager>();
|
||||
}
|
||||
|
||||
protected ISerializationManager SerializationManager { get; }
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.IO;
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Robust.Benchmarks.Serialization.Definitions;
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.Serialization.Manager;
|
||||
using Robust.Shared.Serialization.Markdown;
|
||||
using Robust.Shared.Serialization.Markdown.Mapping;
|
||||
using Robust.Shared.Serialization.Markdown.Sequence;
|
||||
@@ -28,7 +27,7 @@ namespace Robust.Benchmarks.Serialization.Write
|
||||
|
||||
var seedMapping = yamlStream.Documents[0].RootNode.ToDataNodeCast<SequenceDataNode>().Cast<MappingDataNode>(0);
|
||||
|
||||
Seed = SerializationManager.Read<SeedDataDefinition>(seedMapping);
|
||||
Seed = SerializationManager.Read<SeedDataDefinition>(seedMapping, notNullableOverride: true);
|
||||
}
|
||||
|
||||
private const string String = "ABC";
|
||||
@@ -46,7 +45,7 @@ namespace Robust.Benchmarks.Serialization.Write
|
||||
[Benchmark]
|
||||
public DataNode WriteString()
|
||||
{
|
||||
return SerializationManager.WriteValue(String);
|
||||
return SerializationManager.WriteValue(String, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
@@ -58,13 +57,13 @@ namespace Robust.Benchmarks.Serialization.Write
|
||||
[Benchmark]
|
||||
public DataNode WriteDataDefinitionWithString()
|
||||
{
|
||||
return SerializationManager.WriteValue(DataDefinitionWithString);
|
||||
return SerializationManager.WriteValue(DataDefinitionWithString, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public DataNode WriteSeedDataDefinition()
|
||||
{
|
||||
return SerializationManager.WriteValue(Seed);
|
||||
return SerializationManager.WriteValue(Seed, notNullableOverride: true);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
@@ -107,30 +106,21 @@ namespace Robust.Benchmarks.Serialization.Write
|
||||
[BenchmarkCategory("flag")]
|
||||
public DataNode WriteFlagZero()
|
||||
{
|
||||
return SerializationManager.WriteWithTypeSerializer(
|
||||
typeof(int),
|
||||
typeof(FlagSerializer<BenchmarkFlags>),
|
||||
FlagZero);
|
||||
return SerializationManager.WriteValue<int, FlagSerializer<BenchmarkFlags>>((int)FlagZero);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("flag")]
|
||||
public DataNode WriteThirtyOne()
|
||||
{
|
||||
return SerializationManager.WriteWithTypeSerializer(
|
||||
typeof(int),
|
||||
typeof(FlagSerializer<BenchmarkFlags>),
|
||||
FlagThirtyOne);
|
||||
return SerializationManager.WriteValue<int, FlagSerializer<BenchmarkFlags>>((int)FlagThirtyOne);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
[BenchmarkCategory("customTypeSerializer")]
|
||||
public DataNode WriteIntegerCustomSerializer()
|
||||
{
|
||||
return SerializationManager.WriteWithTypeSerializer(
|
||||
typeof(int),
|
||||
typeof(BenchmarkIntSerializer),
|
||||
Integer);
|
||||
return SerializationManager.WriteValue<int, BenchmarkIntSerializer>(Integer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
71
Robust.Benchmarks/TypeMatching/TypeSwitchBenchmark.cs
Normal file
71
Robust.Benchmarks/TypeMatching/TypeSwitchBenchmark.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Robust.Shared.Analyzers;
|
||||
|
||||
namespace Robust.Benchmarks.TypeMatching;
|
||||
|
||||
[MemoryDiagnoser]
|
||||
[Virtual]
|
||||
public class TypeSwitchBenchmark
|
||||
{
|
||||
private readonly Matcher<Struct> _matcher = new();
|
||||
|
||||
[Benchmark]
|
||||
public int BenchmarkInt()
|
||||
{
|
||||
return _matcher.TypeToInt<int>();
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public int BenchmarkString()
|
||||
{
|
||||
return _matcher.TypeToInt<string>();
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public int BenchmarkStruct()
|
||||
{
|
||||
return _matcher.TypeToInt<Struct>();
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public int BenchmarkDouble()
|
||||
{
|
||||
return _matcher.TypeToInt<double>();
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public int BenchmarkFloat()
|
||||
{
|
||||
return _matcher.TypeToInt<float>();
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public int BenchmarkClass()
|
||||
{
|
||||
return _matcher.TypeToInt<Class>();
|
||||
}
|
||||
|
||||
private class Matcher<T1>
|
||||
{
|
||||
public int TypeToInt<T>(T val = default!)
|
||||
{
|
||||
return val switch
|
||||
{
|
||||
int => 1,
|
||||
string => 2,
|
||||
double => 3,
|
||||
T1 => 4,
|
||||
Class => 5,
|
||||
_ => 6
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private struct Struct
|
||||
{
|
||||
}
|
||||
|
||||
private class Class
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -332,7 +332,7 @@ namespace {nameSpace}
|
||||
"Usage",
|
||||
DiagnosticSeverity.Error,
|
||||
true),
|
||||
Location.None));
|
||||
candidateClass.GetLocation()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +143,8 @@ namespace Robust.Client.WebView.Cef
|
||||
|
||||
private const int ScrollSpeed = 50;
|
||||
|
||||
private bool _textInputActive;
|
||||
|
||||
private readonly RobustRequestHandler _requestHandler = new(Logger.GetSawmill("root"));
|
||||
private LiveData? _data;
|
||||
private string _startUrl = "about:blank";
|
||||
@@ -360,24 +362,21 @@ namespace Robust.Client.WebView.Cef
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public void TextEntered(GUITextEventArgs args)
|
||||
public void TextEntered(GUITextEnteredEventArgs args)
|
||||
{
|
||||
if (_data == null)
|
||||
return;
|
||||
|
||||
var host = _data.Browser.GetHost();
|
||||
|
||||
Span<char> buf = stackalloc char[2];
|
||||
var written = args.AsRune.EncodeToUtf16(buf);
|
||||
|
||||
for (var i = 0; i < written; i++)
|
||||
foreach (var chr in args.Text)
|
||||
{
|
||||
host.SendKeyEvent(new CefKeyEvent
|
||||
{
|
||||
EventType = CefKeyEventType.Char,
|
||||
WindowsKeyCode = buf[i],
|
||||
Character = buf[i],
|
||||
UnmodifiedCharacter = buf[i]
|
||||
WindowsKeyCode = chr,
|
||||
Character = chr,
|
||||
UnmodifiedCharacter = chr
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -481,6 +480,32 @@ namespace Robust.Client.WebView.Cef
|
||||
_requestHandler.RemoveBeforeBrowseHandler(handler);
|
||||
}
|
||||
|
||||
public void FocusEntered()
|
||||
{
|
||||
if (_textInputActive)
|
||||
_clyde.TextInputStart();
|
||||
}
|
||||
|
||||
public void FocusExited()
|
||||
{
|
||||
if (_textInputActive)
|
||||
_clyde.TextInputStop();
|
||||
}
|
||||
|
||||
public void TextInputStart()
|
||||
{
|
||||
_textInputActive = true;
|
||||
if (Owner.HasKeyboardFocus())
|
||||
_clyde.TextInputStart();
|
||||
}
|
||||
|
||||
public void TextInputStop()
|
||||
{
|
||||
_textInputActive = false;
|
||||
if (Owner.HasKeyboardFocus())
|
||||
_clyde.TextInputStop();
|
||||
}
|
||||
|
||||
private sealed class LiveData
|
||||
{
|
||||
public OwnedTexture Texture;
|
||||
@@ -579,6 +604,22 @@ namespace Robust.Client.WebView.Cef
|
||||
if (_control.Owner.Disposed)
|
||||
return;
|
||||
}
|
||||
|
||||
protected override void OnVirtualKeyboardRequested(CefBrowser browser, CefTextInputMode inputMode)
|
||||
{
|
||||
base.OnVirtualKeyboardRequested(browser, inputMode);
|
||||
|
||||
// Treat virtual keyboard requests as a guide for whether we should accept text input.
|
||||
|
||||
if (inputMode == CefTextInputMode.None)
|
||||
{
|
||||
_control.TextInputStop();
|
||||
}
|
||||
else
|
||||
{
|
||||
_control.TextInputStart();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +69,12 @@ namespace Robust.Client.WebView.Cef
|
||||
CachePath = cachePath,
|
||||
};
|
||||
|
||||
var userAgentOverride = _cfg.GetCVar(WCVars.UserAgentOverride);
|
||||
if (!string.IsNullOrEmpty(userAgentOverride))
|
||||
{
|
||||
settings.UserAgent = userAgentOverride;
|
||||
}
|
||||
|
||||
Logger.Info($"CEF Version: {CefRuntime.ChromeVersion}");
|
||||
|
||||
_app = new RobustCefApp();
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Robust.Client.WebView.Headless
|
||||
return false;
|
||||
}
|
||||
|
||||
public void TextEntered(GUITextEventArgs args)
|
||||
public void TextEntered(GUITextEnteredEventArgs args)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -125,6 +125,14 @@ namespace Robust.Client.WebView.Headless
|
||||
public void RemoveBeforeBrowseHandler(Action<IBeforeBrowseContext> handler)
|
||||
{
|
||||
}
|
||||
|
||||
public void FocusEntered()
|
||||
{
|
||||
}
|
||||
|
||||
public void FocusExited()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class WebViewWindowDummy : DummyBase, IWebViewWindow
|
||||
|
||||
@@ -15,10 +15,12 @@ namespace Robust.Client.WebView
|
||||
void MouseExited();
|
||||
void MouseWheel(GUIMouseWheelEventArgs args);
|
||||
bool RawKeyEvent(in GuiRawKeyEvent guiRawEvent);
|
||||
void TextEntered(GUITextEventArgs args);
|
||||
void TextEntered(GUITextEnteredEventArgs args);
|
||||
void Resized();
|
||||
void Draw(DrawingHandleScreen handle);
|
||||
void AddBeforeBrowseHandler(Action<IBeforeBrowseContext> handler);
|
||||
void RemoveBeforeBrowseHandler(Action<IBeforeBrowseContext> handler);
|
||||
void FocusEntered();
|
||||
void FocusExited();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<Import Project="..\MSBuild\Robust.Engine.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<OutputType>WinExe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -14,4 +14,10 @@ public static class WCVars
|
||||
/// </summary>
|
||||
public static readonly CVarDef<bool> WebResProtocol =
|
||||
CVarDef.Create("web.res_protocol", true, CVar.CLIENTONLY);
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the default CEF user-agent when set to a non-empty string.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<string> UserAgentOverride =
|
||||
CVarDef.Create("web.user_agent", "", CVar.CLIENTONLY);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.WebView.Cef;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -76,13 +75,27 @@ namespace Robust.Client.WebView
|
||||
return _controlImpl.RawKeyEvent(guiRawEvent);
|
||||
}
|
||||
|
||||
protected internal override void TextEntered(GUITextEventArgs args)
|
||||
protected internal override void TextEntered(GUITextEnteredEventArgs args)
|
||||
{
|
||||
base.TextEntered(args);
|
||||
|
||||
_controlImpl.TextEntered(args);
|
||||
}
|
||||
|
||||
protected internal override void KeyboardFocusEntered()
|
||||
{
|
||||
base.KeyboardFocusEntered();
|
||||
|
||||
_controlImpl.FocusEntered();
|
||||
}
|
||||
|
||||
protected internal override void KeyboardFocusExited()
|
||||
{
|
||||
base.KeyboardFocusExited();
|
||||
|
||||
_controlImpl.FocusExited();
|
||||
}
|
||||
|
||||
protected override void Resized()
|
||||
{
|
||||
base.Resized();
|
||||
|
||||
@@ -3,6 +3,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Shared.Animations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
|
||||
namespace Robust.Client.Animations
|
||||
{
|
||||
@@ -20,7 +21,14 @@ namespace Robust.Client.Animations
|
||||
}
|
||||
|
||||
var entity = (EntityUid) context;
|
||||
var component = IoCManager.Resolve<IEntityManager>().GetComponent(entity, ComponentType);
|
||||
var entManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
if (!entManager.TryGetComponent(entity, ComponentType, out var component))
|
||||
{
|
||||
// This gets checked when the animation is first played, but the component may also be removed while the animation plays
|
||||
Logger.Error($"Couldn't find component {ComponentType} on {entManager.ToPrettyString(entity)} for animation playback!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (component is IAnimationProperties properties)
|
||||
{
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
using System;
|
||||
using Robust.Client.Graphics;
|
||||
|
||||
namespace Robust.Client.Audio
|
||||
{
|
||||
public sealed class AudioStream
|
||||
{
|
||||
public TimeSpan Length { get; }
|
||||
internal ClydeHandle? ClydeHandle { get; }
|
||||
public string? Name { get; }
|
||||
public int ChannelCount { get; }
|
||||
namespace Robust.Client.Audio;
|
||||
|
||||
internal AudioStream(ClydeHandle handle, TimeSpan length, int channelCount, string? name = null)
|
||||
{
|
||||
ClydeHandle = handle;
|
||||
Length = length;
|
||||
ChannelCount = channelCount;
|
||||
Name = name;
|
||||
}
|
||||
public sealed class AudioStream
|
||||
{
|
||||
public TimeSpan Length { get; }
|
||||
internal ClydeHandle? ClydeHandle { get; }
|
||||
public string? Name { get; }
|
||||
public int ChannelCount { get; }
|
||||
|
||||
internal AudioStream(ClydeHandle handle, TimeSpan length, int channelCount, string? name = null)
|
||||
{
|
||||
ClydeHandle = handle;
|
||||
Length = length;
|
||||
ChannelCount = channelCount;
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,13 @@ using Robust.Shared.Localization;
|
||||
|
||||
namespace Robust.Client.Audio.Midi.Commands;
|
||||
|
||||
public sealed class MidiPanicCommand : IConsoleCommand
|
||||
public sealed class MidiPanicCommand : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IMidiManager _midiManager = default!;
|
||||
|
||||
public string Command => "midipanic";
|
||||
public string Description => Loc.GetString("midi-panic-command-description");
|
||||
public string Help => $"{Command}";
|
||||
public override string Command => "midipanic";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
foreach (var renderer in _midiManager.Renderers)
|
||||
{
|
||||
|
||||
@@ -146,7 +146,7 @@ internal sealed partial class MidiManager
|
||||
break;
|
||||
|
||||
default:
|
||||
_midiSawmill.Error($"Unsupported Sequencer Event: {tick:D8}: {SequencerEventToString(midiEvent)}");
|
||||
_midiSawmill.Warning($"Unsupported Sequencer Event: {tick:D8}: {SequencerEventToString(midiEvent)}");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ using Robust.Shared.Log;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -24,7 +25,7 @@ namespace Robust.Client.Audio.Midi;
|
||||
internal sealed partial class MidiManager : IMidiManager
|
||||
{
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IResourceManagerInternal _resourceManager = default!;
|
||||
[Dependency] private readonly IResourceCacheInternal _resourceManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfgMan = default!;
|
||||
[Dependency] private readonly IClydeAudio _clydeAudio = default!;
|
||||
@@ -100,21 +101,27 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
|
||||
private const string FallbackSoundfont = "/Midi/fallback.sf2";
|
||||
|
||||
private const float MaxDistanceForOcclusion = 1000;
|
||||
private const string ContentCustomSoundfontDirectory = "/Audio/MidiCustom/";
|
||||
|
||||
private static ResourcePath CustomSoundfontDirectory = new ResourcePath("/soundfonts/");
|
||||
|
||||
private readonly ResourceLoaderCallbacks _soundfontLoaderCallbacks = new();
|
||||
private readonly ResourceLoaderCallbacks _soundfontLoaderCallbacks;
|
||||
|
||||
private bool FluidsynthInitialized;
|
||||
private bool _failedInitialize;
|
||||
|
||||
private NFluidsynth.Logger.LoggerDelegate _loggerDelegate = default!;
|
||||
private ISawmill _sawmill = default!;
|
||||
private float _maxCastLength;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public int OcclusionCollisionMask { get; set; }
|
||||
|
||||
public MidiManager()
|
||||
{
|
||||
_soundfontLoaderCallbacks = new ResourceLoaderCallbacks(this);
|
||||
}
|
||||
|
||||
private void InitializeFluidsynth()
|
||||
{
|
||||
if (FluidsynthInitialized || _failedInitialize) return;
|
||||
@@ -127,7 +134,11 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
}, true);
|
||||
|
||||
_midiSawmill = _logger.GetSawmill("midi");
|
||||
_midiSawmill.Level = LogLevel.Info;
|
||||
#if DEBUG
|
||||
_midiSawmill.Level = LogLevel.Debug;
|
||||
#else
|
||||
_midiSawmill.Level = LogLevel.Error;
|
||||
#endif
|
||||
_sawmill = _logger.GetSawmill("midi.fluidsynth");
|
||||
_loggerDelegate = LoggerDelegate;
|
||||
|
||||
@@ -166,8 +177,7 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_midiSawmill.Warning(
|
||||
"Failed to initialize fluidsynth due to exception, disabling MIDI support:\n{0}", e);
|
||||
_midiSawmill.Error("Failed to initialize fluidsynth due to exception, disabling MIDI support:\n{0}", e);
|
||||
_failedInitialize = true;
|
||||
return;
|
||||
}
|
||||
@@ -175,13 +185,21 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
_midiThread = new Thread(ThreadUpdate);
|
||||
_midiThread.Start();
|
||||
|
||||
_broadPhaseSystem = EntitySystem.Get<SharedPhysicsSystem>();
|
||||
_broadPhaseSystem = _entityManager.EntitySysManager.GetEntitySystem<SharedPhysicsSystem>();
|
||||
_cfgMan.OnValueChanged(CVars.AudioRaycastLength, OnRaycastLengthChanged, true);
|
||||
|
||||
FluidsynthInitialized = true;
|
||||
}
|
||||
|
||||
private void OnRaycastLengthChanged(float value)
|
||||
{
|
||||
_maxCastLength = value;
|
||||
}
|
||||
|
||||
private void LoggerDelegate(NFluidsynth.Logger.LogLevel level, string message, IntPtr data)
|
||||
{
|
||||
var rLevel = level switch {
|
||||
var rLevel = level switch
|
||||
{
|
||||
NFluidsynth.Logger.LogLevel.Panic => LogLevel.Error,
|
||||
NFluidsynth.Logger.LogLevel.Error => LogLevel.Error,
|
||||
NFluidsynth.Logger.LogLevel.Warning => LogLevel.Warning,
|
||||
@@ -216,6 +234,7 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
|
||||
var renderer = new MidiRenderer(_settings!, soundfontLoader, mono, this, _clydeAudio, _taskManager, _midiSawmill);
|
||||
|
||||
_midiSawmill.Debug($"Loading soundfont {FallbackSoundfont}");
|
||||
// Since the last loaded soundfont takes priority, we load the fallback soundfont before the soundfont.
|
||||
renderer.LoadSoundfont(FallbackSoundfont);
|
||||
|
||||
@@ -223,11 +242,13 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
{
|
||||
foreach (var filepath in LinuxSoundfonts)
|
||||
{
|
||||
if (!File.Exists(filepath) || !SoundFont.IsSoundFont(filepath)) continue;
|
||||
if (!File.Exists(filepath) || !SoundFont.IsSoundFont(filepath))
|
||||
continue;
|
||||
|
||||
try
|
||||
{
|
||||
renderer.LoadSoundfont(filepath, true);
|
||||
renderer.LoadSoundfont(filepath);
|
||||
_midiSawmill.Debug($"Loaded Linux soundfont {filepath}");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -240,29 +261,37 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
else if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
if (File.Exists(OsxSoundfont) && SoundFont.IsSoundFont(OsxSoundfont))
|
||||
renderer.LoadSoundfont(OsxSoundfont, true);
|
||||
{
|
||||
_midiSawmill.Debug($"Loading soundfont {OsxSoundfont}");
|
||||
renderer.LoadSoundfont(OsxSoundfont);
|
||||
}
|
||||
}
|
||||
else if (OperatingSystem.IsWindows())
|
||||
{
|
||||
if (File.Exists(WindowsSoundfont) && SoundFont.IsSoundFont(WindowsSoundfont))
|
||||
renderer.LoadSoundfont(WindowsSoundfont, true);
|
||||
{
|
||||
_midiSawmill.Debug($"Loading soundfont {WindowsSoundfont}");
|
||||
renderer.LoadSoundfont(WindowsSoundfont);
|
||||
}
|
||||
}
|
||||
|
||||
// Load content-specific custom soundfonts, which could override the system/fallback soundfont.
|
||||
foreach (var file in _resourceManager.ContentFindFiles(("/Audio/MidiCustom/")))
|
||||
_midiSawmill.Debug($"Loading soundfonts from {ContentCustomSoundfontDirectory}");
|
||||
foreach (var file in _resourceManager.ContentFindFiles(ContentCustomSoundfontDirectory))
|
||||
{
|
||||
if (file.Extension != "sf2" && file.Extension != "dls") continue;
|
||||
_midiSawmill.Debug($"Loading soundfont {file}");
|
||||
renderer.LoadSoundfont(file.ToString());
|
||||
}
|
||||
|
||||
// Load every soundfont from the user data directory last, since those may override any other soundfont.
|
||||
_midiSawmill.Debug($"loading soundfonts from {CustomSoundfontDirectory.ToRelativePath().ToString()}/*");
|
||||
var enumerator = _resourceManager.UserData.Find($"{CustomSoundfontDirectory.ToRelativePath().ToString()}/*").Item1;
|
||||
foreach (var soundfont in enumerator)
|
||||
_midiSawmill.Debug($"Loading soundfonts from {{USERDATA}} {CustomSoundfontDirectory}");
|
||||
var enumerator = _resourceManager.UserData.Find($"{CustomSoundfontDirectory.ToRelativePath()}/*").Item1;
|
||||
foreach (var file in enumerator)
|
||||
{
|
||||
if (soundfont.Extension != "sf2" && soundfont.Extension != "dls") continue;
|
||||
_midiSawmill.Debug($"loading soundfont {soundfont}");
|
||||
renderer.LoadSoundfont(soundfont.ToString());
|
||||
if (file.Extension != "sf2" && file.Extension != "dls") continue;
|
||||
_midiSawmill.Debug($"Loading soundfont {{USERDATA}} {file}");
|
||||
renderer.LoadSoundfont(file.ToString());
|
||||
}
|
||||
|
||||
renderer.Source.SetVolume(Volume);
|
||||
@@ -287,6 +316,8 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
}
|
||||
|
||||
// Update positions of streams every frame.
|
||||
// This has a lot of code duplication with AudioSystem.FrameUpdate(), and they should probably be combined somehow.
|
||||
|
||||
lock (_renderers)
|
||||
{
|
||||
foreach (var renderer in _renderers)
|
||||
@@ -319,17 +350,17 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
{
|
||||
var pos = mapPos.Value;
|
||||
|
||||
var sourceRelative = _eyeManager.CurrentEye.Position.Position - pos.Position;
|
||||
var sourceRelative = pos.Position - _eyeManager.CurrentEye.Position.Position;
|
||||
var occlusion = 0f;
|
||||
if (sourceRelative.Length > 0)
|
||||
{
|
||||
occlusion = _broadPhaseSystem.IntersectRayPenetration(
|
||||
pos.MapId,
|
||||
new CollisionRay(
|
||||
pos.Position,
|
||||
_eyeManager.CurrentEye.Position.Position,
|
||||
sourceRelative.Normalized,
|
||||
OcclusionCollisionMask),
|
||||
MathF.Min(sourceRelative.Length, MaxDistanceForOcclusion),
|
||||
MathF.Min(sourceRelative.Length, _maxCastLength),
|
||||
renderer.TrackingEntity);
|
||||
}
|
||||
|
||||
@@ -342,7 +373,8 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
|
||||
if (trackingEntity)
|
||||
{
|
||||
renderer.Source.SetVelocity(renderer.TrackingEntity!.Value.GlobalLinearVelocity());
|
||||
var vel = _broadPhaseSystem.GetMapLinearVelocity(renderer.TrackingEntity!.Value);
|
||||
renderer.Source.SetVelocity(vel);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -426,9 +458,15 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
/// </summary>
|
||||
private sealed class ResourceLoaderCallbacks : SoundFontLoaderCallbacks
|
||||
{
|
||||
private readonly MidiManager _parent;
|
||||
private readonly Dictionary<int, Stream> _openStreams = new();
|
||||
private int _nextStreamId = 1;
|
||||
|
||||
public ResourceLoaderCallbacks(MidiManager parent)
|
||||
{
|
||||
_parent = parent;
|
||||
}
|
||||
|
||||
public override IntPtr Open(string filename)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filename))
|
||||
@@ -437,7 +475,7 @@ internal sealed partial class MidiManager : IMidiManager
|
||||
}
|
||||
|
||||
Stream? stream;
|
||||
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||
var resourceCache = _parent._resourceManager;
|
||||
var resourcePath = new ResourcePath(filename);
|
||||
|
||||
if (resourcePath.IsRooted)
|
||||
|
||||
@@ -354,7 +354,7 @@ internal sealed class MidiRenderer : IMidiRenderer
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadSoundfont(string filename, bool resetPresets = false)
|
||||
public void LoadSoundfont(string filename, bool resetPresets = true)
|
||||
{
|
||||
lock (_playerStateLock)
|
||||
{
|
||||
@@ -521,7 +521,10 @@ internal sealed class MidiRenderer : IMidiRenderer
|
||||
return;
|
||||
|
||||
_rendererState.Controllers.AsSpan[midiEvent.Channel].AsSpan[midiEvent.Control] = midiEvent.Value;
|
||||
_synth.CC(midiEvent.Channel, midiEvent.Control, midiEvent.Value);
|
||||
if(midiEvent.Control != 0x0)
|
||||
_synth.CC(midiEvent.Channel, midiEvent.Control, midiEvent.Value);
|
||||
else // Fluidsynth doesn't seem to respect CC0 as bank selection, so we have to do it manually.
|
||||
_synth.BankSelect(midiEvent.Channel, midiEvent.Value);
|
||||
break;
|
||||
|
||||
case RobustMidiCommand.ProgramChange:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using Robust.Client.Configuration;
|
||||
using Robust.Client.Debugging;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.GameStates;
|
||||
@@ -25,7 +26,7 @@ namespace Robust.Client
|
||||
{
|
||||
[Dependency] private readonly IClientNetManager _net = default!;
|
||||
[Dependency] private readonly IPlayerManager _playMan = default!;
|
||||
[Dependency] private readonly INetConfigurationManager _configManager = default!;
|
||||
[Dependency] private readonly IClientNetConfigurationManager _configManager = default!;
|
||||
[Dependency] private readonly IClientEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IDiscordRichPresence _discord = default!;
|
||||
@@ -238,7 +239,7 @@ namespace Robust.Client
|
||||
|
||||
private void GameStoppedReset()
|
||||
{
|
||||
IoCManager.Resolve<INetConfigurationManager>().FlushMessages();
|
||||
_configManager.FlushMessages();
|
||||
_gameStates.Reset();
|
||||
_playMan.Shutdown();
|
||||
_entityManager.Shutdown();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Robust.Client.Audio.Midi;
|
||||
using Robust.Client.Configuration;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.Debugging;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -14,13 +15,17 @@ using Robust.Client.Player;
|
||||
using Robust.Client.Profiling;
|
||||
using Robust.Client.Prototypes;
|
||||
using Robust.Client.Reflection;
|
||||
using Robust.Client.Replays;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.Serialization;
|
||||
using Robust.Client.State;
|
||||
using Robust.Client.Timing;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Themes;
|
||||
using Robust.Client.Utility;
|
||||
using Robust.Client.ViewVariables;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -31,91 +36,104 @@ using Robust.Shared.Physics;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Reflection;
|
||||
using Robust.Shared.Replays;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Robust.Client
|
||||
{
|
||||
internal static class ClientIoC
|
||||
{
|
||||
public static void RegisterIoC(GameController.DisplayMode mode)
|
||||
public static void RegisterIoC(GameController.DisplayMode mode, IDependencyCollection deps)
|
||||
{
|
||||
SharedIoC.RegisterIoC();
|
||||
SharedIoC.RegisterIoC(deps);
|
||||
|
||||
deps.Register<IGameTiming, ClientGameTiming>();
|
||||
deps.Register<IClientGameTiming, ClientGameTiming>();
|
||||
deps.Register<IPrototypeManager, ClientPrototypeManager>();
|
||||
deps.Register<IPrototypeManagerInternal, ClientPrototypeManager>();
|
||||
deps.Register<IMapManager, NetworkedMapManager>();
|
||||
deps.Register<IMapManagerInternal, NetworkedMapManager>();
|
||||
deps.Register<INetworkedMapManager, NetworkedMapManager>();
|
||||
deps.Register<IEntityManager, ClientEntityManager>();
|
||||
deps.Register<IReflectionManager, ClientReflectionManager>();
|
||||
deps.Register<IConsoleHost, ClientConsoleHost>();
|
||||
deps.Register<IClientConsoleHost, ClientConsoleHost>();
|
||||
deps.Register<IComponentFactory, ComponentFactory>();
|
||||
deps.Register<ITileDefinitionManager, ClydeTileDefinitionManager>();
|
||||
deps.Register<IClydeTileDefinitionManager, ClydeTileDefinitionManager>();
|
||||
deps.Register<GameController, GameController>();
|
||||
deps.Register<IGameController, GameController>();
|
||||
deps.Register<IGameControllerInternal, GameController>();
|
||||
deps.Register<IResourceManager, ResourceCache>();
|
||||
deps.Register<IResourceManagerInternal, ResourceCache>();
|
||||
deps.Register<IResourceCache, ResourceCache>();
|
||||
deps.Register<IResourceCacheInternal, ResourceCache>();
|
||||
deps.Register<IClientNetManager, NetManager>();
|
||||
deps.Register<EntityManager, ClientEntityManager>();
|
||||
deps.Register<ClientEntityManager>();
|
||||
deps.Register<IClientEntityManager, ClientEntityManager>();
|
||||
deps.Register<IClientEntityManagerInternal, ClientEntityManager>();
|
||||
deps.Register<IEntityNetworkManager, ClientEntityManager>();
|
||||
deps.Register<IReplayRecordingManager, ReplayRecordingManager>();
|
||||
deps.Register<IClientGameStateManager, ClientGameStateManager>();
|
||||
deps.Register<IBaseClient, BaseClient>();
|
||||
deps.Register<IPlayerManager, PlayerManager>();
|
||||
deps.Register<ISharedPlayerManager, PlayerManager>();
|
||||
deps.Register<IStateManager, StateManager>();
|
||||
deps.Register<IUserInterfaceManager, UserInterfaceManager>();
|
||||
deps.Register<IUserInterfaceManagerInternal, UserInterfaceManager>();
|
||||
deps.Register<ILightManager, LightManager>();
|
||||
deps.Register<IDiscordRichPresence, DiscordRichPresence>();
|
||||
deps.Register<IMidiManager, MidiManager>();
|
||||
deps.Register<IAuthManager, AuthManager>();
|
||||
deps.Register<ProfViewManager>();
|
||||
|
||||
IoCManager.Register<IGameTiming, ClientGameTiming>();
|
||||
IoCManager.Register<IClientGameTiming, ClientGameTiming>();
|
||||
IoCManager.Register<IPrototypeManager, ClientPrototypeManager>();
|
||||
IoCManager.Register<IMapManager, NetworkedMapManager>();
|
||||
IoCManager.Register<IMapManagerInternal, NetworkedMapManager>();
|
||||
IoCManager.Register<INetworkedMapManager, NetworkedMapManager>();
|
||||
IoCManager.Register<IEntityManager, ClientEntityManager>();
|
||||
IoCManager.Register<IReflectionManager, ClientReflectionManager>();
|
||||
IoCManager.Register<IConsoleHost, ClientConsoleHost>();
|
||||
IoCManager.Register<IClientConsoleHost, ClientConsoleHost>();
|
||||
IoCManager.Register<IComponentFactory, ClientComponentFactory>();
|
||||
IoCManager.Register<ITileDefinitionManager, ClydeTileDefinitionManager>();
|
||||
IoCManager.Register<IClydeTileDefinitionManager, ClydeTileDefinitionManager>();
|
||||
IoCManager.Register<GameController, GameController>();
|
||||
IoCManager.Register<IGameController, GameController>();
|
||||
IoCManager.Register<IGameControllerInternal, GameController>();
|
||||
IoCManager.Register<IResourceManager, ResourceCache>();
|
||||
IoCManager.Register<IResourceManagerInternal, ResourceCache>();
|
||||
IoCManager.Register<IResourceCache, ResourceCache>();
|
||||
IoCManager.Register<IResourceCacheInternal, ResourceCache>();
|
||||
IoCManager.Register<IClientNetManager, NetManager>();
|
||||
IoCManager.Register<EntityManager, ClientEntityManager>();
|
||||
IoCManager.Register<ClientEntityManager>();
|
||||
IoCManager.Register<IClientEntityManager, ClientEntityManager>();
|
||||
IoCManager.Register<IClientEntityManagerInternal, ClientEntityManager>();
|
||||
IoCManager.Register<IEntityNetworkManager, ClientEntityManager>();
|
||||
IoCManager.Register<IClientGameStateManager, ClientGameStateManager>();
|
||||
IoCManager.Register<IBaseClient, BaseClient>();
|
||||
IoCManager.Register<IPlayerManager, PlayerManager>();
|
||||
IoCManager.Register<ISharedPlayerManager, PlayerManager>();
|
||||
IoCManager.Register<IStateManager, StateManager>();
|
||||
IoCManager.Register<IUserInterfaceManager, UserInterfaceManager>();
|
||||
IoCManager.Register<IUserInterfaceManagerInternal, UserInterfaceManager>();
|
||||
IoCManager.Register<ILightManager, LightManager>();
|
||||
IoCManager.Register<IDiscordRichPresence, DiscordRichPresence>();
|
||||
IoCManager.Register<IMidiManager, MidiManager>();
|
||||
IoCManager.Register<IAuthManager, AuthManager>();
|
||||
IoCManager.Register<ProfViewManager>();
|
||||
IoCManager.Register<IPhysicsManager, PhysicsManager>();
|
||||
switch (mode)
|
||||
{
|
||||
case GameController.DisplayMode.Headless:
|
||||
IoCManager.Register<IClyde, ClydeHeadless>();
|
||||
IoCManager.Register<IClipboardManager, ClydeHeadless>();
|
||||
IoCManager.Register<IClydeInternal, ClydeHeadless>();
|
||||
IoCManager.Register<IClydeAudio, ClydeAudioHeadless>();
|
||||
IoCManager.Register<IClydeAudioInternal, ClydeAudioHeadless>();
|
||||
IoCManager.Register<IInputManager, InputManager>();
|
||||
IoCManager.Register<IFileDialogManager, DummyFileDialogManager>();
|
||||
IoCManager.Register<IUriOpener, UriOpenerDummy>();
|
||||
deps.Register<IClyde, ClydeHeadless>();
|
||||
deps.Register<IClipboardManager, ClydeHeadless>();
|
||||
deps.Register<IClydeInternal, ClydeHeadless>();
|
||||
deps.Register<IClydeAudio, ClydeAudioHeadless>();
|
||||
deps.Register<IClydeAudioInternal, ClydeAudioHeadless>();
|
||||
deps.Register<IInputManager, InputManager>();
|
||||
deps.Register<IFileDialogManager, DummyFileDialogManager>();
|
||||
deps.Register<IUriOpener, UriOpenerDummy>();
|
||||
break;
|
||||
case GameController.DisplayMode.Clyde:
|
||||
IoCManager.Register<IClyde, Clyde>();
|
||||
IoCManager.Register<IClipboardManager, Clyde>();
|
||||
IoCManager.Register<IClydeInternal, Clyde>();
|
||||
IoCManager.Register<IClydeAudio, FallbackProxyClydeAudio>();
|
||||
IoCManager.Register<IClydeAudioInternal, FallbackProxyClydeAudio>();
|
||||
IoCManager.Register<IInputManager, ClydeInputManager>();
|
||||
IoCManager.Register<IFileDialogManager, FileDialogManager>();
|
||||
IoCManager.Register<IUriOpener, UriOpener>();
|
||||
deps.Register<IClyde, Clyde>();
|
||||
deps.Register<IClipboardManager, Clyde>();
|
||||
deps.Register<IClydeInternal, Clyde>();
|
||||
deps.Register<IClydeAudio, FallbackProxyClydeAudio>();
|
||||
deps.Register<IClydeAudioInternal, FallbackProxyClydeAudio>();
|
||||
deps.Register<IInputManager, ClydeInputManager>();
|
||||
deps.Register<IFileDialogManager, FileDialogManager>();
|
||||
deps.Register<IUriOpener, UriOpener>();
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
IoCManager.Register<IFontManager, FontManager>();
|
||||
IoCManager.Register<IFontManagerInternal, FontManager>();
|
||||
IoCManager.Register<IEyeManager, EyeManager>();
|
||||
IoCManager.Register<IPlacementManager, PlacementManager>();
|
||||
IoCManager.Register<IOverlayManager, OverlayManager>();
|
||||
IoCManager.Register<IOverlayManagerInternal, OverlayManager>();
|
||||
IoCManager.Register<IViewVariablesManager, ViewVariablesManager>();
|
||||
IoCManager.Register<IViewVariablesManagerInternal, ViewVariablesManager>();
|
||||
IoCManager.Register<IClientConGroupController, ClientConGroupController>();
|
||||
IoCManager.Register<IScriptClient, ScriptClient>();
|
||||
deps.Register<IFontManager, FontManager>();
|
||||
deps.Register<IFontManagerInternal, FontManager>();
|
||||
deps.Register<IEyeManager, EyeManager>();
|
||||
deps.Register<IPlacementManager, PlacementManager>();
|
||||
deps.Register<IOverlayManager, OverlayManager>();
|
||||
deps.Register<IOverlayManagerInternal, OverlayManager>();
|
||||
deps.Register<IViewVariablesManager, ClientViewVariablesManager>();
|
||||
deps.Register<IClientViewVariablesManager, ClientViewVariablesManager>();
|
||||
deps.Register<IClientViewVariablesManagerInternal, ClientViewVariablesManager>();
|
||||
deps.Register<IClientConGroupController, ClientConGroupController>();
|
||||
deps.Register<IScriptClient, ScriptClient>();
|
||||
deps.Register<IRobustSerializer, ClientRobustSerializer>();
|
||||
deps.Register<IClientRobustSerializer, ClientRobustSerializer>();
|
||||
deps.Register<IConfigurationManager, ClientNetConfigurationManager>();
|
||||
deps.Register<INetConfigurationManager, ClientNetConfigurationManager>();
|
||||
deps.Register<IConfigurationManagerInternal, ClientNetConfigurationManager>();
|
||||
deps.Register<IClientNetConfigurationManager, ClientNetConfigurationManager>();
|
||||
deps.Register<INetConfigurationManagerInternal, ClientNetConfigurationManager>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
27
Robust.Client/ClientWarmup.cs
Normal file
27
Robust.Client/ClientWarmup.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Threading.Tasks;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.Resources;
|
||||
|
||||
namespace Robust.Client;
|
||||
|
||||
/// <summary>
|
||||
/// Logic for "warming up" things like slow static constructors concurrently.
|
||||
/// </summary>
|
||||
internal static class ClientWarmup
|
||||
{
|
||||
public static void RunWarmup()
|
||||
{
|
||||
Task.Run(WarmupCore);
|
||||
}
|
||||
|
||||
private static void WarmupCore()
|
||||
{
|
||||
// Get ImageSharp loaded.
|
||||
_ = SixLabors.ImageSharp.Configuration.Default;
|
||||
|
||||
SharedWarmup.WarmupCore();
|
||||
|
||||
// Preload the JSON loading code.
|
||||
RsiLoading.Warmup();
|
||||
}
|
||||
}
|
||||
12
Robust.Client/ComponentTrees/LightTreeComponent.cs
Normal file
12
Robust.Client/ComponentTrees/LightTreeComponent.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.ComponentTrees;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Physics;
|
||||
|
||||
namespace Robust.Client.ComponentTrees;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class LightTreeComponent: Component, IComponentTreeComponent<PointLightComponent>
|
||||
{
|
||||
public DynamicTree<ComponentTreeEntry<PointLightComponent>> Tree { get; set; } = default!;
|
||||
}
|
||||
38
Robust.Client/ComponentTrees/LightTreeSystem.cs
Normal file
38
Robust.Client/ComponentTrees/LightTreeSystem.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.ComponentTrees;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
|
||||
namespace Robust.Client.ComponentTrees;
|
||||
|
||||
public sealed class LightTreeSystem : ComponentTreeSystem<LightTreeComponent, PointLightComponent>
|
||||
{
|
||||
#region Component Tree Overrides
|
||||
protected override bool DoFrameUpdate => true;
|
||||
protected override bool DoTickUpdate => false;
|
||||
protected override bool Recursive => true;
|
||||
protected override int InitialCapacity => 128;
|
||||
|
||||
protected override Box2 ExtractAabb(in ComponentTreeEntry<PointLightComponent> entry, Vector2 pos, Angle rot)
|
||||
{
|
||||
// Really we should be rotating the light offset by the relative rotation. But I assume the light offset will
|
||||
// always be relatively small, so fuck it, this is probably faster than having to compute the angle every time.
|
||||
var radius = entry.Component.Radius + entry.Component.Offset.Length;
|
||||
return new Box2(pos - radius, pos + radius);
|
||||
}
|
||||
|
||||
protected override Box2 ExtractAabb(in ComponentTreeEntry<PointLightComponent> entry)
|
||||
{
|
||||
if (entry.Component.TreeUid == null)
|
||||
return default;
|
||||
|
||||
var pos = XformSystem.GetRelativePosition(
|
||||
entry.Transform,
|
||||
entry.Component.TreeUid.Value,
|
||||
GetEntityQuery<TransformComponent>());
|
||||
|
||||
return ExtractAabb(in entry, pos, default);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
12
Robust.Client/ComponentTrees/SpriteTreeComponent.cs
Normal file
12
Robust.Client/ComponentTrees/SpriteTreeComponent.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.ComponentTrees;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Physics;
|
||||
|
||||
namespace Robust.Client.ComponentTrees;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class SpriteTreeComponent: Component, IComponentTreeComponent<SpriteComponent>
|
||||
{
|
||||
public DynamicTree<ComponentTreeEntry<SpriteComponent>> Tree { get; set; } = default!;
|
||||
}
|
||||
40
Robust.Client/ComponentTrees/SpriteTreeSystem.cs
Normal file
40
Robust.Client/ComponentTrees/SpriteTreeSystem.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.ComponentTrees;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
|
||||
namespace Robust.Client.ComponentTrees;
|
||||
|
||||
public sealed class SpriteTreeSystem : ComponentTreeSystem<SpriteTreeComponent, SpriteComponent>
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<SpriteComponent, QueueSpriteTreeUpdateEvent>(OnQueueUpdate);
|
||||
}
|
||||
|
||||
private void OnQueueUpdate(EntityUid uid, SpriteComponent component, ref QueueSpriteTreeUpdateEvent args)
|
||||
=> QueueTreeUpdate(uid, component, args.Xform);
|
||||
|
||||
// TODO remove this when finally ECSing sprite components
|
||||
[ByRefEvent]
|
||||
internal readonly struct QueueSpriteTreeUpdateEvent
|
||||
{
|
||||
public readonly TransformComponent Xform;
|
||||
public QueueSpriteTreeUpdateEvent(TransformComponent xform)
|
||||
{
|
||||
Xform = xform;
|
||||
}
|
||||
}
|
||||
|
||||
#region Component Tree Overrides
|
||||
protected override bool DoFrameUpdate => true;
|
||||
protected override bool DoTickUpdate => false;
|
||||
protected override bool Recursive => true;
|
||||
protected override int InitialCapacity => 1024;
|
||||
|
||||
protected override Box2 ExtractAabb(in ComponentTreeEntry<SpriteComponent> entry, Vector2 pos, Angle rot)
|
||||
=> entry.Component.CalculateRotatedBoundingBox(pos, rot, default).CalcBoundingBox();
|
||||
#endregion
|
||||
}
|
||||
130
Robust.Client/Configuration/ClientNetConfigurationManager.cs
Normal file
130
Robust.Client/Configuration/ClientNetConfigurationManager.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Timing;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using Robust.Shared.Network.Messages;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Client.Configuration;
|
||||
|
||||
internal sealed class ClientNetConfigurationManager : NetConfigurationManager, IClientNetConfigurationManager
|
||||
{
|
||||
[Dependency] private readonly IBaseClient _client = default!;
|
||||
|
||||
private bool _receivedInitialNwVars = false;
|
||||
|
||||
public event EventHandler? ReceivedInitialNwVars;
|
||||
|
||||
public void SyncWithServer()
|
||||
{
|
||||
DebugTools.Assert(NetManager.IsConnected);
|
||||
|
||||
Sawmill.Info("Sending client info...");
|
||||
|
||||
var msg = new MsgConVars();
|
||||
msg.Tick = default;
|
||||
msg.NetworkedVars = GetReplicatedVars();
|
||||
NetManager.ClientSendMessage(msg);
|
||||
}
|
||||
|
||||
public void ClearReceivedInitialNwVars()
|
||||
{
|
||||
_receivedInitialNwVars = false;
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
|
||||
ReceivedInitialNwVars = null;
|
||||
_receivedInitialNwVars = false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void SetCVar(string name, object value, bool force = false)
|
||||
{
|
||||
CVar flags;
|
||||
using (Lock.ReadGuard())
|
||||
{
|
||||
if (!_configVars.TryGetValue(name, out var cVar) || !cVar.Registered)
|
||||
throw new InvalidConfigurationException($"Trying to set unregistered variable '{name}'");
|
||||
|
||||
flags = cVar.Flags;
|
||||
if (!force && NetManager.IsConnected && (cVar.Flags & CVar.NOT_CONNECTED) != 0)
|
||||
{
|
||||
Sawmill.Warning($"'{name}' can only be changed when not connected to a server.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!force && ((cVar.Flags & CVar.SERVER) != 0) && _client.RunLevel != ClientRunLevel.SinglePlayerGame)
|
||||
{
|
||||
Sawmill.Warning($"Only the server can change '{name}'.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Actually set the CVar
|
||||
base.SetCVar(name, value, force);
|
||||
|
||||
if ((flags & CVar.REPLICATED) == 0)
|
||||
return;
|
||||
|
||||
var msg = new MsgConVars();
|
||||
msg.Tick = Timing.CurTick;
|
||||
msg.NetworkedVars = new List<(string name, object value)>
|
||||
{
|
||||
(name, value)
|
||||
};
|
||||
NetManager.ClientSendMessage(msg);
|
||||
}
|
||||
|
||||
protected override void HandleNetVarMessage(MsgConVars message)
|
||||
{
|
||||
if (!_receivedInitialNwVars)
|
||||
ApplyClientNetVarChange(message.NetworkedVars, message.Tick);
|
||||
else
|
||||
base.HandleNetVarMessage(message);
|
||||
}
|
||||
|
||||
protected override void ApplyNetVarChange(
|
||||
INetChannel msgChannel,
|
||||
List<(string name, object value)> networkedVars,
|
||||
GameTick tick)
|
||||
{
|
||||
ApplyClientNetVarChange(networkedVars, tick);
|
||||
}
|
||||
|
||||
private void ApplyClientNetVarChange(List<(string name, object value)> networkedVars, GameTick tick)
|
||||
{
|
||||
// Server sent us a CVar update.
|
||||
Sawmill.Debug($"Handling replicated cvars...");
|
||||
|
||||
foreach (var (name, value) in networkedVars)
|
||||
{
|
||||
if (!_configVars.TryGetValue(name, out var cVar))
|
||||
{
|
||||
Sawmill.Warning($"Server sent an unknown replicated CVar '{name}.'");
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((cVar.Flags & CVar.CLIENT) != 0)
|
||||
continue; // ignore the server specified value.
|
||||
|
||||
// Actually set the CVar
|
||||
SetCVarInternal(name, value, tick);
|
||||
|
||||
Sawmill.Debug($"name={name}, val={value}");
|
||||
}
|
||||
|
||||
if (!_receivedInitialNwVars)
|
||||
{
|
||||
_receivedInitialNwVars = true;
|
||||
ReceivedInitialNwVars?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override T GetClientCVar<T>(INetChannel channel, string name) => GetCVar<T>(name);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Timing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Robust.Client.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// A networked configuration manager that controls the replication of
|
||||
/// console variables between client and server.
|
||||
/// </summary>
|
||||
public interface IClientNetConfigurationManager : INetConfigurationManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Synchronize the CVars marked with <see cref="CVar.REPLICATED"/> with the server.
|
||||
/// This needs to be called once when connecting.
|
||||
/// </summary>
|
||||
void SyncWithServer();
|
||||
|
||||
/// <summary>
|
||||
/// Clears internal flag for <see cref="ReceivedInitialNwVars"/>.
|
||||
/// Must be called upon disconnect.
|
||||
/// </summary>
|
||||
void ClearReceivedInitialNwVars();
|
||||
|
||||
public event EventHandler ReceivedInitialNwVars;
|
||||
}
|
||||
@@ -266,18 +266,18 @@ namespace Robust.Client.Console
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class RemoteExecCommand : IConsoleCommand
|
||||
private sealed class RemoteExecCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => ">";
|
||||
public string Description => Loc.GetString("cmd-remoteexec-desc");
|
||||
public string Help => Loc.GetString("cmd-remoteexec-help");
|
||||
public override string Command => ">";
|
||||
public override string Description => LocalizationManager.GetString("cmd-remoteexec-desc");
|
||||
public override string Help => LocalizationManager.GetString("cmd-remoteexec-help");
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
shell.RemoteExecuteCommand(argStr["> ".Length..]);
|
||||
}
|
||||
|
||||
public async ValueTask<CompletionResult> GetCompletionAsync(
|
||||
public override async ValueTask<CompletionResult> GetCompletionAsync(
|
||||
IConsoleShell shell,
|
||||
string[] args,
|
||||
CancellationToken cancel)
|
||||
|
||||
@@ -6,13 +6,14 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
internal sealed class AddCompCommand : IConsoleCommand
|
||||
internal sealed class AddCompCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "addcompc";
|
||||
public string Description => "Adds a component to an entity on the client";
|
||||
public string Help => "addcompc <uid> <componentName>";
|
||||
[Dependency] private readonly IComponentFactory _componentFactory = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "addcompc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
|
||||
if (args.Length != 2)
|
||||
@@ -24,25 +25,23 @@ namespace Robust.Client.Console.Commands
|
||||
var entity = EntityUid.Parse(args[0]);
|
||||
var componentName = args[1];
|
||||
|
||||
var compFactory = IoCManager.Resolve<IComponentFactory>();
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
var component = (Component) compFactory.GetComponent(componentName);
|
||||
var component = (Component) _componentFactory.GetComponent(componentName);
|
||||
|
||||
component.Owner = entity;
|
||||
|
||||
entityManager.AddComponent(entity, component);
|
||||
_entityManager.AddComponent(entity, component);
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
internal sealed class RemoveCompCommand : IConsoleCommand
|
||||
internal sealed class RemoveCompCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "rmcompc";
|
||||
public string Description => "Removes a component from an entity.";
|
||||
public string Help => "rmcompc <uid> <componentName>";
|
||||
[Dependency] private readonly IComponentFactory _componentFactory = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "rmcompc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 2)
|
||||
{
|
||||
@@ -53,12 +52,9 @@ namespace Robust.Client.Console.Commands
|
||||
var entityUid = EntityUid.Parse(args[0]);
|
||||
var componentName = args[1];
|
||||
|
||||
var entManager = IoCManager.Resolve<IEntityManager>();
|
||||
var compFactory = IoCManager.Resolve<IComponentFactory>();
|
||||
var registration = _componentFactory.GetRegistration(componentName);
|
||||
|
||||
var registration = compFactory.GetRegistration(componentName);
|
||||
|
||||
entManager.RemoveComponent(entityUid, registration.Type);
|
||||
_entityManager.RemoveComponent(entityUid, registration.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,22 +7,23 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
internal sealed class ClientSpawnCommand : IConsoleCommand
|
||||
internal sealed class ClientSpawnCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "cspawn";
|
||||
public string Description => "Spawns a client-side entity with specific type at your feet.";
|
||||
public string Help => "cspawn <entity type>";
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "cspawn";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var controlled = IoCManager.Resolve<IPlayerManager>().LocalPlayer?.ControlledEntity ?? EntityUid.Invalid;
|
||||
var controlled = _playerManager.LocalPlayer?.ControlledEntity ?? EntityUid.Invalid;
|
||||
if (controlled == EntityUid.Invalid)
|
||||
{
|
||||
shell.WriteLine("You don't have an attached entity.");
|
||||
return;
|
||||
}
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var entityManager = _entityManager;
|
||||
entityManager.SpawnEntity(args[0], entityManager.GetComponent<TransformComponent>(controlled).Coordinates);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,16 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class SaveConfig : IConsoleCommand
|
||||
public sealed class SaveConfig : LocalizedCommands
|
||||
{
|
||||
public string Command => "saveconfig";
|
||||
public string Description => "Saves the client configuration to the config file";
|
||||
public string Help => "saveconfig";
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
|
||||
public override string Command => "saveconfig";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IoCManager.Resolve<IConfigurationManager>().SaveToFile();
|
||||
_cfg.SaveToFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,25 +6,21 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
sealed class ClearCommand : IConsoleCommand
|
||||
sealed class ClearCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "cls";
|
||||
public string Help => "Clears the debug console of all messages.";
|
||||
public string Description => "Clears the console.";
|
||||
public override string Command => "cls";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
shell.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
sealed class FillCommand : IConsoleCommand
|
||||
sealed class FillCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "fill";
|
||||
public string Help => "Fills the console with some nonsense for debugging.";
|
||||
public string Description => "Fill up the console for debugging.";
|
||||
public override string Command => "fill";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
for (int x = 0; x < 50; x++)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Reflection;
|
||||
@@ -31,30 +32,31 @@ using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class DumpEntitiesCommand : IConsoleCommand
|
||||
internal sealed class DumpEntitiesCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "dumpentities";
|
||||
public string Help => "Dump entity list";
|
||||
public string Description => "Dumps entity list of UIDs and prototype.";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "dumpentities";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
foreach (var e in entityManager.GetEntities().OrderBy(e => e))
|
||||
foreach (var e in _entityManager.GetEntities().OrderBy(e => e))
|
||||
{
|
||||
shell.WriteLine($"entity {e}, {entityManager.GetComponent<MetaDataComponent>(e).EntityPrototype?.ID}, {entityManager.GetComponent<TransformComponent>(e).Coordinates}.");
|
||||
shell.WriteLine(
|
||||
$"entity {e}, {_entityManager.GetComponent<MetaDataComponent>(e).EntityPrototype?.ID}, {_entityManager.GetComponent<TransformComponent>(e).Coordinates}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GetComponentRegistrationCommand : IConsoleCommand
|
||||
internal sealed class GetComponentRegistrationCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "getcomponentregistration";
|
||||
public string Help => "Usage: getcomponentregistration <componentName>";
|
||||
public string Description => "Gets component registration information";
|
||||
[Dependency] private readonly IComponentFactory _componentFactory = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
|
||||
public override string Command => "getcomponentregistration";
|
||||
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 1)
|
||||
{
|
||||
@@ -62,11 +64,9 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var componentFactory = IoCManager.Resolve<IComponentFactory>();
|
||||
|
||||
try
|
||||
{
|
||||
var registration = componentFactory.GetRegistration(args[0]);
|
||||
var registration = _componentFactory.GetRegistration(args[0]);
|
||||
|
||||
var message = new StringBuilder($"'{registration.Name}': (type: {registration.Type}, ");
|
||||
if (registration.NetID == null)
|
||||
@@ -94,13 +94,14 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleMonitorCommand : IConsoleCommand
|
||||
internal sealed class ToggleMonitorCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "monitor";
|
||||
[Dependency] private readonly IUserInterfaceManager _uiMgr = default!;
|
||||
|
||||
public string Description => Loc.GetString("cmd-monitor-desc");
|
||||
|
||||
public string Help
|
||||
public override string Command => "monitor";
|
||||
|
||||
public override string Help
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -109,9 +110,9 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var monitors = IoCManager.Resolve<IUserInterfaceManager>().DebugMonitors;
|
||||
var monitors = _uiMgr.DebugMonitors;
|
||||
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -149,7 +150,7 @@ namespace Robust.Client.Console.Commands
|
||||
monitors.ToggleMonitor(parsedMonitor);
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
{
|
||||
if (args.Length == 1)
|
||||
{
|
||||
@@ -167,38 +168,36 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ExceptionCommand : IConsoleCommand
|
||||
internal sealed class ExceptionCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "fuck";
|
||||
public string Help => "Throws an exception";
|
||||
public string Description => "Throws an exception";
|
||||
public override string Command => "fuck";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
throw new InvalidOperationException("Fuck");
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ShowPositionsCommand : IConsoleCommand
|
||||
internal sealed class ShowPositionsCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showpos";
|
||||
public string Help => "";
|
||||
public string Description => "Enables debug drawing over all entity positions in the game.";
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "showpos";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = EntitySystem.Get<DebugDrawingSystem>();
|
||||
var mgr = _entitySystems.GetEntitySystem<DebugDrawingSystem>();
|
||||
mgr.DebugPositions = !mgr.DebugPositions;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ShowRayCommand : IConsoleCommand
|
||||
internal sealed class ShowRayCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showrays";
|
||||
public string Help => "Usage: showrays <raylifetime>";
|
||||
public string Description => "Toggles debug drawing of physics rays. An integer for <raylifetime> must be provided";
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "showrays";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -212,35 +211,32 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var mgr = EntitySystem.Get<DebugRayDrawingSystem>();
|
||||
var mgr = _entitySystems.GetEntitySystem<DebugRayDrawingSystem>();
|
||||
mgr.DebugDrawRays = !mgr.DebugDrawRays;
|
||||
shell.WriteError("Toggled showing rays to:" + mgr.DebugDrawRays);
|
||||
mgr.DebugRayLifetime = TimeSpan.FromSeconds(duration);
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class DisconnectCommand : IConsoleCommand
|
||||
internal sealed class DisconnectCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "disconnect";
|
||||
public string Help => "";
|
||||
public string Description => "Immediately disconnect from the server and go back to the main menu.";
|
||||
[Dependency] private readonly IClientNetManager _netManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "disconnect";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IoCManager.Resolve<IClientNetManager>().ClientDisconnect("Disconnect command used.");
|
||||
_netManager.ClientDisconnect("Disconnect command used.");
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class EntityInfoCommand : IConsoleCommand
|
||||
internal sealed class EntityInfoCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "entfo";
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public string Help =>
|
||||
"entfo <entityuid>\nThe entity UID can be prefixed with 'c' to convert it to a client entity UID.";
|
||||
public override string Command => "entfo";
|
||||
|
||||
public string Description => "Displays verbose diagnostics for an entity.";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -255,15 +251,17 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
|
||||
var uid = EntityUid.Parse(args[0]);
|
||||
var entmgr = IoCManager.Resolve<IEntityManager>();
|
||||
var entmgr = _entityManager;
|
||||
if (!entmgr.EntityExists(uid))
|
||||
{
|
||||
shell.WriteError("That entity does not exist. Sorry lad.");
|
||||
return;
|
||||
}
|
||||
|
||||
var meta = entmgr.GetComponent<MetaDataComponent>(uid);
|
||||
shell.WriteLine($"{uid}: {meta.EntityPrototype?.ID}/{meta.EntityName}");
|
||||
shell.WriteLine($"init/del/lmt: {meta.EntityInitialized}/{meta.EntityDeleted}/{meta.EntityLastModifiedTick}");
|
||||
shell.WriteLine(
|
||||
$"init/del/lmt: {meta.EntityInitialized}/{meta.EntityDeleted}/{meta.EntityLastModifiedTick}");
|
||||
foreach (var component in entmgr.GetComponents(uid))
|
||||
{
|
||||
shell.WriteLine(component.ToString() ?? "");
|
||||
@@ -283,13 +281,13 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class SnapGridGetCell : IConsoleCommand
|
||||
internal sealed class SnapGridGetCell : LocalizedCommands
|
||||
{
|
||||
public string Command => "sggcell";
|
||||
public string Help => "sggcell <gridID> <vector2i>\nThat vector2i param is in the form x<int>,y<int>.";
|
||||
public string Description => "Lists entities on a snap grid cell.";
|
||||
[Dependency] private readonly IMapManager _map = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "sggcell";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 2)
|
||||
{
|
||||
@@ -297,12 +295,11 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
string gridId = args[0];
|
||||
string indices = args[1];
|
||||
|
||||
if (!int.TryParse(args[0], out var id))
|
||||
if (!EntityUid.TryParse(args[0], out var gridUid))
|
||||
{
|
||||
shell.WriteError($"{args[0]} is not a valid integer.");
|
||||
shell.WriteError($"{args[0]} is not a valid entity UID.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -312,15 +309,11 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var mapMan = IoCManager.Resolve<IMapManager>();
|
||||
|
||||
if (mapMan.GridExists(new GridId(int.Parse(gridId, CultureInfo.InvariantCulture))))
|
||||
if (_map.TryGetGrid(gridUid, out var grid))
|
||||
{
|
||||
foreach (var entity in
|
||||
mapMan.GetGrid(new GridId(int.Parse(gridId, CultureInfo.InvariantCulture))).GetAnchoredEntities(
|
||||
new Vector2i(
|
||||
int.Parse(indices.Split(',')[0], CultureInfo.InvariantCulture),
|
||||
int.Parse(indices.Split(',')[1], CultureInfo.InvariantCulture))))
|
||||
foreach (var entity in grid.GetAnchoredEntities(new Vector2i(
|
||||
int.Parse(indices.Split(',')[0], CultureInfo.InvariantCulture),
|
||||
int.Parse(indices.Split(',')[1], CultureInfo.InvariantCulture))))
|
||||
{
|
||||
shell.WriteLine(entity.ToString());
|
||||
}
|
||||
@@ -332,104 +325,103 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class SetPlayerName : IConsoleCommand
|
||||
internal sealed class SetPlayerName : LocalizedCommands
|
||||
{
|
||||
public string Command => "overrideplayername";
|
||||
public string Description => "Changes the name used when attempting to connect to the server.";
|
||||
public string Help => Command + " <name>";
|
||||
[Dependency] private readonly IBaseClient _baseClient = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "overrideplayername";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 1)
|
||||
{
|
||||
shell.WriteLine(Help);
|
||||
return;
|
||||
}
|
||||
var client = IoCManager.Resolve<IBaseClient>();
|
||||
client.PlayerNameOverride = args[0];
|
||||
|
||||
_baseClient.PlayerNameOverride = args[0];
|
||||
|
||||
shell.WriteLine($"Overriding player name to \"{args[0]}\".");
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class LoadResource : IConsoleCommand
|
||||
internal sealed class LoadResource : LocalizedCommands
|
||||
{
|
||||
public string Command => "ldrsc";
|
||||
public string Description => "Pre-caches a resource.";
|
||||
public string Help => "ldrsc <path> <type>";
|
||||
[Dependency] private readonly IResourceCache _res = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflection = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "ldrsc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 2)
|
||||
{
|
||||
shell.WriteLine(Help);
|
||||
return;
|
||||
}
|
||||
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||
var reflection = IoCManager.Resolve<IReflectionManager>();
|
||||
|
||||
Type type;
|
||||
|
||||
try
|
||||
{
|
||||
type = reflection.LooseGetType(args[1]);
|
||||
type = _reflection.LooseGetType(args[1]);
|
||||
}
|
||||
catch(ArgumentException)
|
||||
catch (ArgumentException)
|
||||
{
|
||||
shell.WriteError("Unable to find type");
|
||||
return;
|
||||
}
|
||||
|
||||
var getResourceMethod =
|
||||
resourceCache
|
||||
_res
|
||||
.GetType()
|
||||
.GetMethod("GetResource", new[] { typeof(string), typeof(bool) });
|
||||
DebugTools.Assert(getResourceMethod != null);
|
||||
var generic = getResourceMethod!.MakeGenericMethod(type);
|
||||
generic.Invoke(resourceCache, new object[] { args[0], true });
|
||||
generic.Invoke(_res, new object[] { args[0], true });
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ReloadResource : IConsoleCommand
|
||||
internal sealed class ReloadResource : LocalizedCommands
|
||||
{
|
||||
public string Command => "rldrsc";
|
||||
public string Description => "Reloads a resource.";
|
||||
public string Help => "rldrsc <path> <type>";
|
||||
[Dependency] private readonly IResourceCache _res = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflection = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "rldrsc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 2)
|
||||
{
|
||||
shell.WriteLine(Help);
|
||||
return;
|
||||
}
|
||||
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||
var reflection = IoCManager.Resolve<IReflectionManager>();
|
||||
|
||||
Type type;
|
||||
try
|
||||
{
|
||||
type = reflection.LooseGetType(args[1]);
|
||||
type = _reflection.LooseGetType(args[1]);
|
||||
}
|
||||
catch(ArgumentException)
|
||||
catch (ArgumentException)
|
||||
{
|
||||
shell.WriteError("Unable to find type");
|
||||
return;
|
||||
}
|
||||
|
||||
var getResourceMethod = resourceCache.GetType().GetMethod("ReloadResource", new[] { typeof(string) });
|
||||
var getResourceMethod = _res.GetType().GetMethod("ReloadResource", new[] { typeof(string) });
|
||||
DebugTools.Assert(getResourceMethod != null);
|
||||
var generic = getResourceMethod!.MakeGenericMethod(type);
|
||||
generic.Invoke(resourceCache, new object[] { args[0] });
|
||||
generic.Invoke(_res, new object[] { args[0] });
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GridTileCount : IConsoleCommand
|
||||
internal sealed class GridTileCount : LocalizedCommands
|
||||
{
|
||||
public string Command => "gridtc";
|
||||
public string Description => "Gets the tile count of a grid";
|
||||
public string Help => "Usage: gridtc <gridId>";
|
||||
[Dependency] private readonly IMapManager _map = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "gridtc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -437,40 +429,35 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!int.TryParse(args[0], out var id))
|
||||
if (!EntityUid.TryParse(args[0], out var gridUid))
|
||||
{
|
||||
shell.WriteLine($"{args[0]} is not a valid integer.");
|
||||
shell.WriteLine($"{args[0]} is not a valid entity UID.");
|
||||
return;
|
||||
}
|
||||
|
||||
var gridId = new GridId(int.Parse(args[0]));
|
||||
var mapManager = IoCManager.Resolve<IMapManager>();
|
||||
|
||||
if (mapManager.TryGetGrid(gridId, out var grid))
|
||||
if (_map.TryGetGrid(gridUid, out var grid))
|
||||
{
|
||||
shell.WriteLine(mapManager.GetGrid(gridId).GetAllTiles().Count().ToString());
|
||||
shell.WriteLine(grid.GetAllTiles().Count().ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
shell.WriteError($"No grid exists with id {id}");
|
||||
shell.WriteError($"No grid exists with id {gridUid}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GuiDumpCommand : IConsoleCommand
|
||||
internal sealed class GuiDumpCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "guidump";
|
||||
public string Description => "Dump GUI tree to /guidump.txt in user data.";
|
||||
public string Help => "guidump";
|
||||
[Dependency] private readonly IUserInterfaceManager _ui = default!;
|
||||
[Dependency] private readonly IResourceCache _res = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "guidump";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var uiMgr = IoCManager.Resolve<IUserInterfaceManager>();
|
||||
var res = IoCManager.Resolve<IResourceManager>();
|
||||
using var writer = _res.UserData.OpenWriteText(new ResourcePath("/guidump.txt"));
|
||||
|
||||
using var writer = res.UserData.OpenWriteText(new ResourcePath("/guidump.txt"));
|
||||
|
||||
foreach (var root in uiMgr.AllRoots)
|
||||
foreach (var root in _ui.AllRoots)
|
||||
{
|
||||
writer.WriteLine($"ROOT: {root}");
|
||||
_writeNode(root, 0, writer);
|
||||
@@ -531,278 +518,133 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class UITestCommand : IConsoleCommand
|
||||
internal sealed class SetClipboardCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "uitest";
|
||||
public string Description => "Open a dummy UI testing window";
|
||||
public string Help => "uitest";
|
||||
[Dependency] private readonly IClipboardManager _clipboard = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "setclipboard";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var window = new DefaultWindow { MinSize = (500, 400)};
|
||||
var tabContainer = new TabContainer();
|
||||
window.Contents.AddChild(tabContainer);
|
||||
var scroll = new ScrollContainer();
|
||||
tabContainer.AddChild(scroll);
|
||||
//scroll.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide);
|
||||
var vBox = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical
|
||||
};
|
||||
scroll.AddChild(vBox);
|
||||
|
||||
var progressBar = new ProgressBar { MaxValue = 10, Value = 5 };
|
||||
vBox.AddChild(progressBar);
|
||||
|
||||
var optionButton = new OptionButton();
|
||||
optionButton.AddItem("Honk");
|
||||
optionButton.AddItem("Foo");
|
||||
optionButton.AddItem("Bar");
|
||||
optionButton.AddItem("Baz");
|
||||
optionButton.OnItemSelected += eventArgs => optionButton.SelectId(eventArgs.Id);
|
||||
vBox.AddChild(optionButton);
|
||||
|
||||
var tree = new Tree { VerticalExpand = true };
|
||||
var root = tree.CreateItem();
|
||||
root.Text = "Honk!";
|
||||
var child = tree.CreateItem();
|
||||
child.Text = "Foo";
|
||||
for (var i = 0; i < 20; i++)
|
||||
{
|
||||
child = tree.CreateItem();
|
||||
child.Text = $"Bar {i}";
|
||||
}
|
||||
|
||||
vBox.AddChild(tree);
|
||||
|
||||
var rich = new RichTextLabel();
|
||||
var message = new FormattedMessage();
|
||||
message.AddText("Foo\n");
|
||||
message.PushColor(Color.Red);
|
||||
message.AddText("Bar");
|
||||
message.Pop();
|
||||
rich.SetMessage(message);
|
||||
vBox.AddChild(rich);
|
||||
|
||||
var itemList = new ItemList();
|
||||
tabContainer.AddChild(itemList);
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
itemList.AddItem(i.ToString());
|
||||
}
|
||||
|
||||
var grid = new GridContainer { Columns = 3 };
|
||||
tabContainer.AddChild(grid);
|
||||
for (var y = 0; y < 3; y++)
|
||||
{
|
||||
for (var x = 0; x < 3; x++)
|
||||
{
|
||||
grid.AddChild(new Button
|
||||
{
|
||||
MinSize = (50, 50),
|
||||
Text = $"{x}, {y}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var group = new ButtonGroup();
|
||||
var vBoxRadioButtons = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical
|
||||
};
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
vBoxRadioButtons.AddChild(new Button
|
||||
{
|
||||
Text = i.ToString(),
|
||||
Group = group
|
||||
});
|
||||
|
||||
// ftftftftftftft
|
||||
}
|
||||
|
||||
tabContainer.AddChild(vBoxRadioButtons);
|
||||
|
||||
TabContainer.SetTabTitle(vBoxRadioButtons, "Radio buttons!!");
|
||||
|
||||
tabContainer.AddChild(new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
Name = "Slider",
|
||||
Children =
|
||||
{
|
||||
new Slider()
|
||||
}
|
||||
});
|
||||
|
||||
tabContainer.AddChild(new SplitContainer
|
||||
{
|
||||
Orientation = SplitContainer.SplitOrientation.Horizontal,
|
||||
Children =
|
||||
{
|
||||
new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Red},
|
||||
Children =
|
||||
{
|
||||
new Label{ Text = "FOOBARBAZ"},
|
||||
}
|
||||
},
|
||||
new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Blue},
|
||||
Children =
|
||||
{
|
||||
new Label{ Text = "FOOBARBAZ"},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
window.OpenCentered();
|
||||
_clipboard.SetText(args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class SetClipboardCommand : IConsoleCommand
|
||||
internal sealed class GetClipboardCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "setclipboard";
|
||||
public string Description => "Sets the system clipboard";
|
||||
public string Help => "setclipboard <text>";
|
||||
[Dependency] private readonly IClipboardManager _clipboard = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "getclipboard";
|
||||
|
||||
public override async void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<IClipboardManager>();
|
||||
mgr.SetText(args[0]);
|
||||
shell.WriteLine(await _clipboard.GetText());
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GetClipboardCommand : IConsoleCommand
|
||||
internal sealed class ToggleLight : LocalizedCommands
|
||||
{
|
||||
public string Command => "getclipboard";
|
||||
public string Description => "Gets the system clipboard";
|
||||
public string Help => "getclipboard";
|
||||
[Dependency] private readonly ILightManager _light = default!;
|
||||
|
||||
public async void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "togglelight";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<IClipboardManager>();
|
||||
shell.WriteLine(await mgr.GetText());
|
||||
if (!_light.LockConsoleAccess)
|
||||
_light.Enabled = !_light.Enabled;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleLight : IConsoleCommand
|
||||
internal sealed class ToggleFOV : LocalizedCommands
|
||||
{
|
||||
public string Command => "togglelight";
|
||||
public string Description => "Toggles light rendering.";
|
||||
public string Help => "togglelight";
|
||||
[Dependency] private readonly IEyeManager _eye = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "togglefov";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<ILightManager>();
|
||||
if (!mgr.LockConsoleAccess)
|
||||
mgr.Enabled = !mgr.Enabled;
|
||||
_eye.CurrentEye.DrawFov = !_eye.CurrentEye.DrawFov;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleFOV : IConsoleCommand
|
||||
internal sealed class ToggleHardFOV : LocalizedCommands
|
||||
{
|
||||
public string Command => "togglefov";
|
||||
public string Description => "Toggles fov for client.";
|
||||
public string Help => "togglefov";
|
||||
[Dependency] private readonly ILightManager _light = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "togglehardfov";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<IEyeManager>();
|
||||
if (mgr.CurrentEye != null)
|
||||
mgr.CurrentEye.DrawFov = !mgr.CurrentEye.DrawFov;
|
||||
if (!_light.LockConsoleAccess)
|
||||
_light.DrawHardFov = !_light.DrawHardFov;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleHardFOV : IConsoleCommand
|
||||
internal sealed class ToggleShadows : LocalizedCommands
|
||||
{
|
||||
public string Command => "togglehardfov";
|
||||
public string Description => "Toggles hard fov for client (for debugging space-station-14#2353).";
|
||||
public string Help => "togglehardfov";
|
||||
[Dependency] private readonly ILightManager _light = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "toggleshadows";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<ILightManager>();
|
||||
if (!mgr.LockConsoleAccess)
|
||||
mgr.DrawHardFov = !mgr.DrawHardFov;
|
||||
if (!_light.LockConsoleAccess)
|
||||
_light.DrawShadows = !_light.DrawShadows;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ToggleShadows : IConsoleCommand
|
||||
internal sealed class ToggleLightBuf : LocalizedCommands
|
||||
{
|
||||
public string Command => "toggleshadows";
|
||||
public string Description => "Toggles shadow rendering.";
|
||||
public string Help => "toggleshadows";
|
||||
[Dependency] private readonly ILightManager _light = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<ILightManager>();
|
||||
if (!mgr.LockConsoleAccess)
|
||||
mgr.DrawShadows = !mgr.DrawShadows;
|
||||
}
|
||||
}
|
||||
internal sealed class ToggleLightBuf : IConsoleCommand
|
||||
{
|
||||
public string Command => "togglelightbuf";
|
||||
public string Description => "Toggles lighting rendering. This includes shadows but not FOV.";
|
||||
public string Help => "togglelightbuf";
|
||||
public override string Command => "togglelightbuf";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<ILightManager>();
|
||||
if (!mgr.LockConsoleAccess)
|
||||
mgr.DrawLighting = !mgr.DrawLighting;
|
||||
if (!_light.LockConsoleAccess)
|
||||
_light.DrawLighting = !_light.DrawLighting;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ChunkInfoCommand : IConsoleCommand
|
||||
internal sealed class ChunkInfoCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "chunkinfo";
|
||||
public string Description => "Gets info about a chunk under your mouse cursor.";
|
||||
public string Help => Command;
|
||||
[Dependency] private readonly IMapManager _map = default!;
|
||||
[Dependency] private readonly IEyeManager _eye = default!;
|
||||
[Dependency] private readonly IInputManager _input = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "chunkinfo";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mapMan = IoCManager.Resolve<IMapManager>();
|
||||
var inputMan = IoCManager.Resolve<IInputManager>();
|
||||
var eyeMan = IoCManager.Resolve<IEyeManager>();
|
||||
var mousePos = _eye.ScreenToMap(_input.MouseScreenPosition);
|
||||
|
||||
var mousePos = eyeMan.ScreenToMap(inputMan.MouseScreenPosition);
|
||||
|
||||
if (!mapMan.TryFindGridAt(mousePos, out var grid))
|
||||
if (!_map.TryFindGridAt(mousePos, out var grid))
|
||||
{
|
||||
shell.WriteLine("No grid under your mouse cursor.");
|
||||
return;
|
||||
}
|
||||
|
||||
var internalGrid = (IMapGridInternal)grid;
|
||||
|
||||
var chunkIndex = grid.LocalToChunkIndices(grid.MapToGrid(mousePos));
|
||||
var chunk = internalGrid.GetChunk(chunkIndex);
|
||||
var chunk = grid.GetOrAddChunk(chunkIndex);
|
||||
|
||||
shell.WriteLine($"worldBounds: {internalGrid.CalcWorldAABB(chunk)} localBounds: {chunk.CachedBounds}");
|
||||
shell.WriteLine($"worldBounds: {grid.CalcWorldAABB(chunk)} localBounds: {chunk.CachedBounds}");
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ReloadShadersCommand : IConsoleCommand
|
||||
internal sealed class ReloadShadersCommand : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IResourceCacheInternal _res = default!;
|
||||
[Dependency] private readonly ITaskManager _taskManager = default!;
|
||||
|
||||
public string Command => "rldshader";
|
||||
|
||||
public string Description => "Reloads all shaders";
|
||||
|
||||
public string Help => "rldshader";
|
||||
public override string Command => "rldshader";
|
||||
|
||||
public static Dictionary<string, FileSystemWatcher>? _watchers;
|
||||
|
||||
public static ConcurrentDictionary<string, bool>? _reloadShadersQueued = new();
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IResourceCacheInternal resC;
|
||||
var resC = _res;
|
||||
if (args.Length == 1)
|
||||
{
|
||||
if (args[0] == "+watch")
|
||||
@@ -812,16 +654,16 @@ namespace Robust.Client.Console.Commands
|
||||
shell.WriteLine("Already watching.");
|
||||
return;
|
||||
}
|
||||
resC = IoCManager.Resolve<IResourceCacheInternal>();
|
||||
|
||||
_watchers = new Dictionary<string, FileSystemWatcher>();
|
||||
|
||||
var stringComparer = PathHelpers.IsFileSystemCaseSensitive()
|
||||
? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase;
|
||||
? StringComparer.Ordinal
|
||||
: StringComparer.OrdinalIgnoreCase;
|
||||
|
||||
var reversePathResolution = new ConcurrentDictionary<string, HashSet<ResourcePath>>(stringComparer);
|
||||
|
||||
var taskManager = IoCManager.Resolve<ITaskManager>();
|
||||
var taskManager = _taskManager;
|
||||
|
||||
var shaderCount = 0;
|
||||
var created = 0;
|
||||
@@ -877,8 +719,7 @@ namespace Robust.Client.Console.Commands
|
||||
{
|
||||
try
|
||||
{
|
||||
IoCManager.Resolve<IResourceCache>()
|
||||
.ReloadResource<ShaderSourceResource>(resPath);
|
||||
resC.ReloadResource<ShaderSourceResource>(resPath);
|
||||
shell.WriteLine($"Reloaded shader: {resPath}");
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -939,8 +780,6 @@ namespace Robust.Client.Console.Commands
|
||||
|
||||
shell.WriteLine("Reloading content shader resources...");
|
||||
|
||||
resC = IoCManager.Resolve<IResourceCacheInternal>();
|
||||
|
||||
foreach (var (path, _) in resC.GetAllResources<ShaderSourceResource>())
|
||||
{
|
||||
try
|
||||
@@ -955,26 +794,23 @@ namespace Robust.Client.Console.Commands
|
||||
|
||||
shell.WriteLine("Done.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal sealed class ClydeDebugLayerCommand : IConsoleCommand
|
||||
internal sealed class ClydeDebugLayerCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "cldbglyr";
|
||||
public string Description => "Toggle fov and light debug layers";
|
||||
public string Help => "cldbglyr <layer>: Toggle <layer>\ncldbglyr: Turn all Layers off";
|
||||
[Dependency] private readonly IClydeInternal _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "cldbglyr";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var clyde = IoCManager.Resolve<IClydeInternal>();
|
||||
|
||||
if (args.Length < 1)
|
||||
{
|
||||
clyde.DebugLayers = ClydeDebugLayers.None;
|
||||
_clyde.DebugLayers = ClydeDebugLayers.None;
|
||||
return;
|
||||
}
|
||||
|
||||
clyde.DebugLayers = args[0] switch
|
||||
_clyde.DebugLayers = args[0] switch
|
||||
{
|
||||
"fov" => ClydeDebugLayers.Fov,
|
||||
"light" => ClydeDebugLayers.Light,
|
||||
@@ -983,13 +819,13 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GetKeyInfoCommand : IConsoleCommand
|
||||
internal sealed class GetKeyInfoCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "keyinfo";
|
||||
public string Description => "Keys key info for a key";
|
||||
public string Help => "keyinfo <Key>";
|
||||
[Dependency] private readonly IClydeInternal _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "keyinfo";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -997,13 +833,11 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var clyde = IoCManager.Resolve<IClydeInternal>();
|
||||
|
||||
if (Enum.TryParse(typeof(Keyboard.Key), args[0], true, out var parsed))
|
||||
{
|
||||
var key = (Keyboard.Key) parsed!;
|
||||
var key = (Keyboard.Key)parsed!;
|
||||
|
||||
var name = clyde.GetKeyName(key);
|
||||
var name = _clyde.GetKeyName(key);
|
||||
|
||||
shell.WriteLine($"name: '{name}' ");
|
||||
}
|
||||
|
||||
@@ -5,12 +5,11 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
public sealed class DebugAnchoredCommand : IConsoleCommand
|
||||
public sealed class DebugAnchoredCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showanchored";
|
||||
public string Description => $"Shows anchored entities on a particular tile";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "showanchored";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<DebugAnchoringSystem>().Enabled ^= true;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,11 @@ using Robust.Shared.ContentPack;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
#if DEBUG
|
||||
internal sealed class DumpMetadataMembersCommand : IConsoleCommand
|
||||
internal sealed class DumpMetadataMembersCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "dmetamem";
|
||||
public string Description => "Dumps a type's members in a format suitable for the sandbox configuration file.";
|
||||
public string Help => "Usage: dmetamem <type>";
|
||||
public override string Command => "dmetamem";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var type = Type.GetType(args[0]);
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
public sealed class GridChunkBBCommand : IConsoleCommand
|
||||
public sealed class GridChunkBBCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showchunkbb";
|
||||
public string Description => "Displays chunk bounds for the purposes of rendering";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "showchunkbb";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<GridChunkBoundsDebugSystem>().Enabled ^= true;
|
||||
}
|
||||
|
||||
@@ -9,19 +9,23 @@ using Robust.Shared.Network;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class LauncherAuthCommand : IConsoleCommand
|
||||
internal sealed class LauncherAuthCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "launchauth";
|
||||
public string Description => "Load authentication tokens from launcher data to aid in testing of live servers";
|
||||
public string Help => "launchauth [account name]";
|
||||
[Dependency] private readonly IAuthManager _auth = default!;
|
||||
[Dependency] private readonly IGameControllerInternal _gameController = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "launchauth";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var wantName = args.Length > 0 ? args[0] : null;
|
||||
|
||||
var basePath = Path.GetDirectoryName(UserDataDir.GetUserDataDir())!;
|
||||
var basePath = Path.GetDirectoryName(UserDataDir.GetUserDataDir(_gameController))!;
|
||||
var dbPath = Path.Combine(basePath, "launcher", "settings.db");
|
||||
|
||||
#if USE_SYSTEM_SQLITE
|
||||
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3());
|
||||
#endif
|
||||
using var con = new SqliteConnection($"Data Source={dbPath};Mode=ReadOnly");
|
||||
con.Open();
|
||||
using var cmd = con.CreateCommand();
|
||||
@@ -47,9 +51,8 @@ namespace Robust.Client.Console.Commands
|
||||
var userName = reader.GetString(1);
|
||||
var token = reader.GetString(2);
|
||||
|
||||
var cfg = IoCManager.Resolve<IAuthManager>();
|
||||
cfg.Token = token;
|
||||
cfg.UserId = new NetUserId(userId);
|
||||
_auth.Token = token;
|
||||
_auth.UserId = new NetUserId(userId);
|
||||
|
||||
shell.WriteLine($"Logged into account {userName}");
|
||||
}
|
||||
|
||||
@@ -5,12 +5,11 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class LightDebugCommand : IConsoleCommand
|
||||
internal sealed class LightDebugCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "lightbb";
|
||||
public string Description => "Toggles whether to show light bounding boxes";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "lightbb";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<DebugLightTreeSystem>().Enabled ^= true;
|
||||
}
|
||||
|
||||
@@ -7,17 +7,15 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class LsMonitorCommand : IConsoleCommand
|
||||
public sealed class LsMonitorCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "lsmonitor";
|
||||
public string Description => "";
|
||||
public string Help => "";
|
||||
[Dependency] private readonly IClyde _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "lsmonitor";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var clyde = IoCManager.Resolve<IClyde>();
|
||||
|
||||
foreach (var monitor in clyde.EnumerateMonitors())
|
||||
foreach (var monitor in _clyde.EnumerateMonitors())
|
||||
{
|
||||
shell.WriteLine(
|
||||
$"[{monitor.Id}] {monitor.Name}: {monitor.Size.X}x{monitor.Size.Y}@{monitor.RefreshRate}Hz");
|
||||
@@ -26,13 +24,13 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class MonitorInfoCommand : IConsoleCommand
|
||||
public sealed class MonitorInfoCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "monitorinfo";
|
||||
public string Description => "";
|
||||
public string Help => "Usage: monitorinfo <id>";
|
||||
[Dependency] private readonly IClyde _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "monitorinfo";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length < 1)
|
||||
{
|
||||
@@ -40,8 +38,7 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var clyde = IoCManager.Resolve<IClyde>();
|
||||
var monitor = clyde.EnumerateMonitors().Single(c => c.Id == int.Parse(args[0]));
|
||||
var monitor = _clyde.EnumerateMonitors().Single(c => c.Id == int.Parse(args[0]));
|
||||
|
||||
shell.WriteLine($"{monitor.Id}: {monitor.Name}");
|
||||
shell.WriteLine($"Video modes:");
|
||||
@@ -54,19 +51,17 @@ namespace Robust.Client.Console.Commands
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class SetMonitorCommand : IConsoleCommand
|
||||
public sealed class SetMonitorCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "setmonitor";
|
||||
public string Description => "";
|
||||
public string Help => "Usage: setmonitor <id>";
|
||||
[Dependency] private readonly IClyde _clyde = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "setmonitor";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var clyde = IoCManager.Resolve<IClyde>();
|
||||
|
||||
var id = int.Parse(args[0]);
|
||||
var monitor = clyde.EnumerateMonitors().Single(m => m.Id == id);
|
||||
clyde.SetWindowMonitor(monitor);
|
||||
var monitor = _clyde.EnumerateMonitors().Single(m => m.Id == id);
|
||||
_clyde.SetWindowMonitor(monitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
using Robust.Client.Debugging;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
public sealed class PhysicsOverlayCommands : IConsoleCommand
|
||||
public sealed class PhysicsOverlayCommands : LocalizedCommands
|
||||
{
|
||||
public string Command => "physics";
|
||||
public string Description => $"Shows a debug physics overlay. The arg supplied specifies the overlay.";
|
||||
public string Help => $"{Command} <aabbs / com / contactnormals / contactpoints / joints / shapeinfo / shapes>";
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "physics";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var system = EntitySystem.Get<DebugPhysicsSystem>();
|
||||
var system = _entitySystems.GetEntitySystem<DebugPhysicsSystem>();
|
||||
|
||||
switch (args[0])
|
||||
{
|
||||
@@ -35,6 +36,9 @@ namespace Robust.Client.Console.Commands
|
||||
case "contactpoints":
|
||||
system.Flags ^= PhysicsDebugFlags.ContactPoints;
|
||||
break;
|
||||
case "distance":
|
||||
system.Flags ^= PhysicsDebugFlags.Distance;
|
||||
break;
|
||||
case "joints":
|
||||
system.Flags ^= PhysicsDebugFlags.Joints;
|
||||
break;
|
||||
@@ -52,7 +56,7 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
{
|
||||
if (args.Length != 1) return CompletionResult.Empty;
|
||||
|
||||
@@ -62,6 +66,7 @@ namespace Robust.Client.Console.Commands
|
||||
"com",
|
||||
"contactnormals",
|
||||
"contactpoints",
|
||||
"distance",
|
||||
"joints",
|
||||
"shapeinfo",
|
||||
"shapes",
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#if !FULL_RELEASE
|
||||
using System;
|
||||
using JetBrains.Profiler.Api;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Robust.Client.Console.Commands;
|
||||
|
||||
public sealed class ProfileEntitySpawningCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entities = default!;
|
||||
|
||||
public string Command => "profileEntitySpawning";
|
||||
public string Description => "Profiles entity spawning with n entities";
|
||||
public string Help => $"Usage: {Command} | {Command} <amount> <prototype>";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var amount = 1000;
|
||||
string? prototype = null;
|
||||
|
||||
switch (args.Length)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 2:
|
||||
if (!int.TryParse(args[0], out amount))
|
||||
{
|
||||
shell.WriteError($"First argument is not an integer: {args[0]}");
|
||||
return;
|
||||
}
|
||||
|
||||
prototype = args[1];
|
||||
|
||||
break;
|
||||
default:
|
||||
shell.WriteError(Help);
|
||||
return;
|
||||
}
|
||||
|
||||
GC.Collect();
|
||||
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
|
||||
MeasureProfiler.StartCollectingData();
|
||||
|
||||
for (var i = 0; i < amount; i++)
|
||||
{
|
||||
_entities.SpawnEntity(prototype, MapCoordinates.Nullspace);
|
||||
}
|
||||
|
||||
MeasureProfiler.SaveData();
|
||||
|
||||
shell.WriteLine($"Client: Profiled spawning {amount} entities in {stopwatch.Elapsed.TotalMilliseconds:N3} ms");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -4,27 +4,25 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
sealed class HardQuitCommand : IConsoleCommand
|
||||
sealed class HardQuitCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "hardquit";
|
||||
public string Description => "Kills the game client instantly.";
|
||||
public string Help => "Kills the game client instantly, leaving no traces. No telling the server goodbye";
|
||||
public override string Command => "hardquit";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
sealed class QuitCommand : IConsoleCommand
|
||||
sealed class QuitCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "quit";
|
||||
public string Description => "Shuts down the game client gracefully.";
|
||||
public string Help => "Properly shuts down the game client, notifying the connected server and such.";
|
||||
[Dependency] private readonly IGameController _gameController = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "quit";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IoCManager.Resolve<IGameController>().Shutdown("quit command used");
|
||||
_gameController.Shutdown("quit command used");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@ using Robust.Shared.Localization;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class ReloadLocalizationsCommand : IConsoleCommand
|
||||
internal sealed class ReloadLocalizationsCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "rldloc";
|
||||
public string Description => "Reloads localization (client & server)";
|
||||
public string Help => "Usage: rldloc";
|
||||
[Dependency] private readonly ILocalizationManager _loc = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "rldloc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
IoCManager.Resolve<ILocalizationManager>().ReloadLocalizations();
|
||||
_loc.ReloadLocalizations();
|
||||
|
||||
shell.RemoteExecuteCommand("sudo rldloc");
|
||||
}
|
||||
|
||||
@@ -4,47 +4,42 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
#if CLIENT_SCRIPTING
|
||||
internal sealed class ScriptCommand : IConsoleCommand
|
||||
internal sealed class ScriptCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "csi";
|
||||
public string Description => "Opens a C# interactive console.";
|
||||
public string Help => "csi";
|
||||
public override string Command => "csi";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
new ScriptConsoleClient().OpenCentered();
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class WatchCommand : IConsoleCommand
|
||||
internal sealed class WatchCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "watch";
|
||||
public string Description => "Opens a variable watch window.";
|
||||
public string Help => "watch";
|
||||
public override string Command => "watch";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
new WatchWindow().OpenCentered();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
internal sealed class ServerScriptCommand : IConsoleCommand
|
||||
internal sealed class ServerScriptCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "scsi";
|
||||
public string Description => "Opens a C# interactive console on the server.";
|
||||
public string Help => "scsi";
|
||||
[Dependency] private readonly IScriptClient _scriptClient = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "scsi";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var mgr = IoCManager.Resolve<IScriptClient>();
|
||||
if (!mgr.CanScript)
|
||||
if (!_scriptClient.CanScript)
|
||||
{
|
||||
shell.WriteError("You do not have server side scripting permission.");
|
||||
return;
|
||||
}
|
||||
|
||||
mgr.StartSession();
|
||||
_scriptClient.StartSession();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,20 +4,19 @@ using Robust.Shared.Network;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
internal sealed class SendGarbageCommand : IConsoleCommand
|
||||
internal sealed class SendGarbageCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "sendgarbage";
|
||||
public string Description => "Sends garbage to the server.";
|
||||
public string Help => "The server will reply with 'no u'";
|
||||
[Dependency] private readonly IClientNetManager _netManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "sendgarbage";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
// MsgStringTableEntries is registered as NetMessageAccept.Client so the server will immediately deny it.
|
||||
// And kick us.
|
||||
var net = IoCManager.Resolve<IClientNetManager>();
|
||||
var msg = new MsgStringTableEntries();
|
||||
msg.Entries = new MsgStringTableEntries.Entry[0];
|
||||
net.ClientSendMessage(msg);
|
||||
_netManager.ClientSendMessage(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ using Robust.Shared.IoC;
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class SetInputContextCommand : IConsoleCommand
|
||||
public sealed class SetInputContextCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "setinputcontext";
|
||||
public string Description => "Sets the active input context.";
|
||||
public string Help => "setinputcontext <context>";
|
||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "setinputcontext";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
@@ -20,15 +20,13 @@ namespace Robust.Client.Console.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var inputMan = IoCManager.Resolve<IInputManager>();
|
||||
|
||||
if (!inputMan.Contexts.Exists(args[0]))
|
||||
if (!_inputManager.Contexts.Exists(args[0]))
|
||||
{
|
||||
shell.WriteLine("Context not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
inputMan.Contexts.SetActiveContext(args[0]);
|
||||
_inputManager.Contexts.SetActiveContext(args[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
285
Robust.Client/Console/Commands/UITestCommand.cs
Normal file
285
Robust.Client/Console/Commands/UITestCommand.cs
Normal file
@@ -0,0 +1,285 @@
|
||||
using System;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Client.Console.Commands;
|
||||
|
||||
internal sealed class UITestControl : Control
|
||||
{
|
||||
private const string Lipsum = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sed interdum diam. Duis erat risus, tincidunt at pulvinar non, accumsan non dui. Morbi feugiat nisi in odio consectetur, ac suscipit nulla mollis. Nulla consequat neque sit amet neque venenatis feugiat. Proin placerat eget mauris sit amet tincidunt. Sed pulvinar purus sed ex varius, et lobortis risus efficitur. Integer blandit eu neque quis elementum. Vivamus lacinia sem non lacinia eleifend. Integer sit amet est ac risus tempus iaculis sed quis leo. Proin eu dui tincidunt orci ornare elementum. Curabitur molestie enim scelerisque, porttitor ipsum vitae, posuere libero. Donec finibus placerat accumsan. Nam et arcu lacus.
|
||||
|
||||
Proin sed dui gravida nibh faucibus sodales ut sit amet dolor. Pellentesque ornare neque ac ante sagittis posuere. Maecenas ullamcorper pellentesque aliquet. Vestibulum ipsum ipsum, hendrerit eu venenatis eget, tempor aliquet ex. Etiam sed nunc eu orci condimentum consequat. Praesent commodo sem a lorem consequat, nec vestibulum elit dignissim. Sed fermentum maximus neque, non vestibulum felis. Quisque vulputate vehicula massa, sit amet accumsan purus condimentum nec. Ut tincidunt in purus sit amet lobortis. Nunc et eros vel elit sodales mollis. Aenean facilisis justo libero, at mollis arcu rutrum eget. Aenean rutrum, orci pretium faucibus auctor, tellus quam tincidunt diam, et feugiat turpis lectus nec sem.
|
||||
|
||||
Donec et ipsum urna. Vestibulum consequat risus vitae orci consectetur ornare id id ligula. Donec ac nunc venenatis, volutpat elit eget, eleifend ex. Fusce eget odio sed tortor luctus feugiat. Maecenas lobortis nulla sit amet nisl egestas vulputate. Aliquam a placerat nunc. Fusce porta ultricies tortor, vitae dictum elit aliquet ac. In massa sapien, lobortis laoreet odio dignissim, congue blandit nibh. Quisque et iaculis eros, sed pretium felis. Praesent venenatis porta odio sed vulputate. Vivamus lacus nulla, lacinia non commodo id, ultricies nec arcu. Donec scelerisque pretium mollis. Etiam eu facilisis leo.
|
||||
|
||||
Curabitur vulputate euismod massa, pulvinar tincidunt arcu vestibulum ut. Sed eu tempus velit, at porttitor justo. In eget turpis fermentum nibh euismod vestibulum. Proin vitae malesuada ipsum. Nunc at aliquet erat, sed maximus tortor. Cras tristique consequat elit, ut venenatis elit feugiat et. In malesuada, erat a tempus vehicula, nulla justo efficitur mauris, vitae ornare lectus massa eu sapien. Nam libero diam, gravida ac dapibus sed, hendrerit sed libero. Sed fringilla enim vel elit finibus congue. Fusce tristique, neque sit amet blandit posuere, ex urna malesuada ligula, ut sodales dolor est vitae lectus. Sed pharetra tincidunt pulvinar. Fusce sit amet finibus nulla, vel maximus tellus. Etiam in nisl ex. Fusce tempus augue lectus, eu sagittis arcu tempor id. Sed feugiat venenatis semper. Cras eget mollis nisi.
|
||||
|
||||
Suspendisse hendrerit blandit urna ut laoreet. Suspendisse ac elit at erat malesuada commodo id vel dolor. Etiam sem magna, placerat lobortis mattis a, tincidunt at nisi. Ut gravida arcu purus, eu feugiat turpis accumsan non. Sed sit amet varius enim, sed ornare ante. Integer porta felis felis. Vestibulum euismod velit sit amet eleifend posuere. Cras laoreet fermentum condimentum. Suspendisse potenti. Donec iaculis sodales vestibulum. Etiam quis dictum nisl. Fusce dui ex, viverra nec lacus sed, tincidunt accumsan odio. Nulla sit amet ipsum eros. Curabitur et lectus ut nisi lobortis sollicitudin a eu turpis. Etiam molestie purus vitae porttitor auctor.
|
||||
";
|
||||
|
||||
|
||||
private readonly TabContainer _tabContainer;
|
||||
|
||||
public UITestControl()
|
||||
{
|
||||
_tabContainer = new TabContainer();
|
||||
AddChild(_tabContainer);
|
||||
var scroll = new ScrollContainer();
|
||||
_tabContainer.AddChild(scroll);
|
||||
//scroll.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide);
|
||||
var vBox = new BoxContainer
|
||||
{
|
||||
Orientation = BoxContainer.LayoutOrientation.Vertical
|
||||
};
|
||||
scroll.AddChild(vBox);
|
||||
|
||||
var progressBar = new ProgressBar { MaxValue = 10, Value = 5 };
|
||||
vBox.AddChild(progressBar);
|
||||
|
||||
var optionButton = new OptionButton();
|
||||
optionButton.AddItem("Honk");
|
||||
optionButton.AddItem("Foo");
|
||||
optionButton.AddItem("Bar");
|
||||
optionButton.AddItem("Baz");
|
||||
optionButton.OnItemSelected += eventArgs => optionButton.SelectId(eventArgs.Id);
|
||||
vBox.AddChild(optionButton);
|
||||
|
||||
var tree = new Tree { VerticalExpand = true };
|
||||
var root = tree.CreateItem();
|
||||
root.Text = "Honk!";
|
||||
var child = tree.CreateItem();
|
||||
child.Text = "Foo";
|
||||
for (var i = 0; i < 20; i++)
|
||||
{
|
||||
child = tree.CreateItem();
|
||||
child.Text = $"Bar {i}";
|
||||
}
|
||||
|
||||
vBox.AddChild(tree);
|
||||
|
||||
var rich = new RichTextLabel();
|
||||
var message = new FormattedMessage();
|
||||
message.AddText("Foo\n");
|
||||
message.PushColor(Color.Red);
|
||||
message.AddText("Bar");
|
||||
message.Pop();
|
||||
rich.SetMessage(message);
|
||||
vBox.AddChild(rich);
|
||||
|
||||
var itemList = new ItemList();
|
||||
_tabContainer.AddChild(itemList);
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
itemList.AddItem(i.ToString());
|
||||
}
|
||||
|
||||
var grid = new GridContainer { Columns = 3 };
|
||||
_tabContainer.AddChild(grid);
|
||||
for (var y = 0; y < 3; y++)
|
||||
{
|
||||
for (var x = 0; x < 3; x++)
|
||||
{
|
||||
grid.AddChild(new Button
|
||||
{
|
||||
MinSize = (50, 50),
|
||||
Text = $"{x}, {y}"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var group = new ButtonGroup();
|
||||
var vBoxRadioButtons = new BoxContainer
|
||||
{
|
||||
Orientation = BoxContainer.LayoutOrientation.Vertical
|
||||
};
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
vBoxRadioButtons.AddChild(new Button
|
||||
{
|
||||
Text = i.ToString(),
|
||||
Group = group
|
||||
});
|
||||
|
||||
// ftftftftftftft
|
||||
}
|
||||
|
||||
_tabContainer.AddChild(vBoxRadioButtons);
|
||||
|
||||
TabContainer.SetTabTitle(vBoxRadioButtons, "Radio buttons!!");
|
||||
|
||||
_tabContainer.AddChild(new BoxContainer
|
||||
{
|
||||
Orientation = BoxContainer.LayoutOrientation.Vertical,
|
||||
Name = "Slider",
|
||||
Children =
|
||||
{
|
||||
new Slider()
|
||||
}
|
||||
});
|
||||
|
||||
_tabContainer.AddChild(new SplitContainer
|
||||
{
|
||||
Orientation = SplitContainer.SplitOrientation.Horizontal,
|
||||
Children =
|
||||
{
|
||||
new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Red },
|
||||
Children =
|
||||
{
|
||||
new Label { Text = "FOOBARBAZ" },
|
||||
}
|
||||
},
|
||||
new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Blue },
|
||||
Children =
|
||||
{
|
||||
new Label { Text = "FOOBARBAZ" },
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
_tabContainer.AddChild(TabTextEdit());
|
||||
_tabContainer.AddChild(TabRichText());
|
||||
}
|
||||
|
||||
private Control TabTextEdit()
|
||||
{
|
||||
var textEdit = new TextEdit
|
||||
{
|
||||
Placeholder = new Rope.Leaf("You deleted the lipsum OwO")
|
||||
};
|
||||
TabContainer.SetTabTitle(textEdit, "TextEdit");
|
||||
|
||||
var lipsumRope = new Rope.Branch(Rope.Leaf.Empty, null);
|
||||
|
||||
var startIndex = 0;
|
||||
while (true)
|
||||
{
|
||||
var nextIndex = Lipsum.IndexOf(' ', startIndex);
|
||||
var str = nextIndex == -1 ? Lipsum[startIndex..] : Lipsum[startIndex..(nextIndex+1)];
|
||||
|
||||
lipsumRope = new Rope.Branch(lipsumRope, new Rope.Leaf(str));
|
||||
if (lipsumRope.Depth > 250)
|
||||
lipsumRope = (Rope.Branch)Rope.Rebalance(lipsumRope);
|
||||
|
||||
if (nextIndex == -1)
|
||||
break;
|
||||
|
||||
startIndex = nextIndex + 1;
|
||||
}
|
||||
|
||||
var rope = new Rope.Branch(lipsumRope, null);
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
rope = new Rope.Branch(rope, lipsumRope);
|
||||
}
|
||||
|
||||
rope = (Rope.Branch) Rope.Rebalance(rope);
|
||||
|
||||
textEdit.TextRope = rope;
|
||||
|
||||
return textEdit;
|
||||
}
|
||||
|
||||
private Control TabRichText()
|
||||
{
|
||||
var label = new RichTextLabel();
|
||||
label.SetMessage(FormattedMessage.FromMarkup(Lipsum));
|
||||
|
||||
TabContainer.SetTabTitle(label, "RichText");
|
||||
return label;
|
||||
}
|
||||
|
||||
public void SelectTab(Tab tab)
|
||||
{
|
||||
_tabContainer.CurrentTab = (int)tab;
|
||||
}
|
||||
|
||||
public enum Tab : byte
|
||||
{
|
||||
Untitled1 = 0,
|
||||
Untitled2 = 1,
|
||||
Untitled3 = 2,
|
||||
RadioButtons = 3,
|
||||
Slider = 4,
|
||||
Untitled4 = 5,
|
||||
TextEdit = 6,
|
||||
RichText = 7,
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class UITestCommand : LocalizedCommands
|
||||
{
|
||||
public override string Command => "uitest";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var window = new DefaultWindow { MinSize = (500, 400) };
|
||||
window.Contents.AddChild(new UITestControl());
|
||||
|
||||
window.OpenCentered();
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class UITest2Command : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IClyde _clyde = default!;
|
||||
[Dependency] private readonly IUserInterfaceManager _uiMgr = default!;
|
||||
|
||||
public override string Command => "uitest2";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length > 1)
|
||||
{
|
||||
shell.WriteError(Loc.GetString("cmd-uitest2-error-args"));
|
||||
return;
|
||||
}
|
||||
|
||||
var control = new UITestControl();
|
||||
|
||||
if (args.Length == 1)
|
||||
{
|
||||
if (!Enum.TryParse(args[0], out UITestControl.Tab tab))
|
||||
{
|
||||
shell.WriteError(Loc.GetString("cmd-uitest2-error-tab", ("value", args[0])));
|
||||
return;
|
||||
}
|
||||
|
||||
control.SelectTab(tab);
|
||||
}
|
||||
|
||||
var window = _clyde.CreateWindow(new WindowCreateParameters
|
||||
{
|
||||
Title = Loc.GetString("cmd-uitest2-title"),
|
||||
});
|
||||
|
||||
var root = _uiMgr.CreateWindowRoot(window);
|
||||
window.DisposeOnClose = true;
|
||||
|
||||
root.AddChild(control);
|
||||
}
|
||||
|
||||
public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
{
|
||||
if (args.Length == 1)
|
||||
{
|
||||
return CompletionResult.FromHintOptions(
|
||||
Enum.GetNames<UITestControl.Tab>(),
|
||||
Loc.GetString("cmd-uitest2-arg-tab"));
|
||||
}
|
||||
|
||||
return CompletionResult.Empty;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,19 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Robust.Client.Console.Commands
|
||||
{
|
||||
public sealed class VelocitiesCommand : IConsoleCommand
|
||||
public sealed class VelocitiesCommand : LocalizedCommands
|
||||
{
|
||||
public string Command => "showvelocities";
|
||||
public string Description => "Displays your angular and linear velocities";
|
||||
public string Help => $"{Command}";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
public override string Command => "showvelocities";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
EntitySystem.Get<VelocityDebugSystem>().Enabled ^= true;
|
||||
_entitySystems.GetEntitySystem<VelocityDebugSystem>().Enabled ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace Robust.Client.Console
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IReflectionManager _reflectionManager = default!;
|
||||
[Dependency] private readonly IDependencyCollection _dependency = default!;
|
||||
#pragma warning restore 649
|
||||
|
||||
private readonly StringBuilder _inputBuffer = new();
|
||||
@@ -44,11 +45,10 @@ namespace Robust.Client.Console
|
||||
{
|
||||
Title = "Robust C# Interactive (CLIENT)";
|
||||
ScriptInstanceShared.InitDummy();
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_globals = new ScriptGlobalsImpl(this);
|
||||
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
OutputPanel.AddText("Robust C# interactive console (CLIENT).");
|
||||
OutputPanel.AddText(">");
|
||||
}
|
||||
@@ -196,12 +196,10 @@ namespace Robust.Client.Console
|
||||
{
|
||||
private readonly ScriptConsoleClient _owner;
|
||||
|
||||
[field: Dependency] public override IViewVariablesManager vvm { get; } = default!;
|
||||
[field: Dependency] public override IClientViewVariablesManager vvm { get; } = default!;
|
||||
|
||||
public ScriptGlobalsImpl(ScriptConsoleClient owner)
|
||||
public ScriptGlobalsImpl(ScriptConsoleClient owner) : base(owner._dependency)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_owner = owner;
|
||||
}
|
||||
|
||||
@@ -243,9 +241,13 @@ namespace Robust.Client.Console
|
||||
[PublicAPI]
|
||||
public abstract class ScriptGlobals : ScriptGlobalsShared
|
||||
{
|
||||
public abstract IViewVariablesManager vvm { get; }
|
||||
public abstract IClientViewVariablesManager vvm { get; }
|
||||
|
||||
public abstract void vv(object a);
|
||||
|
||||
protected ScriptGlobals(IDependencyCollection dependencies) : base(dependencies)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace Robust.Client.Console
|
||||
public sealed class WatchWindow : DefaultWindow
|
||||
{
|
||||
private readonly IReflectionManager _reflectionManager;
|
||||
private readonly IDependencyCollection _dependency;
|
||||
|
||||
private readonly BoxContainer _watchesVBox;
|
||||
private readonly LineEdit _addWatchEdit;
|
||||
@@ -27,6 +28,7 @@ namespace Robust.Client.Console
|
||||
public WatchWindow()
|
||||
{
|
||||
_reflectionManager = IoCManager.Resolve<IReflectionManager>();
|
||||
_dependency = IoCManager.Resolve<IDependencyCollection>();
|
||||
|
||||
ScriptInstanceShared.InitDummy();
|
||||
|
||||
@@ -92,7 +94,7 @@ namespace Robust.Client.Console
|
||||
return;
|
||||
}
|
||||
|
||||
var control = new WatchControl(@delegate);
|
||||
var control = new WatchControl(@delegate, _dependency);
|
||||
|
||||
_watchesVBox.AddChild(control);
|
||||
_addWatchEdit.Clear();
|
||||
@@ -101,13 +103,14 @@ namespace Robust.Client.Console
|
||||
private sealed class WatchControl : Control
|
||||
{
|
||||
private readonly ScriptRunner<object> _runner;
|
||||
private readonly ScriptGlobalsImpl _globals = new();
|
||||
private readonly ScriptGlobalsImpl _globals;
|
||||
private readonly Label _outputLabel;
|
||||
|
||||
public WatchControl(ScriptRunner<object> runner)
|
||||
public WatchControl(ScriptRunner<object> runner, IDependencyCollection dependency)
|
||||
{
|
||||
Button delButton;
|
||||
_runner = runner;
|
||||
_globals = new ScriptGlobalsImpl(dependency);
|
||||
|
||||
AddChild(new BoxContainer
|
||||
{
|
||||
@@ -150,9 +153,8 @@ namespace Robust.Client.Console
|
||||
|
||||
private sealed class ScriptGlobalsImpl : ScriptGlobalsShared
|
||||
{
|
||||
public ScriptGlobalsImpl()
|
||||
public ScriptGlobalsImpl(IDependencyCollection dependency) : base(dependency)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
}
|
||||
|
||||
protected override void WriteSyntax(object toString)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user