Compare commits
9 commits
Author | SHA1 | Date | |
---|---|---|---|
1609636e90 | |||
07560e605a | |||
a7f7102266 | |||
c59fe85e67 | |||
7ef2b76a32 | |||
f97bc25688 | |||
1a41d4b07b | |||
27ca664829 | |||
e84cad1f79 |
29 changed files with 1198 additions and 613 deletions
|
@ -12,7 +12,6 @@ axum = "0.7.4"
|
|||
axum-server = "0.6.0"
|
||||
byteorder = "1.5.0"
|
||||
dirs = "5.0.1"
|
||||
dotenv = "0.15.0"
|
||||
encoding = "0.2.33"
|
||||
env_logger = "0.11.3"
|
||||
heck = "0.5.0"
|
||||
|
@ -21,6 +20,7 @@ leb128 = "0.2.5"
|
|||
paste = "1.0.14"
|
||||
sysinfo = "0.30.7"
|
||||
rand = "0.8.5"
|
||||
parking_lot = "0.12.3"
|
||||
|
||||
csv = "1.3.0"
|
||||
serde = { version = "1.0.197", features = ["derive"] }
|
||||
|
|
443
assets/TemplateCollections/NPCTransformTemplateCollection.tsv
Normal file
443
assets/TemplateCollections/NPCTransformTemplateCollection.tsv
Normal file
|
@ -0,0 +1,443 @@
|
|||
ID PositionX PositionY PositionZ RotationX RotationY RotationZ Section
|
||||
Street_Teleport_ToGrocery -16.73 0.3 -5.624 0.0 180.0 0.0 1
|
||||
Street_Teleport_ToRamenStore 5.41 0.32 -1.36 0.0 0.0 0.0 1
|
||||
Street_Teleport_ToAudioVideoStore 18.23 0.36 -9.16 0.0 180.0 0.0 1
|
||||
Street_PlayerPos_Default 29.125 0.0 -4.375 0.0 270.0 0.0 1
|
||||
Street_PlayerPos_FromWorkshop 17.541 0.34003 5.481 0.0 193.27106 0.0 1
|
||||
Street_PlayerPos_FromGarage 12.89 0.34 10.71725 0.0 179.08109 0.0 1
|
||||
Street_PlayerPos_FromGrocery -17.177 0.0 0.0 0.0 0.0 0.0 1
|
||||
Street_NPCPos_ToWorkshop 18.243 0.557 8.079 0.0 209.99998 0.0 1
|
||||
Street_NPCPos_Smithy 18.208 0.95 -12.138 0.0 180.0 0.0 1
|
||||
Street_NPCPos_ToGarage 12.83 0.39287 14.673 0.0 180.0 0.0 1
|
||||
Street_NPCPos_Test 0.75 0.31757 -4.5 0.0 90.0 0.0 1
|
||||
Street_NPCPos_Quest 7.875 0.5 -2.125 0.0 185.0 0.0 1
|
||||
Street_NPCPos_RamenStore 5.678 0.9 1.753 0.0 185.0 0.0 1
|
||||
Street_NPCPos_TestS 6.761 0.3 -2.028 0.0 185.0 0.0 1
|
||||
Street_NPCPos_TestL 9.04 0.5 -2.227 0.0 185.0 0.0 1
|
||||
Street_NPCPos_Billy_Quest10020005 37.245 0.35 -1.786 0.0 0.0 0.0 1
|
||||
Street_NPCPos_Anbi_Quest10020005 -22.37 0.36 -7.05 0.0 180.0 0.0 1
|
||||
Street_NPCPos_Car_Quest10020005 37.43 0.75 3.26 0.0 270.0 0.0 1
|
||||
Street_NPCPos_Temp_Quest10020005 20.275 0.35 -10.2 0.0 326.98425 0.0 1
|
||||
Street_NPCPos_Billy_Quest10020006 -28.05087 0.5 -4.7 0.0 52.99999 0.0 1
|
||||
Street_NPCPos_Anbi_Quest10020006 -26.5 0.5 -5.98 0.0 0.0 0.0 1
|
||||
Street_NPCPos_Nocha_Quest10020008 -1.042 0.393 -3.014 0.0 90.0 0.0 1
|
||||
Street_NPCPos_Temp_Quest10020015 19.36 0.393 1.37 0.0 29.52794 0.0 1
|
||||
Street_NPCPos_Bangboo_Quest10020018 11.3 0.393 -0.25 0.0 180.0 0.0 1
|
||||
Street_NPCPos_Temp_Quest10020020 -9.17 0.393 -10.86 0.0 0.0 0.0 1
|
||||
Street_NPCPos_Temp_Quest10020021 6.67203 0.393 -8.174 0.0 84.99999 0.0 1
|
||||
Street_NPCPos_BangbooA_Quest10020006 -16.869 0.729 -8.124 0.0 0.0 0.0 1
|
||||
Street_NPCPos_BangbooB_Quest10020006 -17.556 0.729 -8.124 0.0 0.0 0.0 1
|
||||
Street_NPCPos_BangbooC_Quest10020006 -16.186 0.729 -8.097 0.0 0.0 0.0 1
|
||||
Street_CameraPos_Grocery -16.866 0.98 -1.508 0.0 180.0 0.0 1
|
||||
Street_CameraPos_RamenStore 2.48 2.45 -2.52 10.60003 45.5 0.0 1
|
||||
Street_CameraPos_RamenStore_PC 2.67 2.4 -2.29 10.8 44.0 0.0 1
|
||||
Street_CameraPos_Workshop 18.71 0.91 -9.14 10.60001 180.0 0.0 1
|
||||
TriggerPos_1 35.5 0.31757 -4.5 0.0 270.0 0.0 1
|
||||
Street_NPCPos_Grocery -18.928 0.95 -9.358 0.0 324.60001 0.0 1
|
||||
Street_NPCPos_TestBear 10.929 0.5 -2.392 0.0 185.0 0.0 1
|
||||
Street_PlayerPos_FromGarage2 4.15 0.0 19.17 0.0 270.0 0.0 1
|
||||
Street_NPCPos_ToGarage2 8.618 0.39287 19.235 0.0 270.0 0.0 1
|
||||
Street_Passerby_A1 6.168 0.35 0.017 0.0 0.0 0.0 1
|
||||
Street_Passerby_A2 7.0 0.48 -0.027 0.0 0.0 0.0 1
|
||||
Street_Passerby_B1 14.832 0.35 1.667 0.0 169.99998 0.0 1
|
||||
Street_Passerby_B2 15.41 0.35 1.09 0.0 240.0 0.0 1
|
||||
Street_Passerby_C1 -27.068 0.35 5.609 0.0 230.92207 0.0 1
|
||||
Street_Passerby_C2 -26.701 0.35 6.222 0.0 298.08884 0.0 1
|
||||
Street_Passerby_D1 -12.857 0.35 -11.668 0.0 32.81414 0.0 1
|
||||
Street_Passerby_D2 -12.635 0.35 -10.965 0.0 189.98178 0.0 1
|
||||
Street_ObjectPos_08 -14.573 -0.013 -12.512 0.0 0.0 0.0 1
|
||||
Street_ObjectPos_10 -14.303 1.375 -11.119 0.0 0.0 0.0 1
|
||||
Street_ObjectPos_09 -13.948 0.092 -18.786 0.0 0.0 0.0 1
|
||||
Street_Passerby_09 -5.95 0.35 11.106 0.0 32.66373 0.0 1
|
||||
Street_Passerby_10 -5.734 0.35 12.094 0.0 176.94084 0.0 1
|
||||
Street_Passerby_11 2.162 0.4 -9.208 0.0 86.23466 0.0 1
|
||||
Street_Passerby_12 2.898 0.4 -9.705 0.0 344.81543 0.0 1
|
||||
Street_Passerby_13 16.917 0.35 -10.73 0.0 196.76297 0.0 1
|
||||
Street_Passerby_14 16.337 0.35 -10.233 0.0 150.0 0.0 1
|
||||
Street_Passerby_15 21.459 0.36 -8.39 0.0 231.98558 0.0 1
|
||||
Street_Passerby_16 20.742 0.35 -8.932 0.0 48.55833 0.0 1
|
||||
Street_Passerby_17 15.15 0.35 7.51 0.0 212.18704 0.0 1
|
||||
Street_Passerby_18 14.808 0.35 6.799 0.0 29.95915 0.0 1
|
||||
Street_Passerby_19 -9.383 0.35 -0.624 0.0 261.22681 0.0 1
|
||||
Street_Passerby_20 -10.141 0.35 -1.371 0.0 64.0559 0.0 1
|
||||
Street_Passerby_21 -17.508 0.35 -0.558 0.0 339.64786 0.0 1
|
||||
Street_Passerby_22 -17.19 0.35 0.057 0.0 286.36243 0.0 1
|
||||
Street_Passerby_23 -11.63 0.35 -18.32 0.0 291.77817 0.0 1
|
||||
Street_Passerby_24 -12.63 0.35 -18.43 0.0 27.8 0.0 1
|
||||
Street_Passerby_25 -11.539 0.35 -17.535 0.0 234.79996 0.0 1
|
||||
Street_Passerby_26 -13.04 0.35 -18.03 0.0 66.79999 0.0 1
|
||||
Street_Passerby_27 -26.85 0.569 12.797 0.0 20.89114 0.0 1
|
||||
Street_Passerby_28 -27.431 0.38 13.319 0.0 223.54056 0.0 1
|
||||
Street_Passerby_29 22.296 0.35 -8.766 0.0 151.64432 0.0 1
|
||||
Street_Passerby_30 22.839 0.528 -9.841 0.0 332.39041 0.0 1
|
||||
Street_Passerby_31 -34.693 0.373 12.751 0.0 324.8782 0.0 1
|
||||
Street_Passerby_32 -35.538 0.3793 13.14 0.0 116.70426 0.0 1
|
||||
Street_NPCPos_Quest10020151 -4.574 0.3346 1.6568 0.0 10.32042 0.0 1
|
||||
Street_NPCPos_Quest10020152 14.23 0.35 -9.95 0.0 0.0 0.0 1
|
||||
Street_NPCPos_Quest10020153 11.12 0.4 -8.17 0.0 0.0 0.0 1
|
||||
Street_NPCPos_Quest10020154 24.721 0.348 4.248 0.0 289.53577 0.0 1
|
||||
Street_NPCPos_Quest10020155 -1.79 0.395 -21.504 0.0 321.61935 0.0 1
|
||||
Street_NPCPos_Quest10020156 27.16 0.35 -1.49 0.0 190.0 0.0 1
|
||||
Street_NPCPos_Quest10020157 3.28 0.35 1.465 0.0 90.0 0.0 1
|
||||
Street_NPCPos_Quest10020158 1.35 0.4 -1.38 0.0 180.0 0.0 1
|
||||
Street_Passerby_33 -26.297 0.35 -8.271 0.0 123.11625 0.0 1
|
||||
Street_Passerby_34 -25.442 0.35 -8.919 0.0 318.86185 0.0 1
|
||||
Street_Passerby_35 10.662 0.37 1.331 0.0 233.42654 0.0 1
|
||||
Street_Passerby_36 10.038 0.36 1.146 0.0 193.91667 0.0 1
|
||||
Street_Passerby_37 1.222 0.35 17.124 0.0 73.19746 0.0 1
|
||||
Street_Passerby_38 2.177 0.35 17.239 0.0 295.93552 0.0 1
|
||||
Street_Passerby_39 -7.65 0.35 -11.34 0.0 317.07599 0.0 1
|
||||
Street_Passerby_40 -8.56 0.35 -10.89 0.0 62.40825 0.0 1
|
||||
Street_Passerby_41 -21.485 0.35 -7.556 0.0 231.75189 0.0 1
|
||||
Street_Passerby_42 -22.217 0.36 -7.046 0.0 135.27699 0.0 1
|
||||
Street_Passerby_43 -26.552 0.355 0.922 0.0 329.71353 0.0 1
|
||||
Street_Passerby_44 -26.563 0.36 1.809 0.0 203.36967 0.0 1
|
||||
Street_Passerby_45 -29.2 0.39 -5.888 0.0 61.42846 0.0 1
|
||||
Street_Passerby_46 -14.932 0.35 -29.664 0.0 79.99999 0.0 1
|
||||
Street_Passerby_47 11.51 0.35 -13.93 0.0 209.63834 0.0 1
|
||||
Street_Passerby_48 -22.751 0.36 -7.545 0.0 109.76276 0.0 1
|
||||
Street_Passerby_49 2.386 0.4 -9.954 0.0 19.77401 0.0 1
|
||||
Street_Passerby_50 3.13 0.4 -9.31 0.0 245.81375 0.0 1
|
||||
Street_Passerby_51 -2.53 0.35 -29.03 0.0 20.00001 0.0 1
|
||||
Street_ObjectPos_11 -6.0202 1.62 -36.027 0.0 0.0 0.0 1
|
||||
Street_Passerby_52 -1.89 0.35 -29.04 0.0 330.0 0.0 1
|
||||
Street_Passerby_53 -5.976 0.35 -1.683 0.0 295.77307 0.0 1
|
||||
Street_Passerby_54 -6.768 0.35 -1.331 0.0 119.76264 0.0 1
|
||||
Street_Passerby_55 2.566 0.35 -1.384 0.0 65.57031 0.0 1
|
||||
Street_Passerby_56 3.203 0.35 -1.407 0.0 340.54376 0.0 1
|
||||
Street_Passerby_57 -19.31 0.35 -7.24 0.0 50.0 0.0 1
|
||||
Street_Passerby_58 -18.45 0.35 -6.99 0.0 270.0 0.0 1
|
||||
Street_Passerby_59 -2.315 0.35 -25.478 0.0 240.0 0.0 1
|
||||
Street_Passerby_60 -2.538 0.35 -26.063 0.0 20.00001 0.0 1
|
||||
Street_Passerby_61 -4.613 0.3373 0.009 0.0 171.87192 0.0 1
|
||||
Street_Passerby_62 -4.637 0.357 1.647 0.0 184.25121 0.0 1
|
||||
Street_Passerby_63 16.305 0.35 -10.866 0.0 69.14664 0.0 1
|
||||
Street_Passerby_64 17.0 0.35 -10.3 0.0 212.32573 0.0 1
|
||||
Street_Passerby_65 9.307 0.38 -28.054 0.0 205.75116 0.0 1
|
||||
Street_Passerby_66 9.613 0.38 -29.102 0.0 332.5571 0.0 1
|
||||
Street_Passerby_67 -7.099 0.4991 11.649 0.0 63.06116 0.0 1
|
||||
Street_Passerby_68 -6.042 0.35 12.561 0.0 227.34982 0.0 1
|
||||
Street_Passerby_69 22.433 0.35 6.054 0.0 317.61322 0.0 1
|
||||
Street_Passerby_70 -19.002 0.35 -1.416 0.0 154.39163 0.0 1
|
||||
Street_Passerby_71 -25.812 0.71 15.861 0.0 317.13211 0.0 1
|
||||
Street_ObjectPos_06 -26.43 1.8 16.614 0.0 0.0 0.0 1
|
||||
Street_ObjectPos_07 -24.915 0.996 12.736 0.0 0.0 0.0 1
|
||||
Street_Passerby_72 32.834 0.35 -7.017 0.0 325.03073 0.0 1
|
||||
Street_Passerby_73 -7.586 0.4 -0.346 0.0 136.72357 0.0 1
|
||||
Street_Passerby_74 -26.168 0.5651 12.814 0.0 205.99687 0.0 1
|
||||
Street_ObjectPos_05 -26.783 1.263 10.008 0.0 110.0 0.0 1
|
||||
Street_Passerby_75 -26.378 0.35 6.141 0.0 288.5228 0.0 1
|
||||
Street_Passerby_76 -6.893 0.64 15.257 0.0 50.22827 0.0 1
|
||||
Street_Passerby_77 -11.306 0.35 -9.496 0.0 119.16231 0.0 1
|
||||
Street_Passerby_78 -32.834 0.35 -2.719 0.0 50.0 0.0 1
|
||||
Street_ObjectPos_02 -35.7 1.556 -6.62 0.0 0.0 0.0 1
|
||||
Street_Passerby_79 -35.854 0.38 4.449 0.0 330.0 0.0 1
|
||||
Street_Passerby_80 -0.168 0.388 21.145 0.0 247.54602 0.0 1
|
||||
Street_ObjectPos_13 1.141 0.836 15.84 0.0 0.0 0.0 1
|
||||
Street_Passerby_81 9.372 0.36 -8.746 0.0 319.89386 0.0 1
|
||||
Street_NPCPos_Quest10020118 0.46 0.4 16.07 0.0 132.127 0.0 1
|
||||
Street_NPCPos_Joe 14.487 0.344 7.658 0.0 117.47181 0.0 1
|
||||
Street_Passerby_82 1.345 0.35 -29.269 0.0 318.21954 0.0 1
|
||||
Street_Passerby_83 -29.28 0.36 -6.019 0.0 92.8725 0.0 1
|
||||
Street_Passerby_84 -20.485 0.35 -8.332 0.0 218.35194 0.0 1
|
||||
Street_Passerby_85 11.059 0.35 5.281 0.0 120.00001 0.0 1
|
||||
Street_Passerby_86 12.09 0.36 -5.24 0.0 320.0 0.0 1
|
||||
Street_Passerby_87 12.09 0.36 -5.24 0.0 320.0 0.0 1
|
||||
Street_Passerby_88 12.09 0.36 -5.24 0.0 320.0 0.0 1
|
||||
Street_Passerby_89 12.743 0.35 -10.13 0.0 52.06183 0.0 1
|
||||
Street_Passerby_90 -26.65 0.36 6.866 0.0 260.0 0.0 1
|
||||
Street_Passerby_91 -13.317 0.35 -1.324 0.0 154.53731 0.0 1
|
||||
Street_Passerby_92 7.02 0.33 0.0589 0.0 0.0 0.0 1
|
||||
Street_Passerby_93 12.09 0.36 -5.24 0.0 320.0 0.0 1
|
||||
Street_Passerby_94 24.156 0.36 -0.589 0.0 258.23029 0.0 1
|
||||
Street_Passerby_95 -8.074 0.35 -11.114 0.0 321.74228 0.0 1
|
||||
Street_Passerby_96 32.996 0.35 -7.036 0.0 298.86584 0.0 1
|
||||
Street_Passerby_97 -2.633 0.35 -25.815 0.0 294.18304 0.0 1
|
||||
Street_Passerby_98 -14.06 0.36 -7.276 0.0 289.05328 0.0 1
|
||||
Street_Passerby_99 -26.389 0.356 7.356 0.0 257.54462 0.0 1
|
||||
Street_Passerby_100 28.999 0.36 -7.249 0.0 36.28022 0.0 1
|
||||
Street_Passerby_101 4.87 0.36 -29.65 0.0 180.0 0.0 1
|
||||
Street_Passerby_102 -26.387 0.35 7.338 0.0 249.63678 0.0 1
|
||||
Street_Passerby_103 12.09 0.31 -5.24 0.0 320.0 0.0 1
|
||||
Street_Passerby_104 14.6 0.36 8.1 0.0 210.0 0.0 1
|
||||
Street_Passerby_105 2.127 0.4 -9.184 0.0 33.36407 0.0 1
|
||||
Street_Passerby_106 12.09 0.36 -5.24 0.0 320.0 0.0 1
|
||||
Street_Passerby_107 3.32 0.48 1.472 0.0 90.0 0.0 1
|
||||
Street_Passerby_108 12.09 0.36 -5.24 0.0 320.0 0.0 1
|
||||
Street_Passerby_109 -26.7 0.36 7.295 0.0 260.0 0.0 1
|
||||
Street_Passerby_110 12.09 0.36 -5.24 0.0 320.0 0.0 1
|
||||
Street_Passerby_111 -14.558 0.35 -8.069 0.0 288.58353 0.0 1
|
||||
Street_Passerby_112 -4.577 0.353 1.663 0.0 194.16655 0.0 1
|
||||
Street_Passerby_113 11.049 0.35 5.16 0.0 115.38074 0.0 1
|
||||
Street_Passerby_114 12.09 0.36 -5.24 0.0 320.0 0.0 1
|
||||
Street_NPCPos_Xiute 15.328 0.347 7.214 0.0 298.45078 0.0 1
|
||||
Street_NPCPos_No11_01 5.784 0.35 -35.839 0.0 240.0 0.0 1
|
||||
Street_NPCPos_Keli_01 5.12 0.36 -36.21 0.0 50.0 0.0 1
|
||||
Street_NPCPos_No11_01End 6.64 0.35 -35.06 0.0 10.0 0.0 1
|
||||
Street_Passerby_501 -26.61 0.69 16.044 0.0 28.75916 0.0 1
|
||||
Street_Passerby_502 -22.804 0.36 -7.391 0.0 60.44901 0.0 1
|
||||
Street_Passerby_503 -22.058 0.36 -7.339 0.0 324.42499 0.0 1
|
||||
Street_Passerby_115 3.28 0.4537 1.464 0.0 90.0 0.0 1
|
||||
Street_Passerby_116 8.16 0.48 2.362 0.0 270.0 0.0 1
|
||||
Street_Passerby_117 -4.593 0.351 0.1033 0.0 343.36163 0.0 1
|
||||
Street_Passerby_118 -4.43 0.49 1.48 0.0 180.0 0.0 1
|
||||
Street_Passerby_119 -25.591 0.35 -6.895 0.0 315.20914 0.0 1
|
||||
Street_Passerby_120 -4.667 0.337 1.677 0.0 345.07632 0.0 1
|
||||
Street_NPCPos_Bangboo_Quest10020188 2.652 0.344 -0.622 0.0 74.99999 0.0 1
|
||||
Street_NPCPos_Bangboo_Quest10020196 -3.648 0.353 -17.817 0.0 220.05724 0.0 1
|
||||
Street_NPCPos_Bangboo_Quest10020140 21.47 0.344 5.908 0.0 0.0 0.0 1
|
||||
Street_Passerby_121 -35.256 0.41 13.372 0.0 150.83507 0.0 1
|
||||
Street_Passerby_122 -34.693 0.373 12.751 0.0 324.8782 0.0 1
|
||||
Street_NPCPos_No11_02 -1.8 0.345 -29.986 0.0 310.0 0.0 1
|
||||
Street_NPCPos_Keli_02 -2.26 0.36 -29.6 0.0 150.0 0.0 1
|
||||
Street_NPCPos_Keli_02End 0.11 0.315 -29.62 0.0 79.99999 0.0 1
|
||||
Street_NPCPos_Quest10020155_02 -1.763 0.8425 -21.017 0.0 237.17775 0.0 1
|
||||
Street_NPCPos_No11_03End 14.81 0.349 0.54 0.0 120.00001 0.0 1
|
||||
Street_NPCPos_Keli_03End 15.38 0.359 -0.28 0.0 20.00001 0.0 1
|
||||
Street_NPCPos_Woof 11.26 1.15 -10.188 0.0 0.0 0.0 1
|
||||
Street_ObjectPos_Newsstand 11.08 1.15 -9.372 0.0 0.0 0.0 1
|
||||
Street_Passerby_123 4.504 0.329 -0.0001 0.0 0.0 0.0 1
|
||||
Street_Passerby_124 8.166 0.329 1.463 0.0 270.0 0.0 1
|
||||
Street_Passerby_125 5.36 0.35 -0.01 0.0 0.0 0.0 1
|
||||
Street_Passerby_126 3.358 0.333 1.456 0.0 90.0 0.0 1
|
||||
Street_Passerby_127 8.212 0.452 1.48 0.0 270.0 0.0 1
|
||||
Street_NPCPos_Schroeder 1.752 0.342 -1.479 0.0 55.99999 0.0 1
|
||||
Street_Passerby_128 5.38 0.334 0.064 0.0 0.0 0.0 1
|
||||
Street_Passerby_129 3.287 0.35 1.452 0.0 90.0 0.0 1
|
||||
Street_Passerby_130 -22.633 0.35 -7.275 0.0 53.62085 0.0 1
|
||||
Street_Passerby_131 8.232 0.35 2.374 0.0 270.0 0.0 1
|
||||
Street_Passerby_132 10.17 0.35 2.07 0.0 163.21513 0.0 1
|
||||
Street_Passerby_139 -26.414 0.71 15.934 0.0 336.39316 0.0 1
|
||||
Street_Passerby_140 -27.703 0.593 15.938 0.0 55.93431 0.0 1
|
||||
Street_Passerby_141 10.968 0.4 6.067 0.0 120.00001 0.0 1
|
||||
Street_Passerby_142 11.058 0.35 4.379 0.0 117.98868 0.0 1
|
||||
Street_Passerby_143 10.678 0.36 -13.711 0.0 216.67374 0.0 1
|
||||
Street_Passerby_144 -13.401 0.35 -12.446 0.0 333.78751 0.0 1
|
||||
Street_Passerby_145 40.108 0.353 -0.147 0.0 154.59579 0.0 1
|
||||
Street_ObjectPos_12 43.325 -0.015 -4.342 0.0 90.0 0.0 1
|
||||
Street_Passerby_146 40.73 0.3506 -0.68 0.0 314.69949 0.0 1
|
||||
Street_Passerby_147 2.594 0.35 -7.269 0.0 88.00859 0.0 1
|
||||
Street_Passerby_148 3.52 0.4 -7.453 0.0 303.92548 0.0 1
|
||||
Street_Passerby_149 4.667 0.4 -10.8 0.0 221.15468 0.0 1
|
||||
Street_ObjectPos_04 0.763 1.038 -9.181 0.0 0.0 0.0 1
|
||||
Street_Passerby_150 12.273 0.359 -8.928 0.0 238.31017 0.0 1
|
||||
Street_NPCPos_Woof2 11.26 1.15 -10.188 0.0 0.0 0.0 1
|
||||
Street_NPCPos_Woof3 11.26 1.15 -10.188 0.0 0.0 0.0 1
|
||||
Street_Passerby_507 -26.592 0.36 -9.141 0.0 331.79459 0.0 1
|
||||
Street_Passerby_508 -27.964 0.35 9.704 0.0 276.12378 0.0 1
|
||||
Street_Passerby_509 5.012 0.35 -7.226 0.0 36.47496 0.0 1
|
||||
Street_Passerby_510 -7.145 0.363 4.026 0.0 270.0 0.0 1
|
||||
Street_Passerby_511 4.493 0.36 -35.899 0.0 20.00001 0.0 1
|
||||
Street_Passerby_512 -4.592 0.355 0.073 0.0 343.46274 0.0 1
|
||||
Street_Passerby_513 2.122 0.4 -10.398 0.0 32.57107 0.0 1
|
||||
Street_Passerby_514 2.891 0.4 -10.705 0.0 0.0 0.0 1
|
||||
Street_Passerby_515 14.095 0.36 -14.156 0.0 22.06978 0.0 1
|
||||
Street_Passerby_516 15.321 0.35 7.58 0.0 123.66821 0.0 1
|
||||
Street_Passerby_517 -4.305 0.4 -7.595 0.0 125.55424 0.0 1
|
||||
Street_Passerby_518 -1.701 0.4 -23.751 0.0 310.0 0.0 1
|
||||
Street_Passerby_519 -19.162 0.36 -8.18 0.0 37.20817 0.0 1
|
||||
Street_ObjectPos_03 -21.194 0.171 -9.311 0.0 0.0 0.0 1
|
||||
Street_Passerby_520 -3.812 0.347 -17.462 0.0 247.24823 0.0 1
|
||||
Street_NPCPos_Susie -25.671 0.6214 14.104 0.0 268.89499 0.0 1
|
||||
Street_NPCPos_TinMaster01 -10.191 0.36 -1.46 0.0 345.65805 0.0 1
|
||||
Street_NPCPos_TinMaster02 -6.288 0.3505 -7.195 0.0 321.44672 0.0 1
|
||||
Street_NPCPos_Gate 7.03 0.35 0.017 0.0 0.0 0.0 1
|
||||
Street_NPCPos_Ben 2.233 0.36 2.478 0.0 133.82996 0.0 1
|
||||
Street_PlayerPos_FromRamen 6.074 0.0 -0.758 0.0 0.0 0.0 1
|
||||
Street_NPCPos_Anton -34.865 0.396 13.443 0.0 142.69867 0.0 1
|
||||
Street_NPCPos_OokumaMari 11.921 0.347 -8.374 0.0 219.14148 0.0 1
|
||||
Street_Passerby_151 -4.573 0.34 0.044 0.0 168.11601 1.0 1
|
||||
Street_Passerby_152 9.423 0.352 -32.084 0.0 339.92599 0.0 1
|
||||
Street_Passerby_153 -26.66462 0.3402 7.56905 359.60715 269.99854 0.65592 1
|
||||
Street_NPCPos_Anbi02 -22.5 0.36 0.573 0.0 163.69124 0.0 1
|
||||
Street_NPCPos_Enzo 27.243 0.35 -1.528 0.0 229.92622 0.0 1
|
||||
Street_NPCPos_OokumaMari02 3.281 0.3965 -10.212 0.0 31.35417 0.0 1
|
||||
Street_NPCPos_Billy02 -13.986 0.36 -7.091 0.0 113.60025 0.0 1
|
||||
Street_NPCPos_Tsubaki 10.39 0.35 -8.91 0.0 137.00946 0.0 1
|
||||
Street_NPCPos_Anton02 26.712 0.35 -6.986 0.0 305.87402 0.0 1
|
||||
Street_NPCPos_Nocha02 9.577 0.348 -7.368 0.0 151.92999 0.0 1
|
||||
Street_NPCPos_Tsubaki02 -18.173 0.35 -6.936 0.0 133.66385 0.0 1
|
||||
Street_NPCPos_OokumaMari04 -25.138 0.7161 16.08 0.0 326.39648 0.0 1
|
||||
Street_NPCPos_Ben02 20.665 0.35 -10.565 0.0 251.54306 0.0 1
|
||||
Street_NPCPos_OokumaMari03 -22.553 0.36 -0.064 0.0 159.34224 0.0 1
|
||||
Street_NPCPos_Ben03 -21.869 0.35 0.596 0.0 192.34038 0.0 1
|
||||
Street_NPCPos_Billy03 22.297 0.36 5.854 0.0 340.17264 0.0 1
|
||||
Street_NPCPos_Nocha03 6.929 0.395 -1.278 0.0 342.26456 0.0 1
|
||||
Street_NPCPos_Tsubaki03 7.076 0.35 -0.706 0.0 312.97723 0.0 1
|
||||
Street_NPCPos_Anbi03 10.312 0.35 2.109 0.0 240.46249 0.0 1
|
||||
Street_NPCPos_Ben04 -32.609 0.342 -8.256 0.0 67.92832 0.0 1
|
||||
Street_NPCPos_OokumaMari05 -1.27 0.3492 -29.178 0.0 305.29065 0.0 1
|
||||
Street_NPCPos_Anton03 -2.058 0.35 -28.686 0.0 125.14816 0.0 1
|
||||
Street_NPCPos_Nocha04 -22.595 0.395 -7.348 0.0 125.5207 0.0 1
|
||||
Street_NPCPos_Billy04 -3.506 0.36 -17.778 0.0 251.33165 0.0 1
|
||||
Street_NPCPos_Anbi04 -4.261 0.35 -17.505 0.0 264.7402 0.0 1
|
||||
Street_NPCPos_Schroeder02 -5.053 0.342 4.863 0.0 70.83122 0.0 1
|
||||
Street_NPCPos_Schroeder03 3.253 0.323 1.458 0.0 92.53754 0.0 1
|
||||
Street_Passerby_521 -32.515 2.3 30.558 0.0 75.47579 0.0 1
|
||||
Street_Passerby_522 -29.71 2.3 29.43 0.0 209.83707 0.0 1
|
||||
Street_Passerby_523 -30.529 2.3 28.95 0.0 55.32315 0.0 1
|
||||
Street_Passerby_524 -26.636 0.368 7.484 0.0 250.28363 0.0 1
|
||||
Street_Passerby_525 21.991 0.35 -1.218 0.0 245.47432 0.0 1
|
||||
Street_Passerby_526 -27.72 0.35 12.558 0.0 70.0 0.0 1
|
||||
Street_Passerby_527 -2.147 0.35 -23.641 0.0 290.0 0.0 1
|
||||
Street_Passerby_528 -3.553 0.395 -18.033 0.0 155.24419 0.0 1
|
||||
Street_Passerby_529 -2.866 0.395 -19.195 0.0 327.30453 0.0 1
|
||||
Street_Passerby_530 2.248 0.35 17.375 0.0 240.0 0.0 1
|
||||
Street_Passerby_531 -30.195 2.3 29.303 0.0 316.19141 0.0 1
|
||||
Street_Passerby_532 -15.625 0.35 -6.819 0.0 195.36263 0.0 1
|
||||
Street_Passerby_533 -2.562 0.35 -23.881 0.0 312.95004 0.0 1
|
||||
Street_Passerby_534 -12.646 0.35 -18.012 0.0 255.57466 0.0 1
|
||||
Street_Passerby_535 -13.387 0.35 -16.812 0.0 152.59938 0.0 1
|
||||
Street_NPCPos_Shepherd02 -4.574 0.3346 1.6568 0.0 10.32042 0.0 1
|
||||
Street_NPCPos_No11_04 10.123 0.356 1.745 0.0 142.0 0.0 1
|
||||
Street_NPCPos_PAFUMEI 15.973 0.35 7.416 0.0 334.46896 0.0 1
|
||||
Street_NPCPos_MEIKE 15.483 0.35 7.766 0.0 120.00001 0.0 1
|
||||
Street_Passerby_536 3.952 0.4 -11.297 0.0 48.38462 0.0 1
|
||||
Garage_PlayerPos_Default 19.05 0.42063 21.43 0.0 0.0 0.0 3
|
||||
Garage_PlayerPos_FromWorkshop 19.05 0.42063 22.744 0.0 0.0 0.0 3
|
||||
Garage_PlayerPos_FromStreet 12.79 0.42063 18.82 0.0 0.0 0.0 3
|
||||
Garage_PlayerPos_Quest10020003 20.701 0.42063 29.794 0.0 220.0 0.0 3
|
||||
Garage_NPCPos_ToWorkshop 19.13 0.25 19.663 0.0 0.0 0.0 3
|
||||
Garage_NPCPos_ToStreet 12.836 0.476 15.002 0.0 0.0 0.0 3
|
||||
Garage_NPCPos_Nocha_Quest10020003 17.614 0.35 30.44 0.0 136.39999 0.0 3
|
||||
Garage_NPCPos_Billy_Quest10020003 15.226 0.32 27.58 0.0 82.8 0.0 3
|
||||
Garage_NPCPos_Anbi_Quest10020003 15.319 0.32 28.817 0.0 94.7 0.0 3
|
||||
Garage_NPCPos_Nocha_Quest10020012 17.39999 0.34 27.69 0.0 158.30615 0.0 3
|
||||
Garage_NPCPos_Billy_Quest10020012 18.56 0.31 32.58 0.0 250.0 0.0 3
|
||||
Garage_NPCPos_Anbi_Quest10020012 18.58 0.31 31.46 0.0 320.0 0.0 3
|
||||
ItemPos_1 17.0 0.42063 24.5 0.0 0.0 0.0 3
|
||||
ItemPos_2 18.0 0.42063 24.5 0.0 0.0 0.0 3
|
||||
ItemPos_3 19.0 0.42063 24.5 0.0 0.0 0.0 3
|
||||
ItemPos_4 20.0 0.42063 24.5 0.0 0.0 0.0 3
|
||||
ItemPos_5 21.0 0.42063 24.5 0.0 0.0 0.0 3
|
||||
Garage_PlayerPos_FromStreet2 11.254 0.42063 19.31 0.0 90.0 0.0 3
|
||||
Garage_NPCPos_ToStreet2 8.785 0.42063 19.238 0.0 270.0 0.0 3
|
||||
Garage_PlayerPos_Quest10020010 19.81 0.42063 27.32 0.0 0.0 0.0 3
|
||||
Garage_Object_Car_01 16.19 0.29 31.46 0.0 135.89999 0.0 3
|
||||
Garage_ObjectPos_14 23.874 0.86 31.988 0.0 0.0 0.0 3
|
||||
Garage_ObjectPos_15 22.254 0.82 22.982 0.0 0.0 0.0 3
|
||||
Garage_ObjectPos_16 31.804 0.42063 28.509 0.0 0.0 0.0 3
|
||||
Garage_ObjectPos_17 29.128 0.25 22.05 0.0 0.0 0.0 3
|
||||
Garage_ObjectPos_18 29.941 0.0 32.857 0.0 0.0 0.0 3
|
||||
Garage_NPCPos_Quest10020024 18.54 0.34 27.46 0.0 210.79999 0.0 3
|
||||
Garage_PlayerPos_Quest10020120 17.75 0.42063 26.39 0.0 30.00001 0.0 3
|
||||
Garage_NPCPos_No11 13.818 0.301 26.28 0.0 70.26791 0.0 3
|
||||
Garage_NPCPos_No11_02 29.598 0.345 23.527 0.0 308.61368 0.0 3
|
||||
Garage_NPCPos_No11_03 15.599 0.345 20.68 0.0 335.6268 0.0 3
|
||||
Garage_NPCPos_No11_04 13.97 0.3 25.64 0.74837 128.50786 359.98956 3
|
||||
Garage_NPCPos_Quest10020120 21.467 0.3 30.233 0.0 206.48201 0.0 3
|
||||
Garage_PlayerPos_Chat01 20.545 0.42063 29.194 0.0 43.57 0.0 3
|
||||
Workshop_PlayerPos_Default 23.75 0.58003 12.5 0.0 202.0 0.0 2
|
||||
Workshop_PlayerPos_FromStreet 22.598 0.58003 7.611 0.0 30.00001 0.0 2
|
||||
Workshop_PlayerPos_FromGarage 22.112 0.58002 14.386 0.0 180.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020003 23.375 0.58002 11.406 0.0 0.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020013 29.982 0.58002 15.418 0.0 120.00001 0.0 2
|
||||
Workshop_PlayerPos_Quest10020011 29.867 0.58002 11.406 0.0 30.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020012 29.587 0.58002 11.979 0.0 92.99999 0.0 2
|
||||
Workshop_PlayerPos_Quest10020001 30.31 0.58002 11.18 0.0 40.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020028 30.38 0.58002 12.826 0.0 80.0 0.0 2
|
||||
Workshop_PlayerPos_Pos1 29.44 0.605 15.48 0.0 0.0 0.0 2
|
||||
Workshop_PlayerPos_Pos2 30.729 0.584 15.3 0.0 0.0 0.0 2
|
||||
Workshop_NPCPos_ToGarage 22.093 0.749 16.512 0.0 180.0 0.0 2
|
||||
Workshop_NPCPos_ToStreet 21.529 0.666 5.786 0.0 28.1 0.0 2
|
||||
Workshop_NPCPos_Hollow 33.19 0.86 11.482 0.0 270.0 0.0 2
|
||||
Workshop_NPCPos_VHS 28.02 0.87 16.887 0.0 0.0 0.0 2
|
||||
Workshop_NPCPos_Gacha 19.368 1.41 6.382 0.0 270.0 0.0 2
|
||||
Workshop_NPCPos_TimeMachine 30.08 0.4 14.386 0.0 0.0 0.0 2
|
||||
Workshop_NPCPos_Test 28.875 0.58384 9.625 0.0 312.68036 0.0 2
|
||||
Workshop_NPCPos_SisterLing 24.476 0.5998 10.557 0.0 313.60257 0.0 2
|
||||
Workshop_NPCPos_WorkTable 28.336 0.75 8.292 0.0 44.79997 0.0 2
|
||||
Workshop_NPCPos_Noca 22.0 0.58003 8.5 0.0 50.0 0.0 2
|
||||
WorkShop_NPCPos_Noca_Quest10020001 33.372 0.626 14.29 0.0 270.0 0.0 2
|
||||
WorkShop_NPCPos_Billy_Quest10020003 22.0 0.58003 9.5 0.0 125.0 0.0 2
|
||||
WorkShop_NPCPos_Anbi_Quest10020003 23.0 0.58003 9.0 0.0 295.0 0.0 2
|
||||
WorkShop_NPCPos_Noca_Quest10020009 24.14684 0.58003 12.46807 0.0 207.99998 0.0 2
|
||||
WorkShop_NPCPos_Billy_Quest10020009 24.211 0.58003 10.839 0.0 318.87799 0.0 2
|
||||
WorkShop_NPCPos_Anbi_Quest10020009 22.779 0.58384 11.511 0.0 103.268 0.0 2
|
||||
WorkShop_NPCPos_Salesman_Quest10020103 23.46 0.58003 12.533 0.0 206.96613 0.0 2
|
||||
WorkShop_NPCPos_Tsubaki_Quest10020106 31.594 0.597 15.71 0.0 237.34885 0.0 2
|
||||
Workshop_NpcPos_Quest10020151 19.5 0.58003 10.89 0.0 240.0 0.0 2
|
||||
Workshop_NpcPos_Quest10020181 19.674 0.58003 12.272 0.0 4.53792 0.0 2
|
||||
Workshop_NPCPos_BangbooA_VHS 25.03 0.58003 6.0 0.0 280.0 0.0 2
|
||||
Workshop_NPCPos_guest01_VHS 19.845 0.58003 8.695 0.0 312.21448 0.0 2
|
||||
Workshop_NPCPos_guest02_VHS 19.777 0.58003 10.577 0.0 169.99998 0.0 2
|
||||
Workshop_NPCPos_guest03_VHS 19.84 0.58003 15.49 0.0 270.0 0.0 2
|
||||
Workshop_NPCPos_guest04_VHS 19.152 0.58003 7.176 0.0 250.0 0.0 2
|
||||
Workshop_NPCPos_guest05_VHS 19.256 0.58003 11.563 0.0 300.0 0.0 2
|
||||
Workshop_NPCPos_guest06_VHS 19.27 0.58003 14.28 0.0 240.0 0.0 2
|
||||
Workshop_NPCPos_Bangboo01_VHS 21.29 0.58003 13.62 0.0 199.99998 0.0 2
|
||||
Workshop_NPCPos_Bangboo02_VHS 21.93 0.58003 11.36 0.0 150.0 0.0 2
|
||||
Workshop_NPCPos_Bangboo03_VHS 21.13 0.58003 9.31 0.0 99.99999 0.0 2
|
||||
Workshop_NPCPos_Bangboo04_VHS 20.5 0.58003 10.36 0.0 180.0 0.0 2
|
||||
Workshop_NPCPos_Bangboo05_VHS 22.1 0.58003 9.9 0.0 120.00001 0.0 2
|
||||
Workshop_CameraPos_Pos1 30.85 1.93 13.0 8.0 335.0 0.0 2
|
||||
Workshop_CameraPos_Pos2 29.39 1.93 13.2 8.0 30.0 0.0 2
|
||||
Workshop_NPCPos_Telephone 26.807 1.008 8.432 0.0 270.0 0.0 2
|
||||
Workshop_NPCPos_HollowPause 32.61 0.59 11.58 0.0 90.0 0.0 2
|
||||
Workshop_NPCPos_VHSBangboo 26.098 1.337 9.692 0.0 260.0 0.0 2
|
||||
Workshop_PlayerPos_HollowQuest 32.37027 0.58384 11.5826 0.0 86.69299 0.0 2
|
||||
WorkShop_CameraPos_VHSStore 22.53 1.855 10.8 0.0 115.38 0.0 2
|
||||
Workshop_PlayerPos_FromHollow 32.37027 0.58384 11.5826 0.0 86.69299 0.0 2
|
||||
Workshop_PlayerPos_FromVHS 28.0 0.58384 15.6 0.0 0.0 0.0 2
|
||||
Workshop_PlayerPos_VHSStore 22.758 0.58384 9.921 0.0 86.69299 0.0 2
|
||||
Workshop_NPCPos_ARole1 32.5 0.594 15.027 0.0 150.0 0.0 2
|
||||
Workshop_NPCPos_ARole2 31.15 0.594 12.748 0.0 270.0 0.0 2
|
||||
Workshop_NPCPos_ARole3 32.1 0.594 12.55 0.0 120.00001 0.0 2
|
||||
Workshop_NPCPos_ARole4 25.555 0.594 6.693 0.0 306.96448 0.0 2
|
||||
Workshop_NPCPos_ARole5 28.429 0.594 15.22 0.0 186.60002 0.0 2
|
||||
Workshop_NPCPos_ARole6 28.74 0.594 13.821 0.0 131.39603 0.0 2
|
||||
WorkShop_NPCPos_Tsubaki_Quest10020115 28.903 0.58003 16.034 0.0 154.11002 0.0 2
|
||||
Workshop_PlayerPos_Quest10020106 31.701 0.594 13.423 0.0 255.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020115 30.447 0.594 12.817 0.0 296.12622 0.0 2
|
||||
Workshop_Teleport_ToWorkshop 23.69 0.6 9.698 0.0 60.0 0.0 2
|
||||
Workshop_NPCPos_ARole7 27.35 0.59 16.0 0.0 45.0 0.0 2
|
||||
Workshop_NPCPos_ARole8 29.952 0.594 14.702 0.0 0.0 0.0 2
|
||||
Workshop_NPCPos_ARole8F 30.263 0.594 14.64 0.0 0.0 0.0 2
|
||||
Workshop_NPCPos_ARole9 31.6 0.594 10.85 0.0 307.60001 0.0 2
|
||||
Workshop_NPCPos_ARole10 33.19 0.594 15.438 0.0 260.0 0.0 2
|
||||
Workshop_NPCPos_ARoleTest 30.05 0.594 14.858 0.0 0.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020109 30.628 0.594 11.88 0.0 280.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020113 30.628 0.594 11.88 0.0 280.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020116 30.506 0.594 11.88 0.0 90.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020010 30.208 0.594 12.092 0.0 348.5 0.0 2
|
||||
Workshop_NPCPos_DrawingRoom 24.38 0.594 6.223 0.0 353.79999 0.0 2
|
||||
Workshop_PlayerPos_Quest10020119 30.892 0.594 10.112 0.0 125.60002 0.0 2
|
||||
Workshop_NPCPos_ARole11 31.605 0.594 9.471 0.0 300.0 0.0 2
|
||||
Workshop_NPCPos_ARole12 30.402 0.6 9.8 0.0 44.15999 0.0 2
|
||||
Workshop_NPCPos_ARole17 30.645 0.58 15.042 0.0 0.0 0.0 2
|
||||
Workshop_NPCPos_ARole16 28.292 0.593 8.216 3.08252 316.2569 0.0 2
|
||||
Workshop_NPCPos_ARole16F 25.559 0.578 7.945 0.0 204.72104 0.0 2
|
||||
Workshop_NPCPos_ARole15 33.043 0.6 13.442 0.0 0.0 0.0 2
|
||||
Workshop_NPCPos_ARole14 33.043 0.6 13.442 0.0 0.0 0.0 2
|
||||
Workshop_NPCPos_ARole13 33.043 0.6 13.442 0.0 0.0 0.0 2
|
||||
WorkShop_NPCPos_Tsubaki_Quest10020119 31.19 0.59 10.23 0.0 289.17999 0.0 2
|
||||
Workshop_PlayerPos_Quest10020151 20.396 0.58003 11.186 0.0 270.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020111 28.9 0.588 13.1 0.0 129.89999 0.0 2
|
||||
Workshop_NpcPos_VHS31020002 25.688 0.58003 7.624 0.0 251.93011 0.0 2
|
||||
Workshop_NpcPos_VHS31020001 23.12 0.58003 6.209 0.0 29.26875 0.0 2
|
||||
Workshop_NpcPos_VHS31010001 21.59 0.58003 15.2 0.0 240.0 0.0 2
|
||||
Workshop_NpcPos_Bangboo_Quest10020141 25.28177 0.588 6.47026 0.0 320.26306 0.0 2
|
||||
Workshop_NpcPos_Bangboo_Quest10020195 19.567 0.588 15.244 0.0 120.5 0.0 2
|
||||
Workshop_NpcPos_VHS31010002 21.9 0.58003 14.84 0.0 240.0 0.0 2
|
||||
Workshop_PlayerPos_VHS31020002 21.924 0.58003 12.388 0.0 315.51761 0.0 2
|
||||
Workshop_PlayerPos_VHS31020001 24.0 0.58003 9.36 0.0 150.0 0.0 2
|
||||
Workshop_PlayerPos_VHS31010001 21.59 0.58003 14.46 0.0 0.0 0.0 2
|
||||
Workshop_PlayerPos_VHS31010002 21.9 0.58003 14.46 0.0 0.0 0.0 2
|
||||
Workshop_NPCPos_No11_03 25.3 0.587 13.56 0.0 240.0 0.0 2
|
||||
Workshop_PlayerPos_Quest10020123 30.724 0.594 11.259 0.0 125.60002 0.0 2
|
||||
WorkShop_NPCPos_Bangboo_Quest10020106 32.19 0.595 15.605 0.0 337.73215 0.0 2
|
||||
Workshop_Passerby_133 19.237 0.58003 8.191 0.0 290.0 0.0 2
|
||||
Workshop_Passerby_134 19.838 0.58003 10.448 0.0 199.99998 0.0 2
|
||||
Workshop_Passerby_135 19.435 0.58003 15.141 0.0 270.0 0.0 2
|
||||
Workshop_Passerby_136 19.403 0.58003 7.347 0.0 260.0 0.0 2
|
||||
Workshop_Passerby_137 19.292 0.58003 11.969 0.0 270.0 0.0 2
|
||||
Workshop_Passerby_138 20.347 0.58003 15.573 0.0 340.0 0.0 2
|
||||
Workshop_PlayerPos_HollowPause 31.23 0.584 13.08 0.0 118.0 0.0 2
|
||||
Workshop_NPCPos_ARole17F 31.0 0.58 15.15 0.0 311.0 0.0 2
|
||||
Workshop_NpcPos_VHS31020001End 24.626 0.58003 8.681 0.0 311.76859 0.0 2
|
||||
Workshop_NpcPos_VHS31020002_02 25.503 0.58003 7.032 0.0 306.8797 0.0 2
|
||||
Workshop_NpcPos_VHS31020002End 21.218 0.58003 12.853 0.0 126.61777 0.0 2
|
||||
Workshop_NpcPos_VHS31020002_02End 21.66 0.58003 13.136 0.0 152.39877 0.0 2
|
||||
Workshop_NPCPos_ARole18 31.802 0.594 14.909 0.0 283.90863 0.0 2
|
||||
Workshop_PlayerPos_ARole18 28.258 0.594 15.121 0.0 81.46976 0.0 2
|
||||
Borderlands 0.0 0.0 0.0 0.0 0.0 0.0 0
|
|
|
@ -29,6 +29,7 @@ tracing-bunyan-formatter.workspace = true
|
|||
common.workspace = true
|
||||
protocol.workspace = true
|
||||
qwer.workspace = true
|
||||
parking_lot.workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "nap-gameserver"
|
||||
|
|
102
gameserver/src/data/event_graph.rs
Normal file
102
gameserver/src/data/event_graph.rs
Normal file
|
@ -0,0 +1,102 @@
|
|||
#![allow(unused)]
|
||||
|
||||
use std::collections::{BTreeMap, HashSet};
|
||||
|
||||
use protocol::{HollowEventType, NodeState, NodeVisible};
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct ConfigEventGraph {
|
||||
#[serde(rename = "ID")]
|
||||
pub id: i32,
|
||||
pub events: BTreeMap<ConfigEventType, ConfigEvent>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
#[serde(untagged)]
|
||||
pub enum ConfigValue {
|
||||
Constant(i32),
|
||||
Expression(String),
|
||||
#[default]
|
||||
Empty,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Ord, PartialOrd, Eq, PartialEq)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub enum ConfigEventType {
|
||||
OnStart,
|
||||
OnEnd,
|
||||
OnBro,
|
||||
OnSis,
|
||||
#[serde(other)]
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct ConfigEvent {
|
||||
#[serde(default)]
|
||||
pub actions: Vec<ConfigAction>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
pub enum HollowPositionOffsetType {
|
||||
#[default]
|
||||
Relative = 0,
|
||||
Absolute = 1,
|
||||
EventPos = 2,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
#[serde(tag = "$type")]
|
||||
pub enum ConfigAction {
|
||||
#[serde(rename = "Share.CConfigEmpty")]
|
||||
ConfigEmpty,
|
||||
#[serde(rename = "Share.CConfigSetMapState")]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
ConfigSetMapState {
|
||||
#[serde(default)]
|
||||
x: ConfigValue,
|
||||
#[serde(default)]
|
||||
y: ConfigValue,
|
||||
#[serde(default)]
|
||||
position: HollowPositionOffsetType,
|
||||
radius: Option<ConfigValue>,
|
||||
count: Option<ConfigValue>,
|
||||
#[serde(default)]
|
||||
r#type: HashSet<HollowEventType>,
|
||||
event_type_tag: Option<String>,
|
||||
#[serde(default)]
|
||||
from_visible_state: HashSet<NodeVisible>,
|
||||
#[serde(default)]
|
||||
to_visible_state: Vec<NodeVisible>,
|
||||
#[serde(default)]
|
||||
from_state: HashSet<NodeState>,
|
||||
#[serde(default)]
|
||||
to_state: Vec<NodeState>,
|
||||
#[serde(default)]
|
||||
exclude_player_pos: bool,
|
||||
#[serde(default)]
|
||||
index_list: Vec<ConfigValue>,
|
||||
#[serde(default)]
|
||||
use_perform: bool,
|
||||
},
|
||||
#[serde(rename = "Share.CConfigTriggerBattle")]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
ConfigTriggerBattle {
|
||||
#[serde(rename = "BattleID")]
|
||||
battle_id: ConfigValue,
|
||||
on_success: Option<String>,
|
||||
on_failure: Option<String>,
|
||||
#[serde(default)]
|
||||
end_hollow: bool,
|
||||
#[serde(default)]
|
||||
goto_next_hollow: bool,
|
||||
},
|
||||
#[serde(rename = "Share.CConfigFinishHollow")]
|
||||
ConfigFinishHollow,
|
||||
#[default]
|
||||
#[serde(other)]
|
||||
ConfigUnknown,
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
mod event_graph;
|
||||
mod templates;
|
||||
mod tsv_util;
|
||||
|
||||
use std::path::Path;
|
||||
use std::{collections::HashMap, path::Path};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
pub use event_graph::*;
|
||||
use paste::paste;
|
||||
pub use templates::*;
|
||||
use tokio::sync::OnceCell;
|
||||
|
@ -36,6 +38,16 @@ template_collections! {
|
|||
AvatarConfig;
|
||||
UnlockConfig;
|
||||
MainCityObject;
|
||||
NPCTransform;
|
||||
}
|
||||
|
||||
static EVENT_GRAPH_COLLECTION: OnceCell<HashMap<i32, ConfigEventGraph>> = OnceCell::const_new();
|
||||
|
||||
fn init_binoutput() -> Result<()> {
|
||||
let _ = EVENT_GRAPH_COLLECTION.set(serde_json::from_str(
|
||||
std::fs::read_to_string("assets/BinOutput/EventGraphCollection.json")?.as_str(),
|
||||
)?);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn init_assets() -> Result<()> {
|
||||
|
@ -46,9 +58,19 @@ pub fn init_assets() -> Result<()> {
|
|||
}
|
||||
|
||||
init_template_collections()?;
|
||||
Ok(())
|
||||
init_binoutput()
|
||||
}
|
||||
|
||||
pub fn get_main_city_object(tag_id: i32, npc_id: i32) -> Option<&'static MainCityObjectTemplate> {
|
||||
iter_main_city_object_collection().find(|o| o.tag_id == tag_id && o.npc_id == npc_id)
|
||||
}
|
||||
|
||||
pub fn is_transform_in_section(transform_id: &str, section_id: i32) -> bool {
|
||||
iter_n_p_c_transform_collection()
|
||||
.find(|t| t.id == transform_id)
|
||||
.map_or(false, |t| t.section == section_id)
|
||||
}
|
||||
|
||||
pub fn get_event_graph(id: i32) -> Option<&'static ConfigEventGraph> {
|
||||
EVENT_GRAPH_COLLECTION.get().unwrap().get(&id)
|
||||
}
|
||||
|
|
|
@ -16,7 +16,8 @@ pub struct MainCityObjectTemplate {
|
|||
pub default_interact_ids: Vec<i32>,
|
||||
pub interact_name: Option<String>,
|
||||
pub interact_shape: i32,
|
||||
pub interact_scale: String,
|
||||
#[serde(deserialize_with = "from_sequence")]
|
||||
pub interact_scale: Vec<f64>,
|
||||
pub fan_interact_param: Option<String>,
|
||||
pub focus_interact_scale: f64,
|
||||
pub ignore_collider: bool,
|
||||
|
@ -44,6 +45,20 @@ pub struct MainCityObjectTemplate {
|
|||
pub action_switch: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct NPCTransformTemplate {
|
||||
#[serde(rename = "ID")]
|
||||
pub id: String,
|
||||
pub position_x: f64,
|
||||
pub position_y: f64,
|
||||
pub position_z: f64,
|
||||
pub rotation_x: f64,
|
||||
pub rotation_y: f64,
|
||||
pub rotation_z: f64,
|
||||
pub section: i32,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct UnlockConfigTemplate {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Result;
|
||||
use parking_lot::RwLock;
|
||||
use protocol::{PlayerInfo, PtcPlayerInfoChangedArg};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use crate::net::NetworkSession;
|
||||
|
||||
|
@ -52,21 +52,21 @@ impl<T> PlayerOperationResult<T>
|
|||
where
|
||||
T: Send + Sync,
|
||||
{
|
||||
pub const fn unwrap(&self) -> &T {
|
||||
&self.result
|
||||
pub fn take(self) -> T {
|
||||
self.result
|
||||
}
|
||||
|
||||
pub async fn send_changes(&mut self, session: &NetworkSession) -> Result<&T> {
|
||||
pub async fn send_changes(mut self, session: &NetworkSession) -> Result<T> {
|
||||
if self.player_info_changes.is_some() {
|
||||
let ptc_player_info_changed = PtcPlayerInfoChangedArg {
|
||||
player_uid: session.get_player_uid().await,
|
||||
player_uid: session.player_uid().raw(),
|
||||
player_info: self.player_info_changes.take().unwrap(),
|
||||
};
|
||||
|
||||
session.send_rpc_arg(101, &ptc_player_info_changed).await?;
|
||||
session.push_rpc_arg(101, ptc_player_info_changed).await?;
|
||||
}
|
||||
|
||||
Ok(self.unwrap())
|
||||
Ok(self.take())
|
||||
}
|
||||
|
||||
pub const fn ret(result: T) -> Self {
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
use std::sync::LazyLock;
|
||||
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
pub const EVENT_GRAPH_COLLECTION: &str = include_str!("../../EventGraphCollection.json");
|
||||
|
||||
static EVENT_MAP: LazyLock<Map<String, Value>> = LazyLock::new(|| {
|
||||
serde_json::from_str::<Value>(EVENT_GRAPH_COLLECTION)
|
||||
.unwrap()
|
||||
.as_object()
|
||||
.unwrap()
|
||||
.clone()
|
||||
});
|
||||
|
||||
pub fn get_event_config_json(id: i32) -> &'static Value {
|
||||
EVENT_MAP.get(&id.to_string()).unwrap()
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
use anyhow::{anyhow, bail, Result};
|
||||
use parking_lot::RwLock;
|
||||
use protocol::*;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use crate::game::{manager::UniqueIDManager, util, PlayerOperationResult};
|
||||
use qwer::{
|
||||
|
@ -23,9 +23,9 @@ impl DungeonManager {
|
|||
}
|
||||
}
|
||||
|
||||
pub async fn enter_main_city(&self) -> Result<PlayerOperationResult<PtcEnterSceneArg>> {
|
||||
pub fn enter_main_city(&self) -> Result<PlayerOperationResult<PtcEnterSceneArg>> {
|
||||
let (player_uid, scene_position, scene_rotation) = {
|
||||
let player = self.player.read().await;
|
||||
let player = self.player.read();
|
||||
let pos_in_main_city = player.pos_in_main_city.as_ref().unwrap();
|
||||
|
||||
(
|
||||
|
@ -35,7 +35,7 @@ impl DungeonManager {
|
|||
)
|
||||
};
|
||||
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
let default_scene_uid = player
|
||||
.dungeon_collection
|
||||
.as_ref()
|
||||
|
@ -113,12 +113,12 @@ impl DungeonManager {
|
|||
))
|
||||
}
|
||||
|
||||
pub async fn enter_scene_section(
|
||||
pub fn enter_scene_section(
|
||||
&self,
|
||||
scene_uid: u64,
|
||||
section_id: i32,
|
||||
) -> PlayerOperationResult<PtcEnterSectionArg> {
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
let scene_info = player
|
||||
.dungeon_collection
|
||||
.as_mut()
|
||||
|
@ -145,12 +145,9 @@ impl DungeonManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn enter_scene(
|
||||
&self,
|
||||
scene_uid: u64,
|
||||
) -> Result<PlayerOperationResult<PtcEnterSceneArg>> {
|
||||
pub fn enter_scene(&self, scene_uid: u64) -> Result<PlayerOperationResult<PtcEnterSceneArg>> {
|
||||
let (player_uid, prev_scene_uid) = {
|
||||
let player = self.player.read().await;
|
||||
let player = self.player.read();
|
||||
|
||||
(
|
||||
*player.uid.as_ref().unwrap(),
|
||||
|
@ -158,7 +155,7 @@ impl DungeonManager {
|
|||
)
|
||||
};
|
||||
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
player.scene_uid.replace(scene_uid);
|
||||
player.prev_scene_uid.replace(prev_scene_uid);
|
||||
let dungeon_collection = player.dungeon_collection.as_mut().unwrap();
|
||||
|
@ -248,10 +245,10 @@ impl DungeonManager {
|
|||
))
|
||||
}
|
||||
|
||||
pub async fn hollow_finished(&self) -> PlayerOperationResult<u64> {
|
||||
let cur_scene_uid = self.get_cur_scene_uid().await;
|
||||
pub fn hollow_finished(&self) -> PlayerOperationResult<u64> {
|
||||
let cur_scene_uid = self.get_cur_scene_uid();
|
||||
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
|
||||
let hollow_scene = player
|
||||
.dungeon_collection
|
||||
|
@ -313,10 +310,9 @@ impl DungeonManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn get_default_scene_uid(&self) -> u64 {
|
||||
pub fn get_default_scene_uid(&self) -> u64 {
|
||||
self.player
|
||||
.read()
|
||||
.await
|
||||
.dungeon_collection
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
|
@ -325,10 +321,9 @@ impl DungeonManager {
|
|||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub async fn get_default_scene_uid_for_dungeon(&self, dungeon_uid: u64) -> u64 {
|
||||
pub fn get_default_scene_uid_for_dungeon(&self, dungeon_uid: u64) -> u64 {
|
||||
self.player
|
||||
.read()
|
||||
.await
|
||||
.dungeon_collection
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
|
@ -340,12 +335,12 @@ impl DungeonManager {
|
|||
.default_scene_uid
|
||||
}
|
||||
|
||||
pub async fn get_cur_scene_uid(&self) -> u64 {
|
||||
self.player.read().await.scene_uid.unwrap()
|
||||
pub fn get_cur_scene_uid(&self) -> u64 {
|
||||
self.player.read().scene_uid.unwrap()
|
||||
}
|
||||
|
||||
async fn add_default_hollow_properties(&self, scene_uid: u64) {
|
||||
let mut props = self.scene_properties.write().await;
|
||||
fn add_default_hollow_properties(&self, scene_uid: u64) {
|
||||
let mut props = self.scene_properties.write();
|
||||
|
||||
for (sub_key, value) in &[
|
||||
(1001, 0),
|
||||
|
@ -380,11 +375,11 @@ impl DungeonManager {
|
|||
}
|
||||
}
|
||||
|
||||
pub async fn leave_battle(&self) -> Result<PlayerOperationResult<PtcEnterSceneArg>> {
|
||||
let back_scene_uid = self.get_back_scene_uid().await;
|
||||
pub fn leave_battle(&self) -> Result<PlayerOperationResult<PtcEnterSceneArg>> {
|
||||
let back_scene_uid = self.get_back_scene_uid();
|
||||
|
||||
{
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
|
||||
let hollow_scene = player
|
||||
.dungeon_collection
|
||||
|
@ -404,11 +399,11 @@ impl DungeonManager {
|
|||
}
|
||||
}
|
||||
|
||||
self.enter_scene(back_scene_uid).await
|
||||
self.enter_scene(back_scene_uid)
|
||||
}
|
||||
|
||||
async fn get_back_scene_uid(&self) -> u64 {
|
||||
let player = self.player.read().await;
|
||||
fn get_back_scene_uid(&self) -> u64 {
|
||||
let player = self.player.read();
|
||||
let fight_scene_uid = player.scene_uid.as_ref().unwrap();
|
||||
let fight_scene = player
|
||||
.dungeon_collection
|
||||
|
@ -423,14 +418,12 @@ impl DungeonManager {
|
|||
fight_scene.get_back_scene_uid()
|
||||
}
|
||||
|
||||
pub async fn enter_battle(&self, scene_uid: u64) -> PlayerOperationResult<PtcEnterSceneArg> {
|
||||
let hollow_scene_uid = *self.player.read().await.scene_uid.as_ref().unwrap();
|
||||
let hollow_scene = self
|
||||
.set_cur_hollow_battle(scene_uid, hollow_scene_uid)
|
||||
.await;
|
||||
let ptc_enter_scene = self.enter_scene(scene_uid).await.unwrap().unwrap().clone();
|
||||
pub fn enter_battle(&self, scene_uid: u64) -> PlayerOperationResult<PtcEnterSceneArg> {
|
||||
let hollow_scene_uid = *self.player.read().scene_uid.as_ref().unwrap();
|
||||
let hollow_scene = self.set_cur_hollow_battle(scene_uid, hollow_scene_uid);
|
||||
let ptc_enter_scene = self.enter_scene(scene_uid).unwrap().take().clone();
|
||||
|
||||
let player = self.player.read().await;
|
||||
let player = self.player.read();
|
||||
let dungeon_collection = player.dungeon_collection.as_ref().unwrap();
|
||||
let fight_scene = dungeon_collection
|
||||
.scenes
|
||||
|
@ -459,8 +452,8 @@ impl DungeonManager {
|
|||
)
|
||||
}
|
||||
|
||||
async fn set_cur_hollow_battle(&self, scene_uid: u64, hollow_scene_uid: u64) -> SceneInfo {
|
||||
let mut player = self.player.write().await;
|
||||
fn set_cur_hollow_battle(&self, scene_uid: u64, hollow_scene_uid: u64) -> SceneInfo {
|
||||
let mut player = self.player.write();
|
||||
let hollow_scene = player
|
||||
.dungeon_collection
|
||||
.as_mut()
|
||||
|
@ -485,8 +478,8 @@ impl DungeonManager {
|
|||
hollow_scene.clone()
|
||||
}
|
||||
|
||||
pub async fn create_fight(&self, id: i32, hollow_scene_uid: u64) -> PlayerOperationResult<u64> {
|
||||
let mut player = self.player.write().await;
|
||||
pub fn create_fight(&self, id: i32, hollow_scene_uid: u64) -> PlayerOperationResult<u64> {
|
||||
let mut player = self.player.write();
|
||||
let dungeon_collection = player.dungeon_collection.as_mut().unwrap();
|
||||
let scenes = dungeon_collection.scenes.as_mut().unwrap();
|
||||
let hollow_scene = scenes.get_mut(&hollow_scene_uid).unwrap();
|
||||
|
@ -526,10 +519,10 @@ impl DungeonManager {
|
|||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub async fn is_in_tutorial(&self) -> bool {
|
||||
let cur_scene_uid = self.get_cur_scene_uid().await;
|
||||
pub fn is_in_tutorial(&self) -> bool {
|
||||
let cur_scene_uid = self.get_cur_scene_uid();
|
||||
|
||||
let player = self.player.read().await;
|
||||
let player = self.player.read();
|
||||
let cur_scene = player
|
||||
.dungeon_collection
|
||||
.as_ref()
|
||||
|
@ -543,24 +536,22 @@ impl DungeonManager {
|
|||
matches!(cur_scene, SceneInfo::Fresh { .. })
|
||||
}
|
||||
|
||||
pub async fn create_hollow(
|
||||
pub fn create_hollow(
|
||||
&self,
|
||||
id: i32,
|
||||
world_quest_id: i32,
|
||||
avatar_uids: &[u64],
|
||||
) -> PlayerOperationResult<(u64, u64)> {
|
||||
let back_scene_uid = self.get_default_scene_uid().await;
|
||||
let back_scene_uid = self.get_default_scene_uid();
|
||||
|
||||
let mut dungeon = self
|
||||
.create_base_dungeon(id, back_scene_uid, world_quest_id)
|
||||
.await;
|
||||
let mut dungeon = self.create_base_dungeon(id, back_scene_uid, world_quest_id);
|
||||
dungeon.hollow_event_version = 526;
|
||||
|
||||
let scene_uid = self.uid_mgr.next();
|
||||
dungeon.default_scene_uid = scene_uid;
|
||||
dungeon.scene_properties_uid = scene_uid;
|
||||
|
||||
self.add_default_hollow_properties(scene_uid).await;
|
||||
self.add_default_hollow_properties(scene_uid);
|
||||
|
||||
for (index, avatar_uid) in avatar_uids.iter().enumerate() {
|
||||
dungeon.avatar_map.insert(
|
||||
|
@ -642,10 +633,10 @@ impl DungeonManager {
|
|||
};
|
||||
|
||||
{
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
player
|
||||
.scene_properties
|
||||
.replace(self.scene_properties.read().await.clone());
|
||||
.replace(self.scene_properties.read().clone());
|
||||
|
||||
let dungeon_collection = player.dungeon_collection.as_mut().unwrap();
|
||||
|
||||
|
@ -660,7 +651,7 @@ impl DungeonManager {
|
|||
.unwrap()
|
||||
.insert(scene_uid, scene.clone());
|
||||
}
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
let items = player.items.as_mut().unwrap();
|
||||
|
||||
let mut updated_items = Vec::new();
|
||||
|
@ -674,7 +665,7 @@ impl DungeonManager {
|
|||
}
|
||||
|
||||
let mut prop_changes = Vec::new();
|
||||
for (key, sub_key, value) in &*self.scene_properties.write().await {
|
||||
for (key, sub_key, value) in &*self.scene_properties.write() {
|
||||
prop_changes.push((*key, *sub_key, *value));
|
||||
}
|
||||
|
||||
|
@ -705,8 +696,8 @@ impl DungeonManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn create_hall(&self, id: i32) -> PlayerOperationResult<u64> {
|
||||
let mut dungeon = self.create_base_dungeon(id, 0, 0).await;
|
||||
pub fn create_hall(&self, id: i32) -> PlayerOperationResult<u64> {
|
||||
let mut dungeon = self.create_base_dungeon(id, 0, 0);
|
||||
let dungeon_uid = dungeon.uid;
|
||||
|
||||
let scene_uid = self.uid_mgr.next();
|
||||
|
@ -726,7 +717,7 @@ impl DungeonManager {
|
|||
|
||||
dungeon.default_scene_uid = scene_uid;
|
||||
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
let dungeon_collection = player.dungeon_collection.as_mut().unwrap();
|
||||
|
||||
dungeon_collection
|
||||
|
@ -762,8 +753,8 @@ impl DungeonManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn create_fresh(&self) -> PlayerOperationResult<u64> {
|
||||
let mut dungeon = self.create_base_dungeon(2, 0, 0).await;
|
||||
pub fn create_fresh(&self) -> PlayerOperationResult<u64> {
|
||||
let mut dungeon = self.create_base_dungeon(2, 0, 0);
|
||||
let dungeon_uid = dungeon.uid;
|
||||
|
||||
let scene_uid = self.uid_mgr.next();
|
||||
|
@ -783,7 +774,7 @@ impl DungeonManager {
|
|||
|
||||
dungeon.default_scene_uid = scene_uid;
|
||||
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
let dungeon_collection = player.dungeon_collection.as_mut().unwrap();
|
||||
|
||||
dungeon_collection
|
||||
|
@ -817,13 +808,13 @@ impl DungeonManager {
|
|||
)
|
||||
}
|
||||
|
||||
async fn create_base_dungeon(
|
||||
fn create_base_dungeon(
|
||||
&self,
|
||||
id: i32,
|
||||
back_scene_uid: u64,
|
||||
world_quest_id: i32,
|
||||
) -> DungeonInfo {
|
||||
let player = self.player.read().await;
|
||||
let player = self.player.read();
|
||||
let uid = self.uid_mgr.next();
|
||||
|
||||
DungeonInfo {
|
||||
|
|
|
@ -3,10 +3,11 @@ use std::{
|
|||
sync::Arc,
|
||||
};
|
||||
|
||||
use crate::game::data;
|
||||
use parking_lot::RwLock;
|
||||
use protocol::*;
|
||||
use qwer::{phashmap, phashset, PropertyHashMap, PropertyHashSet};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use crate::data::{self, ConfigAction, ConfigEventType, ConfigValue};
|
||||
|
||||
pub struct HollowGridManager {
|
||||
player: Arc<RwLock<PlayerInfo>>,
|
||||
|
@ -23,25 +24,24 @@ impl HollowGridManager {
|
|||
}
|
||||
}
|
||||
|
||||
pub async fn get_cur_position_in_hollow(&self) -> u16 {
|
||||
self.map.read().await.as_ref().unwrap().start_grid
|
||||
pub fn get_cur_position_in_hollow(&self) -> u16 {
|
||||
self.map.read().as_ref().unwrap().start_grid
|
||||
}
|
||||
|
||||
pub async fn move_to(
|
||||
pub fn move_to(
|
||||
&self,
|
||||
destination_grid: u16,
|
||||
scene_uid: u64,
|
||||
) -> (PtcHollowGridArg, Option<PtcSyncHollowEventInfoArg>) {
|
||||
let mut map = self.map.write().await;
|
||||
let mut map = self.map.write();
|
||||
let map = map.as_mut().unwrap();
|
||||
|
||||
map.start_grid = destination_grid;
|
||||
let grid = map.grids.get_mut(&destination_grid).unwrap();
|
||||
|
||||
self.update_position_to_scene(scene_uid, destination_grid)
|
||||
.await;
|
||||
self.update_position_to_scene(scene_uid, destination_grid);
|
||||
|
||||
let mut events = self.events.write().await;
|
||||
let mut events = self.events.write();
|
||||
let sync_event_info =
|
||||
if let Entry::Vacant(entry) = events.entry(u64::from(destination_grid)) {
|
||||
let event_info = EventInfo {
|
||||
|
@ -82,7 +82,7 @@ impl HollowGridManager {
|
|||
|
||||
(
|
||||
PtcHollowGridArg {
|
||||
player_uid: self.player.read().await.uid.unwrap(),
|
||||
player_uid: self.player.read().uid.unwrap(),
|
||||
is_partial: true,
|
||||
scene_uid,
|
||||
hollow_level: 1,
|
||||
|
@ -92,20 +92,19 @@ impl HollowGridManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn battle_finished(&self) -> (PtcSyncHollowEventInfoArg, bool) {
|
||||
let map = self.map.read().await;
|
||||
pub fn battle_finished(&self) -> (PtcSyncHollowEventInfoArg, bool) {
|
||||
let map = self.map.read();
|
||||
let map = map.as_ref().unwrap();
|
||||
let cur_grid = map.grids.get(&map.start_grid).unwrap();
|
||||
|
||||
let event_config =
|
||||
data::get_event_config_json(cur_grid.grid.event_graph_info.hollow_event_template_id);
|
||||
let graph =
|
||||
data::get_event_graph(cur_grid.grid.event_graph_info.hollow_event_template_id).unwrap();
|
||||
|
||||
let mut hollow_finished = false;
|
||||
let actions = event_config["Events"]["OnEnd"]["Actions"]
|
||||
.as_array()
|
||||
.unwrap();
|
||||
if let Some(action) = actions.first() {
|
||||
hollow_finished = action["$type"].as_str().unwrap() == "Share.CConfigFinishHollow";
|
||||
if let Some(event) = graph.events.get(&ConfigEventType::OnEnd) {
|
||||
if let Some(ConfigAction::ConfigFinishHollow) = event.actions.first() {
|
||||
hollow_finished = true;
|
||||
}
|
||||
}
|
||||
|
||||
(
|
||||
|
@ -130,16 +129,16 @@ impl HollowGridManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn get_cur_event_template_id(&self) -> i32 {
|
||||
let map = self.map.read().await;
|
||||
pub fn get_cur_event_template_id(&self) -> i32 {
|
||||
let map = self.map.read();
|
||||
let map = map.as_ref().unwrap();
|
||||
let cur_grid = map.grids.get(&map.start_grid).unwrap();
|
||||
|
||||
cur_grid.grid.event_graph_info.hollow_event_template_id
|
||||
}
|
||||
|
||||
async fn update_position_to_scene(&self, scene_uid: u64, pos: u16) {
|
||||
let mut player = self.player.write().await;
|
||||
fn update_position_to_scene(&self, scene_uid: u64, pos: u16) {
|
||||
let mut player = self.player.write();
|
||||
let scene = player
|
||||
.dungeon_collection
|
||||
.as_mut()
|
||||
|
@ -166,7 +165,7 @@ impl HollowGridManager {
|
|||
}
|
||||
}
|
||||
|
||||
pub async fn run_event_graph(
|
||||
pub fn run_event_graph(
|
||||
&self,
|
||||
event_graph_uid: u64,
|
||||
_event_id: i32,
|
||||
|
@ -178,12 +177,12 @@ impl HollowGridManager {
|
|||
bool,
|
||||
) {
|
||||
let (player_uid, scene_uid) = {
|
||||
let player = self.player.read().await;
|
||||
let player = self.player.read();
|
||||
|
||||
(player.uid.unwrap(), player.scene_uid.unwrap())
|
||||
};
|
||||
|
||||
let mut map = self.map.write().await;
|
||||
let mut map = self.map.write();
|
||||
let map = map.as_mut().unwrap();
|
||||
|
||||
let mut trigger_battle_id = None;
|
||||
|
@ -199,31 +198,29 @@ impl HollowGridManager {
|
|||
|
||||
let sync_hollow_event = {
|
||||
let info = map.grids.get(&(event_graph_uid as u16)).unwrap().clone();
|
||||
let event_config =
|
||||
data::get_event_config_json(info.grid.event_graph_info.hollow_event_template_id);
|
||||
let graph =
|
||||
data::get_event_graph(info.grid.event_graph_info.hollow_event_template_id).unwrap();
|
||||
|
||||
let mut last_action = &ConfigAction::ConfigEmpty;
|
||||
|
||||
let mut last_exec_type = "";
|
||||
for id in &move_path {
|
||||
let index = (id % 1000) - 1;
|
||||
let actions = if id / 1000 == 1 {
|
||||
event_config["Events"]["OnStart"]["Actions"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
let event = if id / 1000 == 1 {
|
||||
graph.events.get(&ConfigEventType::OnStart)
|
||||
} else {
|
||||
event_config["Events"]["OnEnd"]["Actions"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
graph.events.get(&ConfigEventType::OnEnd)
|
||||
};
|
||||
if let Some(action) = actions.get(index as usize) {
|
||||
last_exec_type = action["$type"].as_str().unwrap();
|
||||
if let Some(action) = event.unwrap().actions.get(index as usize) {
|
||||
last_action = action;
|
||||
|
||||
// ugly, we have to parse these configs properly
|
||||
match action["$type"].as_str().unwrap() {
|
||||
"Share.CConfigSetMapState" => {
|
||||
let x = action["X"].as_i64().unwrap() as u16;
|
||||
let y = action["Y"].as_i64().unwrap() as u16;
|
||||
match action {
|
||||
ConfigAction::ConfigSetMapState { x, y, .. } => {
|
||||
let (ConfigValue::Constant(x), ConfigValue::Constant(y)) = (x, y)
|
||||
else {
|
||||
panic!("ConfigSetMapState: only constant values are supported");
|
||||
};
|
||||
|
||||
let uid = (y * 11) + x;
|
||||
let uid = ((y * 11) + x) as u16;
|
||||
if let Some(info) = map.grids.get_mut(&uid) {
|
||||
info.grid.flag |= HollowGridFlag::Visible as i32
|
||||
| HollowGridFlag::CanMove as i32
|
||||
|
@ -232,14 +229,14 @@ impl HollowGridManager {
|
|||
grid_update.grids.insert(uid, info.clone());
|
||||
}
|
||||
}
|
||||
"Share.CConfigTriggerBattle" => {
|
||||
ConfigAction::ConfigTriggerBattle { .. } => {
|
||||
trigger_battle_id =
|
||||
Some(match info.grid.event_graph_info.hollow_event_template_id {
|
||||
1000107 => 10101002,
|
||||
_ => 10101001,
|
||||
});
|
||||
}
|
||||
"Share.CConfigFinishHollow" => {
|
||||
ConfigAction::ConfigFinishHollow => {
|
||||
hollow_finished = true;
|
||||
}
|
||||
_ => {}
|
||||
|
@ -251,13 +248,9 @@ impl HollowGridManager {
|
|||
|
||||
let last_client_action = *action_move_path.last().unwrap();
|
||||
let actions = if last_client_action / 1000 == 1 {
|
||||
event_config["Events"]["OnStart"]["Actions"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
&graph.events.get(&ConfigEventType::OnStart).unwrap().actions
|
||||
} else {
|
||||
event_config["Events"]["OnEnd"]["Actions"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
&graph.events.get(&ConfigEventType::OnEnd).unwrap().actions
|
||||
};
|
||||
let state = if last_client_action == -1 {
|
||||
EventState::Finished
|
||||
|
@ -265,24 +258,24 @@ impl HollowGridManager {
|
|||
action_move_path.push(-1);
|
||||
EventState::Finished
|
||||
} else {
|
||||
if last_exec_type != "Share.CConfigEmpty" {
|
||||
if !matches!(last_action, ConfigAction::ConfigEmpty) {
|
||||
action_move_path.push(last_client_action + 1);
|
||||
}
|
||||
|
||||
EventState::WaitingClient
|
||||
};
|
||||
|
||||
let finish_event = if last_exec_type != "Share.CConfigTriggerBattle" {
|
||||
let finish_event = if let ConfigAction::ConfigTriggerBattle { .. } = last_action {
|
||||
PtcSyncHollowEventInfoArg {
|
||||
event_graph_uid,
|
||||
hollow_event_template_id: info.grid.event_graph_info.hollow_event_template_id,
|
||||
event_graph_id: info.grid.event_graph_info.hollow_event_template_id,
|
||||
updated_event: EventInfo {
|
||||
id: 1000,
|
||||
cur_action_id: *action_move_path.last().unwrap(),
|
||||
action_move_path,
|
||||
state,
|
||||
prev_state: EventState::Running,
|
||||
id: 0,
|
||||
cur_action_id: 0,
|
||||
action_move_path: vec![],
|
||||
state: EventState::Initing,
|
||||
prev_state: EventState::Initing,
|
||||
cur_action_info: ActionInfo::None {},
|
||||
cur_action_state: ActionState::Init,
|
||||
predicated_failed_actions: phashset![],
|
||||
|
@ -296,11 +289,11 @@ impl HollowGridManager {
|
|||
hollow_event_template_id: info.grid.event_graph_info.hollow_event_template_id,
|
||||
event_graph_id: info.grid.event_graph_info.hollow_event_template_id,
|
||||
updated_event: EventInfo {
|
||||
id: 0,
|
||||
cur_action_id: 0,
|
||||
action_move_path: vec![],
|
||||
state: EventState::Initing,
|
||||
prev_state: EventState::Initing,
|
||||
id: 1000,
|
||||
cur_action_id: *action_move_path.last().unwrap(),
|
||||
action_move_path,
|
||||
state,
|
||||
prev_state: EventState::Running,
|
||||
cur_action_info: ActionInfo::None {},
|
||||
cur_action_state: ActionState::Init,
|
||||
predicated_failed_actions: phashset![],
|
||||
|
@ -322,23 +315,19 @@ impl HollowGridManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn sync_hollow_maps(
|
||||
&self,
|
||||
player_uid: u64,
|
||||
scene_uid: u64,
|
||||
) -> PtcSyncHollowGridMapsArg {
|
||||
pub fn sync_hollow_maps(&self, player_uid: u64, scene_uid: u64) -> PtcSyncHollowGridMapsArg {
|
||||
PtcSyncHollowGridMapsArg {
|
||||
player_uid,
|
||||
scene_uid,
|
||||
hollow_level: 1,
|
||||
main_map: self.map.read().await.clone().unwrap(),
|
||||
main_map: self.map.read().clone().unwrap(),
|
||||
time_period: TimePeriodType::Random,
|
||||
weather: WeatherType::Random,
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn init_default_map(&self) {
|
||||
*self.map.write().await = Some(HollowGridMapProtocolInfo {
|
||||
pub fn init_default_map(&self) {
|
||||
*self.map.write() = Some(HollowGridMapProtocolInfo {
|
||||
row: 5,
|
||||
col: 11,
|
||||
start_grid: 22,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use parking_lot::RwLock;
|
||||
use protocol::{ItemInfo, PlayerInfo};
|
||||
use qwer::{phashmap, PropertyHashMap};
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use crate::game::{util, PlayerOperationResult};
|
||||
|
||||
|
@ -20,8 +20,8 @@ impl ItemManager {
|
|||
}
|
||||
}
|
||||
|
||||
pub async fn add_resource(&self, currency_id: i32, amount: i32) -> PlayerOperationResult<i32> {
|
||||
let mut player_info = self.player_info.write().await;
|
||||
pub fn add_resource(&self, currency_id: i32, amount: i32) -> PlayerOperationResult<i32> {
|
||||
let mut player_info = self.player_info.write();
|
||||
|
||||
for (uid, item) in player_info.items.as_mut().unwrap() {
|
||||
if let ItemInfo::Resource { id, count, .. } = item {
|
||||
|
@ -66,7 +66,7 @@ impl ItemManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn unlock_avatar(&self, id: i32) -> PlayerOperationResult<u64> {
|
||||
pub fn unlock_avatar(&self, id: i32) -> PlayerOperationResult<u64> {
|
||||
let uid = self.uid_mgr.next();
|
||||
|
||||
let avatar = ItemInfo::Avatar {
|
||||
|
@ -86,10 +86,10 @@ impl ItemManager {
|
|||
};
|
||||
|
||||
// Unlock & equip default weapon
|
||||
let weapon_uid = *self.unlock_weapon(10012).await.unwrap();
|
||||
self.equip_weapon(weapon_uid, uid).await;
|
||||
let weapon_uid = self.unlock_weapon(10012).take();
|
||||
self.equip_weapon(weapon_uid, uid);
|
||||
|
||||
let mut player_info = self.player_info.write().await;
|
||||
let mut player_info = self.player_info.write();
|
||||
let items = player_info.items.as_mut().unwrap();
|
||||
items.insert(uid, avatar.clone());
|
||||
|
||||
|
@ -108,8 +108,8 @@ impl ItemManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn unlock_weapon(&self, id: i32) -> PlayerOperationResult<u64> {
|
||||
let mut player_info = self.player_info.write().await;
|
||||
pub fn unlock_weapon(&self, id: i32) -> PlayerOperationResult<u64> {
|
||||
let mut player_info = self.player_info.write();
|
||||
let items = player_info.items.as_mut().unwrap();
|
||||
|
||||
let uid = self.uid_mgr.next();
|
||||
|
@ -141,12 +141,12 @@ impl ItemManager {
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn equip_weapon(
|
||||
pub fn equip_weapon(
|
||||
&self,
|
||||
weapon_uid: u64,
|
||||
equip_avatar_uid: u64,
|
||||
) -> PlayerOperationResult<bool> {
|
||||
let mut player_info = self.player_info.write().await;
|
||||
let mut player_info = self.player_info.write();
|
||||
let items = player_info.items.as_mut().unwrap();
|
||||
|
||||
let Some(ItemInfo::Weapon { avatar_uid, .. }) = items.get_mut(&weapon_uid) else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use parking_lot::RwLock;
|
||||
use protocol::{AccountInfo, PlayerInfo, PropertyBlob};
|
||||
use qwer::OctData;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
const CLIENT_PROP_FLAG: u16 = 1;
|
||||
|
||||
|
@ -12,12 +12,12 @@ pub struct PropertyManager {
|
|||
}
|
||||
|
||||
impl PropertyManager {
|
||||
pub async fn serialize_account_info(&self) -> PropertyBlob {
|
||||
Self::serialize_property(&*self.account_info.read().await).unwrap()
|
||||
pub fn serialize_account_info(&self) -> PropertyBlob {
|
||||
Self::serialize_property(&*self.account_info.read()).unwrap()
|
||||
}
|
||||
|
||||
pub async fn serialize_player_info(&self) -> PropertyBlob {
|
||||
Self::serialize_property(&*self.player_info.read().await).unwrap()
|
||||
pub fn serialize_player_info(&self) -> PropertyBlob {
|
||||
Self::serialize_property(&*self.player_info.read()).unwrap()
|
||||
}
|
||||
|
||||
pub fn serialize_property(prop: &impl OctData) -> Result<PropertyBlob, std::io::Error> {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use parking_lot::RwLock;
|
||||
use qwer::PropertyDoubleKeyHashMap;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use crate::game::PlayerOperationResult;
|
||||
|
||||
|
@ -18,11 +18,10 @@ impl QuestManager {
|
|||
Self { uid_mgr, player }
|
||||
}
|
||||
|
||||
pub async fn add_world_quest(&self, quest: QuestInfo) -> PlayerOperationResult<u64> {
|
||||
pub fn add_world_quest(&self, quest: QuestInfo) -> PlayerOperationResult<u64> {
|
||||
let mut world_quest_collection_uid = self
|
||||
.player
|
||||
.read()
|
||||
.await
|
||||
.quest_data
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
|
@ -33,7 +32,6 @@ impl QuestManager {
|
|||
world_quest_collection_uid = self.uid_mgr.next();
|
||||
self.player
|
||||
.write()
|
||||
.await
|
||||
.quest_data
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
|
@ -42,15 +40,14 @@ impl QuestManager {
|
|||
}
|
||||
|
||||
self.add_quest_to_collection(world_quest_collection_uid, quest)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn add_quest_to_collection(
|
||||
pub fn add_quest_to_collection(
|
||||
&self,
|
||||
collection_uid: u64,
|
||||
mut quest: QuestInfo,
|
||||
) -> PlayerOperationResult<u64> {
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
let quest_data = player.quest_data.as_mut().unwrap();
|
||||
quest.set_collection_uid(collection_uid);
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use parking_lot::RwLock;
|
||||
use protocol::*;
|
||||
use qwer::{phashmap, PropertyHashMap};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use crate::data;
|
||||
|
||||
use super::UniqueIDManager;
|
||||
|
||||
|
@ -19,7 +22,7 @@ impl SceneUnitManager {
|
|||
}
|
||||
}
|
||||
|
||||
pub async fn create_npc(
|
||||
pub fn create_npc(
|
||||
&self,
|
||||
id: i32,
|
||||
tag: i32,
|
||||
|
@ -28,7 +31,7 @@ impl SceneUnitManager {
|
|||
) -> u64 {
|
||||
let uid = self.uid_mgr.next();
|
||||
|
||||
self.units.write().await.insert(
|
||||
self.units.write().insert(
|
||||
uid,
|
||||
SceneUnitProtocolInfo::NpcProtocolInfo {
|
||||
uid,
|
||||
|
@ -42,11 +45,11 @@ impl SceneUnitManager {
|
|||
uid
|
||||
}
|
||||
|
||||
pub async fn get(&self, uid: u64) -> SceneUnitProtocolInfo {
|
||||
self.units.read().await.get(&uid).unwrap().clone()
|
||||
pub fn get(&self, uid: u64) -> Option<SceneUnitProtocolInfo> {
|
||||
self.units.read().get(&uid).map(|u| u.clone())
|
||||
}
|
||||
|
||||
pub async fn sync(&self, scene_uid: u64, section_id: i32) -> PtcSyncSceneUnitArg {
|
||||
pub fn sync(&self, scene_uid: u64, section_id: i32) -> PtcSyncSceneUnitArg {
|
||||
PtcSyncSceneUnitArg {
|
||||
scene_uid,
|
||||
section_id,
|
||||
|
@ -55,188 +58,73 @@ impl SceneUnitManager {
|
|||
scene_units: self
|
||||
.units
|
||||
.read()
|
||||
.await
|
||||
.iter()
|
||||
.map(|(_, unit)| unit.clone())
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_scene_units(&self, section_id: i32) {
|
||||
for o in data::iter_main_city_object_collection().filter(|o| {
|
||||
o.create_type == 0
|
||||
&& data::is_transform_in_section(&o.create_position, section_id)
|
||||
&& o.default_interact_ids.len() != 0
|
||||
&& !o.create_position.ends_with("_Test")
|
||||
}) {
|
||||
self.create_npc(
|
||||
o.npc_id,
|
||||
o.tag_id,
|
||||
0,
|
||||
PropertyHashMap::Base(
|
||||
o.default_interact_ids
|
||||
.iter()
|
||||
.map(|id| {
|
||||
(
|
||||
*id,
|
||||
create_interact(
|
||||
*id,
|
||||
o.interact_shape as u16,
|
||||
InteractScale::from_slice(&o.interact_scale).unwrap(),
|
||||
&o.interact_name.clone().unwrap_or_default(),
|
||||
phashmap![],
|
||||
),
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: partial_sync for newly added/removed units
|
||||
}
|
||||
|
||||
// currently hardcoded for Main City section 2
|
||||
pub async fn add_default_units(&self) {
|
||||
self.create_npc(
|
||||
100171011,
|
||||
3,
|
||||
0,
|
||||
phashmap![(
|
||||
19900006,
|
||||
create_interact(
|
||||
0,
|
||||
1,
|
||||
2.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
"",
|
||||
phashmap![(0, String::new())]
|
||||
)
|
||||
)],
|
||||
)
|
||||
.await;
|
||||
struct InteractScale(pub f64, pub f64, pub f64, pub f64, pub f64);
|
||||
impl InteractScale {
|
||||
pub fn from_slice(v: &[f64]) -> Result<Self> {
|
||||
if v.len() != 5 {
|
||||
bail!("InteractScale slice should contain 5 values");
|
||||
}
|
||||
|
||||
self.create_npc(
|
||||
100171011,
|
||||
4,
|
||||
0,
|
||||
phashmap![(
|
||||
19900006,
|
||||
create_interact(
|
||||
0,
|
||||
1,
|
||||
2.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
"",
|
||||
phashmap![(0, String::new())]
|
||||
)
|
||||
)],
|
||||
)
|
||||
.await;
|
||||
|
||||
self.create_npc(
|
||||
100171011,
|
||||
1002,
|
||||
0,
|
||||
phashmap![(
|
||||
19900062,
|
||||
create_interact(
|
||||
0,
|
||||
1,
|
||||
2.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
"",
|
||||
phashmap![(0, String::new())]
|
||||
)
|
||||
)],
|
||||
)
|
||||
.await;
|
||||
|
||||
self.create_npc(
|
||||
100171011,
|
||||
1001,
|
||||
0,
|
||||
phashmap![(
|
||||
10000010,
|
||||
create_interact(
|
||||
10000010,
|
||||
1,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
"A",
|
||||
phashmap![(1001, String::from("A"))]
|
||||
)
|
||||
)],
|
||||
)
|
||||
.await;
|
||||
|
||||
self.create_npc(
|
||||
100171011,
|
||||
1005,
|
||||
0,
|
||||
phashmap![(
|
||||
10000014,
|
||||
create_interact(
|
||||
10000014,
|
||||
1,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
"A",
|
||||
phashmap![(1005, String::from("A"))]
|
||||
)
|
||||
)],
|
||||
)
|
||||
.await;
|
||||
|
||||
self.create_npc(
|
||||
100173001,
|
||||
2028,
|
||||
0,
|
||||
phashmap![(
|
||||
19900052,
|
||||
create_interact(
|
||||
19900052,
|
||||
2,
|
||||
9.0,
|
||||
2.0,
|
||||
2.0,
|
||||
90.0,
|
||||
10.0,
|
||||
"A",
|
||||
phashmap![(2028, String::from("A"))]
|
||||
)
|
||||
)],
|
||||
)
|
||||
.await;
|
||||
|
||||
self.create_npc(
|
||||
100172011,
|
||||
2000,
|
||||
0,
|
||||
phashmap![(
|
||||
19900030,
|
||||
create_interact(
|
||||
0,
|
||||
1,
|
||||
2.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
"",
|
||||
phashmap![(2000, String::from("A")), (2052, String::from("B"))]
|
||||
)
|
||||
)],
|
||||
)
|
||||
.await;
|
||||
|
||||
self.create_npc(100172081, 2052, 0, phashmap![]).await;
|
||||
Ok(Self(v[0], v[1], v[2], v[3], v[4]))
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn create_interact(
|
||||
interact_id: i32,
|
||||
interact_shape: u16,
|
||||
scale_x: f64,
|
||||
scale_y: f64,
|
||||
scale_z: f64,
|
||||
scale_w: f64,
|
||||
scale_r: f64,
|
||||
scale: InteractScale,
|
||||
name: &str,
|
||||
participators: PropertyHashMap<i32, String>,
|
||||
) -> InteractInfo {
|
||||
InteractInfo {
|
||||
interact_id,
|
||||
interact_shape,
|
||||
scale_x,
|
||||
scale_y,
|
||||
scale_z,
|
||||
scale_w,
|
||||
scale_r,
|
||||
scale_x: scale.0,
|
||||
scale_y: scale.1,
|
||||
scale_z: scale.2,
|
||||
scale_w: scale.3,
|
||||
scale_r: scale.4,
|
||||
name: name.to_string(),
|
||||
participators,
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use parking_lot::RwLock;
|
||||
use protocol::*;
|
||||
use qwer::PropertyHashSet;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use crate::game::PlayerOperationResult;
|
||||
|
||||
|
@ -15,8 +15,8 @@ impl UnlockManager {
|
|||
Self { player }
|
||||
}
|
||||
|
||||
pub async fn unlock(&self, unlock_id: i32) -> PlayerOperationResult<PtcUnlockArg> {
|
||||
let mut player = self.player.write().await;
|
||||
pub fn unlock(&self, unlock_id: i32) -> PlayerOperationResult<PtcUnlockArg> {
|
||||
let mut player = self.player.write();
|
||||
let unlock_info = player.unlock_info.as_mut().unwrap();
|
||||
|
||||
unlock_info
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use std::collections::HashSet;
|
||||
use std::sync::Arc;
|
||||
|
||||
use parking_lot::RwLock;
|
||||
use qwer::{PropertyDoubleKeyHashMap, PropertyHashSet};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use crate::game::PlayerOperationResult;
|
||||
|
||||
|
@ -17,13 +17,13 @@ impl YorozuyaQuestManager {
|
|||
Self { player }
|
||||
}
|
||||
|
||||
pub async fn add_hollow_quest(
|
||||
pub fn add_hollow_quest(
|
||||
&self,
|
||||
yorozuya_collection_id: i32,
|
||||
hollow_quest_type: HollowQuestType,
|
||||
id: i32,
|
||||
) -> PlayerOperationResult<i32> {
|
||||
let mut player = self.player.write().await;
|
||||
let mut player = self.player.write();
|
||||
let yorozuya = player.yorozuya_info.as_mut().unwrap();
|
||||
let hollow_quests = yorozuya.hollow_quests.as_mut().unwrap();
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
mod context;
|
||||
pub mod data;
|
||||
pub mod manager;
|
||||
pub mod util;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ pub fn cur_timestamp_ms() -> u64 {
|
|||
pub fn create_default_account(id: u64) -> AccountInfo {
|
||||
AccountInfo {
|
||||
account_name: Some(format!("1_{id}")),
|
||||
players: Some(vec![id]),
|
||||
players: Some(Vec::new()),
|
||||
gm_level: Some(10),
|
||||
account_type: Some(1),
|
||||
register_cps: Some(String::new()),
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use std::io::{stdin, Read};
|
||||
|
||||
use anyhow::Result;
|
||||
use tracing::Level;
|
||||
|
||||
|
@ -15,7 +17,10 @@ use logging::{init_logging, init_system_logging};
|
|||
async fn main() -> Result<()> {
|
||||
init_logging();
|
||||
init_config();
|
||||
init_assets()?;
|
||||
if let Err(err) = init_assets() {
|
||||
tracing::error!("Error occurred during assets initialization: {err}");
|
||||
on_critical_fault();
|
||||
}
|
||||
|
||||
let span = tracing::span!(Level::DEBUG, "main");
|
||||
let _enter = span.enter();
|
||||
|
@ -26,3 +31,10 @@ async fn main() -> Result<()> {
|
|||
|
||||
net::gateway::listen(&CONFIGURATION.gateway_endpoint).await
|
||||
}
|
||||
|
||||
fn on_critical_fault() {
|
||||
eprintln!("Critical error occurred, press any key to exit...");
|
||||
|
||||
let _ = stdin().read(&mut [0u8]).unwrap();
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
|
|
@ -13,37 +13,31 @@ pub async fn on_rpc_hollow_move(
|
|||
tracing::info!("Hollow movement {:?}", &arg);
|
||||
|
||||
let destination_pos = *arg.positions.last().unwrap();
|
||||
let scene_uid = session
|
||||
.ns_prop_mgr
|
||||
.player_info
|
||||
.read()
|
||||
.await
|
||||
.scene_uid
|
||||
.unwrap();
|
||||
let scene_uid = session.ns_prop_mgr.player_info.read().scene_uid.unwrap();
|
||||
|
||||
let (ptc_hollow_grid, ptc_sync_hollow_event) = session
|
||||
.context
|
||||
.hollow_grid_manager
|
||||
.move_to(destination_pos, scene_uid)
|
||||
.await;
|
||||
.move_to(destination_pos, scene_uid);
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_HOLLOW_GRID_ID, &ptc_hollow_grid)
|
||||
.push_rpc_arg(PTC_HOLLOW_GRID_ID, ptc_hollow_grid)
|
||||
.await?;
|
||||
|
||||
if let Some(ptc_sync_hollow_event) = ptc_sync_hollow_event {
|
||||
session
|
||||
.send_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, &ptc_sync_hollow_event)
|
||||
.push_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, ptc_sync_hollow_event)
|
||||
.await?;
|
||||
}
|
||||
|
||||
let pos = PtcPositionInHollowChangedArg {
|
||||
player_uid: 1337,
|
||||
player_uid: session.player_uid().raw(),
|
||||
hollow_level: arg.hollow_level,
|
||||
position: destination_pos,
|
||||
};
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_POSITION_IN_HOLLOW_CHANGED_ID, &pos)
|
||||
.push_rpc_arg(PTC_POSITION_IN_HOLLOW_CHANGED_ID, pos)
|
||||
.await?;
|
||||
|
||||
Ok(RpcHollowMoveRet::new(
|
||||
|
@ -58,24 +52,23 @@ pub async fn on_rpc_end_battle(
|
|||
) -> Result<RpcEndBattleRet> {
|
||||
tracing::info!("RpcEndBattle: {:?}", &arg);
|
||||
|
||||
let player_uid = session.get_player_uid().await;
|
||||
let (sync_event, hollow_finished) = session.context.hollow_grid_manager.battle_finished().await;
|
||||
let player_uid = session.player_uid().raw();
|
||||
let (sync_event, hollow_finished) = session.context.hollow_grid_manager.battle_finished();
|
||||
|
||||
if !hollow_finished {
|
||||
session
|
||||
.send_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, &sync_event)
|
||||
.push_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, sync_event)
|
||||
.await?;
|
||||
} else {
|
||||
let _ = *session
|
||||
let _ = session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.hollow_finished()
|
||||
.await
|
||||
.send_changes(session)
|
||||
.await?;
|
||||
|
||||
let ptc_dungeon_quest_finished = PtcDungeonQuestFinishedArg {
|
||||
player_uid: 1337,
|
||||
player_uid,
|
||||
quest_id: 1001000101,
|
||||
success: true,
|
||||
reward_items: phashmap![],
|
||||
|
@ -83,7 +76,7 @@ pub async fn on_rpc_end_battle(
|
|||
};
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_DUNGEON_QUEST_FINISHED_ID, &ptc_dungeon_quest_finished)
|
||||
.push_rpc_arg(PTC_DUNGEON_QUEST_FINISHED_ID, ptc_dungeon_quest_finished)
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
@ -91,23 +84,18 @@ pub async fn on_rpc_end_battle(
|
|||
.context
|
||||
.dungeon_manager
|
||||
.leave_battle()
|
||||
.await
|
||||
.unwrap()
|
||||
.send_changes(session)
|
||||
.await?
|
||||
.clone();
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_SYNC_HOLLOW_GRID_MAPS_ID,
|
||||
&session
|
||||
.context
|
||||
.hollow_grid_manager
|
||||
.sync_hollow_maps(
|
||||
player_uid,
|
||||
session.context.dungeon_manager.get_cur_scene_uid().await,
|
||||
)
|
||||
.await,
|
||||
session.context.hollow_grid_manager.sync_hollow_maps(
|
||||
player_uid,
|
||||
session.context.dungeon_manager.get_cur_scene_uid(),
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
@ -117,27 +105,25 @@ pub async fn on_rpc_end_battle(
|
|||
position: session
|
||||
.context
|
||||
.hollow_grid_manager
|
||||
.get_cur_position_in_hollow()
|
||||
.await,
|
||||
.get_cur_position_in_hollow(),
|
||||
};
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_POSITION_IN_HOLLOW_CHANGED_ID,
|
||||
&ptc_position_in_hollow_changed,
|
||||
ptc_position_in_hollow_changed,
|
||||
)
|
||||
.await?;
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_ENTER_SCENE_ID, &ptc_enter_scene)
|
||||
.push_rpc_arg(PTC_ENTER_SCENE_ID, ptc_enter_scene)
|
||||
.await?;
|
||||
|
||||
Ok(RpcEndBattleRet::new(
|
||||
session
|
||||
.context
|
||||
.hollow_grid_manager
|
||||
.get_cur_event_template_id()
|
||||
.await,
|
||||
.get_cur_event_template_id(),
|
||||
HashMap::new(),
|
||||
))
|
||||
}
|
||||
|
@ -148,13 +134,7 @@ pub async fn on_rpc_run_hollow_event_graph(
|
|||
) -> Result<RpcRunHollowEventGraphRet> {
|
||||
tracing::info!("Run hollow event graph {:?}", arg);
|
||||
|
||||
let scene_uid = session
|
||||
.ns_prop_mgr
|
||||
.player_info
|
||||
.read()
|
||||
.await
|
||||
.scene_uid
|
||||
.unwrap();
|
||||
let scene_uid = session.ns_prop_mgr.player_info.read().scene_uid.unwrap();
|
||||
|
||||
if arg.event_graph_uid == 3405096459205834 {
|
||||
// Perform (cutscene)
|
||||
|
@ -176,50 +156,45 @@ pub async fn on_rpc_run_hollow_event_graph(
|
|||
specials: phashmap![],
|
||||
};
|
||||
session
|
||||
.send_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, &finish_perform)
|
||||
.push_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, finish_perform)
|
||||
.await?;
|
||||
|
||||
let (ptc_hollow_grid, ptc_sync_hollow_event) = session
|
||||
.context
|
||||
.hollow_grid_manager
|
||||
.move_to(22, scene_uid)
|
||||
.await;
|
||||
let (ptc_hollow_grid, ptc_sync_hollow_event) =
|
||||
session.context.hollow_grid_manager.move_to(22, scene_uid);
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_HOLLOW_GRID_ID, &ptc_hollow_grid)
|
||||
.push_rpc_arg(PTC_HOLLOW_GRID_ID, ptc_hollow_grid)
|
||||
.await?;
|
||||
if let Some(ptc_sync_hollow_event) = ptc_sync_hollow_event {
|
||||
session
|
||||
.send_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, &ptc_sync_hollow_event)
|
||||
.push_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, ptc_sync_hollow_event)
|
||||
.await?;
|
||||
}
|
||||
} else {
|
||||
let (sync_hollow_event, hollow_grid, trigger_battle_id, hollow_finished) = session
|
||||
.context
|
||||
.hollow_grid_manager
|
||||
.run_event_graph(arg.event_graph_uid, arg.event_id, arg.move_path.clone())
|
||||
.await;
|
||||
.run_event_graph(arg.event_graph_uid, arg.event_id, arg.move_path.clone());
|
||||
|
||||
if !hollow_finished {
|
||||
session
|
||||
.send_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, &sync_hollow_event)
|
||||
.push_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, sync_hollow_event)
|
||||
.await?;
|
||||
}
|
||||
session
|
||||
.send_rpc_arg(PTC_HOLLOW_GRID_ID, &hollow_grid)
|
||||
.push_rpc_arg(PTC_HOLLOW_GRID_ID, hollow_grid)
|
||||
.await?;
|
||||
|
||||
if hollow_finished {
|
||||
let _ = *session
|
||||
let _ = session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.hollow_finished()
|
||||
.await
|
||||
.send_changes(session)
|
||||
.await?;
|
||||
|
||||
let ptc_dungeon_quest_finished = PtcDungeonQuestFinishedArg {
|
||||
player_uid: 1337,
|
||||
player_uid: session.player_uid().raw(),
|
||||
quest_id: 1001000101,
|
||||
success: true,
|
||||
reward_items: phashmap![],
|
||||
|
@ -227,7 +202,7 @@ pub async fn on_rpc_run_hollow_event_graph(
|
|||
};
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_DUNGEON_QUEST_FINISHED_ID, &ptc_dungeon_quest_finished)
|
||||
.push_rpc_arg(PTC_DUNGEON_QUEST_FINISHED_ID, ptc_dungeon_quest_finished)
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
@ -236,43 +211,39 @@ pub async fn on_rpc_run_hollow_event_graph(
|
|||
.ns_prop_mgr
|
||||
.player_info
|
||||
.read()
|
||||
.await
|
||||
.scene_uid
|
||||
.as_ref()
|
||||
.unwrap();
|
||||
let battle_scene_uid = *session
|
||||
let battle_scene_uid = session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.create_fight(trigger_battle_id, hollow_uid)
|
||||
.await
|
||||
.send_changes(session)
|
||||
.await?;
|
||||
|
||||
let ptc_position_in_hollow_changed = PtcPositionInHollowChangedArg {
|
||||
player_uid: 1337,
|
||||
player_uid: session.player_uid().raw(),
|
||||
hollow_level: 1,
|
||||
position: session
|
||||
.context
|
||||
.hollow_grid_manager
|
||||
.get_cur_position_in_hollow()
|
||||
.await,
|
||||
.get_cur_position_in_hollow(),
|
||||
};
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_POSITION_IN_HOLLOW_CHANGED_ID,
|
||||
&ptc_position_in_hollow_changed,
|
||||
ptc_position_in_hollow_changed,
|
||||
)
|
||||
.await?;
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_ENTER_SCENE_ID,
|
||||
session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.enter_battle(battle_scene_uid)
|
||||
.await
|
||||
.send_changes(session)
|
||||
.await?,
|
||||
)
|
||||
|
@ -291,31 +262,33 @@ pub async fn on_rpc_start_hollow_quest(
|
|||
|
||||
// Set avatar HP properties
|
||||
for (_idx, avatar_uid) in &arg.avatar_map {
|
||||
let player_info = session.ns_prop_mgr.player_info.read().await;
|
||||
let items = player_info.items.as_ref().unwrap();
|
||||
let Some(ItemInfo::Avatar { id, .. }) = items
|
||||
.iter()
|
||||
.find(|(uid, _)| **uid == *avatar_uid)
|
||||
.map(|(_, item)| item)
|
||||
else {
|
||||
return Ok(RpcStartHollowQuestRet::error(
|
||||
ErrorCode::ObjectNotExist,
|
||||
Vec::new(),
|
||||
));
|
||||
};
|
||||
let update_properties = {
|
||||
let player_info = session.ns_prop_mgr.player_info.read();
|
||||
let items = player_info.items.as_ref().unwrap();
|
||||
let Some(ItemInfo::Avatar { id, .. }) = items
|
||||
.iter()
|
||||
.find(|(uid, _)| **uid == *avatar_uid)
|
||||
.map(|(_, item)| item)
|
||||
else {
|
||||
return Ok(RpcStartHollowQuestRet::error(
|
||||
ErrorCode::ObjectNotExist,
|
||||
Vec::new(),
|
||||
));
|
||||
};
|
||||
|
||||
let avatar_config = data::iter_avatar_config_collection()
|
||||
.find(|c| c.id == *id)
|
||||
.unwrap();
|
||||
let avatar_config = data::iter_avatar_config_collection()
|
||||
.find(|c| c.id == *id)
|
||||
.unwrap();
|
||||
|
||||
let update_properties = PtcPropertyChangedArg {
|
||||
scene_unit_uid: *avatar_uid,
|
||||
is_partial: true,
|
||||
changed_properties: phashmap![(1, avatar_config.hp), (111, avatar_config.hp)],
|
||||
PtcPropertyChangedArg {
|
||||
scene_unit_uid: *avatar_uid,
|
||||
is_partial: true,
|
||||
changed_properties: phashmap![(1, avatar_config.hp), (111, avatar_config.hp)],
|
||||
}
|
||||
};
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_PROPERTY_CHANGED_ID, &update_properties)
|
||||
.push_rpc_arg(PTC_PROPERTY_CHANGED_ID, update_properties)
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
@ -325,11 +298,10 @@ pub async fn on_rpc_start_hollow_quest(
|
|||
.sorted_by_key(|kv| kv.0)
|
||||
.map(|(_idx, uid)| *uid)
|
||||
.collect::<Vec<_>>();
|
||||
let (dungeon_uid, scene_uid) = *session
|
||||
let (dungeon_uid, scene_uid) = session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.create_hollow(10001, 10010001, &avatars)
|
||||
.await
|
||||
.send_changes(session)
|
||||
.await?;
|
||||
|
||||
|
@ -350,46 +322,42 @@ pub async fn on_rpc_start_hollow_quest(
|
|||
sort_id: 2000,
|
||||
},
|
||||
)
|
||||
.await
|
||||
.send_changes(session)
|
||||
.await?;
|
||||
|
||||
let ptc_enter_scene = session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.enter_scene(scene_uid)
|
||||
.await?
|
||||
.enter_scene(scene_uid)?
|
||||
.send_changes(session)
|
||||
.await?
|
||||
.clone();
|
||||
|
||||
session.context.hollow_grid_manager.init_default_map().await;
|
||||
session.context.hollow_grid_manager.init_default_map();
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_SYNC_HOLLOW_GRID_MAPS_ID,
|
||||
&session
|
||||
session
|
||||
.context
|
||||
.hollow_grid_manager
|
||||
.sync_hollow_maps(session.get_player_uid().await, scene_uid)
|
||||
.await,
|
||||
.sync_hollow_maps(session.player_uid().raw(), scene_uid),
|
||||
)
|
||||
.await?;
|
||||
|
||||
let ptc_position_in_hollow_changed = PtcPositionInHollowChangedArg {
|
||||
player_uid: 1337,
|
||||
player_uid: session.player_uid().raw(),
|
||||
hollow_level: 1,
|
||||
position: session
|
||||
.context
|
||||
.hollow_grid_manager
|
||||
.get_cur_position_in_hollow()
|
||||
.await,
|
||||
.get_cur_position_in_hollow(),
|
||||
};
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_POSITION_IN_HOLLOW_CHANGED_ID,
|
||||
&ptc_position_in_hollow_changed,
|
||||
ptc_position_in_hollow_changed,
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
@ -412,11 +380,11 @@ pub async fn on_rpc_start_hollow_quest(
|
|||
};
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, &ptc_sync_hollow_event_info)
|
||||
.push_rpc_arg(PTC_SYNC_HOLLOW_EVENT_INFO_ID, ptc_sync_hollow_event_info)
|
||||
.await?;
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_ENTER_SCENE_ID, &ptc_enter_scene)
|
||||
.push_rpc_arg(PTC_ENTER_SCENE_ID, ptc_enter_scene)
|
||||
.await?;
|
||||
Ok(RpcStartHollowQuestRet::new())
|
||||
}
|
||||
|
|
|
@ -1,18 +1,52 @@
|
|||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
use super::*;
|
||||
use crate::game::util;
|
||||
use crate::{
|
||||
game::util,
|
||||
net::session::{AccountUID, PlayerUID},
|
||||
};
|
||||
|
||||
const DEFAULT_ACCOUNT_ID: u64 = 1337;
|
||||
const DEFAULT_ACCOUNT_ID: u64 = 1;
|
||||
|
||||
pub async fn on_rpc_login(session: &NetworkSession, arg: &RpcLoginArg) -> Result<RpcLoginRet> {
|
||||
tracing::info!("Received rpc login arg: {}", arg.account_name);
|
||||
*session.ns_prop_mgr.account_info.write().await =
|
||||
util::create_default_account(DEFAULT_ACCOUNT_ID);
|
||||
|
||||
Ok(RpcLoginRet::new(
|
||||
session.ns_prop_mgr.serialize_account_info().await,
|
||||
))
|
||||
match session.logged_in(
|
||||
AccountUID(DEFAULT_ACCOUNT_ID),
|
||||
util::create_default_account(DEFAULT_ACCOUNT_ID),
|
||||
) {
|
||||
Ok(()) => Ok(RpcLoginRet::new(
|
||||
session.ns_prop_mgr.serialize_account_info(),
|
||||
)),
|
||||
Err(_) => Ok(RpcLoginRet::error(ErrorCode::RepeatedLogin, Vec::new())),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn on_rpc_create_player(
|
||||
session: &NetworkSession,
|
||||
_arg: &RpcCreatePlayerArg,
|
||||
) -> Result<RpcCreatePlayerRet> {
|
||||
let account_uid = session.account_uid();
|
||||
let player_count = session
|
||||
.ns_prop_mgr
|
||||
.account_info
|
||||
.read()
|
||||
.players
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.len();
|
||||
|
||||
let player_uid = PlayerUID::new(account_uid, player_count + 1);
|
||||
session
|
||||
.ns_prop_mgr
|
||||
.account_info
|
||||
.write()
|
||||
.players
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.push(player_uid.raw());
|
||||
|
||||
Ok(RpcCreatePlayerRet::new(player_uid.raw()))
|
||||
}
|
||||
|
||||
pub async fn on_ptc_get_server_timestamp(
|
||||
|
|
|
@ -39,6 +39,7 @@ macro_rules! protocol_handlers {
|
|||
.instrument(tracing::info_span!(stringify!([<on_$name:snake>]), protocol_id = protocol_id))
|
||||
.await?;
|
||||
|
||||
session.flush_rpc_queue().await?;
|
||||
session.send_rpc_ret(ret).await
|
||||
}
|
||||
)*
|
||||
|
@ -57,6 +58,7 @@ macro_rules! protocol_handlers {
|
|||
|
||||
protocol_handlers! {
|
||||
RpcLogin;
|
||||
RpcCreatePlayer;
|
||||
PtcGetServerTimestamp;
|
||||
PtcPlayerOperation;
|
||||
RpcAdvanceBeginnerProcedure;
|
||||
|
@ -68,6 +70,7 @@ protocol_handlers! {
|
|||
RpcDelNewMap;
|
||||
RpcEndBattle;
|
||||
RpcEnterWorld;
|
||||
RpcReenterWorld;
|
||||
RpcFinishActPerformShow;
|
||||
RpcFinishEventGraphPerformShow;
|
||||
RpcGetPlayerMails;
|
||||
|
|
|
@ -6,21 +6,23 @@ pub async fn on_rpc_mod_nick_name(
|
|||
) -> Result<RpcModNickNameRet> {
|
||||
tracing::info!("creating character");
|
||||
|
||||
let mut player = session.ns_prop_mgr.player_info.write().await;
|
||||
player.nick_name.replace(arg.nick_name.clone());
|
||||
player.avatar_id.replace(arg.avatar_id);
|
||||
let player_info_changed = {
|
||||
let mut player = session.ns_prop_mgr.player_info.write();
|
||||
player.nick_name.replace(arg.nick_name.clone());
|
||||
player.avatar_id.replace(arg.avatar_id);
|
||||
|
||||
let player_info_changed = PtcPlayerInfoChangedArg {
|
||||
player_uid: player.uid.unwrap(),
|
||||
player_info: PlayerInfo {
|
||||
nick_name: Some(arg.nick_name.clone()),
|
||||
avatar_id: Some(arg.avatar_id),
|
||||
..Default::default()
|
||||
},
|
||||
PtcPlayerInfoChangedArg {
|
||||
player_uid: player.uid.unwrap(),
|
||||
player_info: PlayerInfo {
|
||||
nick_name: Some(arg.nick_name.clone()),
|
||||
avatar_id: Some(arg.avatar_id),
|
||||
..Default::default()
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_PLAYER_INFO_CHANGED_ID, &player_info_changed)
|
||||
.push_rpc_arg(PTC_PLAYER_INFO_CHANGED_ID, player_info_changed)
|
||||
.await?;
|
||||
Ok(RpcModNickNameRet::new())
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ use qwer::{
|
|||
use crate::config::CONFIGURATION;
|
||||
use crate::data;
|
||||
use crate::game::util;
|
||||
use crate::net::session::PlayerUID;
|
||||
|
||||
use super::*;
|
||||
|
||||
|
@ -12,21 +13,34 @@ pub async fn on_rpc_run_event_graph(
|
|||
session: &NetworkSession,
|
||||
arg: &RpcRunEventGraphArg,
|
||||
) -> Result<RpcRunEventGraphRet> {
|
||||
tracing::info!("RunEventGraph requested");
|
||||
let unit = session.context.scene_unit_manager.get(arg.owner_uid);
|
||||
|
||||
let unit = session.context.scene_unit_manager.get(arg.owner_uid).await;
|
||||
|
||||
let SceneUnitProtocolInfo::NpcProtocolInfo { tag, id, .. } = unit;
|
||||
let main_city_object = data::get_main_city_object(tag, id).unwrap();
|
||||
let interact_id = match unit {
|
||||
Some(SceneUnitProtocolInfo::NpcProtocolInfo { interacts_info, .. })
|
||||
if interacts_info.len() != 0 =>
|
||||
{
|
||||
*interacts_info.iter().next().unwrap().0
|
||||
}
|
||||
Some(SceneUnitProtocolInfo::NpcProtocolInfo { tag, id, .. }) => {
|
||||
let main_city_object = data::get_main_city_object(tag, id).unwrap();
|
||||
*main_city_object.default_interact_ids.first().unwrap()
|
||||
}
|
||||
None => {
|
||||
return Ok(RpcRunEventGraphRet::error(
|
||||
ErrorCode::EntityNotExist,
|
||||
Vec::new(),
|
||||
))
|
||||
}
|
||||
};
|
||||
|
||||
let mut ptc_sync_event_info = PtcSyncEventInfoArg {
|
||||
owner_type: EventGraphOwnerType::SceneUnit,
|
||||
owner_type: arg.owner_type,
|
||||
owner_uid: arg.owner_uid,
|
||||
updated_events: pdkhashmap![],
|
||||
};
|
||||
|
||||
ptc_sync_event_info.updated_events.insert(
|
||||
*main_city_object.default_interact_ids.first().unwrap(),
|
||||
interact_id,
|
||||
100,
|
||||
EventInfo {
|
||||
id: 100,
|
||||
|
@ -42,7 +56,7 @@ pub async fn on_rpc_run_event_graph(
|
|||
);
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_SYNC_EVENT_INFO_ID, &ptc_sync_event_info)
|
||||
.push_rpc_arg(PTC_SYNC_EVENT_INFO_ID, ptc_sync_event_info)
|
||||
.await?;
|
||||
|
||||
Ok(RpcRunEventGraphRet::new())
|
||||
|
@ -52,8 +66,6 @@ pub async fn on_rpc_finish_event_graph_perform_show(
|
|||
session: &NetworkSession,
|
||||
arg: &RpcFinishEventGraphPerformShowArg,
|
||||
) -> Result<RpcFinishEventGraphPerformShowRet> {
|
||||
tracing::info!("FinishEventGraphPerformShow");
|
||||
|
||||
let mut ptc_sync_event_info = PtcSyncEventInfoArg {
|
||||
owner_type: EventGraphOwnerType::SceneUnit,
|
||||
owner_uid: arg.owner_uid,
|
||||
|
@ -77,7 +89,7 @@ pub async fn on_rpc_finish_event_graph_perform_show(
|
|||
);
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_SYNC_EVENT_INFO_ID, &ptc_sync_event_info)
|
||||
.push_rpc_arg(PTC_SYNC_EVENT_INFO_ID, ptc_sync_event_info)
|
||||
.await?;
|
||||
|
||||
Ok(RpcFinishEventGraphPerformShowRet::new())
|
||||
|
@ -87,38 +99,63 @@ pub async fn on_rpc_interact_with_unit(
|
|||
session: &NetworkSession,
|
||||
arg: &RpcInteractWithUnitArg,
|
||||
) -> Result<RpcInteractWithUnitRet> {
|
||||
tracing::info!("InteractWithUnit");
|
||||
|
||||
let unit = session.context.scene_unit_manager.get(arg.unit_uid).await;
|
||||
|
||||
let SceneUnitProtocolInfo::NpcProtocolInfo { tag, id, .. } = unit;
|
||||
let main_city_object = data::get_main_city_object(tag, id).unwrap();
|
||||
|
||||
let mut ptc_sync_event_info = PtcSyncEventInfoArg {
|
||||
owner_type: EventGraphOwnerType::SceneUnit,
|
||||
owner_uid: arg.unit_uid,
|
||||
updated_events: pdkhashmap![],
|
||||
};
|
||||
|
||||
ptc_sync_event_info.updated_events.insert(
|
||||
*main_city_object.default_interact_ids.first().unwrap(),
|
||||
100,
|
||||
EventInfo {
|
||||
id: 100,
|
||||
cur_action_id: 101,
|
||||
action_move_path: Vec::from([101]),
|
||||
state: EventState::WaitingClient,
|
||||
prev_state: EventState::Running,
|
||||
cur_action_info: ActionInfo::None {},
|
||||
cur_action_state: ActionState::Init,
|
||||
predicated_failed_actions: phashset![],
|
||||
stack_frames: Vec::new(),
|
||||
},
|
||||
tracing::info!(
|
||||
"InteractWithUnit: unit_uid: {}, interaction: {}",
|
||||
arg.unit_uid,
|
||||
arg.interaction
|
||||
);
|
||||
|
||||
session
|
||||
.send_rpc_arg(PTC_SYNC_EVENT_INFO_ID, &ptc_sync_event_info)
|
||||
.await?;
|
||||
let unit = session.context.scene_unit_manager.get(arg.unit_uid);
|
||||
|
||||
let interact_id = match unit {
|
||||
Some(SceneUnitProtocolInfo::NpcProtocolInfo { interacts_info, .. })
|
||||
if interacts_info.len() != 0 =>
|
||||
{
|
||||
*interacts_info.iter().next().unwrap().0
|
||||
}
|
||||
Some(SceneUnitProtocolInfo::NpcProtocolInfo { tag, id, .. }) => {
|
||||
let main_city_object = data::get_main_city_object(tag, id).unwrap();
|
||||
*main_city_object.default_interact_ids.first().unwrap()
|
||||
}
|
||||
None => {
|
||||
return Ok(RpcInteractWithUnitRet::error(
|
||||
ErrorCode::EntityNotExist,
|
||||
Vec::new(),
|
||||
))
|
||||
}
|
||||
};
|
||||
|
||||
// 0 - ServerInteractiveSystem::TriggerEnterEvent
|
||||
// 1 - ServerInteractiveSystem::TriggerExitEvent
|
||||
// 2 - ServerInteractiveSystem::TriggerInteractDirectly
|
||||
if arg.interaction == 2 {
|
||||
let mut ptc_sync_event_info = PtcSyncEventInfoArg {
|
||||
owner_type: EventGraphOwnerType::SceneUnit,
|
||||
owner_uid: arg.unit_uid,
|
||||
updated_events: pdkhashmap![],
|
||||
};
|
||||
|
||||
ptc_sync_event_info.updated_events.insert(
|
||||
interact_id,
|
||||
100,
|
||||
EventInfo {
|
||||
id: 100,
|
||||
cur_action_id: 101,
|
||||
action_move_path: Vec::from([101]),
|
||||
state: EventState::WaitingClient,
|
||||
prev_state: EventState::Running,
|
||||
cur_action_info: ActionInfo::None {},
|
||||
cur_action_state: ActionState::Init,
|
||||
predicated_failed_actions: phashset![],
|
||||
stack_frames: Vec::new(),
|
||||
},
|
||||
);
|
||||
|
||||
session
|
||||
.push_rpc_arg(PTC_SYNC_EVENT_INFO_ID, ptc_sync_event_info)
|
||||
.await?;
|
||||
}
|
||||
|
||||
Ok(RpcInteractWithUnitRet::new())
|
||||
}
|
||||
|
||||
|
@ -141,8 +178,6 @@ pub async fn on_rpc_save_pos_in_main_city(
|
|||
_session: &NetworkSession,
|
||||
_arg: &RpcSavePosInMainCityArg,
|
||||
) -> Result<RpcSavePosInMainCityRet> {
|
||||
tracing::info!("MainCity pos updated");
|
||||
|
||||
Ok(RpcSavePosInMainCityRet::new())
|
||||
}
|
||||
|
||||
|
@ -168,43 +203,33 @@ fn create_player(id: u64) -> PlayerInfo {
|
|||
}
|
||||
|
||||
pub async fn enter_main_city(session: &NetworkSession) -> Result<()> {
|
||||
let hall_scene_uid = session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.get_default_scene_uid()
|
||||
.await;
|
||||
let hall_scene_uid = session.context.dungeon_manager.get_default_scene_uid();
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_ENTER_SECTION_ID,
|
||||
session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.enter_scene_section(hall_scene_uid, 2)
|
||||
.await
|
||||
.unwrap(),
|
||||
.take(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_SYNC_SCENE_UNIT_ID,
|
||||
&session
|
||||
.context
|
||||
.scene_unit_manager
|
||||
.sync(hall_scene_uid, 2)
|
||||
.await,
|
||||
session.context.scene_unit_manager.sync(hall_scene_uid, 2),
|
||||
)
|
||||
.await?;
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_ENTER_SCENE_ID,
|
||||
session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.enter_main_city()
|
||||
.await?
|
||||
.enter_main_city()?
|
||||
.send_changes(session)
|
||||
.await?,
|
||||
)
|
||||
|
@ -215,97 +240,89 @@ pub async fn on_rpc_enter_world(
|
|||
session: &NetworkSession,
|
||||
_arg: &RpcEnterWorldArg,
|
||||
) -> Result<RpcEnterWorldRet> {
|
||||
let account = session.ns_prop_mgr.account_info.read().await;
|
||||
{
|
||||
let account = session.ns_prop_mgr.account_info.read();
|
||||
|
||||
let id = *account.players.as_ref().unwrap().first().unwrap(); // get first id from list
|
||||
*session.ns_prop_mgr.player_info.write().await = create_player(id);
|
||||
let player_uid = *account.players.as_ref().unwrap().first().unwrap(); // get first id from list
|
||||
session.set_cur_player(PlayerUID::from(player_uid), create_player(player_uid))?;
|
||||
}
|
||||
|
||||
let item_manager = &session.context.item_manager;
|
||||
item_manager.add_resource(501, 120).await;
|
||||
item_manager.add_resource(10, 228).await;
|
||||
item_manager.add_resource(100, 1337).await;
|
||||
item_manager.add_resource(501, 120);
|
||||
item_manager.add_resource(10, 228);
|
||||
item_manager.add_resource(100, 1337);
|
||||
|
||||
for avatar_id in data::iter_avatar_config_collection()
|
||||
.filter(|c| c.camp != 0)
|
||||
.map(|c| c.id)
|
||||
{
|
||||
item_manager.unlock_avatar(avatar_id).await;
|
||||
item_manager.unlock_avatar(avatar_id);
|
||||
}
|
||||
|
||||
for unlock_id in data::iter_unlock_config_collection().map(|c| c.id) {
|
||||
session.context.unlock_manager.unlock(unlock_id).await;
|
||||
session.context.unlock_manager.unlock(unlock_id);
|
||||
}
|
||||
|
||||
session.context.dungeon_manager.create_hall(1).await;
|
||||
session.context.scene_unit_manager.add_default_units().await;
|
||||
session.context.dungeon_manager.create_hall(1);
|
||||
session.context.scene_unit_manager.add_scene_units(2);
|
||||
|
||||
let quest_manager = session.context.quest_manager.clone();
|
||||
quest_manager
|
||||
.add_world_quest(QuestInfo::MainCity {
|
||||
id: 10020002,
|
||||
finished_count: 0,
|
||||
collection_uid: 0,
|
||||
progress: 0,
|
||||
parent_quest_id: 0,
|
||||
state: QuestState::InProgress,
|
||||
finish_condition_progress: phashmap![],
|
||||
progress_time: 2111012,
|
||||
sort_id: 1000,
|
||||
bound_npc_and_interact: phashmap![],
|
||||
})
|
||||
.await;
|
||||
quest_manager.add_world_quest(QuestInfo::MainCity {
|
||||
id: 10020002,
|
||||
finished_count: 0,
|
||||
collection_uid: 0,
|
||||
progress: 0,
|
||||
parent_quest_id: 0,
|
||||
state: QuestState::InProgress,
|
||||
finish_condition_progress: phashmap![],
|
||||
progress_time: 2111012,
|
||||
sort_id: 1000,
|
||||
bound_npc_and_interact: phashmap![],
|
||||
});
|
||||
|
||||
quest_manager
|
||||
.add_world_quest(QuestInfo::Hollow {
|
||||
id: 10010002,
|
||||
finished_count: 0,
|
||||
collection_uid: 3405096459205774,
|
||||
progress: 0,
|
||||
parent_quest_id: 0,
|
||||
state: QuestState::Ready,
|
||||
sort_id: 1001,
|
||||
statistics: phashmap![],
|
||||
statistics_ext: pdkhashmap![],
|
||||
acquired_hollow_challenge_reward: 0,
|
||||
progress_time: 0,
|
||||
finish_condition_progress: phashmap![],
|
||||
dungeon_uid: 0,
|
||||
})
|
||||
.await;
|
||||
quest_manager.add_world_quest(QuestInfo::Hollow {
|
||||
id: 10010002,
|
||||
finished_count: 0,
|
||||
collection_uid: 3405096459205774,
|
||||
progress: 0,
|
||||
parent_quest_id: 0,
|
||||
state: QuestState::Ready,
|
||||
sort_id: 1001,
|
||||
statistics: phashmap![],
|
||||
statistics_ext: pdkhashmap![],
|
||||
acquired_hollow_challenge_reward: 0,
|
||||
progress_time: 0,
|
||||
finish_condition_progress: phashmap![],
|
||||
dungeon_uid: 0,
|
||||
});
|
||||
|
||||
session
|
||||
.context
|
||||
.yorozuya_quest_manager
|
||||
.add_hollow_quest(102, HollowQuestType::SideQuest, 10010002)
|
||||
.await;
|
||||
session.context.yorozuya_quest_manager.add_hollow_quest(
|
||||
102,
|
||||
HollowQuestType::SideQuest,
|
||||
10010002,
|
||||
);
|
||||
|
||||
if CONFIGURATION.skip_tutorial {
|
||||
Box::pin(enter_main_city(session)).await?;
|
||||
} else {
|
||||
let fresh_scene_uid = *session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.create_fresh()
|
||||
.await
|
||||
.unwrap();
|
||||
let fresh_scene_uid = session.context.dungeon_manager.create_fresh().take();
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_ENTER_SCENE_ID,
|
||||
session
|
||||
.context
|
||||
.dungeon_manager
|
||||
.enter_scene(fresh_scene_uid)
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap(),
|
||||
.take(),
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
session
|
||||
.send_rpc_arg(
|
||||
.push_rpc_arg(
|
||||
PTC_SYNC_SCENE_TIME_ID,
|
||||
&PtcSyncSceneTimeArg {
|
||||
PtcSyncSceneTimeArg {
|
||||
timestamp: 3600 * 8 * 1000,
|
||||
last_timestamp: 0,
|
||||
},
|
||||
|
@ -313,6 +330,25 @@ pub async fn on_rpc_enter_world(
|
|||
.await?;
|
||||
|
||||
Ok(RpcEnterWorldRet::new(
|
||||
session.ns_prop_mgr.serialize_player_info().await,
|
||||
session.ns_prop_mgr.serialize_player_info(),
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn on_rpc_reenter_world(
|
||||
session: &NetworkSession,
|
||||
_arg: &RpcReenterWorldArg,
|
||||
) -> Result<RpcReenterWorldRet> {
|
||||
tracing::warn!("OnRpcReenterWorld: world re-entrance is not implemented yet, kicking player!");
|
||||
|
||||
session
|
||||
.push_rpc_arg(
|
||||
PTC_KICK_PLAYER_ID,
|
||||
PtcKickPlayerArg {
|
||||
reason_id: 2,
|
||||
reason_str: String::new(),
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(RpcReenterWorldRet::error(ErrorCode::Fail, Vec::new()))
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
use anyhow::Result;
|
||||
use protocol::{AccountInfo, PlayerInfo};
|
||||
use qwer::{OctData, ProtocolHeader};
|
||||
use std::collections::VecDeque;
|
||||
use std::io::Cursor;
|
||||
use std::sync::Arc;
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::sync::{Mutex, MutexGuard};
|
||||
use tokio::sync::{Mutex, MutexGuard, OnceCell};
|
||||
|
||||
use crate::game::manager::net_stream;
|
||||
use crate::game::GameContext;
|
||||
|
@ -12,11 +14,36 @@ use crate::game::GameContext;
|
|||
use super::handlers::ProtocolHandler;
|
||||
use super::{Packet, RequestBody, ResponseBody};
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct AccountUID(pub u64);
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct PlayerUID(u64);
|
||||
|
||||
impl PlayerUID {
|
||||
pub const fn new(account_uid: AccountUID, index: usize) -> Self {
|
||||
Self(account_uid.0 * 100 + index as u64)
|
||||
}
|
||||
|
||||
pub const fn from(raw: u64) -> Self {
|
||||
Self(raw)
|
||||
}
|
||||
|
||||
pub const fn raw(&self) -> u64 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
struct QueueItem(pub u16, pub Vec<u8>);
|
||||
|
||||
pub struct NetworkSession {
|
||||
client_socket: Arc<Mutex<TcpStream>>,
|
||||
cur_rpc_uid: u64,
|
||||
outgoing_rpc_queue: Mutex<VecDeque<QueueItem>>,
|
||||
pub ns_prop_mgr: net_stream::PropertyManager,
|
||||
pub context: GameContext,
|
||||
account_uid: OnceCell<AccountUID>,
|
||||
player_uid: OnceCell<PlayerUID>,
|
||||
}
|
||||
|
||||
impl NetworkSession {
|
||||
|
@ -26,8 +53,11 @@ impl NetworkSession {
|
|||
Self {
|
||||
client_socket: Arc::new(Mutex::new(client_socket)),
|
||||
cur_rpc_uid: 0,
|
||||
outgoing_rpc_queue: Mutex::new(VecDeque::new()),
|
||||
context: GameContext::new(ns_prop_mgr.player_info.clone()),
|
||||
ns_prop_mgr,
|
||||
account_uid: OnceCell::new(),
|
||||
player_uid: OnceCell::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,8 +65,26 @@ impl NetworkSession {
|
|||
self.client_socket.lock().await
|
||||
}
|
||||
|
||||
pub async fn get_player_uid(&self) -> u64 {
|
||||
self.ns_prop_mgr.player_info.read().await.uid.unwrap()
|
||||
pub fn logged_in(&self, uid: AccountUID, account: AccountInfo) -> Result<()> {
|
||||
self.account_uid.set(uid)?;
|
||||
*self.ns_prop_mgr.account_info.write() = account;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_cur_player(&self, uid: PlayerUID, player: PlayerInfo) -> Result<()> {
|
||||
self.player_uid.set(uid)?;
|
||||
*self.ns_prop_mgr.player_info.write() = player;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn account_uid(&self) -> AccountUID {
|
||||
*self.account_uid.get().unwrap()
|
||||
}
|
||||
|
||||
pub fn player_uid(&self) -> PlayerUID {
|
||||
*self.player_uid.get().unwrap()
|
||||
}
|
||||
|
||||
pub async fn run(&mut self) -> Result<()> {
|
||||
|
@ -65,13 +113,32 @@ impl NetworkSession {
|
|||
}
|
||||
}
|
||||
|
||||
pub async fn send_rpc_arg(&self, protocol_id: u16, data: &impl OctData) -> Result<()> {
|
||||
let header: Vec<u8> = ProtocolHeader::default().into();
|
||||
|
||||
pub async fn push_rpc_arg(&self, protocol_id: u16, data: impl OctData) -> Result<()> {
|
||||
let mut payload = Vec::new();
|
||||
let mut cursor = Cursor::new(&mut payload);
|
||||
data.marshal_to(&mut cursor, 0)?;
|
||||
|
||||
self.outgoing_rpc_queue
|
||||
.lock()
|
||||
.await
|
||||
.push_back(QueueItem(protocol_id, payload));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn flush_rpc_queue(&self) -> Result<()> {
|
||||
let mut queue = self.outgoing_rpc_queue.lock().await;
|
||||
|
||||
while let Some(QueueItem(protocol_id, payload)) = queue.pop_front() {
|
||||
self.send_rpc_arg(protocol_id, payload).await?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn send_rpc_arg(&self, protocol_id: u16, payload: Vec<u8>) -> Result<()> {
|
||||
let header: Vec<u8> = ProtocolHeader::default().into();
|
||||
|
||||
let body: Vec<u8> = RequestBody {
|
||||
protocol_id,
|
||||
payload,
|
||||
|
|
|
@ -7,3 +7,4 @@ version.workspace = true
|
|||
byteorder.workspace = true
|
||||
hex.workspace = true
|
||||
qwer.workspace = true
|
||||
serde.workspace = true
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[derive(OctData, Clone, Debug, PartialEq, Eq)]
|
||||
|
@ -560,7 +562,7 @@ flag! {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(OctData, Clone, Debug)]
|
||||
#[derive(OctData, Clone, Debug, Hash, PartialEq, Eq, Deserialize)]
|
||||
#[repr(i16)]
|
||||
pub enum NodeState {
|
||||
All = 0,
|
||||
|
@ -577,7 +579,7 @@ pub enum NodeState {
|
|||
EnumCount = 11,
|
||||
}
|
||||
|
||||
#[derive(OctData, Clone, Debug)]
|
||||
#[derive(OctData, Clone, Debug, Hash, PartialEq, Eq, Deserialize)]
|
||||
#[repr(i16)]
|
||||
pub enum NodeVisible {
|
||||
All = 0,
|
||||
|
@ -588,24 +590,34 @@ pub enum NodeVisible {
|
|||
EnumCount = 5,
|
||||
}
|
||||
|
||||
#[derive(OctData, Clone, Debug)]
|
||||
#[derive(OctData, Clone, Debug, Hash, PartialEq, Eq, Deserialize)]
|
||||
#[repr(i16)]
|
||||
pub enum HollowEventType {
|
||||
None = 0,
|
||||
All = 1,
|
||||
Begin = 10,
|
||||
End = 20,
|
||||
#[serde(rename = "Interact_End")]
|
||||
InteractEnd = 21,
|
||||
#[serde(rename = "Battle_End")]
|
||||
BattleEnd = 22,
|
||||
#[serde(rename = "Change_Level_Interact")]
|
||||
ChangeLevelInteract = 23,
|
||||
#[serde(rename = "Change_Level_Fight")]
|
||||
ChangeLevelFight = 24,
|
||||
Battle = 30,
|
||||
#[serde(rename = "Battle_Normal")]
|
||||
BattleNormal = 31,
|
||||
#[serde(rename = "Battle_Elite")]
|
||||
BattleElite = 32,
|
||||
#[serde(rename = "Battle_Boss")]
|
||||
BattleBoss = 33,
|
||||
Dialog = 40,
|
||||
#[serde(rename = "Dialog_Positive")]
|
||||
DialogPositive = 41,
|
||||
#[serde(rename = "Dialog_Negative")]
|
||||
DialogNegative = 42,
|
||||
#[serde(rename = "Dialog_Special")]
|
||||
DialogSpecial = 43,
|
||||
}
|
||||
|
||||
|
@ -671,7 +683,7 @@ pub enum InteractTarget {
|
|||
TriggerBox = 1,
|
||||
}
|
||||
|
||||
#[derive(OctData, Clone, Debug)]
|
||||
#[derive(OctData, Clone, Copy, Debug)]
|
||||
#[repr(i16)]
|
||||
pub enum EventGraphOwnerType {
|
||||
Scene = 0,
|
||||
|
|
|
@ -61,6 +61,9 @@ pub struct RpcLoginArg {
|
|||
pub config_sign: String,
|
||||
}
|
||||
|
||||
#[derive(OctData, Debug)]
|
||||
pub struct RpcCreatePlayerArg {}
|
||||
|
||||
#[derive(OctData, Clone, Debug)]
|
||||
pub struct PtcEnterSceneArg {
|
||||
pub player_uid: u64,
|
||||
|
@ -76,6 +79,9 @@ pub struct PtcEnterSceneArg {
|
|||
pub camera_y: u32,
|
||||
}
|
||||
|
||||
#[derive(OctData, Clone, Debug)]
|
||||
pub struct RpcReenterWorldArg {}
|
||||
|
||||
#[derive(OctData, Clone, Debug)]
|
||||
pub struct RpcEnterWorldArg {}
|
||||
|
||||
|
@ -343,15 +349,29 @@ pub struct PtcSyncSceneTimeArg {
|
|||
pub last_timestamp: u64,
|
||||
}
|
||||
|
||||
#[derive(OctData, Debug)]
|
||||
pub struct PtcKickPlayerArg {
|
||||
pub reason_id: i32,
|
||||
pub reason_str: String,
|
||||
}
|
||||
|
||||
ret! {
|
||||
struct RpcLoginRet {
|
||||
account_info: PropertyBlob,
|
||||
}
|
||||
|
||||
struct RpcCreatePlayerRet {
|
||||
player_uid: u64,
|
||||
}
|
||||
|
||||
struct RpcEnterWorldRet {
|
||||
player_info: PropertyBlob,
|
||||
}
|
||||
|
||||
struct RpcReenterWorldRet {
|
||||
player_info: PropertyBlob,
|
||||
}
|
||||
|
||||
struct RpcGetPlayerMailsRet {
|
||||
mail_count: u32, // Actually List<CPlayerMailInfo>, TODO!
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue