More Cleanups

This commit is contained in:
hondacrx
2021-06-08 12:56:09 -04:00
parent 302a1f293c
commit 52e43853fe
58 changed files with 223 additions and 257 deletions
@@ -6,10 +6,9 @@ using Bgs.Protocol.Authentication.V1;
using Bgs.Protocol.Challenge.V1;
using Framework.Constants;
using Framework.Database;
using Framework.Realm;
using Google.Protobuf;
using System;
using Framework.Realm;
using System.Net;
namespace BNetServer.Networking
{
@@ -42,7 +41,7 @@ namespace BNetServer.Networking
var endpoint = Global.LoginServiceMgr.GetAddressForClient(GetRemoteIpEndPoint().Address);
ChallengeExternalRequest externalChallenge = new ChallengeExternalRequest();
ChallengeExternalRequest externalChallenge = new();
externalChallenge.PayloadType = "web_auth_url";
externalChallenge.Payload = ByteString.CopyFromUtf8($"https://{endpoint.Address}:{endpoint.Port}/bnetserver/login/");
@@ -92,7 +91,7 @@ namespace BNetServer.Networking
{
var realmId = new RealmId(lastPlayerCharactersResult.Read<byte>(1), lastPlayerCharactersResult.Read<byte>(2), lastPlayerCharactersResult.Read<uint>(3));
LastPlayedCharacterInfo lastPlayedCharacter = new LastPlayedCharacterInfo();
LastPlayedCharacterInfo lastPlayedCharacter = new();
lastPlayedCharacter.RealmId = realmId;
lastPlayedCharacter.CharacterName = lastPlayerCharactersResult.Read<string>(4);
lastPlayedCharacter.CharacterGUID = lastPlayerCharactersResult.Read<ulong>(5);
@@ -142,14 +141,14 @@ namespace BNetServer.Networking
}
}
LogonResult logonResult = new LogonResult();
LogonResult logonResult = new();
logonResult.ErrorCode = 0;
logonResult.AccountId = new EntityId();
logonResult.AccountId.Low = accountInfo.Id;
logonResult.AccountId.High = 0x100000000000000;
foreach (var pair in accountInfo.GameAccounts)
{
EntityId gameAccountId = new EntityId();
EntityId gameAccountId = new();
gameAccountId.Low = pair.Value.Id;
gameAccountId.High = 0x200000200576F57;
logonResult.GameAccountId.Add(gameAccountId);
@@ -1,12 +1,10 @@
// 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 Bgs.Protocol;
using Bgs.Protocol.Connection.V1;
using Framework.Constants;
using System.Collections.Generic;
using Google.Protobuf;
using Bgs.Protocol;
using System.Diagnostics;
using System;
namespace BNetServer.Networking
{
@@ -19,7 +17,7 @@ namespace BNetServer.Networking
response.ClientId.MergeFrom(request.ClientId);
response.ServerId = new ProcessId();
response.ServerId.Label = (uint)Process.GetCurrentProcess().Id;
response.ServerId.Label = (uint)Environment.ProcessId;
response.ServerId.Epoch = (uint)Time.UnixTime;
response.ServerTime = (ulong)Time.UnixTimeMilliseconds;
@@ -22,7 +22,7 @@ namespace BNetServer.Networking
return BattlenetRpcErrorCode.Denied;
Bgs.Protocol.Attribute command = null;
Dictionary<string, Variant> Params = new Dictionary<string, Variant>();
Dictionary<string, Variant> Params = new();
for (int i = 0; i < request.Attribute.Count; ++i)
{