Skip to content

Commit

Permalink
Dice2.4.0beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
w4123 committed Jun 6, 2020
1 parent 30c7462 commit 87276a6
Show file tree
Hide file tree
Showing 21 changed files with 1,632 additions and 34 deletions.
3 changes: 0 additions & 3 deletions CQSDKCPP/CQAPI_EX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ std::map<long long, FriendInfo> CQ::getFriendList() noexcept {
FriendInfo info(pack.getUnpack()); //读取
ret[info.QQID] = info; //写入map
}
std::ofstream fout("friendinfo.log", std::ios::out | std::ios::app);
fout << "friend add" << std::endl;
fout.close();
return ret;
}
bool CQ::canSendImage() noexcept
Expand Down
27 changes: 24 additions & 3 deletions Dice/BlackListManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,14 @@ int DDBlackManager::find(const DDBlackMark& mark) {
}
else {
unordered_set<unsigned int> sInter;
std::set_intersection(sRange.begin(), sRange.end(), sTimeRange.begin(), sTimeRange.end(), std::inserter(sInter, sInter.begin()));
for (const auto& item : sRange)
{
if (sTimeRange.count(item))
{
sInter.insert(item);
}
}
//std::set_intersection(sRange.begin(), sRange.end(), sTimeRange.begin(), sTimeRange.end(), std::inserter(sInter, sInter.begin()));
if (sInter.empty())return -1;
sRange.swap(sInter);
}
Expand All @@ -380,7 +387,14 @@ int DDBlackManager::find(const DDBlackMark& mark) {
}
else {
unordered_set<unsigned int> sInter;
std::set_intersection(sRange.begin(), sRange.end(), sGroupRange.begin(), sGroupRange.end(), std::inserter(sInter, sInter.begin()));
for(const auto& item: sRange)
{
if(sGroupRange.count(item))
{
sInter.insert(item);
}
}
//std::set_intersection(sRange.begin(), sRange.end(), sGroupRange.begin(), sGroupRange.end(), std::inserter(sInter, sInter.begin()));
if (sInter.empty())return -1;
sRange.swap(sInter);
}
Expand All @@ -397,7 +411,14 @@ int DDBlackManager::find(const DDBlackMark& mark) {
}
else {
unordered_set<unsigned int> sInter;
std::set_intersection(sRange.begin(), sRange.end(), sQQRange.begin(), sQQRange.end(), std::inserter(sInter, sInter.begin()));
for (const auto& item : sRange)
{
if (sQQRange.count(item))
{
sInter.insert(item);
}
}
//std::set_intersection(sRange.begin(), sRange.end(), sQQRange.begin(), sQQRange.end(), std::inserter(sInter, sInter.begin()));
if (sInter.empty())return -1;
sRange.swap(sInter);
}
Expand Down
5 changes: 5 additions & 0 deletions Dice/Dice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "CharacterCard.h"
#include "DiceEvent.h"
#include "DiceSession.h"
#include "DiceGUI.h"

#pragma warning(disable:4996)
#pragma warning(disable:6031)
Expand Down Expand Up @@ -756,6 +757,10 @@ EVE_Menu(eventMasterMode) {
return 0;
}

EVE_Menu(eventGUI) {
return GUIMain();
}

EVE_Disable(eventDisable)
{
Enabled = false;
Expand Down
Binary file added Dice/Dice.ico
Binary file not shown.
41 changes: 40 additions & 1 deletion Dice/Dice.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;DICE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ExceptionHandling>SyncCThrow</ExceptionHandling>
<ExceptionHandling>Sync</ExceptionHandling>
<WholeProgramOptimization>true</WholeProgramOptimization>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand All @@ -133,6 +133,13 @@
<ShowProgress>NotSet</ShowProgress>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<PostBuildEvent>
<Command>copy /Y $(TargetPath) "D:\酷Q Air\dev\com.w4123.dice"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand All @@ -152,6 +159,13 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<PostBuildEvent>
<Command>copy /Y $(TargetPath) "D:\酷Q Air\dev\com.w4123.dice"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand All @@ -171,6 +185,13 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<PostBuildEvent>
<Command>copy /Y $(TargetPath) "D:\酷Q Air\dev\com.w4123.dice"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
Expand Down Expand Up @@ -204,6 +225,13 @@
<ShowProgress>NotSet</ShowProgress>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<PostBuildEvent>
<Command>copy /Y $(TargetPath) "D:\酷Q Air\dev\com.w4123.dice"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\CQSDKCPP\CQAPI.cpp" />
Expand All @@ -220,6 +248,7 @@
<ClCompile Include="DiceConsole.cpp" />
<ClCompile Include="DiceEvent.cpp" />
<ClCompile Include="DiceFile.cpp" />
<ClCompile Include="DiceGUI.cpp" />
<ClCompile Include="DiceMod.cpp" />
<ClCompile Include="DiceMsgSend.cpp" />
<ClCompile Include="DiceNetwork.cpp" />
Expand Down Expand Up @@ -268,6 +297,7 @@
<ClInclude Include="DiceConsole.h" />
<ClInclude Include="DiceEvent.h" />
<ClInclude Include="DiceFile.hpp" />
<ClInclude Include="DiceGUI.h" />
<ClInclude Include="DiceMod.h" />
<ClInclude Include="DiceMsgSend.h" />
<ClInclude Include="DiceNetwork.h" />
Expand All @@ -284,6 +314,7 @@
<ClInclude Include="RandomGenerator.h" />
<ClInclude Include="RD.h" />
<ClInclude Include="RDConstant.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="STLExtern.hpp" />
<ClInclude Include="StorageBase.h" />
<ClInclude Include="StrExtern.hpp" />
Expand All @@ -294,6 +325,14 @@
<ItemGroup>
<Library Include="CQP.lib" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="bitmap1.bmp" />
<Image Include="Dice.ico" />
<Image Include="DiceLogo.bmp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<ProjectExtensions>
Expand Down
2 changes: 2 additions & 0 deletions Dice/Dice.vcxproj.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CppProjectProperties/LanguageStandard/@EntryValue">Cpp17</s:String></wpf:ResourceDictionary>
25 changes: 25 additions & 0 deletions Dice/Dice.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<ClCompile Include="Jsonio.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="DiceGUI.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="APPINFO.h">
Expand Down Expand Up @@ -263,6 +266,12 @@
<ClInclude Include="DiceSession.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="DiceGUI.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="app.json">
Expand All @@ -274,4 +283,20 @@
<Filter>资源文件</Filter>
</Library>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resource.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="Dice.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="bitmap1.bmp">
<Filter>资源文件</Filter>
</Image>
<Image Include="DiceLogo.bmp">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
</Project>
22 changes: 17 additions & 5 deletions Dice/DiceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ int FromMsg::MasterSet() {
return 1;
}
else if (strOption == "reset") {
if (console.master() != fromQQ) {
reply(GlobalMsg["strNotMaster"]);
return 1;
}
string strMaster = readDigit();
if (strMaster.empty() || stoll(strMaster) == console.master()) {
reply("Master不要消遣于我!");
Expand Down Expand Up @@ -1899,15 +1903,23 @@ int FromMsg::DiceReply() {
chatType ToChat = mLinkedList[fromChat];
mLinkedList.erase(fromChat);
auto Range = mFwdList.equal_range(fromChat);
for (auto it = Range.first; it != Range.second; ++it) {
for (auto it = Range.first; it != Range.second;) {
if (it->second == ToChat) {
mFwdList.erase(it);
it = mFwdList.erase(it);
}
else
{
++it;
}
}
Range = mFwdList.equal_range(ToChat);
for (auto it = Range.first; it != Range.second; ++it) {
for (auto it = Range.first; it != Range.second;) {
if (it->second == fromChat) {
mFwdList.erase(it);
it = mFwdList.erase(it);
}
else
{
++it;
}
}
reply(GlobalMsg["strLinkLoss"]);
Expand Down Expand Up @@ -2060,7 +2072,7 @@ int FromMsg::DiceReply() {
if (!UserList.count(llTarget)) {
reply(GlobalMsg["strUserNotFound"]);
return 1;
}
}
strVar["trust"] = to_string(trustedQQ(llTarget));
reply(GlobalMsg["strUserTrustShow"]);
return 1;
Expand Down
Loading

0 comments on commit 87276a6

Please sign in to comment.