本文整理汇总了C#中EResult类的典型用法代码示例。如果您正苦于以下问题:C# EResult类的具体用法?C# EResult怎么用?C# EResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EResult类属于命名空间,在下文中一共展示了EResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseTradeResult
internal ParseTradeResult(ulong tradeID, EResult result) {
if ((tradeID == 0) || (result == EResult.Unknown)) {
throw new ArgumentNullException(nameof(tradeID) + " || " + nameof(result));
}
TradeID = tradeID;
Result = result;
}
示例2: LoggedOnCallback
internal LoggedOnCallback( EResult result )
{
Result = result;
}
示例3: OnDisconnected
private async void OnDisconnected(SteamClient.DisconnectedCallback callback) {
if (callback == null) {
Logging.LogNullError(nameof(callback), BotName);
return;
}
EResult lastLogOnResult = LastLogOnResult;
LastLogOnResult = EResult.Invalid;
Logging.LogGenericInfo("Disconnected from Steam!", BotName);
ArchiWebHandler.OnDisconnected();
CardsFarmer.OnDisconnected();
Trading.OnDisconnected();
FirstTradeSent = false;
HandledGifts.ClearAndTrim();
// If we initiated disconnect, do not attempt to reconnect
if (callback.UserInitiated) {
return;
}
switch (lastLogOnResult) {
case EResult.Invalid:
// Invalid means that we didn't get OnLoggedOn() in the first place, so Steam is down
// Always reset one-time-only access tokens in this case, as OnLoggedOn() didn't do that for us
AuthCode = TwoFactorCode = null;
break;
case EResult.InvalidPassword:
// If we didn't use login key, it's nearly always rate limiting
if (string.IsNullOrEmpty(BotDatabase.LoginKey)) {
goto case EResult.RateLimitExceeded;
}
BotDatabase.LoginKey = null;
Logging.LogGenericInfo("Removed expired login key", BotName);
break;
case EResult.NoConnection:
case EResult.ServiceUnavailable:
case EResult.Timeout:
case EResult.TryAnotherCM:
await Task.Delay(5000).ConfigureAwait(false);
break;
case EResult.RateLimitExceeded:
Logging.LogGenericInfo("Will retry after 25 minutes...", BotName);
await Task.Delay(25 * 60 * 1000).ConfigureAwait(false); // Captcha disappears after around 20 minutes, so we make it 25
break;
}
if (!KeepRunning || SteamClient.IsConnected) {
return;
}
Logging.LogGenericInfo("Reconnecting...", BotName);
await Connect().ConfigureAwait(false);
}
示例4: LoggedOffCallback
internal LoggedOffCallback( EResult result )
{
this.Result = result;
}
示例5: buttonOverwrite_Click
private void buttonOverwrite_Click(object sender, RoutedEventArgs e)
{
Result = EResult.Overwrite;
Close();
}
示例6: ConnectedCallback
internal ConnectedCallback( EResult result )
{
this.Result = result;
}
示例7: MsgChannelEncryptResult
public MsgChannelEncryptResult()
{
Result = EResult.Invalid;
}
示例8: LoggedOffCallback
internal LoggedOffCallback( SteamClient client, EResult result )
: base( client )
示例9: MyCallback
// generally we don't want user code to instantiate callback objects,
// but rather only let handlers create them
internal MyCallback( EResult res )
{
Result = res;
}
示例10: PurchaseResponseCallback
internal PurchaseResponseCallback(JobID jobID, CMsgClientPurchaseResponse msg) {
JobID = jobID;
if (msg == null) {
return;
}
Result = (EResult) msg.eresult;
PurchaseResult = (EPurchaseResult) msg.purchase_result_details;
if (msg.purchase_receipt_info == null) {
return;
}
ReceiptInfo = new KeyValue();
using (MemoryStream ms = new MemoryStream(msg.purchase_receipt_info)) {
if (!ReceiptInfo.TryReadAsBinary(ms)) {
return;
}
List<KeyValue> lineItems = ReceiptInfo["lineitems"].Children;
Items = new Dictionary<uint, string>(lineItems.Count);
foreach (KeyValue lineItem in lineItems) {
uint appID = (uint) lineItem["PackageID"].AsUnsignedLong();
string gameName = lineItem["ItemDescription"].AsString();
gameName = WebUtility.UrlDecode(gameName); // Apparently steam expects client to decode sent HTML
Items.Add(appID, gameName);
}
}
}
示例11: LoggedOnCallback
internal LoggedOnCallback( JobID jobID, EResult result )
{
JobID = jobID;
Result = result;
}
示例12: NotifyCMOffline
public async void NotifyCMOffline( Monitor monitor, EResult result = EResult.Invalid )
{
string keyName = monitor.Server.ToString();
ServerInfo serverInfo = ServerInfo.DeserializeFromBytes( await redis.Hashes.Get( 10, "steamstatus:servers", keyName ) );
serverInfo.IsOnline = false;
if ( result != EResult.Invalid )
{
serverInfo.Result = result.ToString();
}
var task = redis.Hashes.Set( 10, "steamstatus:servers", keyName, serverInfo.SerializeToBytes() );
}
示例13: UGCJobResult
public UGCJobResult( JobID id, EResult result )
{
this.ID = id;
this.Result = result;
}
示例14: RedeemGuestPassResponseCallback
internal RedeemGuestPassResponseCallback(JobID jobID, CMsgClientRedeemGuestPassResponse msg) {
if ((jobID == null) || (msg == null)) {
throw new ArgumentNullException(nameof(jobID) + " || " + nameof(msg));
}
JobID = jobID;
Result = (EResult) msg.eresult;
}
示例15: Deserialize
public void Deserialize( Stream stream )
{
BinaryReader br = new BinaryReader( stream );
Result = (EResult)br.ReadInt32();
}