Compare commits

..

No commits in common. "main" and "release" have entirely different histories.

1466 changed files with 52876 additions and 7832 deletions

View file

@ -0,0 +1,51 @@
namespace FreeSR.Admin
{
using FreeSR.Admin.Command.Handlers;
using FreeSR.Admin.Service;
using FreeSR.Shared.Command;
using FreeSR.Shared.Configuration;
using FreeSR.Shared.Exceptions;
using NLog;
internal static class AdminServer
{
private static readonly Logger s_log = LogManager.GetCurrentClassLogger();
private static void Main(string[] args)
{
Directory.SetCurrentDirectory(AppContext.BaseDirectory);
AppDomain.CurrentDomain.UnhandledException += OnFatalException;
Console.WriteLine("FreeSR is a free and open-source software, if you paid for this, you have been scammed!");
Console.WriteLine("FreeSR是一个免费且开源的软件如果你是花钱买来的则说明你被骗了");
Console.WriteLine("https://git.xeondev.com/Moux23333/FreeSR");
s_log.Info("Initializing...");
CommandManager.Instance.Initialize(typeof(AccountCommandCategory));
ConfigurationManager<AdminServerConfiguration>.Instance.Initialize("AdminServer.json");
var serverConfiguration = ConfigurationManager<AdminServerConfiguration>.Instance.Model;
HttpAdminService.Initialize(serverConfiguration.Network);
s_log.Info("Server is ready!");
Thread.Sleep(-1);
}
private static void OnFatalException(object sender, UnhandledExceptionEventArgs args)
{
if (args.ExceptionObject is ServerInitializationException initException)
{
Console.WriteLine("Server initialization failed, unhandled exception!");
Console.WriteLine(initException);
}
else
{
Console.WriteLine("Unhandled exception in runtime!");
Console.WriteLine(args.ExceptionObject);
}
Console.WriteLine("Press enter to close this window...");
Console.ReadLine();
}
}
}

View file

@ -0,0 +1,7 @@
{
"Network": {
"Host": "0.0.0.0",
"Port": 1337
},
"DispatchUrl": "http://localhost:8888"
}

View file

@ -0,0 +1,10 @@
namespace FreeSR.Admin
{
using FreeSR.Shared.Configuration;
internal class AdminServerConfiguration
{
public NetworkConfiguration Network { get; set; }
public string DispatchUrl { get; set; }
}
}

View file

@ -0,0 +1,19 @@
namespace FreeSR.Admin.Command
{
using FreeSR.Shared.Command.Context;
internal class AdminCommandContext : ICommandContext
{
public string Message { get; private set; }
public void SendError(string message)
{
Message = "Error: " + message;
}
public void SendMessage(string message)
{
Message = message;
}
}
}

View file

@ -0,0 +1,17 @@
namespace FreeSR.Admin.Command.Handlers
{
using FreeSR.Shared.Command;
using FreeSR.Shared.Command.Context;
using FreeSR.Shared.Configuration;
[Command("account")]
internal class AccountCommandCategory : CommandCategory
{
[Command("create")]
public void AccountCreateCommandHandler(ICommandContext context, string username, string password)
{
var config = ConfigurationManager<AdminServerConfiguration>.Instance.Model;
context.SendMessage($"dohttpreq={config.DispatchUrl}/sdk/createaccount?user={username}&pass={password}");
}
}
}

View file

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Ceen.Httpd" Version="0.9.10" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FreeSR.Shared\FreeSR.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="AdminServer.example.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="assets\console.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View file

@ -0,0 +1,25 @@
namespace FreeSR.Admin.Handlers
{
using Ceen;
using FreeSR.Admin.Service;
internal class ConsolePageRequestHandler : IHttpModule
{
public async Task<bool> HandleAsync(IHttpContext context)
{
context.Response.StatusCode = HttpStatusCode.OK;
await context.Response.WriteAllAsync(CreateHTMLDocument(), "text/html");
return true;
}
private static string CreateHTMLDocument()
{
string baseString = HttpAdminService.ConsoleHTML;
return baseString.Replace("%SERVER_VERSION%", "v0.1.0 dev - experimental open source")
.Replace("%GAME_VERSION%", "1.2.0");
}
}
}

View file

@ -0,0 +1,23 @@
namespace FreeSR.Admin.Handlers
{
using Ceen;
using FreeSR.Admin.Command;
using FreeSR.Shared.Command;
internal class ExecuteCommandRequestHandler : IHttpModule
{
public async Task<bool> HandleAsync(IHttpContext context)
{
var query = context.Request.QueryString;
string command = query["command"];
var ctx = new AdminCommandContext();
CommandManager.Instance.Invoke(ctx, command);
context.Response.StatusCode = HttpStatusCode.OK;
await context.Response.WriteAllAsync(ctx.Message, "text/plain");
return true;
}
}
}

View file

@ -0,0 +1,43 @@
namespace FreeSR.Admin.Service
{
using Ceen.Httpd;
using Ceen.Httpd.Logging;
using FreeSR.Admin.Handlers;
using FreeSR.Shared.Configuration;
using System.Net;
internal static class HttpAdminService
{
public static string ConsoleHTML { get; private set; }
private static ServerConfig s_httpdConfiguration;
public static void Initialize(NetworkConfiguration config)
{
LoadHtDocs();
s_httpdConfiguration = CreateConfiguration();
_ = BootHttpAsync(config);
}
private static void LoadHtDocs()
{
ConsoleHTML = File.ReadAllText("assets/console.html");
}
private static ServerConfig CreateConfiguration()
{
return new ServerConfig().AddLogger(new CLFStdOut())
.AddRoute("/console", new ConsolePageRequestHandler())
.AddRoute("/console/exec", new ExecuteCommandRequestHandler());
}
private static async Task BootHttpAsync(NetworkConfiguration config)
{
await HttpServer.ListenAsync(new IPEndPoint(
IPAddress.Parse(config.Host),
config.Port),
false, s_httpdConfiguration);
}
}
}

View file

@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<head>
<title>FreeSR</title>
<style>
body {
font-family: Arial, sans-serif;
}
#status {
font-weight: bold;
}
#console {
width: 100%;
height: 300px;
font-family: monospace;
background-color: #f0f0f0;
overflow-y: scroll;
}
#commandInput {
width: 100%;
padding: 5px;
}
#submitBtn {
padding: 5px 10px;
margin-top: 10px;
cursor: pointer;
}
</style>
</head>
<body>
<h1>FreeSR Control Panel</h1>
<div>
<h2>Status:</h2>
<p id="status">Loading...</p>
</div>
<div>
<h2>Server Statistics:</h2>
<p>Server build: %SERVER_VERSION%</p>
<p>Supported game version: %GAME_VERSION%</p>
</div>
<div>
<h2>Admin Console:</h2>
<textarea id="console" readonly></textarea>
<input type="text" id="commandInput" placeholder="Enter admin command...">
<button id="submitBtn">Execute</button>
</div>
<script>
const consoleOutput = document.getElementById('console');
const commandInput = document.getElementById('commandInput');
const submitBtn = document.getElementById('submitBtn');
// Function to update the status section (replace with actual server status)
function updateStatus(statusText) {
const statusElement = document.getElementById('status');
statusElement.innerText = statusText;
}
// Function to add a new line to the console
function addToConsole(text) {
consoleOutput.value += text + '\n';
consoleOutput.scrollTop = consoleOutput.scrollHeight;
}
function sendCommand() {
const command = commandInput.value;
if (command.length == 0)
return;
addToConsole(`> ${command}`);
fetch(`/console/exec?command=${encodeURIComponent(command)}`)
.then(response => response.text())
.then(data => {
if (data.startsWith("dohttpreq")) {
fetch(data.replace("dohttpreq=", ""))
.then(response => response.text())
.then(data => {
addToConsole(data);
});
}
else {
addToConsole(data);
}
})
.catch(error => {
addToConsole(`Error: ${error.message}`);
});
commandInput.value = '';
}
submitBtn.addEventListener('click', sendCommand);
</script>
</body>
</html>

View file

@ -0,0 +1,59 @@
namespace FreeSR.Database.Account
{
using FreeSR.Database.Account.Model;
using FreeSR.Database.Account.Util;
using FreeSR.Database.Mongo;
using MongoDB.Driver;
public class AccountDatabase : SRMongoDatabase<AccountModel>
{
private int _maxUid;
public AccountDatabase(IMongoDatabase database, string collectionName) : base(database, collectionName)
{
// AccountDatabase.
}
public async Task<AccountModel> Create(string name, string password)
{
if (_maxUid == 0)
_maxUid = await FetchMaxUid();
if (await GetByName(name) != null)
return null;
var model = new AccountModel
{
Uid = Interlocked.Increment(ref _maxUid),
Name = name,
Password = password,
CreationDateUtc = DateTime.UtcNow,
Token = AccountTokenUtil.Generate()
};
await Insert(model);
return model;
}
public async Task<AccountModel> GetByUid(int uid)
{
return await FindOne(account => account.Uid == uid);
}
public async Task<AccountModel> GetByName(string name)
{
return await FindOne(account => account.Name == name);
}
public async Task Update(AccountModel account)
{
await Update(model => model.Uid == account.Uid, account);
}
private async Task<int> FetchMaxUid()
{
var maxUidAccount = await FindMax(account => account.Uid);
return maxUidAccount?.Uid ?? 0;
}
}
}

View file

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\FreeSR.Database\FreeSR.Database.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,14 @@
namespace FreeSR.Database.Account.Model
{
using MongoDB.Bson.Serialization.Attributes;
[BsonIgnoreExtraElements]
public class AccountModel
{
public int Uid { get; set; }
public string Name { get; set; }
public string Password { get; set; }
public string Token { get; set; }
public DateTime CreationDateUtc { get; set; }
}
}

View file

@ -0,0 +1,37 @@
namespace FreeSR.Database.Account.Util
{
using FreeSR.Database.Account.Model;
public static class AccountTokenUtil
{
private const int AccountTokenLength = 128;
private const string TokenCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
private static Random s_random;
static AccountTokenUtil()
{
s_random = new Random();
}
public static string Generate()
{
var token = "";
for (int i = 0; i < AccountTokenLength; i++)
{
token += TokenCharacters[s_random.Next(TokenCharacters.Length)];
}
return token;
}
public static bool Verify(AccountModel accountModel, string clientToken)
{
if (accountModel == null)
return false;
return string.Equals(accountModel.Token, clientToken);
}
}
}

View file

@ -0,0 +1,9 @@
namespace FreeSR.Database.Configuration
{
public class DatabaseConfiguration
{
public string ConnectionString { get; set; }
public string Name { get; set; }
public DatabaseEntry[] Entries { get; set; }
}
}

View file

@ -0,0 +1,8 @@
namespace FreeSR.Database.Configuration
{
public class DatabaseEntry
{
public string CollectionName { get; set; }
public DatabaseType Type { get; set; }
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Database.Configuration
{
using FreeSR.Shared.Exceptions;
internal class DatabaseMisconfiguredException : ServerInitializationException
{
public DatabaseMisconfiguredException(string message) : base(message)
{
// DatabaseMisconfiguredException.
}
}
}

View file

@ -0,0 +1,7 @@
namespace FreeSR.Database.Configuration
{
public enum DatabaseType
{
Account
}
}

View file

@ -0,0 +1,55 @@
namespace FreeSR.Database
{
using FreeSR.Database.Configuration;
using FreeSR.Shared;
using MongoDB.Driver;
using NLog;
public sealed class DatabaseManager : Singleton<DatabaseManager>
{
private static readonly Logger s_log = LogManager.GetCurrentClassLogger();
private DatabaseConfiguration _configuration;
private Dictionary<Type, object> _databases;
public IMongoDatabase MongoDatabase { get; private set; }
private DatabaseManager()
{
_databases = new Dictionary<Type, object>();
}
public void Initialize(DatabaseConfiguration configuration)
{
_configuration = configuration;
var mongoClient = new MongoClient(configuration.ConnectionString);
MongoDatabase = mongoClient.GetDatabase(configuration.Name);
}
public string GetCollectionName(DatabaseType databaseType)
{
foreach (var entry in _configuration.Entries)
{
if (entry.Type == databaseType)
return entry.CollectionName;
}
throw new DatabaseMisconfiguredException($"Can not find database of type {databaseType} in provided configuration.");
}
public DatabaseManager Add<T>(ISRDatabase<T> database) where T : class
{
_databases.Add(database.GetType(), database);
return this;
}
public T Get<T>() where T : class
{
if (_databases.TryGetValue(typeof(T), out var database))
return database as T;
return null;
}
}
}

View file

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.20.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FreeSR.Shared\FreeSR.Shared.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,18 @@
namespace FreeSR.Database
{
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
public interface ISRDatabase<T> where T : class
{
Task Insert(T document);
Task InsertMany(IEnumerable<T> documents);
Task<List<T>> Find(Expression<Func<T, bool>> filter);
Task<T> FindOne(Expression<Func<T, bool>> filter);
Task Update(Expression<Func<T, bool>> filter, T updatedDocument);
Task Delete(Expression<Func<T, bool>> filter);
Task<long> Count();
Task<T> FindMax(Expression<Func<T, object>> fieldSelector);
}
}

View file

@ -0,0 +1,58 @@
namespace FreeSR.Database.Mongo
{
using MongoDB.Driver;
using System.Linq.Expressions;
public class SRMongoDatabase<T> : ISRDatabase<T> where T : class
{
protected readonly IMongoCollection<T> _collection;
public SRMongoDatabase(IMongoDatabase database, string collectionName)
{
_collection = database.GetCollection<T>(collectionName);
}
public async Task Insert(T document)
{
await _collection.InsertOneAsync(document);
}
public async Task InsertMany(IEnumerable<T> documents)
{
await _collection.InsertManyAsync(documents);
}
public async Task<List<T>> Find(Expression<Func<T, bool>> filter)
{
var result = await _collection.FindAsync(filter);
return await result.ToListAsync();
}
public async Task<T> FindOne(Expression<Func<T, bool>> filter)
{
var result = await _collection.FindAsync(filter);
return await result.FirstOrDefaultAsync();
}
public async Task Update(Expression<Func<T, bool>> filter, T updatedDocument)
{
await _collection.ReplaceOneAsync(filter, updatedDocument);
}
public async Task Delete(Expression<Func<T, bool>> filter)
{
await _collection.DeleteOneAsync(filter);
}
public async Task<long> Count()
{
return await _collection.CountDocumentsAsync(Builders<T>.Filter.Empty);
}
public async Task<T> FindMax(Expression<Func<T, object>> fieldSelector)
{
var sortDefinition = Builders<T>.Sort.Descending(fieldSelector);
return await _collection.Find(Builders<T>.Filter.Empty).Sort(sortDefinition).FirstOrDefaultAsync();
}
}
}

View file

@ -1,5 +1,8 @@
namespace FreeSR.Dispatch namespace FreeSR.Dispatch
{ {
using FreeSR.Database;
using FreeSR.Database.Account;
using FreeSR.Database.Configuration;
using FreeSR.Dispatch.Service; using FreeSR.Dispatch.Service;
using FreeSR.Dispatch.Service.Manager; using FreeSR.Dispatch.Service.Manager;
using FreeSR.Shared.Configuration; using FreeSR.Shared.Configuration;
@ -27,6 +30,11 @@
ConfigurationManager<DispatchServerConfiguration>.Instance.Initialize("DispatchServer.json"); ConfigurationManager<DispatchServerConfiguration>.Instance.Initialize("DispatchServer.json");
var serverConfiguration = ConfigurationManager<DispatchServerConfiguration>.Instance.Model; var serverConfiguration = ConfigurationManager<DispatchServerConfiguration>.Instance.Model;
DatabaseManager.Instance.Initialize(serverConfiguration.Database);
var mongoDatabase = DatabaseManager.Instance.MongoDatabase;
DatabaseManager.Instance.Add(new AccountDatabase(mongoDatabase, DatabaseManager.Instance.GetCollectionName(DatabaseType.Account)));
RegionManager.Initialize(serverConfiguration.Region); RegionManager.Initialize(serverConfiguration.Region);
HttpDispatchService.Initialize(serverConfiguration.Network); HttpDispatchService.Initialize(serverConfiguration.Network);

View file

@ -3,6 +3,16 @@
"Host": "0.0.0.0", "Host": "0.0.0.0",
"Port": 8888 "Port": 8888
}, },
"Database": {
"ConnectionString": "mongodb://127.0.0.1:27017/",
"Name": "FreeSR",
"Entries": [
{
"CollectionName": "accounts",
"Type": "Account"
}
]
},
"Region": { "Region": {
"Name": "FreeSR", "Name": "FreeSR",
"EnvType": "2", "EnvType": "2",

View file

@ -1,11 +1,13 @@
namespace FreeSR.Dispatch namespace FreeSR.Dispatch
{ {
using FreeSR.Database.Configuration;
using FreeSR.Dispatch.Configuration; using FreeSR.Dispatch.Configuration;
using FreeSR.Shared.Configuration; using FreeSR.Shared.Configuration;
internal class DispatchServerConfiguration internal class DispatchServerConfiguration
{ {
public NetworkConfiguration Network { get; set; } public NetworkConfiguration Network { get; set; }
public DatabaseConfiguration Database { get; set; }
public RegionConfiguration Region { get; set; } public RegionConfiguration Region { get; set; }
} }
} }

View file

@ -5,7 +5,6 @@
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>
<RollForward>Major</RollForward>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -14,6 +13,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\FreeSR.Database.Account\FreeSR.Database.Account.csproj" />
<ProjectReference Include="..\FreeSR.Proto\FreeSR.Proto.csproj" /> <ProjectReference Include="..\FreeSR.Proto\FreeSR.Proto.csproj" />
<ProjectReference Include="..\FreeSR.Shared\FreeSR.Shared.csproj" /> <ProjectReference Include="..\FreeSR.Shared\FreeSR.Shared.csproj" />
</ItemGroup> </ItemGroup>

View file

@ -28,7 +28,7 @@
context.Response.StatusCode = HttpStatusCode.OK; context.Response.StatusCode = HttpStatusCode.OK;
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/json";
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(0) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", dataObject) .Object("data", dataObject)
.Build()); .Build());

View file

@ -12,7 +12,7 @@
context.Response.StatusCode = HttpStatusCode.OK; context.Response.StatusCode = HttpStatusCode.OK;
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/json";
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(0) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", Data) .Object("data", Data)
.Build()); .Build());

View file

@ -11,7 +11,7 @@
context.Response.StatusCode = HttpStatusCode.OK; context.Response.StatusCode = HttpStatusCode.OK;
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/json";
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(0) .Retcode((int)RetcodeStatus.RetSucc)
.Boolean("success", true) .Boolean("success", true)
.String("message", "") .String("message", "")
.Build()); .Build());

View file

@ -1,6 +1,9 @@
namespace FreeSR.Dispatch.Handlers namespace FreeSR.Dispatch.Handlers
{ {
using Ceen; using Ceen;
using FreeSR.Database;
using FreeSR.Database.Account;
using FreeSR.Database.Account.Model;
using FreeSR.Dispatch.Util; using FreeSR.Dispatch.Util;
using FreeSR.Proto; using FreeSR.Proto;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@ -16,17 +19,30 @@
string data = await context.Request.Body.ReadAllAsStringAsync(); string data = await context.Request.Body.ReadAllAsStringAsync();
JObject loginJson = JObject.Parse(data); JObject loginJson = JObject.Parse(data);
AccountDatabase accountDatabase = DatabaseManager.Instance.Get<AccountDatabase>();
string accountName = (string)loginJson["account"]; string accountName = (string)loginJson["account"];
string password = (string)loginJson["password"]; string password = (string)loginJson["password"];
var accountData = DispatchHelper.ToLoginResponseData(); AccountModel account = await accountDatabase.GetByName(accountName);
if (account == null)
{
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode((int)RetcodeStatus.RetFail)
.Message("Account not found.")
.Object("data", null)
.Build());
return true;
}
// no password check, because client patch is closed-source for now.
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(0) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", new JObject .Object("data", new JObject
{ {
{"account", accountData}, {"account", account.ToLoginResponseData()},
{"device_grant_required", false}, {"device_grant_required", false},
{"safe_moblie_required", false}, {"safe_moblie_required", false},
{"realperson_required", false}, {"realperson_required", false},

View file

@ -25,7 +25,7 @@
context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/plain";
await context.Response.WriteAllAsync(Convert.ToBase64String(ProtobufUtil.Serialize(new RegionList await context.Response.WriteAllAsync(Convert.ToBase64String(ProtobufUtil.Serialize(new RegionList
{ {
Retcode = 0, Retcode = (uint)RetcodeStatus.RetSucc,
TopServerRegionName = RegionManager.GetTopServerRegionName(), TopServerRegionName = RegionManager.GetTopServerRegionName(),
RegionInfoLists = { RegionManager.GetRegionList() } RegionInfoLists = { RegionManager.GetRegionList() }
}))); })));

View file

@ -25,13 +25,10 @@
B5 = true, B5 = true,
B6 = true, B6 = true,
B7 = true, B7 = true,
B8 = true, Gfemaboifee = true,
useTcp = true,
//MdkResVersion = "5335706", //MdkResVersion = "5335706",
AssetBundleUrl = "https://autopatchos.starrails.com/asb/BetaLive/output_6510636_cb4da670a18a", AssetBundleUrl = "https://autopatchcn.bhsr.com/asb/BetaLive/output_6355877_591cdefefe9b",
ExResourceUrl = "https://autopatchos.starrails.com/design_data/BetaLive/output_6519585_2be8ac313835", ExResourceUrl = "https://autopatchcn.bhsr.com/design_data/BetaLive/output_6367879_26191d7cc23b",
IfixVersion = "https://autopatchos.starrails.com/ifix/BetaLive/output_6523427_28cc5c21c689",
LuaUrl = "https://autopatchos.starrails.com/lua/BetaLive/output_6516960_dede96733b5b",
}))); })));
return true; return true;

View file

@ -13,7 +13,7 @@
context.Response.StatusCode = HttpStatusCode.OK; context.Response.StatusCode = HttpStatusCode.OK;
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/json";
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(0) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", CaptchaData) .Object("data", CaptchaData)
.Build()); .Build());

View file

@ -0,0 +1,32 @@
namespace FreeSR.Dispatch.Handlers.Sdk
{
using Ceen;
using FreeSR.Database;
using FreeSR.Database.Account;
internal class CreateAccountHandler : IHttpModule
{
public async Task<bool> HandleAsync(IHttpContext context)
{
var query = context.Request.QueryString;
var name = query["user"];
var password = query["pass"];
var database = DatabaseManager.Instance.Get<AccountDatabase>();
var account = await database.Create(name, password);
context.Response.StatusCode = HttpStatusCode.OK;
if (account == null)
{
await context.Response.WriteAllAsync("Sorry, this username is already taken.", "text/plain");
}
else
{
await context.Response.WriteAllAsync($"Successfully created account with name {account.Name}, uid: {account.Uid}", "text/plain");
}
return true;
}
}
}

View file

@ -1,6 +1,9 @@
namespace FreeSR.Dispatch.Handlers namespace FreeSR.Dispatch.Handlers
{ {
using Ceen; using Ceen;
using FreeSR.Database;
using FreeSR.Database.Account;
using FreeSR.Database.Account.Model;
using FreeSR.Dispatch.Util; using FreeSR.Dispatch.Util;
using FreeSR.Proto; using FreeSR.Proto;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@ -10,14 +13,41 @@
{ {
public async Task<bool> HandleAsync(IHttpContext context) public async Task<bool> HandleAsync(IHttpContext context)
{ {
var data = await context.Request.Body.ReadAllAsStringAsync();
var json = JObject.Parse(data);
var uid = int.Parse((string)json["uid"]);
var token = (string)json["token"];
AccountDatabase accountDatabase = DatabaseManager.Instance.Get<AccountDatabase>();
AccountModel account = await accountDatabase.GetByUid(uid);
if (account == null)
{
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode((int)RetcodeStatus.RetFail)
.Message("Account not found.")
.Object("data", null)
.Build());
return true;
}
else if (account.Token != token)
{
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode((int)RetcodeStatus.RetFail)
.Message("Invalid user token.")
.Object("data", null)
.Build());
return true;
}
var accountData = DispatchHelper.ToLoginResponseData();
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(0) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", new JObject .Object("data", new JObject
{ {
{"account", accountData}, {"account", account.ToLoginResponseData()},
{"device_grant_required", false}, {"device_grant_required", false},
{"safe_moblie_required", false}, {"safe_moblie_required", false},
{"realperson_required", false}, {"realperson_required", false},

View file

@ -3,6 +3,7 @@
using Ceen.Httpd; using Ceen.Httpd;
using Ceen.Httpd.Logging; using Ceen.Httpd.Logging;
using FreeSR.Dispatch.Handlers; using FreeSR.Dispatch.Handlers;
using FreeSR.Dispatch.Handlers.Sdk;
using FreeSR.Shared.Configuration; using FreeSR.Shared.Configuration;
using System.Net; using System.Net;
@ -29,7 +30,8 @@
.AddRoute("/account/risky/api/check", new RiskyApiCheckHandler()) .AddRoute("/account/risky/api/check", new RiskyApiCheckHandler())
.AddRoute("/hkrpg_global/mdk/agreement/api/getAgreementInfos", new GetAgreementInfosHandler()) .AddRoute("/hkrpg_global/mdk/agreement/api/getAgreementInfos", new GetAgreementInfosHandler())
.AddRoute("/data_abtest_api/config/experiment/list", new GetExperimentListHandler()) .AddRoute("/data_abtest_api/config/experiment/list", new GetExperimentListHandler())
.AddRoute("/hkrpg_global/combo/granter/api/getConfig", new ComboGranterApiGetConfigHandler()); .AddRoute("/hkrpg_global/combo/granter/api/getConfig", new ComboGranterApiGetConfigHandler())
.AddRoute("/sdk/createaccount", new CreateAccountHandler());
} }
private static async Task BootHttpAsync(NetworkConfiguration config) private static async Task BootHttpAsync(NetworkConfiguration config)

View file

@ -1,16 +1,17 @@
namespace FreeSR.Dispatch.Util namespace FreeSR.Dispatch.Util
{ {
using FreeSR.Database.Account.Model;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
internal static class DispatchHelper internal static class DispatchHelper
{ {
public static JObject ToLoginResponseData() public static JObject ToLoginResponseData(this AccountModel model)
{ {
return new JObject return new JObject
{ {
{"uid", 1337}, {"uid", model.Uid},
{"name", "reversedrooms"}, {"name", model.Name},
{"email", "reversedrooms@mihomo.com"}, {"email", "reversedrooms"},
{"mobile", ""}, {"mobile", ""},
{"is_email_verify", "0"}, {"is_email_verify", "0"},
{"realname", ""}, {"realname", ""},
@ -30,7 +31,7 @@
{"steam_name", ""}, {"steam_name", ""},
{"unmasked_email", ""}, {"unmasked_email", ""},
{"unmasked_email_type", 0}, {"unmasked_email_type", 0},
{"token", "FreesrToken"} {"token", model.Token}
}; };
} }
} }

View file

@ -5,7 +5,6 @@
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>
<RollForward>Major</RollForward>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -13,15 +13,11 @@
var response = new GetAvatarDataScRsp var response = new GetAvatarDataScRsp
{ {
Retcode = 0, Retcode = (uint)RetcodeStatus.RetSucc,
IsAll = request.IsGetAll IsAll = request.IsGetAll
}; };
uint[] characters = new uint[] { 8001,8002,8003,8004, uint[] characters = new uint[] { 8001, 1307, 1306, 1312 };
1001,1002,1003,1004,1005,1006,1008,1009,1013,
1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,
1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1217,
1301,1302,1303,1304,1305,1306,1307,1308,1312};
foreach (uint id in characters) foreach (uint id in characters)
{ {
@ -29,8 +25,8 @@
{ {
BaseAvatarId = id, BaseAvatarId = id,
Exp = 0, Exp = 0,
Level = 80, Level = 1,
Promotion = 6, Promotion = 0,
Rank = 6, Rank = 6,
EquipmentUniqueId = 0 EquipmentUniqueId = 0
}; };

View file

@ -1,239 +0,0 @@
using FreeSR.Gateserver.Manager.Handlers.Core;
using static FreeSR.Gateserver.Manager.Handlers.LineupReqGroup;
using FreeSR.Gateserver.Network;
using FreeSR.Proto;
namespace FreeSR.Gateserver.Manager.Handlers
{
internal static class BattleReqGroup
{
[Handler(CmdType.CmdSetLineupNameCsReq)]
public static void OnSetLineupNameCsReq(NetSession session, int cmdId, object data)
{
var request = data as SetLineupNameCsReq;
if(request.Name == "battle")
{
var lineupInfo = new LineupInfo
{
ExtraLineupType = ExtraLineupType.LineupNone,
Name = "Squad 1",
Mp = 5,
MaxMp = 5,
LeaderSlot = 0
};
List<uint> characters = new List<uint> { Avatar1, Avatar2, Avatar3, Avatar4 };
foreach (uint id in characters)
{
if (id == 0) continue;
lineupInfo.AvatarLists.Add(new LineupAvatar
{
Id = id,
Hp = 10000,
Satiety = 100,
Sp = new AmountInfo{CurAmount = 10000,MaxAmount = 10000},
AvatarType = AvatarType.AvatarFormalType,
Slot = (uint)lineupInfo.AvatarLists.Count
});
}
var sceneInfo = new SceneInfo
{
GameModeType = 2,
EntryId = 2010101,
PlaneId = 20101,
FloorId = 20101001
};
var calaxInfoTest = new SceneEntityInfo
{
GroupId = 19,
InstId = 300001,
EntityId = 4194583,
Prop = new ScenePropInfo
{
PropState = 1,
PropId = 808
},
Motion = new MotionInfo
{
Pos = new Vector
{
X = -570,
Y = 19364,
Z = 4480
},
Rot = new Vector
{
Y = 180000
}
},
};
sceneInfo.EntityLists.Add(calaxInfoTest);
session.Send(CmdType.CmdEnterSceneByServerScNotify, new EnterSceneByServerScNotify
{
Scene = sceneInfo,
Lineup = lineupInfo
});
session.Send(CmdType.CmdSceneEntityMoveScNotify, new SceneEntityMoveScNotify
{
EntryId = 2010101,
EntityId = 0,
Motion = new MotionInfo
{
Pos = new Vector
{
X = -570,
Y = 19364,
Z = 4480
},
Rot = new Vector
{
Y = 180000
}
}
});
}
session.Send(CmdType.CmdSetLineupNameScRsp, new SetLineupNameScRsp
{
Retcode = 0,
Name = request.Name,
Index = request.Index
});
}
[Handler(CmdType.CmdStartCocoonStageCsReq)]
public static void OnStartCocoonStageCsReq(NetSession session, int cmdId, object data)
{
var request = data as StartCocoonStageCsReq;
Dictionary<uint, List<uint>> monsterIds = new Dictionary<uint, List<uint>>
{
{ 1, new List<uint> { 3013010, 3012010, 3013010, 3001010 } },
{ 2, new List<uint> { 8034010 } },
{ 3, new List<uint> { 3014022 } },
};
Dictionary<uint, uint> monsterLevels = new Dictionary<uint, uint>
{
{1,70},{2,70},{3,60}
};
//basic
var battleInfo = new SceneBattleInfo
{
StageId = 201012311,
LogicRandomSeed = 639771447,
WorldLevel = 6
};
var testRelic = new BattleRelic
{
Id = 61011,
Level = 999,
MainAffixId = 1,
SubAffixLists = {new RelicAffix
{
AffixId = 4,
Step = 999
} }
};
//avatar
List<uint> SkillIdEnds = new List<uint> { 1, 2, 3, 4, 7, 101, 102, 103, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210 };
List<uint> characters = new List<uint> { Avatar1, Avatar2, Avatar3, Avatar4 };
foreach (uint avatarId in characters)
{
var avatarData = new BattleAvatar
{
Id = avatarId,
Level = 80,
Promotion = 6,
Rank = 6,
Hp = 10000,
AvatarType = AvatarType.AvatarFormalType,
WorldLevel = 6,
Sp = new AmountInfo { CurAmount = 10000, MaxAmount = 10000 },
RelicLists = { testRelic },
EquipmentLists = {new BattleEquipment
{
Id = 23006,
Level = 80,
Rank = 5,
Promotion = 6
} }
};
foreach (uint end in SkillIdEnds)
{
uint level = 1;
if (end == 1) level = 6;
else if (end < 4 || end == 4) level = 10;
if (end > 4) level = 1;
avatarData.SkilltreeLists.Add(new AvatarSkillTree
{
PointId = avatarId * 1000 + end,
Level = level
});
}
battleInfo.BattleAvatarLists.Add(avatarData);
}
//monster
for (uint i = 1; i <= monsterIds.Count; i++)
{
SceneMonsterWave monsterInfo = new SceneMonsterWave
{
Pkgenfbhofi = i,
MonsterParam = new SceneMonsterParam
{
Level = monsterLevels[i],
}
};
if (monsterIds.ContainsKey(i))
{
List<uint> monsterIdList = monsterIds[i];
foreach (uint monsterId in monsterIdList)
{
monsterInfo.MonsterLists.Add(new SceneMonsterInfo
{
MonsterId = monsterId
});
}
}
battleInfo.MonsterWaveLists.Add(monsterInfo);
}
var response = new StartCocoonStageScRsp
{
Retcode = 0,
CocoonId = request.CocoonId,
Wave = request.Wave,
PropEntityId = request.PropEntityId,
BattleInfo = battleInfo
};
session.Send(CmdType.CmdStartCocoonStageScRsp, response);
}
[Handler(CmdType.CmdPVEBattleResultCsReq)]
public static void OnPVEBattleResultCsReq(NetSession session, int cmdId, object data)
{
var request = data as PVEBattleResultCsReq;
session.Send(CmdType.CmdPVEBattleResultScRsp, new PVEBattleResultScRsp
{
Retcode = 0,
EndStatus = request.EndStatus
});
}
}
}

View file

@ -6,16 +6,12 @@
internal static class LineupReqGroup internal static class LineupReqGroup
{ {
public static uint Avatar1 = 8001;
public static uint Avatar2 = 1308;
public static uint Avatar3 = 1304;
public static uint Avatar4 = 1301;
[Handler(CmdType.CmdGetCurLineupDataCsReq)] [Handler(CmdType.CmdGetCurLineupDataCsReq)]
public static void OnGetCurLineupDataCsReq(NetSession session, int cmdId, object _) public static void OnGetCurLineupDataCsReq(NetSession session, int cmdId, object _)
{ {
var response = new GetCurLineupDataScRsp var response = new GetCurLineupDataScRsp
{ {
Retcode = 0 Retcode = (uint)RetcodeStatus.RetSucc
}; };
response.Lineup = new LineupInfo response.Lineup = new LineupInfo
@ -23,11 +19,10 @@
ExtraLineupType = ExtraLineupType.LineupNone, ExtraLineupType = ExtraLineupType.LineupNone,
Name = "Squad 1", Name = "Squad 1",
LeaderSlot = 0, LeaderSlot = 0,
Mp = 5, Mp = 5
MaxMp = 5
}; };
var characters = new uint[] { Avatar1, Avatar2, Avatar3, Avatar4 }; var characters = new uint[] { 8001, 1307, 1306, 1312 };
foreach (uint id in characters) foreach (uint id in characters)
{ {
@ -50,7 +45,7 @@
{ {
var response = new GetAllLineupDataScRsp var response = new GetAllLineupDataScRsp
{ {
Retcode = 0, Retcode = (uint)RetcodeStatus.RetSucc,
CurIndex = 0, CurIndex = 0,
}; };
@ -59,11 +54,10 @@
ExtraLineupType = ExtraLineupType.LineupNone, ExtraLineupType = ExtraLineupType.LineupNone,
Name = "Squad 1", Name = "Squad 1",
Mp = 5, Mp = 5,
MaxMp = 5,
LeaderSlot = 0 LeaderSlot = 0
}); });
var characters = new uint[] { Avatar1, Avatar2, Avatar3, Avatar4 }; var characters = new uint[] { 8001, 1307, 1306, 1312 };
foreach (uint id in characters) foreach (uint id in characters)
{ {
@ -88,91 +82,8 @@
session.Send(CmdType.CmdChangeLineupLeaderScRsp, new ChangeLineupLeaderScRsp session.Send(CmdType.CmdChangeLineupLeaderScRsp, new ChangeLineupLeaderScRsp
{ {
Slot = request.Slot, Slot = request.Slot,
Retcode = 0 Retcode = (uint)RetcodeStatus.RetSucc
}); });
} }
[Handler(CmdType.CmdJoinLineupCsReq)]
public static void OnJoinLineupCsReq(NetSession session, int cmdId, object data)
{
var request = data as JoinLineupCsReq;
if (request.Slot == 0) Avatar1 = request.BaseAvatarId;
if (request.Slot == 1) Avatar2 = request.BaseAvatarId;
if (request.Slot == 2) Avatar3 = request.BaseAvatarId;
if (request.Slot == 3) Avatar4 = request.BaseAvatarId;
RefreshLineup(session);
session.Send(CmdType.CmdJoinLineupScRsp, new JoinLineupScRsp
{
Retcode = 0
});
}
[Handler(CmdType.CmdReplaceLineupCsReq)]
public static void OnReplaceLineupCsReq(NetSession session, int cmdId, object data)
{
var request = data as ReplaceLineupCsReq;
Avatar1 = 0; Avatar2 = 0; Avatar3 = 0; Avatar4 = 0;
foreach (LineupSlotData slotData in request.LineupSlotLists)
{
if (slotData.Slot == 0) Avatar1 = slotData.Id;
if (slotData.Slot == 1) Avatar2 = slotData.Id;
if (slotData.Slot == 2) Avatar3 = slotData.Id;
if (slotData.Slot == 3) Avatar4 = slotData.Id;
}
RefreshLineup(session);
session.Send(CmdType.CmdReplaceLineupScRsp, new ReplaceLineupScRsp
{
Retcode = 0
});
}
[Handler(CmdType.CmdQuitLineupCsReq)]
public static void OnQuitLineupCsReq(NetSession session, int cmdId, object data)
{
var request = data as QuitLineupCsReq;
if (request.BaseAvatarId == Avatar1) Avatar1 = 0;
if (request.BaseAvatarId == Avatar2) Avatar2 = 0;
if (request.BaseAvatarId == Avatar3) Avatar3 = 0;
if (request.BaseAvatarId == Avatar4) Avatar4 = 0;
RefreshLineup(session);
session.Send(CmdType.CmdQuitLineupScRsp, new QuitLineupScRsp
{
Retcode = 0,
BaseAvatarId = request.BaseAvatarId,
IsVirtual = request.IsVirtual
});
}
public static void RefreshLineup(NetSession session) {
var characters = new uint[] { Avatar1, Avatar2, Avatar3, Avatar4 };
var response = new SyncLineupNotify
{
Lineup = new LineupInfo
{
ExtraLineupType = ExtraLineupType.LineupNone,
Name = "Squad 1",
Mp = 5,
MaxMp = 5,
LeaderSlot = 0
}
};
foreach (uint id in characters)
{
if (id == 0) continue;
response.Lineup.AvatarLists.Add(new LineupAvatar
{
AvatarType = AvatarType.AvatarFormalType,
Sp = new AmountInfo { CurAmount = 10000, MaxAmount = 10000 },
Hp = 10000,
Satiety = 100,
Id = id,
Slot = (uint)response.Lineup.AvatarLists.Count
});
}
session.Send(CmdType.CmdSyncLineupNotify, response);
}
} }
} }

View file

@ -12,108 +12,19 @@
var request = data as GetMissionStatusCsReq; var request = data as GetMissionStatusCsReq;
GetMissionStatusScRsp response = new GetMissionStatusScRsp GetMissionStatusScRsp response = new GetMissionStatusScRsp
{ {
Retcode = 0, Retcode = (uint)RetcodeStatus.RetSucc,
}; };
response.FinishedMainMissionIdLists = new uint[] { response.FinishedMainMissionIdLists = new uint[] {
1000101, 1000111, 1000112, 1000113, 1000114, 1000201, 1000202, 1000203, 1000204, 1000300, 1000301, 1000302, 1000303, 1000101,1000112,1000113,1000201,1000202,1000204,1000301,1000401,1000402,1000410,1000510,1000601,1010301,
1000304, 1000400, 1000401, 1000402, 1000410, 1000500, 1000501, 1000502, 1000503, 1000504, 1000505, 1000510, 1000511, 1010302,1010401,1010403,1010701,1011403,1010202,1010902,1011102,4010101 };
1010001, 1010002, 1010101, 1010201, 1010202, 1010203, 1010204, 1010205, 1010206, 1010301, 1010302, 1010303, 1010401,
1010405, 1010402, 1010403, 1010500, 1010501, 1010502, 1010503, 1010601, 1010602, 1010700, 1010701, 1010801, 1010802,
1010901, 1010902, 1011001, 1011002, 1011003, 1011100, 1011101, 1011102, 1011103, 1011201, 1011202, 1011301, 1011400,
1011401, 1011402, 1011403, 1011501, 1011502, 1011503, 1020101, 1020201, 1020302, 1020301, 1020400, 1020401, 1020402,
1020403, 1020501, 1020601, 1020701, 1020702, 1020801, 1020901, 1021001, 1021101, 1021201, 1021301, 1021401, 1021501,
1021601, 1021702, 1021703, 1030101, 1030102, 1030201, 1030202, 1030301, 1030302, 1030303, 1030304, 1030401, 1030402,
1030403, 1030501, 1030601, 1030701, 1030702, 1030801, 2000001, 2000002, 2000003, 2000004, 2000100, 2000101, 2000131,
2000132, 2000133, 2000110, 2000111, 2000301, 2000103, 2000112, 2000108, 2000104, 2000102, 2000105, 2000106, 2000107,
2000313, 2000314, 2000109, 2000113, 2000116, 2000118, 2000119, 2000120, 2000122, 2000302, 2000303, 2000304, 2000305,
2000310, 2000311, 2000312, 2000320, 2000701, 2000702, 2000703, 2000704, 2000705, 2000706, 2000707, 2000801, 2000802,
2000803, 2000901, 2000902, 2000903, 2001001, 2001002, 2001003, 2010005, 2010301, 2010302, 2011103, 2011104, 2011409,
2010401, 2010402, 2010405, 2010502, 2010503, 2010701, 2010708, 2010709, 2010720, 2010730, 2010731, 2010732, 2010733,
2010734, 2010735, 2010904, 2011101, 2011102, 2011105, 2011301, 2011302, 2011303, 2011501, 2011502, 2010909, 2010910,
2011601, 2011701, 2011801, 2011901, 2011902, 2011903, 2011904, 2011905, 2011906, 2020301, 2020302, 2020304, 2020316,
2020317, 2020318, 2020319, 2020401, 2020402, 2020403, 2020404, 2020405, 2020406, 2020407, 2020303, 2020103, 2020104,
2020105, 2020106, 2020107, 2020108, 2020109, 2020110, 2020111, 2020201, 2020202, 2020203, 2020204, 2020205, 2000201,
2000202, 2000203, 2000204, 2000205, 2000206, 2000207, 2000208, 2000209, 2000211, 2000212, 2010201, 2010202, 2010203,
2010204, 2010205, 2010206, 2010500, 2010501, 2010705, 2010706, 2010901, 2010902, 2010903, 2010702, 2010703, 2011400,
2011401, 2011406, 2011402, 2011403, 2011404, 2011405, 2011407, 2011408, 2011410, 2011411, 2011412, 2011413, 2010905,
2010906, 2010907, 2010908, 2010911, 2010912, 2020305, 2020306, 2020309, 2020307, 2020308, 2020701, 2020702, 2020703,
2020313, 2020314, 2020315, 6020101, 6020201, 6020202, 2020501, 2020502, 2020503, 2020504, 2020505, 2020506, 2020507,
2020601, 2020602, 2020603, 2020604, 2020801, 2020802, 2020901, 2021001, 2021002, 2021009, 2021601, 2021602, 2021701,
2021702, 2021703, 2021704, 2021705, 2021801, 2021802, 2021803, 2030001, 2030002, 2030003, 2030101, 2030102, 2030201,
2030202, 2030203, 2030301, 2030302, 3000201, 3000202, 3000203, 3000211, 3000212, 3000213, 3000301, 3000302, 3000303,
3000522, 3000523, 3000524, 3000525, 3000526, 3000527, 3000601, 3000602, 3000603, 3000604, 3000701, 3000702, 3000703,
3000704, 3000705, 3000800, 3000801, 3000802, 3000803, 3010102, 3010103, 3010104, 3010105, 3010201, 3010202, 3010203,
3010204, 3010205, 3011011, 3011012, 3011013, 3011014, 3011111, 3011112, 3011113, 3011114, 3011201, 3011202, 3011203,
3011204, 3011205, 3011206, 3011207, 3011208, 3011401, 3011402, 3011403, 3011404, 3011405, 3011406, 3011407, 3011408,
3011501, 3011502, 3011503, 3011504, 3011505, 3011601, 3011602, 3011603, 3011604, 3011605, 3011606, 3011607, 3011608,
3011609, 3011610, 3012001, 3020101, 3020102, 3020103, 3020104, 3020105, 3020106, 3020107, 3020108, 3020201, 3020202,
3020203, 3020204, 3020205, 3020206, 4020101, 4020102, 4020103, 4020104, 4020105, 4020106, 4020107, 4020108, 4020109,
4020110, 4020111, 4020112, 4020113, 4020114, 4010105, 4010106, 4010107, 4010112, 4010113, 4010131, 4010115, 4010116,
4010121, 4010122, 4010123, 4010124, 4010125, 4010126, 4010127, 4010128, 4010133, 4010134, 4010135, 4010130, 4010136,
4010137, 4010138, 4010140, 4010141, 4015101, 4015103, 4015102, 4015202, 4015203, 4015204, 4015301, 4015302, 4015303,
4015401, 4015402, 4015403, 4015501, 4015601, 4015701, 4030001, 4030002, 4030003, 4030004, 4030006, 4030007, 4030009,
4030010, 4040001, 4040002, 4040003, 4040004, 4040005, 4040006, 4040052, 4040007, 4040008, 4040051, 4040009, 4040010,
4040011, 4040012, 4040053, 4040014, 4040015, 4040017, 4040018, 4040019, 4040020, 4040021, 4040022, 4040023, 4040024,
4040100, 4040189, 4040190, 4040101, 4040151, 4040154, 4040102, 4040103, 4040153, 4040104, 4040152, 4040105, 4040106,
4040155, 4040107, 4040108, 4040109, 4040156, 4040157, 4040110, 4040114, 4040115, 4040158, 4040159, 4040160, 4040161,
4040162, 4040116, 4040169, 4040163, 4040164, 4040165, 4040166, 4040167, 4040168, 4040170, 4040171, 4040172, 4040173,
4040174, 4040175, 4040176, 4040177, 4040178, 4040179, 4040180, 4040181, 4040182, 4040183, 4040184, 4040185, 4040186,
4040117, 4040118, 4040119, 4040187, 4040120, 4040188, 4040121, 4040122, 4040123, 4040124, 4040125, 4040126, 4040127,
4040128, 4040129, 4040130, 4140101, 4140102, 4140103, 4140104, 4140105, 4140106, 4140107, 4140108, 4140109, 4140110,
4140111, 4140112, 4140113, 4140114, 4140115, 4140116, 4140117, 4140118, 4140119, 4140120, 4140121, 4140122, 4140123,
4040201, 4040202, 4040203, 4040204, 4040205, 4040206, 4040207, 4040208, 4040290, 4040209, 4040210, 4040211, 4040212,
4040213, 4040214, 4040215, 4040216, 4040217, 4040218, 4040219, 4040220, 4040221, 4040222, 4040223, 4040224, 4040225,
4040226, 4040227, 4040228, 4040229, 4040230, 4040231, 4040240, 4040241, 4040242, 4040244, 4040245, 4040246, 4040247,
4040248, 4040249, 4040250, 4040251, 4040252, 4040253, 4040254, 4040255, 4040256, 4040257, 4040258, 4040259, 4040260,
4040261, 4040262, 4040263, 4040264, 4240301, 4240302, 4240304, 4240305, 4240306, 4240307, 4240308, 4240309, 4240310,
4240311, 4240312, 4240313, 4240314, 4240316, 4240317, 4240401, 4240402, 4340101, 4340102, 4340103, 4340104, 4340105,
4340106, 4340107, 4340108, 4340150, 4340151, 4340152, 4340153, 4340154, 4340155, 4340156, 4340157, 4540101, 4540102,
4540103, 4540104, 4540105, 4540106, 4540107, 4540111, 4540112, 4540113, 4540114, 4540201, 4540202, 4540203, 4540204,
4540205, 4540206, 4540211, 4540212, 4540213, 4540214, 4540301, 4540302, 4540303, 4540304, 4540305, 4540306, 4540307,
4540311, 4540312, 4540313, 4540314, 4540315, 4540401, 4540402, 4540403, 4540404, 4540405, 4540406, 4540407, 4540408,
4540411, 4540412, 4540413, 4540414, 4040300, 4040301, 4040302, 4040303, 4040304, 4040305, 4040306, 4040307, 4040308,
4040309, 4040310, 4040311, 4040312, 4040313, 4040314, 4040315, 4040316, 4040317, 4040318, 4040319, 4040320, 4040321,
4040322, 4040323, 4040324, 4040325, 4040326, 4040327, 4040328, 4040329, 4040330, 4040331, 4040341, 4050005, 4050007,
4050008, 4050009, 4050010, 4050011, 4050012, 4050013, 4050014, 4050015, 4050016, 4050017, 4050018, 4050019, 4050020,
4050021, 4050022, 4050023, 4050024, 4050025, 4050026, 4050027, 4050028, 4050029, 4050030, 4050031, 4050032, 4050033,
4050034, 4050035, 4050036, 4050037, 4050038, 4050039, 4072121, 4072122, 4072123, 4071311, 4071312, 4071313, 4071320,
4071321, 4071322, 4122101, 4122102, 4122103, 4072011, 4072012, 4072013, 4072021, 4072022, 4072023, 4072024, 4070011,
4070012, 4070013, 4081311, 4081312, 4081313, 4081314, 4081315, 4081316, 4081317, 4081318, 8000001, 8000002, 8000101,
8000102, 8000104, 8000105, 8000131, 8000132, 8000133, 8000134, 8000135, 8000136, 8000137, 8000138, 8000139, 8000151,
8000152, 8000153, 8000154, 8000155, 8000156, 8000157, 8000158, 8000159, 8000161, 8000162, 8000170, 8000171, 8000172,
8000173, 8000174, 8000175, 8000177, 8000178, 8000180, 8000181, 8000183, 8000182, 8000185, 8000184, 8000186, 8000187,
8000188, 8000189, 8000201, 8000202, 8000203, 8000204, 8001201, 8001202, 8001203, 8001205, 8001206, 8001207, 8001208,
8001209, 8001211, 8001212, 8001213, 8001215, 8001216, 8001219, 8001220, 8001223, 8001224, 8001225, 8001226, 8001227,
8001204, 8001210, 8001214, 8001217, 8001218, 8001221, 8001222, 8001241, 8001242, 8001243, 8001244, 8001251, 8001252,
8001253, 8001254, 8001255, 8001261, 8001262, 8001263, 8001264, 8001265, 8001266, 8001267, 8001268, 8011401, 8002100,
8002101, 8002102, 8002106, 8002103, 8002104, 8002105, 8002107, 8002201, 8002202, 8002211, 8002212, 8002213, 8002214,
8002221, 8002222, 8002231, 8002232, 8002233, 8002234, 8003101, 8003102, 8003201, 8003202, 8003213, 8003214, 8003204,
8003220, 8003217, 8003203, 8003215, 8003205, 8003206, 8003207, 8003221, 8003218, 8003208, 8003216, 8003209, 8003210,
8003222, 8003219, 8003211, 8003212, 8003240, 8003241, 8003242, 8003243, 8003244, 8003245, 8003246, 8003247, 8003248,
8003249, 8003250, 8003251, 8003260, 8003261, 8003262, 8003263, 8003264, 8003265, 8003266, 8003267, 8003268, 8003269,
8003278, 8003279, 8003280, 8003281, 8003282, 8003283, 8003284, 8012101, 8012102, 8012103, 8012104, 8012105, 8012106,
8012107, 8012401, 8013101, 8013102, 8013103, 8013104, 8013105, 8013106, 8013107, 8013108, 8013109, 8013110, 8014101,
8014102, 8014103, 8014104, 8014105, 8014106, 8014108, 8014112, 8014121, 8014122, 8014123, 8014124, 8014125, 8014126,
8014127, 8014128, 8014129, 8014130, 8014131, 8014132, 8014133, 8014134, 8014135, 8014136, 8014137, 8014138, 8014139,
8014140, 8014141, 8014142, 8014143, 8014144, 8014145, 8014146, 8014147, 8014148, 8014149, 8014150, 8014161, 8014162,
8014163, 8014164, 8014165, 8014166, 8014167, 8014168, 8015191, 8015101, 8015111, 8015192, 8015102, 8015112, 8015193,
8015103, 8015113, 8015123, 8015194, 8015104, 8015114, 8015195, 8015196, 8015197, 8015198, 8015150, 8015151, 8015152,
8015153, 8015154, 8015155, 8015156, 8015157, 8015158, 8015159, 8015161, 8015162, 8015163, 8015164, 8015165, 8015171,
8015172, 8015173, 8015180, 8015201, 8015202, 8015203, 8016101, 8016102, 8016103, 8016104, 8016105, 8016106, 8016201,
8016202, 8016203, 8016204, 8016205, 8016206, 8016207, 8016208, 8016209, 8016210, 8016211, 8016212, 8016213, 8016301,
8016302, 8016303, 8016304, 8016305, 8017101, 8017102, 8020101, 8020102, 8020103, 8020104, 8020105, 8020106, 8020107,
8020108, 8020201, 8020202, 8020203, 8020204, 8020205, 8020206, 8020207, 8020208, 8020209, 8020210, 8020211, 8020212,
8020213, 8020214, 8020215, 8020216, 8020217, 8020218, 8020219, 8020220, 8020221, 8020222, 8020223, 8020224, 8020225,
8020226, 8020227, 8020228, 8020229, 8020230, 8020231, 8020232, 8020233, 8020234, 8020235, 8020236, 8020300, 8020301,
8020302, 8020303, 8020304, 8020305 };
if (request.SubMissionIdLists != null) if (request.SubMissionIdLists != null)
{ {
foreach (uint id in request.SubMissionIdLists) foreach (uint id in request.SubMissionIdLists)
{ {
response.SubMissionStatusLists.Add(new Mission() response.MissionEventStatusLists.Add(new Mission()
{ {
Id = id, Id = id,
Progress = 0, Progress = 0,
@ -126,7 +37,7 @@
{ {
foreach (uint id in request.MainMissionIdLists) foreach (uint id in request.MainMissionIdLists)
{ {
response.MissionEventStatusLists.Add(new Mission() response.SubMissionStatusLists.Add(new Mission()
{ {
Id = id, Id = id,
Progress = 0, Progress = 0,

View file

@ -12,31 +12,31 @@
public static void OnGetNpcTakenRewardCsReq(NetSession session, int cmdId, object data) public static void OnGetNpcTakenRewardCsReq(NetSession session, int cmdId, object data)
{ {
var npcRewardReq = data as GetNpcTakenRewardCsReq; var npcRewardReq = data as Eddbhmdjadb;
session.Send(CmdType.CmdGetNpcTakenRewardScRsp, new GetNpcTakenRewardScRsp session.Send(CmdType.CmdGetNpcTakenRewardScRsp, new Nikhfbniagb
{ {
NpcId = npcRewardReq.NpcId, NpcId = npcRewardReq.Okonlennkfb,
Retcode = 0 Retcode = (uint)RetcodeStatus.RetSucc
}); });
} }
[Handler(CmdType.CmdGetFirstTalkByPerformanceNpcCsReq)] [Handler(CmdType.CmdGetFirstTalkByPerformanceNpcCsReq)]
public static void OnGetFirstTalkByPerformanceNpcCsReq(NetSession session, int cmdId, object data) public static void OnGetFirstTalkByPerformanceNpcCsReq(NetSession session, int cmdId, object data)
{ {
var npcPerformanceReq = data as GetFirstTalkByPerformanceNpcCsReq; var npcPerformanceReq = data as Jknjlicadhe;
var response = new GetFirstTalkByPerformanceNpcScRsp var response = new Kpbeklbbihd
{ {
Retcode = 0 Retcode = (uint)RetcodeStatus.RetSucc
}; };
foreach(uint id in npcPerformanceReq.FirstTalkIdLists) foreach(uint id in npcPerformanceReq.Ffgeablhjmms)
{ {
response.NpcMeetStatusLists.Add(new NpcMeetStatusInfo response.Hhldcbegobcs.Add(new NpcMeetStatusInfo
{ {
IsMeet = true, Jgndlkbohij = true,
MeetId = id Okonlennkfb = id
}); });
} }

View file

@ -22,14 +22,9 @@
session.Send(CmdType.CmdPlayerHeartBeatScRsp, new PlayerHeartBeatScRsp session.Send(CmdType.CmdPlayerHeartBeatScRsp, new PlayerHeartBeatScRsp
{ {
Retcode = 0, Retcode = (uint)RetcodeStatus.RetSucc,
DownloadData = new ClientDownloadData DownloadData = new ClientDownloadData(),
{
Version = 51,
Time = DateTimeOffset.Now.ToUnixTimeMilliseconds(),
Data = Convert.FromBase64String("G0x1YVMBGZMNChoKBAQICHhWAAAAAAAAAAAAAAAod0ABD0BGcmVlU1JMdWEudHh0AAAAAAAAAAAAAQccAAAAJABAAClAQAApgEAAKcBAAFYAAQAsgAABXUBBAOSAQQAkAUAAKcFBAikBQgIpQUIC7AAAAWyAAACWgAIA6cDCAMEAwwEWAQMAqoABgKlBgQCpQUMDqYFDAxLAQwMRQACAqUGBAJ9BRIiewP1/GQCAABIAAAAEA0NTBAxVbml0eUVuZ2luZQQLR2FtZU9iamVjdAQFRmluZAQpVUlSb290L0Fib3ZlRGlhbG9nL0JldGFIaW50RGlhbG9nKENsb25lKQQYR2V0Q29tcG9uZW50c0luQ2hpbGRyZW4EB3R5cGVvZgQEUlBHBAdDbGllbnQEDkxvY2FsaXplZFRleHQTAAAAAAAAAAAEB0xlbmd0aBMBAAAAAAAAAAQLZ2FtZU9iamVjdAQFbmFtZQQJSGludFRleHQEBXRleHQUYTxiPkZyZWVTUiBpcyBhIGZyZWUgc29mdHdhcmUuRnJlZVNS5piv5LiA5Liq5YWN6LS56L2v5Lu244CCIGh0dHBzOi8vZGlzY29yZC5nZy9yZXZlcnNlZHJvb21zPC9iPgEAAAABAAAAAAAcAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAEAAAABAAAAAQAAAAEAAAABAAAAAUAAAAFAAAABQAAAAUAAAAFAAAABgAAAAYAAAAEAAAACQAAAAYAAAAEb2JqBgAAABwAAAAHY29tcHRzDgAAABwAAAAMKGZvciBpbmRleCkSAAAAGwAAAAwoZm9yIGxpbWl0KRIAAAAbAAAACyhmb3Igc3RlcCkSAAAAGwAAAAJpEwAAABoAAAABAAAABV9FTlY=")
},
ClientTimeMs = heartbeatReq.ClientTimeMs, ClientTimeMs = heartbeatReq.ClientTimeMs,
ServerTimeMs = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds() ServerTimeMs = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds()
}); });
@ -40,17 +35,19 @@
{ {
session.Send(CmdType.CmdGetHeroBasicTypeInfoScRsp, new GetHeroBasicTypeInfoScRsp session.Send(CmdType.CmdGetHeroBasicTypeInfoScRsp, new GetHeroBasicTypeInfoScRsp
{ {
Retcode = 0, Retcode = (uint)RetcodeStatus.RetSucc,
Gender = Gender.GenderMan, Gender = Gender.GenderMan,
BasicTypeInfoLists ={ Cdkjkpnjjjas ={
new PlayerHeroBasicTypeInfo new Hlbbodklpbo
{ {
BasicType = HeroBasicType.BoyWarrior, Peihhlcchfj = HeroBasicType.BoyWarrior,
Rank = 1, Rank = 1,
Knhaecbafbas = {} Chmeifanmags = {}
} }
}, },
CurBasicType = HeroBasicType.BoyWarrior, CurBasicType = HeroBasicType.BoyWarrior,
Bhepmbpaojp = false,
Cnlbajkmnbn = false
}); });
} }
@ -74,10 +71,10 @@
session.Send(CmdType.CmdPlayerLoginScRsp, new PlayerLoginScRsp session.Send(CmdType.CmdPlayerLoginScRsp, new PlayerLoginScRsp
{ {
Retcode = 0, Retcode = (uint)RetcodeStatus.RetSucc,
//IsNewPlayer = false, //IsNewPlayer = false,
LoginRandom = request.LoginRandom, LoginRandom = request.LoginRandom,
Stamina = 240, Stamina = 100,
ServerTimestampMs = (ulong)DateTimeOffset.Now.ToUnixTimeSeconds() * 1000, ServerTimestampMs = (ulong)DateTimeOffset.Now.ToUnixTimeSeconds() * 1000,
BasicInfo = new PlayerBasicInfo BasicInfo = new PlayerBasicInfo
{ {
@ -98,12 +95,30 @@
{ {
session.Send(CmdType.CmdPlayerGetTokenScRsp, new PlayerGetTokenScRsp session.Send(CmdType.CmdPlayerGetTokenScRsp, new PlayerGetTokenScRsp
{ {
Retcode = 0, Retcode = (uint)RetcodeStatus.RetSucc,
Uid = 1337, Uid = 1337,
//BlackInfo = null, //BlackInfo = null,
Msg = "OK", Msg = "OK",
SecretKeySeed = 0 SecretKeySeed = 0
}); });
byte[] decodedBytes = Convert.FromBase64String("eyJPcGdpbW5rb2tuanMiOlt7Iklvbm1sb2tjZ25nIjowLCJCZWdpblRpbWUiOjAsIkpvZGlwZ2xkb2hqIjoiIiwiR2djYWFrZ2ZjYm8iOmZhbHNlLCJFbmRUaW1lIjoyMDIxOTc4Nzc0LCJEZWxnam5jaGxwaiI6IiIsIkNvbmZpZ0lkIjowLCJKaGpiZ21tcGNjaiI6IkZyZWVTUiBpcyBhIGZyZWUgYW5kIG9wZW4tc291cmNlIHNvZnR3YXJlLCBpZiB5b3UgcGFpZCBmb3IgdGhpcywgeW91IGhhdmUgYmVlbiBzY2FtbWVkISBGcmVlU1LmmK/kuIDkuKrlhY3otLnkuJTlvIDmupDnmoTova/ku7bvvIzlpoLmnpzkvaDmmK/oirHpkrHkubDmnaXnmoTvvIzor7TmmI7kvaDooqvpqpfkuobvvIFyZXBvc2l0b3J5IGxpbmsg5LuT5bqT5Zyw5Z2AOmh0dHBzOi8vZ2l0Lnhlb25kZXYuY29tL01vdXgyMzMzMy9GcmVlU1IiLCJLcGZmY2hjb2xlZCI6MH1dfQ==");
string decodedJsonData = Encoding.UTF8.GetString(decodedBytes);
ServerAnnounceNotify announceNotify = JsonConvert.DeserializeObject<ServerAnnounceNotify>(decodedJsonData);
session.Send(10, announceNotify);
/*session.Send(10, new ServerAnnounceNotify
{
Opgimnkoknjs =
{
new AnnounceData
{
BeginTime = 0,
EndTime = DateTimeOffset.Now.ToUnixTimeSeconds() + 10,
Jhjbgmmpccj = @"FreeSR is a free and open-source software, if you paid for this, you have been scammed! FreeSR是一个免费且开源的软件如果你是花钱买来的说明你被骗了repository link 仓库地址:https://git.xeondev.com/Moux23333/FreeSR"
}
}
});*/
} }
} }
} }

View file

@ -3,7 +3,6 @@
using FreeSR.Gateserver.Manager.Handlers.Core; using FreeSR.Gateserver.Manager.Handlers.Core;
using FreeSR.Gateserver.Network; using FreeSR.Gateserver.Network;
using FreeSR.Proto; using FreeSR.Proto;
using System.Numerics;
internal static class SceneReqGroup internal static class SceneReqGroup
@ -16,12 +15,12 @@
GameModeType = 1, GameModeType = 1,
//Bkmbkahohif = 1, //Bkmbkahohif = 1,
//Admbbnbnibk = 1, //Admbbnbnibk = 1,
EntryId = 2032101, EntryId = 1030101,
PlaneId = 20321, PlaneId = 10301,
FloorId = 20321001, FloorId = 10301001,
}; };
/*scene.EntityLists.Add(new SceneEntityInfo scene.EntityLists.Add(new SceneEntityInfo
{ {
EntityId = 0, EntityId = 0,
GroupId = 0, GroupId = 0,
@ -31,52 +30,13 @@
Pos = new Vector(), Pos = new Vector(),
Rot = new Vector() Rot = new Vector()
} }
});*/ });
session.Send(CmdType.CmdGetCurSceneInfoScRsp, new GetCurSceneInfoScRsp session.Send(CmdType.CmdGetCurSceneInfoScRsp, new GetCurSceneInfoScRsp
{ {
Scene = scene, Scene = scene,
Retcode = 0 Retcode = (uint)RetcodeStatus.RetSucc
}); });
} }
[Handler(CmdType.CmdGetSceneMapInfoCsReq)]
public static void OnGetSceneMapInfoCsReq(NetSession session, int cmdId, object data)
{
var request = data as GetSceneMapInfoCsReq;
uint[] back = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 0 };
var mapinfo = new SceneMapInfo
{
Retcode = 0,
LightenSectionLists = back,
ChestLists = {
new ChestInfo
{
ChestType = ChestType.MapInfoChestTypeNormal
},
new ChestInfo
{
ChestType = ChestType.MapInfoChestTypePuzzle
},
new ChestInfo
{
ChestType = ChestType.MapInfoChestTypeChallenge
}
},
};
var response = new GetSceneMapInfoScRsp
{
Retcode = 0,
EntryId = request.EntryIdLists[0],
CurMapEntryId = request.EntryId,
SceneMapInfoes = { mapinfo },
LightenSectionLists = back,
};
session.Send(CmdType.CmdGetSceneMapInfoScRsp, response);
}
} }
} }

View file

@ -14,7 +14,7 @@
{ {
var response = new GetTutorialGuideScRsp var response = new GetTutorialGuideScRsp
{ {
Retcode = 0 Retcode = (uint)RetcodeStatus.RetSucc
}; };
uint[] guides = new uint[] uint[] guides = new uint[]
@ -50,7 +50,7 @@
var response = new GetTutorialScRsp var response = new GetTutorialScRsp
{ {
Retcode = 0, Retcode = (uint)RetcodeStatus.RetSucc,
}; };
foreach (uint id in completedTutorials) foreach (uint id in completedTutorials)

View file

@ -25,28 +25,18 @@
//{CmdType.CmdGetQuestDataCsReq, typeof(GetQuestDataCsReq)}, //{CmdType.CmdGetQuestDataCsReq, typeof(GetQuestDataCsReq)},
//{CmdType.CmdGetChallengeCsReq, typeof(GetChallengeCsReq)}, //{CmdType.CmdGetChallengeCsReq, typeof(GetChallengeCsReq)},
{CmdType.CmdGetCurSceneInfoCsReq, typeof(GetCurSceneInfoCsReq)}, {CmdType.CmdGetCurSceneInfoCsReq, typeof(GetCurSceneInfoCsReq)},
{CmdType.CmdGetSceneMapInfoCsReq, typeof(GetSceneMapInfoCsReq)},
{CmdType.CmdGetBasicInfoCsReq, typeof(GetBasicInfoCsReq)}, {CmdType.CmdGetBasicInfoCsReq, typeof(GetBasicInfoCsReq)},
{CmdType.CmdGetHeroBasicTypeInfoCsReq, typeof(GetHeroBasicTypeInfoCsReq)}, {CmdType.CmdGetHeroBasicTypeInfoCsReq, typeof(Hlbbodklpbo)},
{CmdType.CmdPlayerHeartBeatCsReq, typeof(PlayerHeartBeatCsReq)}, {CmdType.CmdPlayerHeartBeatCsReq, typeof(PlayerHeartBeatCsReq)},
//{CmdType.CmdGetGachaInfoCsReq, typeof(GetGachaInfoCsReq)}, //{CmdType.CmdGetGachaInfoCsReq, typeof(GetGachaInfoCsReq)},
//{CmdType.CmdDoGachaCsReq, typeof(DoGachaCsReq)}, //{CmdType.CmdDoGachaCsReq, typeof(DoGachaCsReq)},
{CmdType.CmdGetNpcTakenRewardCsReq, typeof(GetNpcTakenRewardCsReq)}, {CmdType.CmdGetNpcTakenRewardCsReq, typeof(Eddbhmdjadb)},
{CmdType.CmdGetFirstTalkByPerformanceNpcCsReq, typeof(GetFirstTalkByPerformanceNpcCsReq)}, {CmdType.CmdGetFirstTalkByPerformanceNpcCsReq, typeof(Jknjlicadhe)},
{CmdType.CmdSceneEntityMoveCsReq, typeof(SceneEntityMoveCsReq)}, //{CmdType.CmdGetBagCsReq, typeof(GetBagCsReq)}
{CmdType.CmdReplaceLineupCsReq, typeof(ReplaceLineupCsReq)},
{CmdType.CmdJoinLineupCsReq, typeof(JoinLineupCsReq)},
{CmdType.CmdQuitLineupCsReq, typeof(QuitLineupCsReq)},
{CmdType.CmdSwapLineupCsReq, typeof(SwapLineupCsReq)},
{CmdType.CmdSetLineupNameCsReq, typeof(SetLineupNameCsReq)},
{CmdType.CmdStartCocoonStageCsReq, typeof(StartCocoonStageCsReq)},
{CmdType.CmdPVEBattleResultCsReq, typeof(PVEBattleResultCsReq)}
}); });
s_types = builder.ToImmutable(); s_types = builder.ToImmutable();

View file

@ -28,5 +28,20 @@
await _channel.WriteAndFlushAsync(packet); await _channel.WriteAndFlushAsync(packet);
} }
public async void Send<T>(int cmdId, T data) where T : class
{
var packet = new NetPacket()
{
CmdId = cmdId,
Data = data
};
var buffer = Unpooled.Buffer();
packet.Serialize<T>(buffer);
packet.Buf = buffer;
await _channel.WriteAndFlushAsync(packet);
}
} }
} }

View file

@ -33,7 +33,6 @@
NotifyManager.AddReqGroupHandler(typeof(SceneReqGroup)); NotifyManager.AddReqGroupHandler(typeof(SceneReqGroup));
NotifyManager.AddReqGroupHandler(typeof(GachaReqGroup)); NotifyManager.AddReqGroupHandler(typeof(GachaReqGroup));
NotifyManager.AddReqGroupHandler(typeof(NPCReqGroup)); NotifyManager.AddReqGroupHandler(typeof(NPCReqGroup));
NotifyManager.AddReqGroupHandler(typeof(BattleReqGroup));
NotifyManager.Init(); NotifyManager.Init();
} }

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AACCGBNDAIO
{
[ProtoMember(5)] public int Bepmagjiopb;
[ProtoMember(8)] public AvatarType AvatarType;
}
}

View file

@ -0,0 +1,17 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AAEALIKMCLG
{
[ProtoMember(4)] public int Damage;
[ProtoMember(6)] public int Nbeecnlkomn;
[ProtoMember(10)] public int Bepmagjiopb;
[ProtoMember(2)] public int StageId;
[ProtoMember(12)] public string Nickname;
[ProtoMember(8)] public long Time;
[ProtoMember(7)] public int Uid;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ABCCDLAAOOO
{
[ProtoMember(15)] public int Hmekpnciefb;
[ProtoMember(2)] public int Cdgdnnefneb;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ABJKDBCKFCC
{
[ProtoMember(6)] public int Retcode;
}
}

View file

@ -0,0 +1,10 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ABMGNABMJGH
{
}
}

View file

@ -0,0 +1,14 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ACCJMILCGPF
{
[ProtoMember(9)] public int Retcode;
[ProtoMember(13)] public ItemList Reward;
[ProtoMember(10)] public int TakeDays;
[ProtoMember(4)] public int Id;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ACHPPEPELLJ
{
[ProtoMember(6)] public JOGGEDDHDHG Ngkebflomii;
[ProtoMember(13)] public int Retcode;
}
}

View file

@ -0,0 +1,13 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ACIEPALMNIK
{
[ProtoMember(12)] public int Hcekcjdooch;
[ProtoMember(14)] public int Retcode;
[ProtoMember(11)] public BBNEDLDINPO Lihledalfil;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ACJBCDBLJEG
{
[ProtoMember(2)] public int Malnbhckeni;
}
}

View file

@ -0,0 +1,15 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ACJFOAHHHFN
{
[ProtoMember(11)] public int Khobiklbdnl;
[ProtoMember(9)] public int Pjhbeoiiddl;
[ProtoMember(10)] public int Ipfabmcjdmn;
[ProtoMember(12)] public int Dfffenfgffn;
[ProtoMember(1)] public int Dpnklgjojpl;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ACKDBJMBHCJ
{
[ProtoMember(2)] public int StageId;
}
}

View file

@ -0,0 +1,15 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ACNAFDDOMOG
{
[ProtoMember(1)] public bool Hgjpcbddcma;
[ProtoMember(2)] public int Kfjkgomionh;
[ProtoMember(3)] public bool Okeokgaicel;
[ProtoMember(4)] public string Bamfbgadfik;
[ProtoMember(5)] public bool Peohgknpoji;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ACPCLKJPLEA
{
[ProtoMember(2)] public int Retcode;
}
}

View file

@ -0,0 +1,10 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ADBPNOOODLJ
{
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
public enum ADJGAMMCGGM
{
SECRET_KEY_NONE = 0,
SECRET_KEY_SERVER_CHECK = 1,
SECRET_KEY_VIDEO = 2,
SECRET_KEY_BATTLE_TIME = 3,
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ADMFMNOFEEJ
{
[ProtoMember(2)] public IEHIDDGOALL Ckajekffbdp;
[ProtoMember(14)] public DOFPJABOAAH Cjdfiiacefo;
}
}

View file

@ -0,0 +1,10 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class ADPDFNPMFOG
{
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AEAFLDGKLCM
{
[ProtoMember(4)] public int Opcfmgjjfia;
[ProtoMember(6)] public int Retcode;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AEEBKCJEIDE
{
[ProtoMember(15)] public JDOFGIPGPBC Kiiipnflhkf;
}
}

View file

@ -0,0 +1,13 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AEHDBIMPFKO
{
[ProtoMember(14)] public int Retcode;
[ProtoMember(9)] public BBMHAKPCLDC Agodpmobkah;
[ProtoMember(11)] public BBMHAKPCLDC Hajhcfooipp;
}
}

View file

@ -0,0 +1,13 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AEJGPEBIEKD
{
[ProtoMember(8)] public int Nmanfpffopk;
[ProtoMember(11)] public int Ddpdfgfcdnf;
[ProtoMember(5)] public int Kjoacmenfbd;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AEMFCABAKNJ
{
[ProtoMember(4)] public int Id;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
public enum AFCELKDNCJB
{
ROGUE_HANDBOOK_MIRACLE_STATUS_LOCK = 0,
ROGUE_HANDBOOK_MIRACLE_STATUS_UNLOCK = 1,
ROGUE_HANDBOOK_MIRACLE_STATUS_MEET = 2,
ROGUE_HANDBOOK_MIRACLE_STATUS_GET = 3,
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AFDEBFHBBBE
{
[ProtoMember(7)] public List<int> Ddhddkakfah;
[ProtoMember(10)] public bool Ilblcgbhkhm;
}
}

View file

@ -0,0 +1,10 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AFHINEFMGON
{
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AGAIEHANEIC
{
[ProtoMember(6)] public IALMMKMPNCC Fhgojeafidj;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AGFOJHLHEOC
{
[ProtoMember(1)] public int Ppenknblbnh;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AGGKOALBGBI
{
[ProtoMember(11)] public List<HLLNFIHFNDP> ItemList;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AGKDJLJMMJL
{
[ProtoMember(1)] public int Uid;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AGLIEIPIHCI
{
[ProtoMember(2)] public int Id;
[ProtoMember(14)] public int Retcode;
}
}

View file

@ -0,0 +1,13 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AGLIHJCIHBN
{
[ProtoMember(6)] public List<int> Hknhngmidkh;
[ProtoMember(2)] public int Ipdplmejacp;
[ProtoMember(14)] public List<NJIIEBEKKPH> Kmlhfodebhb;
}
}

View file

@ -0,0 +1,13 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AGMKJHPNOBE
{
[ProtoMember(5)] public int Retcode;
[ProtoMember(1)] public NLNOGAOKKOP Mnikdeknbnl;
[ProtoMember(4)] public int Jcombljlhji;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AGNAJINBNHB
{
[ProtoMember(2)] public Vector Mlcfiikfidm;
[ProtoMember(5)] public int Gkggnkklaah;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AHADHMGGHND
{
[ProtoMember(3)] public FLEKHFGGPKM Edpodfalbal;
}
}

View file

@ -0,0 +1,13 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AHEAJLLNDBB
{
[ProtoMember(10)] public int Retcode;
[ProtoMember(3)] public AKEPBFNOCDL Mkfjohjbckm;
[ProtoMember(14)] public int Ocngdkgocnf;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AHEJIKGHLEL
{
[ProtoMember(3)] public int Retcode;
[ProtoMember(10)] public List<LIBLHCAIJPE> Blhnpkgjkfj;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AHKPKLPKLAP
{
[ProtoMember(5)] public List<int> Cboobbbileh;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AHNCHNIMKLB
{
[ProtoMember(1)] public int Hdjenjnlmml;
}
}

View file

@ -0,0 +1,14 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AHOGKOPPJDG
{
[ProtoMember(11)] public KEIOMHKEPGH Ecllnnkjeij;
[ProtoMember(14)] public int Level;
[ProtoMember(3)] public int Retcode;
[ProtoMember(15)] public int Mkolcjfjfek;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AIAMEGFEEIF
{
[ProtoMember(3)] public int Retcode;
[ProtoMember(4)] public int Pnlenikcdgi;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AICLCFIDNDD
{
[ProtoMember(13)] public BBNEDLDINPO Lihledalfil;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AIDNGOLLJNA
{
[ProtoMember(11)] public int Retcode;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AIGLAMPNIKK
{
[ProtoMember(1)] public List<int> Jadbganhekf;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AIJBIOCLAJG
{
[ProtoMember(2)] public int Level;
[ProtoMember(6)] public int Kfcdhmnpfdd;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AIPCAKPOALF
{
[ProtoMember(9)] public BICNOAPNNLJ Pbkokgjljhp;
}
}

View file

@ -0,0 +1,14 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AIPJLBOIAGH
{
[ProtoMember(7)] public BJPLOEMJJCA Gpnffpdcjoo;
[ProtoMember(14)] public NNBOPJDJNOL Jmajhmdopbp;
[ProtoMember(13)] public LCEHIJNBLIE BasicInfo;
[ProtoMember(12)] public int Llmfgjgmada;
}
}

View file

@ -0,0 +1,11 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AJBBKJNPNAC
{
[ProtoMember(15)] public bool Jbgfiinonao;
}
}

View file

@ -0,0 +1,15 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AJDNJACLDPP
{
[ProtoMember(4)] public List<int> Pajhmpfbakm;
[ProtoMember(11)] public int Iomccaiabmi;
[ProtoMember(10)] public int Cfkhgpgpneb;
[ProtoMember(15)] public List<int> Imgjegikppd;
[ProtoMember(6)] public int Retcode;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AJLIPDAMAJJ
{
[ProtoMember(13)] public bool Ilcmlhlaldi;
[ProtoMember(2)] public JLPEFMANAGI Status;
}
}

View file

@ -0,0 +1,12 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AJNDBCAEEAO
{
[ProtoMember(5)] public int GroupId;
[ProtoMember(11)] public int Kbplfehfggh;
}
}

View file

@ -0,0 +1,14 @@
namespace FreeSR.Proto
{
using ProtoBuf;
[ProtoContract]
public class AJPPPGNDGKD
{
[ProtoMember(1)] public int SkillId;
[ProtoMember(2)] public double Ekgcakpnopa;
[ProtoMember(3)] public List<int> Elnifmdgbeb;
[ProtoMember(4)] public double Damage;
}
}

Some files were not shown because too many files have changed in this diff Show more