Refactoring of BNetServer
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class LogonData
|
||||
{
|
||||
public string this[string inputId] => Inputs.SingleOrDefault(i => i.Id == inputId)?.Value;
|
||||
|
||||
[DataMember(Name = "version")]
|
||||
public string Version { get; set; }
|
||||
|
||||
[DataMember(Name = "program_id")]
|
||||
public string Program { get; set; }
|
||||
|
||||
[DataMember(Name = "platform_id")]
|
||||
public string Platform { get; set; }
|
||||
|
||||
[DataMember(Name = "inputs")]
|
||||
public List<FormInputValue> Inputs { get; set; } = new List<FormInputValue>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class LogonResult
|
||||
{
|
||||
[DataMember(Name = "authentication_state")]
|
||||
public string AuthenticationState { get; set; }
|
||||
|
||||
[DataMember(Name = "login_ticket")]
|
||||
public string LoginTicket { get; set; }
|
||||
|
||||
[DataMember(Name = "error_code")]
|
||||
public string ErrorCode { get; set; }
|
||||
|
||||
[DataMember(Name = "error_message")]
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
[DataMember(Name = "support_error_code")]
|
||||
public string SupportErrorCode { get; set; }
|
||||
|
||||
[DataMember(Name = "authenticator_form")]
|
||||
public FormInputs AuthenticatorForm { get; set; } = new FormInputs();
|
||||
}
|
||||
|
||||
public enum AuthenticationState
|
||||
{
|
||||
NONE = 0,
|
||||
LOGIN = 1,
|
||||
LEGAL = 2,
|
||||
AUTHENTICATOR = 3,
|
||||
DONE = 4,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class FormInput
|
||||
{
|
||||
[DataMember(Name = "input_id")]
|
||||
public string Id { get; set; }
|
||||
|
||||
[DataMember(Name = "type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[DataMember(Name = "label")]
|
||||
public string Label { get; set; }
|
||||
|
||||
[DataMember(Name = "max_length")]
|
||||
public int MaxLength { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class FormInputValue
|
||||
{
|
||||
[DataMember(Name = "input_id")]
|
||||
public string Id { get; set; }
|
||||
|
||||
[DataMember(Name = "value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class FormInputs
|
||||
{
|
||||
[DataMember(Name = "type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[DataMember(Name = "prompt")]
|
||||
public string Prompt { get; set; }
|
||||
|
||||
[DataMember(Name = "inputs")]
|
||||
public List<FormInput> Inputs { get; set; } = new List<FormInput>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class Address
|
||||
{
|
||||
[DataMember(Name = "ip")]
|
||||
public string Ip { get; set; }
|
||||
|
||||
[DataMember(Name = "port")]
|
||||
public int Port { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class AddressFamily
|
||||
{
|
||||
[DataMember(Name = "family")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[DataMember(Name = "addresses")]
|
||||
public IList<Address> Addresses { get; set; } = new List<Address>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class ClientVersion
|
||||
{
|
||||
[DataMember(Name = "versionMajor")]
|
||||
public int Major { get; set; }
|
||||
|
||||
[DataMember(Name = "versionBuild")]
|
||||
public int Build { get; set; }
|
||||
|
||||
[DataMember(Name = "versionMinor")]
|
||||
public int Minor { get; set; }
|
||||
|
||||
[DataMember(Name = "versionRevision")]
|
||||
public int Revision { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class RealmCharacterCountEntry
|
||||
{
|
||||
[DataMember(Name = "wowRealmAddress")]
|
||||
public int WowRealmAddress { get; set; }
|
||||
|
||||
[DataMember(Name = "count")]
|
||||
public int Count { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class RealmCharacterCountList
|
||||
{
|
||||
[DataMember(Name = "counts")]
|
||||
public IList<RealmCharacterCountEntry> Counts { get; set; } = new List<RealmCharacterCountEntry>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class RealmEntry
|
||||
{
|
||||
|
||||
[DataMember(Name = "wowRealmAddress")]
|
||||
public int WowRealmAddress { get; set; }
|
||||
|
||||
[DataMember(Name = "cfgTimezonesID")]
|
||||
public int CfgTimezonesID { get; set; }
|
||||
|
||||
[DataMember(Name = "populationState")]
|
||||
public int PopulationState { get; set; }
|
||||
|
||||
[DataMember(Name = "cfgCategoriesID")]
|
||||
public int CfgCategoriesID { get; set; }
|
||||
|
||||
[DataMember(Name = "version")]
|
||||
public ClientVersion Version { get; set; } = new ClientVersion();
|
||||
|
||||
[DataMember(Name = "cfgRealmsID")]
|
||||
public int CfgRealmsID { get; set; }
|
||||
|
||||
[DataMember(Name = "flags")]
|
||||
public int Flags { get; set; }
|
||||
|
||||
[DataMember(Name = "name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[DataMember(Name = "cfgConfigsID")]
|
||||
public int CfgConfigsID { get; set; }
|
||||
|
||||
[DataMember(Name = "cfgLanguagesID")]
|
||||
public int CfgLanguagesID { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class RealmListServerIPAddresses
|
||||
{
|
||||
[DataMember(Name = "families")]
|
||||
public IList<AddressFamily> Families { get; set; } = new List<AddressFamily>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class RealmListTicketClientInformation
|
||||
{
|
||||
[DataMember(Name = "info")]
|
||||
public RealmListTicketInformation Info { get; set; } = new RealmListTicketInformation();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class RealmListTicketIdentity
|
||||
{
|
||||
[DataMember(Name = "gameAccountID")]
|
||||
public int GameAccountId { get; set; }
|
||||
|
||||
[DataMember(Name = "gameAccountRegion")]
|
||||
public int GameAccountRegion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class RealmListTicketInformation
|
||||
{
|
||||
[DataMember(Name = "platform")]
|
||||
public int Platform { get; set; }
|
||||
|
||||
[DataMember(Name = "buildVariant")]
|
||||
public string BuildVariant { get; set; }
|
||||
|
||||
[DataMember(Name = "type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
[DataMember(Name = "timeZone")]
|
||||
public string Timezone { get; set; }
|
||||
|
||||
[DataMember(Name = "currentTime")]
|
||||
public int CurrentTime { get; set; }
|
||||
|
||||
[DataMember(Name = "textLocale")]
|
||||
public int TextLocale { get; set; }
|
||||
|
||||
[DataMember(Name = "audioLocale")]
|
||||
public int AudioLocale { get; set; }
|
||||
|
||||
[DataMember(Name = "versionDataBuild")]
|
||||
public int VersionDataBuild { get; set; }
|
||||
|
||||
[DataMember(Name = "version")]
|
||||
public ClientVersion ClientVersion { get; set; } = new ClientVersion();
|
||||
|
||||
[DataMember(Name = "secret")]
|
||||
public List<int> Secret { get; set; }
|
||||
|
||||
[DataMember(Name = "clientArch")]
|
||||
public int ClientArch { get; set; }
|
||||
|
||||
[DataMember(Name = "systemVersion")]
|
||||
public string SystemVersion { get; set; }
|
||||
|
||||
[DataMember(Name = "platformType")]
|
||||
public int PlatformType { get; set; }
|
||||
|
||||
[DataMember(Name = "systemArch")]
|
||||
public int SystemArch { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class RealmListUpdate
|
||||
{
|
||||
[DataMember(Name = "update")]
|
||||
public RealmEntry Update { get; set; } = new RealmEntry();
|
||||
|
||||
[DataMember(Name = "deleting")]
|
||||
public bool Deleting { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Framework.Web
|
||||
{
|
||||
[DataContract]
|
||||
public class RealmListUpdates
|
||||
{
|
||||
[DataMember(Name = "updates")]
|
||||
public IList<RealmListUpdate> Updates { get; set; } = new List<RealmListUpdate>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user