Skip to content

Commit

Permalink
check config elem exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Jun 10, 2018
1 parent c5f5709 commit d4ef4b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions OsuBotTransferClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ public override void StartWork()
if (web_socket != null)
return;

if (string.IsNullOrWhiteSpace(API_Key))
{
IO.CurrentIO.WriteColor($"[OsuBotTransferClient]未钦定配置选项API_Key,请去http://mikirasora.moe/account/api获取Api key并去config.ini填写.", ConsoleColor.Red);
return;
}

if (string.IsNullOrWhiteSpace(Target_User_Name))
{
IO.CurrentIO.WriteColor($"[OsuBotTransferClient]未钦定配置选项Target_User_Name,请去config.ini配置.", ConsoleColor.Red);
return;
}

web_socket = new WebSocket(CONNECT_PATH);
web_socket.OnClose += Web_socket_OnClose;
web_socket.OnError += Web_socket_OnError;
Expand Down
2 changes: 1 addition & 1 deletion PublicOsuBotTransfer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\..\Release\Plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down

0 comments on commit d4ef4b2

Please sign in to comment.