KCP gameserver with packet dispatch, scene streaming, combat, gacha and the shop, plus a small HTTP server for the login flow and the wish history page. Game data under assets is pulled out of the client instead of being typed by hand. The excel tables come from the packed bin container and the spawn points from the compiled scene scripts.
15 lines
448 B
C#
15 lines
448 B
C#
using System.Text.Json;
|
|
|
|
namespace Yuanshen.Common.Data.Provider;
|
|
|
|
internal sealed class LocalAssetProvider : IAssetProvider
|
|
{
|
|
private const string ExcelDirectory = "assets/excel/";
|
|
|
|
public JsonDocument GetExcelTableJson(string assetName)
|
|
{
|
|
string path = Path.Combine(AppContext.BaseDirectory, ExcelDirectory, assetName);
|
|
using FileStream stream = File.OpenRead(path);
|
|
return JsonDocument.Parse(stream);
|
|
}
|
|
}
|