| @@ -28,8 +28,8 @@ namespace Constants | |||
| SCCI int basicEncourageSpeed = 100; | |||
| SCCI int basicFixSpeed = 123; | |||
| SCCI int basicSpeedOfOpeningOrLocking = 4000; | |||
| SCCI int basicStudentSpeedOfClimbingThroughWindows = 611; | |||
| SCCI int basicTrickerSpeedOfClimbingThroughWindows = 1270; | |||
| SCCI int basicStudentSpeedOfClimbingThroughWindows = 1222; | |||
| SCCI int basicTrickerSpeedOfClimbingThroughWindows = 2540; | |||
| SCCI int basicSpeedOfOpenChest = 1000; | |||
| SCCI int basicHp = 3000000; | |||
| @@ -37,8 +37,8 @@ namespace Constants | |||
| SCCI int basicEncouragementDegree = 1500000; | |||
| SCCI int basicTimeOfRouse = 1000; | |||
| SCCI int basicStudentSpeed = 1270; | |||
| SCCI int basicTrickerSpeed = 1504; | |||
| SCCI int basicStudentSpeed = 3000; | |||
| SCCI int basicTrickerSpeed = 3600; | |||
| SCCI double basicConcealment = 1; | |||
| SCCI int basicStudentAlertnessRadius = 15 * numOfGridPerCell; | |||
| @@ -58,10 +58,10 @@ namespace Constants | |||
| SCCI int basicRecoveryFromHit = 3700; // 基本命中攻击恢复时长 | |||
| SCCI int basicStunnedTimeOfStudent = 4300; | |||
| SCCI int basicBulletMoveSpeed = 3700; // 基本子弹移动速度 | |||
| SCCI double basicRemoteAttackRange = 3000; // 基本远程攻击范围 | |||
| SCCI double basicAttackShortRange = 1100; // 基本近程攻击范围 | |||
| SCCI double basicBulletBombRange = 1000; // 基本子弹爆炸范围 | |||
| SCCI int basicBulletMoveSpeed = 7400; // 基本子弹移动速度 | |||
| SCCI double basicRemoteAttackRange = 6000; // 基本远程攻击范围 | |||
| SCCI double basicAttackShortRange = 2200; // 基本近程攻击范围 | |||
| SCCI double basicBulletBombRange = 2000; // 基本子弹爆炸范围 | |||
| // 道具相关 | |||
| @@ -16,18 +16,14 @@ | |||
| #include <google/protobuf/port_def.inc> | |||
| PROTOBUF_PRAGMA_INIT_SEG | |||
| namespace _pb = ::PROTOBUF_NAMESPACE_ID; | |||
| namespace _pbi = _pb::internal; | |||
| namespace protobuf | |||
| { | |||
| } // namespace protobuf | |||
| static const ::_pb::EnumDescriptor* file_level_enum_descriptors_MessageType_2eproto[11]; | |||
| static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_MessageType_2eproto = nullptr; | |||
| static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_MessageType_2eproto[11]; | |||
| static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_MessageType_2eproto = nullptr; | |||
| const uint32_t TableStruct_MessageType_2eproto::offsets[1] = {}; | |||
| static constexpr ::_pbi::MigrationSchema* schemas = nullptr; | |||
| static constexpr ::_pb::Message* const* file_default_instances = nullptr; | |||
| static constexpr ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema* schemas = nullptr; | |||
| static constexpr ::PROTOBUF_NAMESPACE_ID::Message* const* file_default_instances = nullptr; | |||
| const char descriptor_table_protodef_MessageType_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = | |||
| "\n\021MessageType.proto\022\010protobuf*\202\001\n\nBullet" | |||
| @@ -86,13 +82,13 @@ const ::_pbi::DescriptorTable descriptor_table_MessageType_2eproto = { | |||
| file_level_enum_descriptors_MessageType_2eproto, | |||
| file_level_service_descriptors_MessageType_2eproto, | |||
| }; | |||
| PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_MessageType_2eproto_getter() | |||
| PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_MessageType_2eproto_getter() | |||
| { | |||
| return &descriptor_table_MessageType_2eproto; | |||
| } | |||
| // Force running AddDescriptors() at dynamic initialization time. | |||
| PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_MessageType_2eproto(&descriptor_table_MessageType_2eproto); | |||
| PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_MessageType_2eproto(&descriptor_table_MessageType_2eproto); | |||
| namespace protobuf | |||
| { | |||
| const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* BulletType_descriptor() | |||
| @@ -8,12 +8,12 @@ | |||
| #include <string> | |||
| #include <google/protobuf/port_def.inc> | |||
| #if PROTOBUF_VERSION < 3021000 | |||
| #if PROTOBUF_VERSION < 3019000 | |||
| #error This file was generated by a newer version of protoc which is | |||
| #error incompatible with your Protocol Buffer headers. Please update | |||
| #error your headers. | |||
| #endif | |||
| #if 3021005 < PROTOBUF_MIN_PROTOC_VERSION | |||
| #if 3019004 < PROTOBUF_MIN_PROTOC_VERSION | |||
| #error This file was generated by an older version of protoc which is | |||
| #error incompatible with your Protocol Buffer headers. Please | |||
| #error regenerate this file with a newer version of protoc. | |||
| @@ -23,6 +23,7 @@ | |||
| #include <google/protobuf/io/coded_stream.h> | |||
| #include <google/protobuf/arena.h> | |||
| #include <google/protobuf/arenastring.h> | |||
| #include <google/protobuf/generated_message_table_driven.h> | |||
| #include <google/protobuf/generated_message_util.h> | |||
| #include <google/protobuf/metadata_lite.h> | |||
| #include <google/protobuf/generated_message_reflection.h> | |||
| @@ -42,6 +43,11 @@ PROTOBUF_NAMESPACE_CLOSE | |||
| // Internal implementation detail -- do not use these members. | |||
| struct TableStruct_MessageType_2eproto | |||
| { | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] PROTOBUF_SECTION_VARIABLE(protodesc_cold); | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; | |||
| static const uint32_t offsets[]; | |||
| }; | |||
| extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_MessageType_2eproto; | |||
| @@ -16,18 +16,14 @@ | |||
| #include <google/protobuf/port_def.inc> | |||
| PROTOBUF_PRAGMA_INIT_SEG | |||
| namespace _pb = ::PROTOBUF_NAMESPACE_ID; | |||
| namespace _pbi = _pb::internal; | |||
| namespace protobuf | |||
| { | |||
| } // namespace protobuf | |||
| static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_Services_2eproto = nullptr; | |||
| static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_Services_2eproto = nullptr; | |||
| static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_Services_2eproto = nullptr; | |||
| static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_Services_2eproto = nullptr; | |||
| const uint32_t TableStruct_Services_2eproto::offsets[1] = {}; | |||
| static constexpr ::_pbi::MigrationSchema* schemas = nullptr; | |||
| static constexpr ::_pb::Message* const* file_default_instances = nullptr; | |||
| static constexpr ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema* schemas = nullptr; | |||
| static constexpr ::PROTOBUF_NAMESPACE_ID::Message* const* file_default_instances = nullptr; | |||
| const char descriptor_table_protodef_Services_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = | |||
| "\n\016Services.proto\022\010protobuf\032\025Message2Clie" | |||
| @@ -58,12 +54,12 @@ const char descriptor_table_protodef_Services_2eproto[] PROTOBUF_SECTION_VARIABL | |||
| "tOpenChest\022\017.protobuf.IDMsg\032\021.protobuf.B" | |||
| "oolRes\0222\n\014EndAllAction\022\017.protobuf.IDMsg\032" | |||
| "\021.protobuf.BoolResb\006proto3"; | |||
| static const ::_pbi::DescriptorTable* const descriptor_table_Services_2eproto_deps[2] = { | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* const descriptor_table_Services_2eproto_deps[2] = { | |||
| &::descriptor_table_Message2Clients_2eproto, | |||
| &::descriptor_table_Message2Server_2eproto, | |||
| }; | |||
| static ::_pbi::once_flag descriptor_table_Services_2eproto_once; | |||
| const ::_pbi::DescriptorTable descriptor_table_Services_2eproto = { | |||
| static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_Services_2eproto_once; | |||
| const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_Services_2eproto = { | |||
| false, | |||
| false, | |||
| 1106, | |||
| @@ -80,13 +76,13 @@ const ::_pbi::DescriptorTable descriptor_table_Services_2eproto = { | |||
| file_level_enum_descriptors_Services_2eproto, | |||
| file_level_service_descriptors_Services_2eproto, | |||
| }; | |||
| PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_Services_2eproto_getter() | |||
| PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_Services_2eproto_getter() | |||
| { | |||
| return &descriptor_table_Services_2eproto; | |||
| } | |||
| // Force running AddDescriptors() at dynamic initialization time. | |||
| PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_Services_2eproto(&descriptor_table_Services_2eproto); | |||
| PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_Services_2eproto(&descriptor_table_Services_2eproto); | |||
| namespace protobuf | |||
| { | |||
| @@ -8,12 +8,12 @@ | |||
| #include <string> | |||
| #include <google/protobuf/port_def.inc> | |||
| #if PROTOBUF_VERSION < 3021000 | |||
| #if PROTOBUF_VERSION < 3019000 | |||
| #error This file was generated by a newer version of protoc which is | |||
| #error incompatible with your Protocol Buffer headers. Please update | |||
| #error your headers. | |||
| #endif | |||
| #if 3021005 < PROTOBUF_MIN_PROTOC_VERSION | |||
| #if 3019004 < PROTOBUF_MIN_PROTOC_VERSION | |||
| #error This file was generated by an older version of protoc which is | |||
| #error incompatible with your Protocol Buffer headers. Please | |||
| #error regenerate this file with a newer version of protoc. | |||
| @@ -23,6 +23,7 @@ | |||
| #include <google/protobuf/io/coded_stream.h> | |||
| #include <google/protobuf/arena.h> | |||
| #include <google/protobuf/arenastring.h> | |||
| #include <google/protobuf/generated_message_table_driven.h> | |||
| #include <google/protobuf/generated_message_util.h> | |||
| #include <google/protobuf/metadata_lite.h> | |||
| #include <google/protobuf/generated_message_reflection.h> | |||
| @@ -43,6 +44,11 @@ PROTOBUF_NAMESPACE_CLOSE | |||
| // Internal implementation detail -- do not use these members. | |||
| struct TableStruct_Services_2eproto | |||
| { | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] PROTOBUF_SECTION_VARIABLE(protodesc_cold); | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; | |||
| static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; | |||
| static const uint32_t offsets[]; | |||
| }; | |||
| extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_Services_2eproto; | |||
| @@ -27,8 +27,8 @@ class Constants(NoInstance): | |||
| basicEncourageSpeed = 100 | |||
| basicLearnSpeed = 123 | |||
| basicSpeedOfOpeningOrLocking = 4000 | |||
| basicStudentSpeedOfClimbingThroughWindows = 611 | |||
| basicTrickerSpeedOfClimbingThroughWindows = 1270 | |||
| basicStudentSpeedOfClimbingThroughWindows = 1222 | |||
| basicTrickerSpeedOfClimbingThroughWindows = 2540 | |||
| basicSpeedOfOpenChest = 1000 | |||
| basicHp = 3000000 | |||
| @@ -36,8 +36,8 @@ class Constants(NoInstance): | |||
| basicEncouragementDegree = 1500000 | |||
| basicTimeOfRouse = 1000 | |||
| basicStudentSpeed = 1270 | |||
| basicTrickerSpeed = 1504 | |||
| basicStudentSpeed = 3000 | |||
| basicTrickerSpeed = 3600 | |||
| basicConcealment = 1.0 | |||
| basicStudentAlertnessRadius = 15 * numOfGridPerCell | |||
| @@ -57,10 +57,10 @@ class Constants(NoInstance): | |||
| basicRecoveryFromHit = 3700 # 基本命中攻击恢复时长 | |||
| basicStunnedTimeOfStudent = 4300 | |||
| basicBulletmoveSpeed = 3700 # 基本子弹移动速度 | |||
| basicRemoteAttackRange = 3000 # 基本远程攻击范围 | |||
| basicAttackShortRange = 1100 # 基本近程攻击范围 | |||
| basicBulletBombRange = 1000 # 基本子弹爆炸范围 | |||
| basicBulletmoveSpeed = 7400 # 基本子弹移动速度 | |||
| basicRemoteAttackRange = 6000 # 基本远程攻击范围 | |||
| basicAttackShortRange = 2200 # 基本近程攻击范围 | |||
| basicBulletBombRange = 2000 # 基本子弹爆炸范围 | |||
| # 道具相关 | |||
| @@ -84,10 +84,10 @@ class Constants(NoInstance): | |||
| addedTimeOfSpeedWhenInspire = 1.6 | |||
| timeOfAddingSpeedWhenInspire = 6000 | |||
| addHpWhenEncourage = basicHp / 4; | |||
| addHpWhenEncourage = basicHp / 4 | |||
| checkIntervalWhenShowTime = 200; | |||
| addAddictionPer100msWhenShowTime = 300; | |||
| checkIntervalWhenShowTime = 200 | |||
| addAddictionPer100msWhenShowTime = 300 | |||
| class Assassin: | |||
| @@ -8,31 +8,37 @@ RUN apt-get update && apt-get install --no-install-recommends -y gcc g++ make wg | |||
| RUN git clone -b v1.46.3 --depth 1 --shallow-submodules https://gitee.com/mirrors/grpc.git | |||
| RUN wget -P . https://cloud.tsinghua.edu.cn/f/1f2713efd9e44255abd6/?dl=1 | |||
| RUN mv 'index.html?dl=1' third_party.tar.gz | |||
| RUN cd grpc | |||
| WORKDIR /usr/local/grpc | |||
| RUN rm -rf third_party | |||
| RUN mv ../third_party.tar.gz . | |||
| RUN tar -zxvf third_party.tar.gz | |||
| RUN mkdir -p cmake/build | |||
| RUN pushd cmake/build | |||
| WORKDIR /usr/local/grpc/cmake/build | |||
| RUN cmake -DgRPC_INSTALL=ON \ | |||
| -DgRPC_BUILD_TESTS=OFF \ | |||
| ../.. | |||
| RUN make -j$(nproc) | |||
| RUN make install | |||
| RUN popd | |||
| #安装protobuf | |||
| RUN cd /usr/local | |||
| WORKDIR /usr/local | |||
| RUN git clone https://gitee.com/mirrors/protobuf_source.git ./protobuf | |||
| RUN cd protobuf | |||
| RUN git checkout 3.22.1 | |||
| RUN ./autogen.sh | |||
| WORKDIR /usr/local/protobuf | |||
| RUN git checkout 3.20.x | |||
| RUN ./autogen.sh | |||
| RUN ./configure | |||
| RUN make -j$(nproc) | |||
| RUN make install | |||
| RUN ldconfig | |||
| #RUN git submodule update --init --recursive | |||
| #RUN cmake . | |||
| #RUN cmake --build . --parallel 10 | |||
| #RUN make install | |||
| COPY ./CAPI /usr/local/PlayerCode | |||
| RUN cd /usr/local/PlayerCode/CAPI | |||
| RUN cmake CMakeLists.txt | |||
| COPY ./CAPI /usr/local/PlayerCode/CAPI | |||
| COPY ./dependency /usr/local/PlayerCode/dependency | |||
| WORKDIR /usr/local/PlayerCode/dependency/proto | |||
| RUN ./cpp_output.sh | |||
| WORKDIR /usr/local/PlayerCode/CAPI/cpp | |||
| RUN cmake ./CMakeLists.txt | |||
| RUN make | |||
| @@ -0,0 +1,38 @@ | |||
| #! /bin/bash | |||
| workdir=/d/伤风/软件部/MyTHUAI6/THUAI6/logic | |||
| targetdir=/d/伤风/软件部/THUAI6-毕业吧少女 | |||
| mkdir -p ${targetdir} | |||
| pushd ${targetdir} | |||
| mkdir -p win/win64 | |||
| mkdir -p linux/linux64/ | |||
| mkdir -p win/win64/Debug/ | |||
| mkdir -p linux/linux64/Debug/ | |||
| popd | |||
| pushd ${workdir} | |||
| pushd Server/bin/Release/net6.0/linux-x64/publish | |||
| rm *.pdb | |||
| cp -rf * ${targetdir}/linux/linux64/ | |||
| popd | |||
| pushd Server/bin/Debug/net6.0/linux-x64/publish | |||
| cp -rf * ${targetdir}/linux/linux64/Debug/ | |||
| popd | |||
| pushd Server/bin/Debug/net6.0/win-x64/publish | |||
| cp -rf * ${targetdir}/win/win64/Debug/ | |||
| popd | |||
| pushd Server/bin/Release/net6.0/win-x64/publish | |||
| rm *.pdb | |||
| cp -rf * ${targetdir}/win/win64/ | |||
| popd | |||
| pushd Client/bin/Release/net6.0-windows/win-x64/publish | |||
| rm *.pdb | |||
| cp -rf * ${targetdir}/win/win64/ | |||
| popd | |||
| @@ -292,8 +292,8 @@ namespace Downloader | |||
| public static string dataPath = ""; // C盘的文档文件夹 | |||
| public Data(string path) | |||
| { | |||
| // dataPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); | |||
| dataPath = new DirectoryInfo(".").FullName; | |||
| dataPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); | |||
| //dataPath = new DirectoryInfo(".").FullName; | |||
| Data.path = System.IO.Path.Combine(dataPath, "THUAI6.json"); | |||
| if (File.Exists(Data.path)) | |||
| { | |||
| @@ -397,8 +397,9 @@ namespace Downloader | |||
| .Build(); // 创建 CosXmlConfig 对象 | |||
| // 永久密钥访问凭证 | |||
| string secretId = "***"; //"云 API 密钥 SecretId"; | |||
| string secretKey = "***"; //"云 API 密钥 SecretKey"; | |||
| string secretId = "***"; //"云 API 密钥 SecretId"; | |||
| string secretKey = "***"; //"云 API 密钥 SecretKey"; | |||
| long durationSecond = 1000; // 每次请求签名有效时长,单位为秒 | |||
| QCloudCredentialProvider cosCredentialProvider = new DefaultQCloudCredentialProvider( | |||
| @@ -515,11 +516,14 @@ namespace Downloader | |||
| Dictionary<string, string> jsonDict = JsonConvert.DeserializeObject<Dictionary<string, string>>(json); | |||
| foreach (KeyValuePair<string, string> pair in jsonDict) | |||
| { | |||
| MD5 = GetFileMd5Hash(System.IO.Path.Combine(Data.FilePath, pair.Key)); | |||
| if (MD5.Length == 0) // 文档不存在 | |||
| newFileName.Add(pair.Key); | |||
| else if (MD5 != pair.Value) // MD5不匹配 | |||
| updateFileName.Add(pair.Key); | |||
| if (System.IO.Path.GetFileName(pair.Key) != "AI.cpp" && System.IO.Path.GetFileName(pair.Key) != "AI.py") | |||
| { | |||
| MD5 = GetFileMd5Hash(System.IO.Path.Combine(Data.FilePath, pair.Key)); | |||
| if (MD5.Length == 0) // 文档不存在 | |||
| newFileName.Add(pair.Key); | |||
| else if (MD5 != pair.Value) // MD5不匹配 | |||
| updateFileName.Add(pair.Key); | |||
| } | |||
| } | |||
| newFile = newFileName.Count; | |||
| @@ -817,7 +821,7 @@ namespace Downloader | |||
| } | |||
| foreach (FileInfo file in player.GetFiles()) | |||
| { | |||
| if (file.Name == "README.md") | |||
| if (file.Name == "AI.cpp" || file.Name == "AI.py") | |||
| { | |||
| continue; | |||
| } | |||
| @@ -1120,7 +1124,7 @@ namespace WebConnect | |||
| try | |||
| { | |||
| string content; | |||
| client.DefaultRequestHeaders.Authorization = new("bearertoken", logintoken); | |||
| client.DefaultRequestHeaders.Authorization = new("Bearer", logintoken); | |||
| if (!File.Exists(tarfile)) | |||
| { | |||
| //Console.WriteLine("文件不存在!"); | |||
| @@ -1290,6 +1294,125 @@ namespace WebConnect | |||
| Console.WriteLine("写入token.dat发生冲突!请检查token.dat是否被其它程序占用!"); | |||
| } | |||
| } | |||
| public static int WriteUserEmail(string email) | |||
| { | |||
| try | |||
| { | |||
| string savepath = System.IO.Path.Combine(Data.dataPath, "THUAI6.json"); | |||
| FileStream fs = new FileStream(savepath, FileMode.Open, FileAccess.ReadWrite); | |||
| StreamReader sr = new StreamReader(fs); | |||
| string json = sr.ReadToEnd(); | |||
| if (json == null || json == "") | |||
| { | |||
| json += @"{""THUAI6""" + ":" + @"""2023""}"; | |||
| } | |||
| Dictionary<string, string> dict = new Dictionary<string, string>(); | |||
| dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(json); | |||
| if (!dict.ContainsKey("email")) | |||
| { | |||
| dict.Add("email", email); | |||
| } | |||
| else | |||
| { | |||
| dict["email"] = email; | |||
| } | |||
| sr.Close(); | |||
| fs.Close(); | |||
| FileStream fs2 = new FileStream(savepath, FileMode.Open, FileAccess.ReadWrite); | |||
| StreamWriter sw = new StreamWriter(fs2); | |||
| sw.WriteLine(JsonConvert.SerializeObject(dict)); | |||
| sw.Close(); | |||
| fs2.Close(); | |||
| return 0;//成功 | |||
| } | |||
| catch | |||
| { | |||
| return -1;//失败 | |||
| } | |||
| } | |||
| public static int WriteUserPassword(string password) | |||
| { | |||
| try | |||
| { | |||
| string savepath = System.IO.Path.Combine(Data.dataPath, "THUAI6.json"); | |||
| FileStream fs = new FileStream(savepath, FileMode.Open, FileAccess.ReadWrite); | |||
| StreamReader sr = new StreamReader(fs); | |||
| string json = sr.ReadToEnd(); | |||
| if (json == null || json == "") | |||
| { | |||
| json += @"{""THUAI6""" + ":" + @"""2023""}"; | |||
| } | |||
| Dictionary<string, string> dict = new Dictionary<string, string>(); | |||
| dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(json); | |||
| if (!dict.ContainsKey("password")) | |||
| { | |||
| dict.Add("password", password); | |||
| } | |||
| else | |||
| { | |||
| dict["password"] = password; | |||
| } | |||
| sr.Close(); | |||
| fs.Close(); | |||
| FileStream fs2 = new FileStream(savepath, FileMode.Open, FileAccess.ReadWrite); | |||
| StreamWriter sw = new StreamWriter(fs2); | |||
| sw.WriteLine(JsonConvert.SerializeObject(dict)); | |||
| sw.Close(); | |||
| fs2.Close(); | |||
| return 0;//成功 | |||
| } | |||
| catch | |||
| { | |||
| return -1;//失败,THUAI6.json 文件不存在或者已被占用 | |||
| } | |||
| } | |||
| public static string ReadUserPassword() | |||
| { | |||
| try | |||
| { | |||
| string savepath = System.IO.Path.Combine(Data.dataPath, "THUAI6.json"); | |||
| FileStream fs = new FileStream(savepath, FileMode.Open, FileAccess.Read); | |||
| StreamReader sr = new StreamReader(fs); | |||
| string json = sr.ReadToEnd(); | |||
| Dictionary<string, string> dict = new Dictionary<string, string>(); | |||
| if (json == null || json == "") | |||
| { | |||
| json += @"{""THUAI6""" + ":" + @"""2023""}"; | |||
| } | |||
| dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(json); | |||
| return dict["password"]; | |||
| } | |||
| catch | |||
| { | |||
| return null; //文件不存在或者已被占用 | |||
| } | |||
| } | |||
| public static string ReadUserEmail() | |||
| { | |||
| try | |||
| { | |||
| string savepath = System.IO.Path.Combine(Data.dataPath, "THUAI6.json"); | |||
| FileStream fs = new FileStream(savepath, FileMode.Open, FileAccess.Read); | |||
| StreamReader sr = new StreamReader(fs); | |||
| string json = sr.ReadToEnd(); | |||
| Dictionary<string, string> dict = new Dictionary<string, string>(); | |||
| if (json == null || json == "") | |||
| { | |||
| json += @"{""THUAI6""" + ":" + @"""2023""}"; | |||
| } | |||
| dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(json); | |||
| return dict["email"]; | |||
| } | |||
| catch | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| public bool ReadToken() // 读取token | |||
| { | |||
| try | |||
| @@ -19,9 +19,11 @@ namespace starter.viewmodel.settings | |||
| /// <summary> | |||
| /// initializer | |||
| /// </summary> | |||
| public SettingsViewModel() | |||
| { | |||
| //Program.Tencent_cos_download.UpdateHash(); | |||
| //WebConnect.Web.WriteUserEmail("wangsk21@mails.tsinghua.edu.cn"); | |||
| if (Downloader.Program.Tencent_cos_download.CheckAlreadyDownload()) | |||
| { | |||
| obj.checkUpdate(); | |||
| @@ -558,7 +560,10 @@ namespace starter.viewmodel.settings | |||
| { | |||
| clickBackCommand = new BaseCommand(new Action<object>(o => | |||
| { | |||
| Status = SettingsModel.Status.login; | |||
| if (Downloader.Program.Tencent_cos_download.CheckAlreadyDownload()) | |||
| Status = SettingsModel.Status.login; | |||
| else | |||
| Status = SettingsModel.Status.newUser; | |||
| })); | |||
| } | |||
| return clickBackCommand; | |||
| @@ -657,6 +662,21 @@ namespace starter.viewmodel.settings | |||
| return clickReselectCommand; | |||
| } | |||
| } | |||
| private BaseCommand clickExitCommand; | |||
| public BaseCommand ClickExitCommand | |||
| { | |||
| get | |||
| { | |||
| if (clickExitCommand == null) | |||
| { | |||
| clickExitCommand = new BaseCommand(new Action<object>(o => | |||
| { | |||
| System.Windows.Application.Current.Shutdown(); | |||
| })); | |||
| } | |||
| return clickExitCommand; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -1,5 +1,5 @@ | |||
| # 规则 | |||
| V4.7 | |||
| V4.8 | |||
| - [规则](#规则) | |||
| - [简则](#简则) | |||
| - [地图](#地图) | |||
| @@ -62,7 +62,7 @@ $$ | |||
| ### 人物 | |||
| - 人物半径为800 | |||
| - 人物共有17种不可叠加的状态: | |||
| 1. (可)移动状态Idel | |||
| 1. (可)移动状态 Idel | |||
| 2. 学习 Learning | |||
| 3. 被勉励 Encouraged | |||
| 4. 在勉励 Encouraging | |||
| @@ -87,10 +87,10 @@ $$ | |||
| | 攻击(子弹)类型 |搞蛋鬼的一般攻击CommonAttackOfGhost| 飞刀FlyingKnife | 蹦蹦炸弹BombBomb | 小炸弹JumpyDumpty | | |||
| | :------------ | :--------------------- | :--------------------- | :--------------------- | :--------------------- | | |||
| | 子弹爆炸范围 | 0 | 0 | 1000 | 500 | | |||
| | 子弹攻击距离 | 1100 | 39000 | 1100 | 2200 | | |||
| | 攻击力 | 1500000 | 1200000 | 1,800,000 | 900000 | | |||
| | 移动速度/s | 3700 | 9250 | 3000 | 4300 | | |||
| | 子弹爆炸范围 | 0 | 0 | 2000 | 1000 | | |||
| | 子弹攻击距离 | 2200 | 78000 | 2200 | 4400 | | |||
| | 攻击力 | 1500000 | 1200000 | 1800000 | 900000 | | |||
| | 移动速度/s | 7400 | 18500 | 6000 | 8600 | | |||
| | 前摇(ms) | 297 | 400 | 366 | - | | |||
| |未攻击至目标时的后摇(ms)| 800 | 0 | 3700 | - | | |||
| |攻击至目标时的后摇(ms)| 3700 | 0 | 3700 | - | | |||
| @@ -180,12 +180,12 @@ $$ | |||
| | 捣蛋鬼职业 | Assassin | Klee | 喧哗者ANoisyPerson | Idol | | |||
| | :------------ | :--------------------- | :--------------------- | :--------------------- | :--------------------- | | |||
| | 移动速度/s | 1980 | 1800 | 1926 | 1,800 | | |||
| | 移动速度/s | 3960 | 3600 | 3852 | 3600 | | |||
| | 隐蔽度 | 1.5 | 1 | 0.8 | 0.75| | |||
| | 警戒范围 | 22,100 | 17000 | 15300 | 17000 | |||
| | 视野范围 | 15600 | 13000 | 13000 | 14300| | |||
| | 开锁门速度 | 4000 | 4000 | 4000 |4000 | | |||
| | 翻窗速度 | 1270 | 1270 | 1,397 | 1270| | |||
| | 翻窗速度 | 2540 | 2540 | 2794 | 2540| | |||
| | 翻箱速度 | 1000 | 1100 | 1000 |1000| | |||
| #### Assassin | |||
| @@ -234,7 +234,7 @@ $$ | |||
| | 学生职业 | 教师Teacher | 健身狂Athlete | 学霸StraightAStudent | 开心果Sunshine | | |||
| | :------------ | :--------------------- | :--------------------- | :--------------------- | :--------------------- | | |||
| | 移动速度 | 1350 | 1575 | 1440 | 1500 | | |||
| | 移动速度 | 2700 | 3150 | 2880 | 3000 | | |||
| | 最大毅力值 | 30000000 | 3000000 | 3300000 | 3200000 | | |||
| | 最大沉迷度 | 600000 | 54,000 | 78,000 | 66,000 | | |||
| | 学习一科速度 | 0 | 73 | 135 | 123 | | |||
| @@ -243,7 +243,7 @@ $$ | |||
| | 警戒范围 | 7500 | 15000 | 13,500 | 15000 | | |||
| | 视野范围 | 9,000 | 11000 | 9,000 | 10000 | | |||
| | 开锁门速度 | 4000 | 4000 | 4000 | 2800 | | |||
| | 翻窗速度 | 635 | 1,524 | 1,058 | 1270 | | |||
| | 翻窗速度 | 1270 | 3048 | 2116 | 2540 | | |||
| | 翻箱速度 | 1000 | 1000 | 1000 | 900 | | |||
| #### 运动员 | |||
| @@ -93,8 +93,8 @@ namespace Preparation.Utility | |||
| public const int basicTreatSpeed = 100; | |||
| public const int basicFixSpeed = 123; | |||
| public const int basicSpeedOfOpeningOrLocking = 4000; | |||
| public const int basicStudentSpeedOfClimbingThroughWindows = 611; | |||
| public const int basicGhostSpeedOfClimbingThroughWindows = 1270; | |||
| public const int basicStudentSpeedOfClimbingThroughWindows = 1222; | |||
| public const int basicGhostSpeedOfClimbingThroughWindows = 2540; | |||
| public const int basicSpeedOfOpenChest = 1000; | |||
| public const int basicHp = 3000000; // 初始血量 | |||
| @@ -105,9 +105,9 @@ namespace Preparation.Utility | |||
| public const int basicTimeOfRescue = 1000; | |||
| #if DEBUG | |||
| public const int basicStudentMoveSpeed = 9000;// 基本移动速度,单位:s-1 | |||
| public const int basicStudentMoveSpeed = 3000;// 基本移动速度,单位:s-1 | |||
| #else | |||
| public const int basicStudentMoveSpeed = 1500; | |||
| public const int basicStudentMoveSpeed = 3000; | |||
| #endif | |||
| public const int basicGhostMoveSpeed = (int)(basicStudentMoveSpeed * 1.2); | |||
| @@ -200,10 +200,10 @@ namespace Preparation.Utility | |||
| public const int basicRecoveryFromHit = 3700;//基本命中攻击恢复时长 | |||
| public const int basicStunnedTimeOfStudent = 4300; | |||
| public const int basicBulletMoveSpeed = 3700; // 基本子弹移动速度,单位:s-1 | |||
| public const double basicRemoteAttackRange = 3000; // 基本远程攻击范围 | |||
| public const double basicAttackShortRange = 1100; // 基本近程攻击范围 | |||
| public const double basicBulletBombRange = 1000; // 基本子弹爆炸范围 | |||
| public const int basicBulletMoveSpeed = 7400; // 基本子弹移动速度,单位:s-1 | |||
| public const double basicRemoteAttackRange = 6000; // 基本远程攻击范围 | |||
| public const double basicAttackShortRange = 2200; // 基本近程攻击范围 | |||
| public const double basicBulletBombRange = 2000; // 基本子弹爆炸范围 | |||
| #endregion | |||
| #region 技能相关 | |||
| public const int maxNumOfSkill = 3; | |||