qq362946 / fantasy Goto Github PK
View Code? Open in Web Editor NEWC # Game Framework, but not limited to games. Can be used for non game business development
Home Page: https://www.fantsida.com/fantasy
License: MIT License
C # Game Framework, but not limited to games. Can be used for non game business development
Home Page: https://www.fantsida.com/fantasy
License: MIT License
TCP连接的话,无参数的协议或者参数没赋值,服务端没反应。(例如心跳,所以说现在采用TCP连接的话,网络接连过几秒就断开了。。)
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>TRACE;FANTASY_NET</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>1701;1702;IL2121;CS8603;IL2121;CS8625;IL2121;CS8618;CS8622;CS8632;CS8602;CS8603;CS8600;CS8625;CS8600;;CS8604;CS8601;SYSLIB0023</NoWarn>
</PropertyGroup>
添加一个获取所有属性名的函数:
public PropertyInfo[] GetProperties()
{
var t = typeof((ConfigName));
return t.GetProperties();
}
方便通过属性名去获取值。
案例:
多语言文档遍历数据到字典的子字典。
var localizationList = LocalizationData.Instance.List;
_phrases = new Dictionary<string, Dictionary<string, string>>(0);
// 获得类的所有属性名
var lang = LocalizationData.Instance.GetProperties();
for (var i = 2; i < lang.Length; i++)
{
var p = new Dictionary<string, string>();
for (var j = 0; j < localizationList.Count; j++)
{
var local = localizationList[j];
// 通过属性名去获取对于的值
var localProperty = local.GetType().GetProperty(lang[i].Name);
if (localProperty == null) return;
var value = localProperty.GetValue(local, null);
p.Add(localizationList[j].Key, value.ToString());
}
_phrases.Add(lang[i].Name.Insert(2, "-").ToLower(), p);
}
去掉
<PackageReference Include="EPPlus" Version="6.2.10" />
换成
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
如题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.