重新架构

This commit is contained in:
Mili 2022-10-01 22:11:12 +08:00
parent 295943e172
commit b63d3831c2
69 changed files with 836 additions and 692 deletions

2
.gitignore vendored
View File

@ -363,4 +363,4 @@ MigrationBackup/
FodyWeavers.xsd FodyWeavers.xsd
# FunGame Implement # FunGame Implement
FunGame.Core/Implement/*.cs FunGame.Implement/Implement/*.cs

View File

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Company>Milimoe</Company>
<Authors>Milimoe</Authors>
<Product>FunGame</Product>
<Title>FunGame.Console</Title>
<ApplicationIcon>images\logo.ico</ApplicationIcon>
<BaseOutputPath>..\bin\</BaseOutputPath>
<AssemblyName>FunGame</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<Content Include="images\logo.ico" />
</ItemGroup>
</Project>

2
FunGame.Console/Main.cs Normal file
View File

@ -0,0 +1,2 @@
Console.WriteLine("Hello, FunGame's Console!");
Console.ReadKey();

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,223 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FunGame.Core.Api.Interface
{
public interface FunGameEvent
{
}
public interface BeforeConnectEvent : FunGameEvent
{
}
public interface AfterConnectEvent : FunGameEvent
{
}
public interface BeforeDisconnectEvent : FunGameEvent
{
}
public interface AfterDisconnectEvent : FunGameEvent
{
}
public interface BeforeLoginEvent : FunGameEvent
{
}
public interface AfterLoginEvent : FunGameEvent
{
}
public interface BeforeLogoutEvent : FunGameEvent
{
}
public interface AfterLogoutEvent : FunGameEvent
{
}
public interface BeforeRegEvent : FunGameEvent
{
}
public interface AfterRegEvent : FunGameEvent
{
}
public interface BeforeIntoRoomEvent : FunGameEvent
{
}
public interface AfterIntoRoomEvent : FunGameEvent
{
}
public interface BeforeSendTalkEvent : FunGameEvent
{
}
public interface AfterSendTalkEvent : FunGameEvent
{
}
public interface BeforeCreateRoomEvent : FunGameEvent
{
}
public interface AfterCreateRoomEvent : FunGameEvent
{
}
public interface BeforeQuitRoomEvent : FunGameEvent
{
}
public interface AfterQuitRoomEvent : FunGameEvent
{
}
public interface BeforeChangeRoomSettingEvent : FunGameEvent
{
}
public interface AfterChangeRoomSettingEvent : FunGameEvent
{
}
public interface BeforeStartMatchEvent : FunGameEvent
{
}
public interface AfterStartMatchEvent : FunGameEvent
{
}
public interface BeforeStartGameEvent : FunGameEvent
{
}
public interface AfterStartGameEvent : FunGameEvent
{
}
public interface BeforeChangeProfileEvent : FunGameEvent
{
}
public interface AfterChangeProfileEvent : FunGameEvent
{
}
public interface BeforeChangeAccountSettingEvent : FunGameEvent
{
}
public interface AfterChangeAccountSettingEvent : FunGameEvent
{
}
public interface BeforeOpenStockEvent : FunGameEvent
{
}
public interface AfterOpenStockEvent : FunGameEvent
{
}
public interface BeforeSignInEvent : FunGameEvent
{
}
public interface AfterSignInEvent : FunGameEvent
{
}
public interface BeforeOpenStoreEvent : FunGameEvent
{
}
public interface AfterOpenStoreEvent : FunGameEvent
{
}
public interface BeforeBuyItemEvent : FunGameEvent
{
}
public interface AfterBuyItemEvent : FunGameEvent
{
}
public interface BeforeShowRankingEvent : FunGameEvent
{
}
public interface AfterShowRankingEvent : FunGameEvent
{
}
public interface BeforeUseItemEvent : FunGameEvent
{
}
public interface AfterUseItemEvent : FunGameEvent
{
}
public interface BeforeEndGameEvent : FunGameEvent
{
}
public interface AfterEndGameEvent : FunGameEvent
{
}
}

View File

@ -1,39 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FunGame.Core.Api.Interface
{
/**
* FunGame.Core项目中Implement文件夹创建新的类实现
*
* using FunGame.Core.Interface;
namespace FunGame.Core.Implement
{
public class ClientConnectInterfaceImpl : ClientConnectInterface
{
public string RemoteServerIP()
{
// 此处修改连接远程服务器IP
string serverIP = "127.0.0.1";
string serverPort = "22222";
return serverIP + ":" + serverPort;
}
}
}
*/
public interface ClientConnectInterface
{
public string RemoteServerIP();
}
public interface ServerInterface
{
}
}

View File

@ -1,323 +0,0 @@
using FunGame.Core.Api.Model.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace FunGame.Core.Api.Util
{
#region
/// <summary>
/// 通用工具类,客户端和服务器端都可以直接调用的工具方法都可以写在这里
/// </summary>
public class Utility
{
/// <summary>
/// 判断字符串是否是IP地址
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsIP(string str)
{
//判断是否为IP
return Regex.IsMatch(str, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$");
}
/// <summary>
/// 判断字符串是否为邮箱地址
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsEmail(string str)
{
//判断是否为Email
return Regex.IsMatch(str, @"^(\w)+(\.\w)*@(\w)+((\.\w+)+)$");
}
/// <summary>
/// 判断字符串是否是一个FunGame可接受的服务器地址
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static ErrorType IsServerAddress(string str)
{
string[] strs = str.Split(':');
string ip;
int port;
if (strs.Length < 2)
{
ip = strs[0];
port = 22222;
}
else if (strs.Length < 3)
{
ip = strs[0];
port = Convert.ToInt32(strs[1]);
}
else return ErrorType.WrongFormat;
if (IsIP(ip) && port > 0 && port < 65536) return ErrorType.None;
else if (!IsIP(ip) && port > 0 && port < 65536) return ErrorType.IsNotIP;
else if (IsIP(ip) && (port <= 0 || port >= 65536)) return ErrorType.IsNotPort;
else return ErrorType.WrongFormat;
}
/// <summary>
/// 判断参数是否是一个FunGame可接受的服务器地址
/// </summary>
/// <param name="ip"></param>
/// <param name="port"></param>
/// <returns></returns>
public static ErrorType IsServerAddress(string ip, int port)
{
if (IsIP(ip) && port > 0 && port < 65536) return ErrorType.None;
else if (!IsIP(ip) && port > 0 && port < 65536) return ErrorType.IsNotIP;
else if (IsIP(ip) && (port <= 0 || port >= 65536)) return ErrorType.IsNotPort;
else return ErrorType.WrongFormat;
}
}
#endregion
#region INI文件工具类
public class INIHelper
{
/*
* API函数
*/
[DllImport("kernel32", CharSet = CharSet.Unicode)]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32", CharSet = CharSet.Unicode)]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
/// <summary>
/// 写入ini文件
/// </summary>
/// <param name="Section">Section</param>
/// <param name="Key">键</param>
/// <param name="Value">值</param>
/// <param name="FileName">文件名缺省为FunGame.ini</param>
public static void WriteINI(string Section, string Key, string Value, string FileName = @"FunGame.ini")
{
WritePrivateProfileString(Section, Key, Value, System.Environment.CurrentDirectory.ToString() + @"\" + FileName);
}
/// <summary>
/// 读取ini文件
/// </summary>
/// <param name="Section">Section</param>
/// <param name="Key">键</param>
/// <param name="FileName">文件名缺省为FunGame.ini</param>
/// <returns>读取到的值</returns>
public static string ReadINI(string Section, string Key, string FileName = @"FunGame.ini")
{
StringBuilder str = new(256);
_ = GetPrivateProfileString(Section, Key, "", str, 256, System.Environment.CurrentDirectory.ToString() + @"\" + FileName);
return str.ToString();
}
/// <summary>
/// 查询ini文件是否存在
/// </summary>
/// <param name="FileName">文件名缺省为FunGame.ini</param>
/// <returns>是否存在</returns>
public static bool ExistINIFile(string FileName = @"FunGame.ini")
{
return File.Exists(System.Environment.CurrentDirectory.ToString() + @"\" + FileName);
}
/// <summary>
/// 初始化ini模板文件
/// </summary>
public static void Init(FunGameEnums.FunGame FunGameType)
{
switch(FunGameType)
{
case FunGameEnums.FunGame.FunGame_Core:
case FunGameEnums.FunGame.FunGame_Core_Api:
case FunGameEnums.FunGame.FunGame_Console:
case FunGameEnums.FunGame.FunGame_Desktop:
/**
* Config
*/
WriteINI("Config", "AutoConnect", "true");
WriteINI("Config", "AutoLogin", "false");
/**
* Account
*/
WriteINI("Account", "UserName", "");
WriteINI("Account", "Password", "");
WriteINI("Account", "AutoKey", "");
break;
case FunGameEnums.FunGame.FunGame_Server:
/**
* Server
*/
WriteINI("Server", "Name", "FunGame Server");
WriteINI("Server", "Password", "");
WriteINI("Server", "Describe", "Just Another FunGame Server.");
WriteINI("Server", "Notice", "This is the FunGame Server's Notice.");
WriteINI("Server", "Key", "");
WriteINI("Server", "Status", "1");
/**
* Socket
*/
WriteINI("Socket", "Port", "22222");
WriteINI("Socket", "MaxPlayer", "20");
WriteINI("Socket", "MaxConnectFailed", "0");
/**
* MySQL
*/
WriteINI("MySQL", "DBServer", "localhost");
WriteINI("MySQL", "DBPort", "3306");
WriteINI("MySQL", "DBName", "fungame");
WriteINI("MySQL", "DBUser", "root");
WriteINI("MySQL", "DBPassword", "pass");
break;
}
}
}
#endregion
#region
/// <summary>
/// 在FunGame.Core.Api中添加新接口和新实现时需要
/// 在FunGame.Core.Api.Model.Enum.CommonEnums里同步添加InterfaceType、InterfaceMethod
/// </summary>
public class ReflectionHelper
{
/**
* DLL
*/
public const string FUNGAME_CORE = "FunGame.Core";
/**
*
*/
public static string EXEDocPath = System.Environment.CurrentDirectory.ToString() + "\\"; // 程序目录
public static string PluginDocPath = System.Environment.CurrentDirectory.ToString() + "\\plugins\\"; // 插件目录
////////////////////////////////////////////////////////////////////
/////////////// * 下 面 是 工 具 类 实 现 * ////////////////
///////////////////////////////////////////////////////////////////
/**
*
*/
private Assembly? Assembly;
private Type? Type;
private MethodInfo? Method;
private object? Instance;
/// <summary>
/// 获取FunGame.Core.dll中接口的实现方法
/// </summary>
/// <param name="Interface">接口代号</param>
/// <returns></returns>
private Type? GetFunGameCoreImplement(int Interface)
{
// 通过类名获取获取命名空间+类名称
string ClassName = EnumHelper.GetImplementClassName(Interface);
List<Type>? Classes = null;
if (Assembly != null)
{
Classes = Assembly.GetTypes().Where(w =>
w.Namespace == "FunGame.Core.Implement" &&
w.Name.Contains(ClassName)
).ToList();
if (Classes != null && Classes.Count > 0)
return Classes[0];
else return null;
}
else return null;
}
/// <summary>
/// 公开方法获取FUNGAME.CORE.DLL中指定方法的返回值
/// </summary>
/// <param name="Interface">接口代号</param>
/// <param name="Method">方法代号</param>
/// <returns></returns>
public object? GetFunGameCoreValue(int Interface, int Method)
{
Assembly = Assembly.LoadFile(EXEDocPath + @FUNGAME_CORE + ".dll");
Type = GetFunGameCoreImplement(Interface); // 通过类名获取获取命名空间+类名称
string MethodName = EnumHelper.GetImplementMethodName(Method); // 获取方法名
if (Assembly != null && Type != null) this.Method = Type.GetMethod(MethodName); // 从Type中查找方法名
else return null;
Instance = Assembly.CreateInstance(Type.Namespace + "." + Type.Name);
if (Instance != null && this.Method != null)
{
object? value = this.Method.Invoke(Instance, Array.Empty<object>()); // 实例方法的调用
if (value != null)
return value;
else return null;
}
else return null;
}
}
#endregion
#region
public class EnumHelper
{
/// <summary>
/// 获取实现类类名
/// </summary>
/// <param name="Interface">接口代号</param>
/// <returns></returns>
public static string GetImplementClassName(int Interface)
{
foreach (string str in System.Enum.GetNames(typeof(InterfaceType)))
{
InterfaceType temp = (InterfaceType)System.Enum.Parse(typeof(InterfaceType), Interface.ToString(), true);
if (temp.ToString() == str)
return temp + "Impl";
}
return "";
}
/// <summary>
/// 获取实现类的方法名
/// </summary>
/// <param name="Method">方法代号</param>
/// <returns></returns>
public static string GetImplementMethodName(int Method)
{
foreach (string str in System.Enum.GetNames(typeof(InterfaceMethod)))
{
InterfaceMethod temp = (InterfaceMethod)System.Enum.Parse(typeof(InterfaceMethod), Method.ToString(), true);
if (temp.ToString() == str)
return temp.ToString();
}
return "";
}
/// <summary>
/// 获取Socket枚举名
/// </summary>
/// <param name="SocketType">Socket枚举</param>
/// <returns></returns>
public static string GetSocketTypeName(int SocketType)
{
foreach (string str in System.Enum.GetNames(typeof(SocketMessageType)))
{
SocketMessageType temp = (SocketMessageType)System.Enum.Parse(typeof(SocketMessageType), SocketType.ToString(), true);
if (temp.ToString() == str)
return temp.ToString();
}
return "";
}
}
#endregion
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Api.Factory
{
public class CharacterFactory
{
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Api.Factory
{
public abstract class ItemFactory
{
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Api.Factory
{
public class RoomFactory
{
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Api.Factory
{
public abstract class SkillFactory
{
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Api.Factory
{
public class StockFactory
{
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Api.Factory
{
public class UserFactory
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Api.Proxy
{
public class SQLProxy
{
}
}

View File

@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Milimoe.FunGame.Core.Entity.Enum;
namespace Milimoe.FunGame.Core.Api.Utility
{
public class EnumHelper
{
/// <summary>
/// 获取实现类类名
/// </summary>
/// <param name="Interface">接口代号</param>
/// <returns></returns>
public static string GetImplementClassName(int Interface)
{
foreach (string str in Enum.GetNames(typeof(InterfaceType)))
{
InterfaceType temp = (InterfaceType)Enum.Parse(typeof(InterfaceType), Interface.ToString(), true);
if (temp.ToString() == str)
return temp + "Impl";
}
return "";
}
/// <summary>
/// 获取实现类的方法名
/// </summary>
/// <param name="Method">方法代号</param>
/// <returns></returns>
public static string GetImplementMethodName(int Method)
{
foreach (string str in Enum.GetNames(typeof(InterfaceMethod)))
{
InterfaceMethod temp = (InterfaceMethod)Enum.Parse(typeof(InterfaceMethod), Method.ToString(), true);
if (temp.ToString() == str)
return temp.ToString();
}
return "";
}
/// <summary>
/// 获取Socket枚举名
/// </summary>
/// <param name="SocketType">Socket枚举</param>
/// <returns></returns>
public static string GetSocketTypeName(int SocketType)
{
foreach (string str in Enum.GetNames(typeof(SocketMessageType)))
{
SocketMessageType temp = (SocketMessageType)Enum.Parse(typeof(SocketMessageType), SocketType.ToString(), true);
if (temp.ToString() == str)
return temp.ToString();
}
return "";
}
}
}

View File

@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Milimoe.FunGame.Core.Entity.Enum;
namespace Milimoe.FunGame.Core.Api.Utility
{
/// <summary>
/// 通用工具类,客户端和服务器端都可以直接调用的工具方法都可以写在这里
/// </summary>
public class Utility
{
/// <summary>
/// 判断字符串是否是IP地址
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsIP(string str)
{
//判断是否为IP
return Regex.IsMatch(str, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$");
}
/// <summary>
/// 判断字符串是否为邮箱地址
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsEmail(string str)
{
//判断是否为Email
return Regex.IsMatch(str, @"^(\w)+(\.\w)*@(\w)+((\.\w+)+)$");
}
/// <summary>
/// 判断字符串是否是一个FunGame可接受的服务器地址
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static ErrorType IsServerAddress(string str)
{
string[] strs = str.Split(':');
string ip;
int port;
if (strs.Length < 2)
{
ip = strs[0];
port = 22222;
}
else if (strs.Length < 3)
{
ip = strs[0];
port = Convert.ToInt32(strs[1]);
}
else return ErrorType.WrongFormat;
if (IsIP(ip) && port > 0 && port < 65536) return ErrorType.None;
else if (!IsIP(ip) && port > 0 && port < 65536) return ErrorType.IsNotIP;
else if (IsIP(ip) && (port <= 0 || port >= 65536)) return ErrorType.IsNotPort;
else return ErrorType.WrongFormat;
}
/// <summary>
/// 判断参数是否是一个FunGame可接受的服务器地址
/// </summary>
/// <param name="ip"></param>
/// <param name="port"></param>
/// <returns></returns>
public static ErrorType IsServerAddress(string ip, int port)
{
if (IsIP(ip) && port > 0 && port < 65536) return ErrorType.None;
else if (!IsIP(ip) && port > 0 && port < 65536) return ErrorType.IsNotIP;
else if (IsIP(ip) && (port <= 0 || port >= 65536)) return ErrorType.IsNotPort;
else return ErrorType.WrongFormat;
}
}
}

View File

@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using Milimoe.FunGame.Core.Entity.Enum;
namespace Milimoe.FunGame.Core.Api.Utility
{
public class INIHelper
{
/*
* API函数
*/
[DllImport("kernel32", CharSet = CharSet.Unicode)]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32", CharSet = CharSet.Unicode)]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
/// <summary>
/// 写入ini文件
/// </summary>
/// <param name="Section">Section</param>
/// <param name="Key">键</param>
/// <param name="Value">值</param>
/// <param name="FileName">文件名缺省为FunGame.ini</param>
public static void WriteINI(string Section, string Key, string Value, string FileName = @"FunGame.ini")
{
WritePrivateProfileString(Section, Key, Value, Environment.CurrentDirectory.ToString() + @"\" + FileName);
}
/// <summary>
/// 读取ini文件
/// </summary>
/// <param name="Section">Section</param>
/// <param name="Key">键</param>
/// <param name="FileName">文件名缺省为FunGame.ini</param>
/// <returns>读取到的值</returns>
public static string ReadINI(string Section, string Key, string FileName = @"FunGame.ini")
{
StringBuilder str = new(256);
_ = GetPrivateProfileString(Section, Key, "", str, 256, Environment.CurrentDirectory.ToString() + @"\" + FileName);
return str.ToString();
}
/// <summary>
/// 查询ini文件是否存在
/// </summary>
/// <param name="FileName">文件名缺省为FunGame.ini</param>
/// <returns>是否存在</returns>
public static bool ExistINIFile(string FileName = @"FunGame.ini")
{
return File.Exists(Environment.CurrentDirectory.ToString() + @"\" + FileName);
}
/// <summary>
/// 初始化ini模板文件
/// </summary>
public static void Init(FunGameEnums.FunGame FunGameType)
{
switch (FunGameType)
{
case FunGameEnums.FunGame.FunGame_Core:
case FunGameEnums.FunGame.FunGame_Core_Api:
case FunGameEnums.FunGame.FunGame_Console:
case FunGameEnums.FunGame.FunGame_Desktop:
/**
* Config
*/
WriteINI("Config", "AutoConnect", "true");
WriteINI("Config", "AutoLogin", "false");
/**
* Account
*/
WriteINI("Account", "UserName", "");
WriteINI("Account", "Password", "");
WriteINI("Account", "AutoKey", "");
break;
case FunGameEnums.FunGame.FunGame_Server:
/**
* Server
*/
WriteINI("Server", "Name", "FunGame Server");
WriteINI("Server", "Password", "");
WriteINI("Server", "Describe", "Just Another FunGame Server.");
WriteINI("Server", "Notice", "This is the FunGame Server's Notice.");
WriteINI("Server", "Key", "");
WriteINI("Server", "Status", "1");
/**
* Socket
*/
WriteINI("Socket", "Port", "22222");
WriteINI("Socket", "MaxPlayer", "20");
WriteINI("Socket", "MaxConnectFailed", "0");
/**
* MySQL
*/
WriteINI("MySQL", "DBServer", "localhost");
WriteINI("MySQL", "DBPort", "3306");
WriteINI("MySQL", "DBName", "fungame");
WriteINI("MySQL", "DBUser", "root");
WriteINI("MySQL", "DBPassword", "pass");
break;
}
}
}
}

View File

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Api.Utility
{
/// <summary>
/// 在FunGame.Core.Interface中添加新接口和新实现时需要
/// 在FunGame.Core.Entity.Enum.CommonEnums里同步添加InterfaceType、InterfaceMethod
/// </summary>
public class ReflectionHelper
{
/**
* DLL
*/
public const string FUNGAME_IMPL = "FunGame.Implement";
/**
*
*/
public static string EXEDocPath = Environment.CurrentDirectory.ToString() + "\\"; // 程序目录
public static string PluginDocPath = Environment.CurrentDirectory.ToString() + "\\plugins\\"; // 插件目录
////////////////////////////////////////////////////////////////////
/////////////// * 下 面 是 工 具 类 实 现 * ////////////////
///////////////////////////////////////////////////////////////////
/**
*
*/
private Assembly? Assembly;
private Type? Type;
private MethodInfo? Method;
private object? Instance;
/// <summary>
/// 获取FunGame.Implement.dll中接口的实现方法
/// </summary>
/// <param name="Interface">接口代号</param>
/// <returns></returns>
private Type? GetFunGameImplementType(int Interface)
{
// 通过类名获取获取命名空间+类名称
string ClassName = EnumHelper.GetImplementClassName(Interface);
List<Type>? Classes = null;
if (Assembly != null)
{
Classes = Assembly.GetTypes().Where(w =>
w.Namespace == "Milimoe.FunGame.Core.Implement" &&
w.Name.Contains(ClassName)
).ToList();
if (Classes != null && Classes.Count > 0)
return Classes[0];
else return null;
}
else return null;
}
/// <summary>
/// 公开方法获取FunGame.Implement.DLL中指定方法的返回值
/// </summary>
/// <param name="Interface">接口代号</param>
/// <param name="Method">方法代号</param>
/// <returns></returns>
public object? GetFunGameImplValue(int Interface, int Method)
{
Assembly = Assembly.LoadFile(EXEDocPath + FUNGAME_IMPL + ".dll");
Type = GetFunGameImplementType(Interface); // 通过类名获取获取命名空间+类名称
string MethodName = EnumHelper.GetImplementMethodName(Method); // 获取方法名
if (Assembly != null && Type != null) this.Method = Type.GetMethod(MethodName); // 从Type中查找方法名
else return null;
Instance = Assembly.CreateInstance(Type.Namespace + "." + Type.Name);
if (Instance != null && this.Method != null)
{
object? value = this.Method.Invoke(Instance, Array.Empty<object>()); // 实例方法的调用
if (value != null)
return value;
else return null;
}
else return null;
}
}
}

View File

@ -6,11 +6,11 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Enum namespace Milimoe.FunGame.Core.Entity.Enum
{ {
/** /**
* State Type Result Method * State Type Result Method
* FunGame.Core.Api接口和实现时InterfaceTypeInterfaceMethod * Milimoe.FunGame.Core.Api接口和实现时InterfaceTypeInterfaceMethod
*/ */
#region State #region State
@ -76,8 +76,8 @@ namespace FunGame.Core.Api.Model.Enum
public enum InterfaceType public enum InterfaceType
{ {
ClientConnectInterface, IClient,
ServerInterface IServer
} }
public enum LightType public enum LightType

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Enum namespace Milimoe.FunGame.Core.Entity.Enum
{ {
public static class FunGameEnums public static class FunGameEnums
{ {

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Entity.Event
{
public class GeneralEventHandler
{
}
}

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class ActiveItem : Item public class ActiveItem : Item
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class ActiveSkill : Skill public class ActiveSkill : Skill
{ {

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class Character public class Character
{ {

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class CharacterStatistics public class CharacterStatistics
{ {

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class GameStatistics public class GameStatistics
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public abstract class Item public abstract class Item
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class PassiveItem : Item public class PassiveItem : Item
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class PassiveSkill : Skill public class PassiveSkill : Skill
{ {

View File

@ -6,7 +6,7 @@ using System.Security.Policy;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class Room public class Room
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public abstract class Skill public abstract class Skill
{ {

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class Stock public class Stock
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class User public class User
{ {

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Core.Api.Model.Entity namespace Milimoe.FunGame.Core.Entity.General
{ {
public class UserStatistics public class UserStatistics
{ {

View File

@ -4,13 +4,13 @@
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Company>Milimoe</Company>
<BaseOutputPath>..\bin</BaseOutputPath> <BaseOutputPath>..\bin</BaseOutputPath>
<Company>Milimoe</Company>
<Authors>Milimoe</Authors> <Authors>Milimoe</Authors>
<Title>FunGame</Title>
<PackageOutputPath>..\bin</PackageOutputPath>
<AssemblyVersion>1.0</AssemblyVersion> <AssemblyVersion>1.0</AssemblyVersion>
<FileVersion>1.0</FileVersion> <FileVersion>1.0</FileVersion>
<PackageOutputPath>..\bin</PackageOutputPath>
<Title>FunGame.Core</Title>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -21,11 +21,4 @@
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\FunGame.Core.Api\FunGame.Core.Api.csproj">
<Private>False</Private>
<CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies>
</ProjectReference>
</ItemGroup>
</Project> </Project>

View File

@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Interface
{
public interface IEvent
{
}
public interface IConnectEvent : IEvent
{
}
public interface IDisconnectEvent : IEvent
{
}
public interface ILoginEvent : IEvent
{
}
public interface ILogoutEvent : IEvent
{
}
public interface IRegEvent : IEvent
{
}
public interface IIntoRoomEvent : IEvent
{
}
public interface ISendTalkEvent : IEvent
{
}
public interface ICreateRoomEvent : IEvent
{
}
public interface IQuitRoomEvent : IEvent
{
}
public interface IChangeRoomSettingEvent : IEvent
{
}
public interface IStartMatchEvent : IEvent
{
}
public interface IStartGameEvent : IEvent
{
}
public interface IChangeProfileEvent : IEvent
{
}
public interface IChangeAccountSettingEvent : IEvent
{
}
public interface IOpenStockEvent : IEvent
{
}
public interface ISignInEvent : IEvent
{
}
public interface IOpenStoreEvent : IEvent
{
}
public interface IBuyItemEvent : IEvent
{
}
public interface IShowRankingEvent : IEvent
{
}
public interface IUseItemEvent : IEvent
{
}
public interface IEndGameEvent : IEvent
{
}
}

View File

@ -0,0 +1,22 @@
namespace Milimoe.FunGame.Core.Interface
{
/**
* FunGame.Core项目中Implement文件夹创建新的类实现
*
* using Milimoe.FunGame.Core.Interface;
namespace Milimoe.FunGame.Core.Implement
{
public class IClientImpl : IClient
{
public string RemoteServerIP()
{
// 此处修改连接远程服务器IP
string serverIP = "127.0.0.1";
string serverPort = "22222";
return serverIP + ":" + serverPort;
}
}
}
*/
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Interface
{
public interface IClient
{
public string RemoteServerIP();
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Interface
{
public interface IServer
{
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Others
{
public class Config
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Service
{
public class MySQLManager
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Service
{
public class PluginManager
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Service
{
public class RedisManager
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Service
{
public class ResourceManager
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Service
{
public class SocketManager
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Milimoe.FunGame.Core.Service
{
public class ThreadManager
{
}
}

View File

@ -1,4 +1,4 @@
namespace FunGame.Desktop.Models.Component namespace Milimoe.FunGame.Desktop.Entity.Component
{ {
partial class ExitButton partial class ExitButton
{ {

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace FunGame.Desktop.Models.Component namespace Milimoe.FunGame.Desktop.Entity.Component
{ {
public partial class ExitButton : Button public partial class ExitButton : Button
{ {
@ -15,7 +15,7 @@ namespace FunGame.Desktop.Models.Component
InitializeComponent(); InitializeComponent();
Anchor = System.Windows.Forms.AnchorStyles.None; Anchor = System.Windows.Forms.AnchorStyles.None;
BackColor = System.Drawing.Color.White; BackColor = System.Drawing.Color.White;
BackgroundImage = global::FunGame.Desktop.Properties.Resources.exit; BackgroundImage = global::Milimoe.FunGame.Desktop.Properties.Resources.exit;
FlatAppearance.BorderColor = System.Drawing.Color.White; FlatAppearance.BorderColor = System.Drawing.Color.White;
FlatAppearance.BorderSize = 0; FlatAppearance.BorderSize = 0;
FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
@ -35,7 +35,7 @@ namespace FunGame.Desktop.Models.Component
InitializeComponent(); InitializeComponent();
Anchor = System.Windows.Forms.AnchorStyles.None; Anchor = System.Windows.Forms.AnchorStyles.None;
BackColor = System.Drawing.Color.White; BackColor = System.Drawing.Color.White;
BackgroundImage = global::FunGame.Desktop.Properties.Resources.exit; BackgroundImage = global::Milimoe.FunGame.Desktop.Properties.Resources.exit;
FlatAppearance.BorderColor = System.Drawing.Color.White; FlatAppearance.BorderColor = System.Drawing.Color.White;
FlatAppearance.BorderSize = 0; FlatAppearance.BorderSize = 0;
FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));

View File

@ -1,4 +1,4 @@
namespace FunGame.Desktop.Models.Component namespace Milimoe.FunGame.Desktop.Entity.Component
{ {
partial class ShowMessage partial class ShowMessage
{ {
@ -32,11 +32,11 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShowMessage)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShowMessage));
this.MsgText = new System.Windows.Forms.Label(); this.MsgText = new System.Windows.Forms.Label();
this.LeftButton = new System.Windows.Forms.Button(); this.LeftButton = new System.Windows.Forms.Button();
this.Exit = new FunGame.Desktop.Models.Component.ExitButton(this.components); this.Exit = new FunGame.Desktop.Entity.Component.ExitButton(this.components);
this.RightButton = new System.Windows.Forms.Button(); this.RightButton = new System.Windows.Forms.Button();
this.MidButton = new System.Windows.Forms.Button(); this.MidButton = new System.Windows.Forms.Button();
this.Title = new System.Windows.Forms.Label(); this.Title = new System.Windows.Forms.Label();
this.TransparentRect = new FunGame.Desktop.Models.Component.TransparentRect(); this.TransparentRect = new FunGame.Desktop.Entity.Component.TransparentRect();
this.InputButton = new System.Windows.Forms.Button(); this.InputButton = new System.Windows.Forms.Button();
this.InputText = new System.Windows.Forms.TextBox(); this.InputText = new System.Windows.Forms.TextBox();
this.TransparentRect.SuspendLayout(); this.TransparentRect.SuspendLayout();
@ -133,7 +133,7 @@
this.TransparentRect.Name = "TransparentRect"; this.TransparentRect.Name = "TransparentRect";
this.TransparentRect.Opacity = 125; this.TransparentRect.Opacity = 125;
this.TransparentRect.Radius = 20; this.TransparentRect.Radius = 20;
this.TransparentRect.ShapeBorderStyle = FunGame.Desktop.Models.Component.TransparentRect.ShapeBorderStyles.ShapeBSNone; this.TransparentRect.ShapeBorderStyle = FunGame.Desktop.Entity.Component.TransparentRect.ShapeBorderStyles.ShapeBSNone;
this.TransparentRect.Size = new System.Drawing.Size(235, 170); this.TransparentRect.Size = new System.Drawing.Size(235, 170);
this.TransparentRect.TabIndex = 103; this.TransparentRect.TabIndex = 103;
this.TransparentRect.TabStop = false; this.TransparentRect.TabStop = false;

View File

@ -7,9 +7,9 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using FunGame.Core.Api.Model.Enum; using Milimoe.FunGame.Core.Entity.Enum;
namespace FunGame.Desktop.Models.Component namespace Milimoe.FunGame.Desktop.Entity.Component
{ {
public partial class ShowMessage : Form public partial class ShowMessage : Form
{ {

View File

@ -1,6 +1,6 @@
namespace FunGame.Desktop.Models.Component namespace FunGame.Desktop.Models.Component
{ {
partial class TextArea partial class TextArea : RichTextBox
{ {
/// <summary> /// <summary>
/// 必需的设计器变量。 /// 必需的设计器变量。

View File

@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace FunGame.Desktop.Models.Component namespace Milimoe.FunGame.Desktop.Entity.Component
{ {
[ToolboxBitmap(typeof(TextBox))] [ToolboxBitmap(typeof(TextBox))]
partial class TextArea : RichTextBox partial class TextArea : RichTextBox

View File

@ -1,4 +1,4 @@
namespace FunGame.Desktop.Models.Component namespace Milimoe.FunGame.Desktop.Entity.Component
{ {
partial class TransparentRect partial class TransparentRect
{ {

View File

@ -7,7 +7,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace FunGame.Desktop.Models.Component namespace Milimoe.FunGame.Desktop.Entity.Component
{ {
partial class TransparentRect : GroupBox partial class TransparentRect : GroupBox
{ {

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
@ -15,7 +15,7 @@
<SignAssembly>False</SignAssembly> <SignAssembly>False</SignAssembly>
<Authors>Milimoe</Authors> <Authors>Milimoe</Authors>
<Product>FunGame</Product> <Product>FunGame</Product>
<Title>FunGame</Title> <Title>FunGame.Desktop</Title>
<PackageOutputPath>..\bin</PackageOutputPath> <PackageOutputPath>..\bin</PackageOutputPath>
<AssemblyVersion>1.0</AssemblyVersion> <AssemblyVersion>1.0</AssemblyVersion>
<FileVersion>1.0</FileVersion> <FileVersion>1.0</FileVersion>
@ -49,6 +49,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Models\" />
<Folder Include="UI\Login\" /> <Folder Include="UI\Login\" />
<Folder Include="UI\Register\" /> <Folder Include="UI\Register\" />
<Folder Include="UI\RoomSetting\" /> <Folder Include="UI\RoomSetting\" />
@ -58,10 +59,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\FunGame.Core.Api\FunGame.Core.Api.csproj"> <ProjectReference Include="..\FunGame.Core\FunGame.Core.csproj">
<CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies> <CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\FunGame.Core\FunGame.Core.csproj"> <ProjectReference Include="..\FunGame.Implement\FunGame.Implement.csproj">
<CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies> <CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

View File

@ -4,10 +4,10 @@ using System.Linq;
using System.Security.AccessControl; using System.Security.AccessControl;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using FunGame.Core.Api.Model.Enum; using Milimoe.FunGame.Core.Entity.Enum;
using FunGame.Core.Api.Util; using Milimoe.FunGame.Core.Api.Utility;
namespace FunGame.Desktop.Models.Config namespace Milimoe.FunGame.Desktop.Others
{ {
public static class Config public static class Config
{ {

View File

@ -1,11 +1,11 @@
using FunGame.Core.Api.Model.Entity; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Milimoe.FunGame.Core.Entity.General;
namespace FunGame.Desktop.Models.Config namespace Milimoe.FunGame.Desktop.Others
{ {
public class Usercfg public class Usercfg
{ {

View File

@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace FunGame.Desktop.Properties { namespace Milimoe.FunGame.Desktop.Properties {
using System; using System;
@ -80,16 +80,6 @@ namespace FunGame.Desktop.Properties {
} }
} }
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap favicon {
get {
object obj = ResourceManager.GetObject("favicon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary> /// </summary>

View File

@ -133,9 +133,6 @@
<data name="back" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="back" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\back.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\images\back.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="favicon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Images\favicon.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="min" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="min" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\min.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\images\min.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>

View File

@ -1,7 +1,7 @@
using FunGame.Desktop.Models.Component; using Milimoe.FunGame.Desktop.Entity.Component;
using FunGame.Desktop.Models.Config; using Milimoe.FunGame.Desktop.Others;
namespace FunGame.Desktop.UI namespace Milimoe.FunGame.Desktop.UI
{ {
partial class Main partial class Main
{ {
@ -33,7 +33,7 @@ namespace FunGame.Desktop.UI
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
this.Exit = new FunGame.Desktop.Models.Component.ExitButton(this.components); this.Exit = new FunGame.Desktop.Entity.Component.ExitButton(this.components);
this.Title = new System.Windows.Forms.Label(); this.Title = new System.Windows.Forms.Label();
this.MinForm = new System.Windows.Forms.Button(); this.MinForm = new System.Windows.Forms.Button();
this.Connection = new System.Windows.Forms.Label(); this.Connection = new System.Windows.Forms.Label();
@ -55,10 +55,10 @@ namespace FunGame.Desktop.UI
this.QueryRoom = new System.Windows.Forms.Button(); this.QueryRoom = new System.Windows.Forms.Button();
this.RoomList = new System.Windows.Forms.ListBox(); this.RoomList = new System.Windows.Forms.ListBox();
this.Notice = new System.Windows.Forms.GroupBox(); this.Notice = new System.Windows.Forms.GroupBox();
this.NoticeText = new FunGame.Desktop.Models.Component.TextArea(); this.NoticeText = new FunGame.Desktop.Entity.Component.TextArea();
this.InfoBox = new System.Windows.Forms.GroupBox(); this.InfoBox = new System.Windows.Forms.GroupBox();
this.TransparentRectControl = new FunGame.Desktop.Models.Component.TransparentRect(); this.TransparentRectControl = new FunGame.Desktop.Entity.Component.TransparentRect();
this.GameInfo = new FunGame.Desktop.Models.Component.TextArea(); this.GameInfo = new FunGame.Desktop.Entity.Component.TextArea();
this.QuitRoom = new System.Windows.Forms.Button(); this.QuitRoom = new System.Windows.Forms.Button();
this.CreateRoom = new System.Windows.Forms.Button(); this.CreateRoom = new System.Windows.Forms.Button();
this.Logout = new System.Windows.Forms.Button(); this.Logout = new System.Windows.Forms.Button();
@ -77,7 +77,7 @@ namespace FunGame.Desktop.UI
// //
this.Exit.Anchor = System.Windows.Forms.AnchorStyles.None; this.Exit.Anchor = System.Windows.Forms.AnchorStyles.None;
this.Exit.BackColor = System.Drawing.Color.White; this.Exit.BackColor = System.Drawing.Color.White;
this.Exit.BackgroundImage = global::FunGame.Desktop.Properties.Resources.exit; this.Exit.BackgroundImage = global::Milimoe.FunGame.Desktop.Properties.Resources.exit;
this.Exit.FlatAppearance.BorderColor = System.Drawing.Color.White; this.Exit.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.Exit.FlatAppearance.BorderSize = 0; this.Exit.FlatAppearance.BorderSize = 0;
this.Exit.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); this.Exit.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
@ -110,7 +110,7 @@ namespace FunGame.Desktop.UI
// //
this.MinForm.Anchor = System.Windows.Forms.AnchorStyles.None; this.MinForm.Anchor = System.Windows.Forms.AnchorStyles.None;
this.MinForm.BackColor = System.Drawing.Color.White; this.MinForm.BackColor = System.Drawing.Color.White;
this.MinForm.BackgroundImage = global::FunGame.Desktop.Properties.Resources.min; this.MinForm.BackgroundImage = global::Milimoe.FunGame.Desktop.Properties.Resources.min;
this.MinForm.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.MinForm.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.MinForm.FlatAppearance.BorderColor = System.Drawing.Color.LightGray; this.MinForm.FlatAppearance.BorderColor = System.Drawing.Color.LightGray;
this.MinForm.FlatAppearance.BorderSize = 0; this.MinForm.FlatAppearance.BorderSize = 0;
@ -142,7 +142,7 @@ namespace FunGame.Desktop.UI
// Light // Light
// //
this.Light.BackColor = System.Drawing.Color.Transparent; this.Light.BackColor = System.Drawing.Color.Transparent;
this.Light.Image = global::FunGame.Desktop.Properties.Resources.yellow; this.Light.Image = global::Milimoe.FunGame.Desktop.Properties.Resources.yellow;
this.Light.Location = new System.Drawing.Point(777, 426); this.Light.Location = new System.Drawing.Point(777, 426);
this.Light.Name = "Light"; this.Light.Name = "Light";
this.Light.Size = new System.Drawing.Size(18, 18); this.Light.Size = new System.Drawing.Size(18, 18);
@ -152,7 +152,7 @@ namespace FunGame.Desktop.UI
// //
this.SendTalkText.Anchor = System.Windows.Forms.AnchorStyles.None; this.SendTalkText.Anchor = System.Windows.Forms.AnchorStyles.None;
this.SendTalkText.BackColor = System.Drawing.Color.Transparent; this.SendTalkText.BackColor = System.Drawing.Color.Transparent;
this.SendTalkText.BackgroundImage = global::FunGame.Desktop.Properties.Resources.send; this.SendTalkText.BackgroundImage = global::Milimoe.FunGame.Desktop.Properties.Resources.send;
this.SendTalkText.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.SendTalkText.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.SendTalkText.FlatAppearance.BorderSize = 0; this.SendTalkText.FlatAppearance.BorderSize = 0;
this.SendTalkText.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Teal; this.SendTalkText.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Teal;
@ -433,7 +433,7 @@ namespace FunGame.Desktop.UI
this.TransparentRectControl.Name = "TransparentRectControl"; this.TransparentRectControl.Name = "TransparentRectControl";
this.TransparentRectControl.Opacity = 125; this.TransparentRectControl.Opacity = 125;
this.TransparentRectControl.Radius = 20; this.TransparentRectControl.Radius = 20;
this.TransparentRectControl.ShapeBorderStyle = FunGame.Desktop.Models.Component.TransparentRect.ShapeBorderStyles.ShapeBSNone; this.TransparentRectControl.ShapeBorderStyle = Milimoe.FunGame.Desktop.Entity.Component.TransparentRect.ShapeBorderStyles.ShapeBSNone;
this.TransparentRectControl.Size = new System.Drawing.Size(464, 343); this.TransparentRectControl.Size = new System.Drawing.Size(464, 343);
this.TransparentRectControl.TabIndex = 2; this.TransparentRectControl.TabIndex = 2;
this.TransparentRectControl.TabStop = false; this.TransparentRectControl.TabStop = false;
@ -559,7 +559,7 @@ namespace FunGame.Desktop.UI
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = global::FunGame.Desktop.Properties.Resources.back; this.BackgroundImage = global::Milimoe.FunGame.Desktop.Properties.Resources.back;
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.StopMatch); this.Controls.Add(this.StopMatch);
this.Controls.Add(this.Copyright); this.Controls.Add(this.Copyright);
@ -637,8 +637,8 @@ namespace FunGame.Desktop.UI
private Button Store; private Button Store;
private LinkLabel Copyright; private LinkLabel Copyright;
private Button StopMatch; private Button StopMatch;
private Models.Component.TextArea GameInfo; private Entity.Component.TextArea GameInfo;
private Models.Component.TextArea NoticeText; private Entity.Component.TextArea NoticeText;
private Models.Component.TransparentRect TransparentRectControl; private Entity.Component.TransparentRect TransparentRectControl;
} }
} }

View File

@ -1,17 +1,17 @@
using FunGame.Desktop.Models.Component;
using System.Diagnostics; using System.Diagnostics;
using System.Net.Sockets; using System.Net.Sockets;
using System.Net; using System.Net;
using System.Windows.Forms; using System.Windows.Forms;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using System.Text; using System.Text;
using FunGame.Core.Api.Model.Entity; using Milimoe.FunGame.Core.Api.Utility;
using FunGame.Desktop.Models.Config; using Milimoe.FunGame.Core.Entity.General;
using FunGame.Desktop.Utils; using Milimoe.FunGame.Core.Entity.Enum;
using FunGame.Core.Api.Model.Enum; using Milimoe.FunGame.Desktop.Entity.Component;
using FunGame.Core.Api.Util; using Milimoe.FunGame.Desktop.Others;
using Milimoe.FunGame.Desktop.Utils;
namespace FunGame.Desktop.UI namespace Milimoe.FunGame.Desktop.UI
{ {
public partial class Main : Form public partial class Main : Form
{ {
@ -291,7 +291,7 @@ namespace FunGame.Desktop.UI
{ {
try try
{ {
string? ipaddress = (string?)Config.ReflectionHelper.GetFunGameCoreValue((int)InterfaceType.ClientConnectInterface, (int)InterfaceMethod.RemoteServerIP); // 获取服务器IP string? ipaddress = (string?)Config.ReflectionHelper.GetFunGameImplValue((int)InterfaceType.IClient, (int)InterfaceMethod.RemoteServerIP); // 获取服务器IP
if (ipaddress != null) if (ipaddress != null)
{ {
string[] s = ipaddress.Split(':'); string[] s = ipaddress.Split(':');

View File

@ -1,4 +1,4 @@
namespace FunGame.Desktop.UI namespace Milimoe.FunGame.Desktop.UI
{ {
internal static class Start internal static class Start
{ {

View File

@ -8,13 +8,13 @@ using System.Threading.Tasks;
using FunGame.Desktop.Models.Component; using FunGame.Desktop.Models.Component;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using FunGame.Core.Api.Model.Entity; using Milimoe.FunGame.Core.Entity.General;
using FunGame.Core.Api.Model.Enum; using Milimoe.FunGame.Core.Entity.Enum;
using FunGame.Core.Api.Util; using Milimoe.FunGame.Desktop.Others;
using FunGame.Desktop.Models.Config; using Milimoe.FunGame.Desktop.UI;
using FunGame.Desktop.UI; using Milimoe.FunGame.Core.Api.Utility;
namespace FunGame.Desktop.Utils namespace Milimoe.FunGame.Desktop.Utils
{ {
public class SocketHelper public class SocketHelper
{ {

View File

@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<BaseOutputPath>..\bin</BaseOutputPath>
<Company>Milimoe</Company> <Company>Milimoe</Company>
<BaseOutputPath>..\bin</BaseOutputPath>
<Authors>Milimoe</Authors> <Authors>Milimoe</Authors>
<Title>FunGame.Implement</Title>
<PackageOutputPath>..\bin</PackageOutputPath>
<AssemblyVersion>1.0</AssemblyVersion> <AssemblyVersion>1.0</AssemblyVersion>
<FileVersion>1.0</FileVersion> <FileVersion>1.0</FileVersion>
<PackageOutputPath>..\bin</PackageOutputPath>
<Title>FunGame</Title>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@ -21,4 +21,11 @@
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\FunGame.Core\FunGame.Core.csproj">
<Private>False</Private>
<CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies>
</ProjectReference>
</ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
@ -7,7 +7,7 @@
<BaseOutputPath>..\bin\</BaseOutputPath> <BaseOutputPath>..\bin\</BaseOutputPath>
<Authors>Milimoe</Authors> <Authors>Milimoe</Authors>
<Company>Milimoe</Company> <Company>Milimoe</Company>
<Title>FunGame</Title> <Title>FunGameSDK</Title>
<AssemblyVersion>1.0</AssemblyVersion> <AssemblyVersion>1.0</AssemblyVersion>
<FileVersion>1.0</FileVersion> <FileVersion>1.0</FileVersion>
<PackageOutputPath>..\bin\plugin</PackageOutputPath> <PackageOutputPath>..\bin\plugin</PackageOutputPath>
@ -21,4 +21,8 @@
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\FunGame.Core\FunGame.Core.csproj" />
</ItemGroup>
</Project> </Project>

View File

@ -8,16 +8,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Desktop", "FunGame.
{CC6C83C6-5818-4565-8873-67587FED1D0A} = {CC6C83C6-5818-4565-8873-67587FED1D0A} {CC6C83C6-5818-4565-8873-67587FED1D0A} = {CC6C83C6-5818-4565-8873-67587FED1D0A}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Core", "FunGame.Core\FunGame.Core.csproj", "{CC6C83C6-5818-4565-8873-67587FED1D0A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Implement", "FunGame.Implement\FunGame.Implement.csproj", "{CC6C83C6-5818-4565-8873-67587FED1D0A}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{842BB22E-4309-4ADD-93CD-A981CE10C30E} = {842BB22E-4309-4ADD-93CD-A981CE10C30E} {842BB22E-4309-4ADD-93CD-A981CE10C30E} = {842BB22E-4309-4ADD-93CD-A981CE10C30E}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Core.Api", "FunGame.Core.Api\FunGame.Core.Api.csproj", "{842BB22E-4309-4ADD-93CD-A981CE10C30E}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Core", "FunGame.Core\FunGame.Core.csproj", "{842BB22E-4309-4ADD-93CD-A981CE10C30E}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunGame.Plugin", "FunGame.Plugin\FunGame.Plugin.csproj", "{A1132284-47F3-4C2D-89DB-C34B2354D9BB}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Plugin", "FunGame.Plugin\FunGame.Plugin.csproj", "{A1132284-47F3-4C2D-89DB-C34B2354D9BB}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{842BB22E-4309-4ADD-93CD-A981CE10C30E} = {842BB22E-4309-4ADD-93CD-A981CE10C30E} {842BB22E-4309-4ADD-93CD-A981CE10C30E} = {842BB22E-4309-4ADD-93CD-A981CE10C30E}
{CC6C83C6-5818-4565-8873-67587FED1D0A} = {CC6C83C6-5818-4565-8873-67587FED1D0A}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunGame.Console", "FunGame.Console\FunGame.Console.csproj", "{1DB30EB0-5434-453B-949B-2164B6809291}"
ProjectSection(ProjectDependencies) = postProject
{842BB22E-4309-4ADD-93CD-A981CE10C30E} = {842BB22E-4309-4ADD-93CD-A981CE10C30E}
{CC6C83C6-5818-4565-8873-67587FED1D0A} = {CC6C83C6-5818-4565-8873-67587FED1D0A}
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
@ -42,6 +49,10 @@ Global
{A1132284-47F3-4C2D-89DB-C34B2354D9BB}.Debug|Any CPU.Build.0 = Debug|Any CPU {A1132284-47F3-4C2D-89DB-C34B2354D9BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1132284-47F3-4C2D-89DB-C34B2354D9BB}.Release|Any CPU.ActiveCfg = Release|Any CPU {A1132284-47F3-4C2D-89DB-C34B2354D9BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1132284-47F3-4C2D-89DB-C34B2354D9BB}.Release|Any CPU.Build.0 = Release|Any CPU {A1132284-47F3-4C2D-89DB-C34B2354D9BB}.Release|Any CPU.Build.0 = Release|Any CPU
{1DB30EB0-5434-453B-949B-2164B6809291}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DB30EB0-5434-453B-949B-2164B6809291}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DB30EB0-5434-453B-949B-2164B6809291}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DB30EB0-5434-453B-949B-2164B6809291}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE