2025-03-03 00:27:26 +08:00

76 lines
2.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Interface;
using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Core.Library.Common.Event;
using MilimoeFunGame.Testing.Characters;
namespace Addons
{
public class TestPlugin : Plugin, ILoginEvent
{
public override string Name => "fungame.example.plugin";
public override string Description => "My First Plugin";
public override string Version => "1.0.0";
public override string Author => "FunGamer";
protected override bool BeforeLoad(params object[] objs)
{
EntityModuleConfig<Character> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleCharacter)
{
{ "Oshima", OshimaCharacters.Oshima },
{ "Xinyin", OshimaCharacters.Xinyin },
{ "Yang", OshimaCharacters.Yang },
{ "NanGanyu", OshimaCharacters.NanGanyu },
{ "NiuNan", OshimaCharacters.NiuNan },
{ "Mayor", OshimaCharacters.Mayor },
{ "马猴烧酒", OshimaCharacters. },
{ "QingXiang", OshimaCharacters.QingXiang },
{ "QWQAQW", OshimaCharacters.QWQAQW },
{ "ColdBlue", OshimaCharacters.ColdBlue },
{ "绿拱门", OshimaCharacters.绿 },
{ "QuDuoduo", OshimaCharacters.QuDuoduo }
};
config.SaveConfig();
EntityModuleConfig<Skill> config2 = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleSkill);
//Character c = Factory.GetCharacter();
List<Skill> listSkill = [];
foreach (Skill s in listSkill)
{
config2.Add(s.Name, s);
}
config2.SaveConfig();
EntityModuleConfig<Item> config3 = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleItem)
{
};
config3.SaveConfig();
PluginConfig config4 = new(Name, "config")
{
{ "flush", 10000 },
{ "oshima", "呵呵了" }
};
config4.SaveConfig();
return true;
}
public void AfterLoginEvent(object sender, LoginEventArgs e)
{
Console.WriteLine("after");
}
public void BeforeLoginEvent(object sender, LoginEventArgs e)
{
Console.WriteLine("before");
// 如果这里设置Cancel = true将终止登录
e.Cancel = true;
}
}
}