format code

This commit is contained in:
Mikhail
2024-07-19 10:53:02 -04:00
parent 1670142226
commit 22d19cf38b
155 changed files with 148 additions and 853 deletions

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.IntlServer
namespace nksrv.IntlServer
{
internal class AutoLoginEndpoint : IntlMsgHandler
{

View File

@@ -1,13 +1,4 @@
using EmbedIO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.IntlServer
namespace nksrv.IntlServer
{
public class CodeStatusEndpoint : IntlMsgHandler
{
@@ -16,7 +7,7 @@ namespace nksrv.IntlServer
protected override async Task HandleAsync()
{
// pretend that any code is valid
await WriteJsonStringAsync("{\"expire_time\":759,\"msg\":\"Success\",\"ret\":0,\"seq\":\""+Seq+"\"}");
await WriteJsonStringAsync("{\"expire_time\":759,\"msg\":\"Success\",\"ret\":0,\"seq\":\"" + Seq + "\"}");
}
}
}

View File

@@ -1,11 +1,4 @@
using Google.Api;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.IntlServer
namespace nksrv.IntlServer
{
public class GetNoticeContent : IntlMsgHandler
{

View File

@@ -1,12 +1,6 @@
using EmbedIO;
using nksrv.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using nksrv.Utils;
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.IntlServer
{

View File

@@ -1,15 +1,8 @@
using EmbedIO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using static nksrv.IntlServer.IntlLogin2Endpoint;
using Newtonsoft.Json;
using static nksrv.IntlServer.IntlLogin1Endpoint;
using nksrv.Utils;
using System.Net;
using static nksrv.IntlServer.IntlLogin2Endpoint;
namespace nksrv.IntlServer
{
@@ -43,7 +36,7 @@ namespace nksrv.IntlServer
}
}
var user = new User() { ID = uid, Password = ep.password, RegisterTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(), Username = ep.account, PlayerName = "Player_"+Rng.RandomString(8) };
var user = new User() { ID = uid, Password = ep.password, RegisterTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(), Username = ep.account, PlayerName = "Player_" + Rng.RandomString(8) };
JsonDb.Instance.Users.Add(user);

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.IntlServer
namespace nksrv.IntlServer
{
internal class IntlGetAccountInfo : IntlMsgHandler
{

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.IntlServer
namespace nksrv.IntlServer
{
public class IntlGetProfileInfo : IntlMsgHandler
{
@@ -15,7 +9,7 @@ namespace nksrv.IntlServer
if (User == null)
throw new Exception("no user"); // should never happen
await WriteJsonStringAsync("{\"bind_list\":[{\"channel_info\":{\"birthday\":\"1970-01\",\"email\":\""+User.Username+"\",\"is_receive_email\":1,\"lang_type\":\"en\",\"last_login_time\":1719075003,\"nick_name\":\"\",\"phone\":\"\",\"phone_area_code\":\"\",\"region\":\"724\",\"register_account\":\""+User.Username+"\",\"register_account_type\":1,\"register_time\":"+User.RegisterTime+",\"seq\":\"abc\",\"uid\":\""+User.ID+"\",\"user_name\":\""+User.PlayerName+"\",\"username_pass_verify\":0},\"channelid\":131,\"email\":\"" + User.Username + "\",\"picture_url\":\"\",\"user_name\":\""+User.PlayerName+"\"}],\"birthday\":\"1970-01\",\"email\":\"" + User.Username + "\",\"gender\":0,\"msg\":\"success\",\"picture_url\":\"\",\"ret\":0,\"seq\":\"" + Seq + "\",\"user_name\":\"" + User.PlayerName + "\"}");
await WriteJsonStringAsync("{\"bind_list\":[{\"channel_info\":{\"birthday\":\"1970-01\",\"email\":\"" + User.Username + "\",\"is_receive_email\":1,\"lang_type\":\"en\",\"last_login_time\":1719075003,\"nick_name\":\"\",\"phone\":\"\",\"phone_area_code\":\"\",\"region\":\"724\",\"register_account\":\"" + User.Username + "\",\"register_account_type\":1,\"register_time\":" + User.RegisterTime + ",\"seq\":\"abc\",\"uid\":\"" + User.ID + "\",\"user_name\":\"" + User.PlayerName + "\",\"username_pass_verify\":0},\"channelid\":131,\"email\":\"" + User.Username + "\",\"picture_url\":\"\",\"user_name\":\"" + User.PlayerName + "\"}],\"birthday\":\"1970-01\",\"email\":\"" + User.Username + "\",\"gender\":0,\"msg\":\"success\",\"picture_url\":\"\",\"ret\":0,\"seq\":\"" + Seq + "\",\"user_name\":\"" + User.PlayerName + "\"}");
}
}
}

View File

@@ -1,12 +1,5 @@
using EmbedIO;
using nksrv.Utils;
using Swan.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.IntlServer
{

View File

@@ -1,12 +1,7 @@
using EmbedIO;
using Newtonsoft.Json;
using nksrv.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using static nksrv.IntlServer.IntlLogin2Endpoint;
namespace nksrv.IntlServer

View File

@@ -1,13 +1,8 @@
using EmbedIO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using nksrv.Utils;
using Swan.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.IntlServer
{
@@ -28,7 +23,7 @@ namespace nksrv.IntlServer
{
var x = JsonConvert.DeserializeObject<AuthPkt>(Content);
string tokToCheck = "";
if(x != null && x.channel_info != null && !string.IsNullOrEmpty(x.channel_info.account_token))
if (x != null && x.channel_info != null && !string.IsNullOrEmpty(x.channel_info.account_token))
{
tokToCheck = x.channel_info.account_token;
}

View File

@@ -1,13 +1,4 @@
using EmbedIO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.IntlServer
namespace nksrv.IntlServer
{
internal class IntlQueryAccountInfo : IntlMsgHandler
{

View File

@@ -1,12 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EmbedIO;
using Swan;
namespace nksrv.IntlServer
namespace nksrv.IntlServer
{
public class IntlReturnJsonHandler : IntlMsgHandler
{

View File

@@ -1,14 +1,7 @@
using EmbedIO;
using Newtonsoft.Json;
using nksrv.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using static nksrv.IntlServer.IntlLogin1Endpoint;
using static nksrv.IntlServer.IntlLogin2Endpoint;
namespace nksrv.IntlServer