mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-21 19:49:34 +08:00
重新架构
This commit is contained in:
parent
295943e172
commit
b63d3831c2
2
.gitignore
vendored
2
.gitignore
vendored
@ -363,4 +363,4 @@ MigrationBackup/
|
||||
FodyWeavers.xsd
|
||||
|
||||
# FunGame Implement
|
||||
FunGame.Core/Implement/*.cs
|
||||
FunGame.Implement/Implement/*.cs
|
29
FunGame.Console/FunGame.Console.csproj
Normal file
29
FunGame.Console/FunGame.Console.csproj
Normal 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
2
FunGame.Console/Main.cs
Normal file
@ -0,0 +1,2 @@
|
||||
Console.WriteLine("Hello, FunGame's Console!");
|
||||
Console.ReadKey();
|
BIN
FunGame.Console/images/logo.ico
Normal file
BIN
FunGame.Console/images/logo.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
@ -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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -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
|
||||
}
|
14
FunGame.Core/Api/Factory/CharacterFactory.cs
Normal file
14
FunGame.Core/Api/Factory/CharacterFactory.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
13
FunGame.Core/Api/Factory/ItemFactory.cs
Normal file
13
FunGame.Core/Api/Factory/ItemFactory.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
15
FunGame.Core/Api/Factory/RoomFactory.cs
Normal file
15
FunGame.Core/Api/Factory/RoomFactory.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
13
FunGame.Core/Api/Factory/SkillFactory.cs
Normal file
13
FunGame.Core/Api/Factory/SkillFactory.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
14
FunGame.Core/Api/Factory/StockFactory.cs
Normal file
14
FunGame.Core/Api/Factory/StockFactory.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
13
FunGame.Core/Api/Factory/UserFactory.cs
Normal file
13
FunGame.Core/Api/Factory/UserFactory.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
12
FunGame.Core/Api/Proxy/SQLProxy.cs
Normal file
12
FunGame.Core/Api/Proxy/SQLProxy.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
60
FunGame.Core/Api/Utility/EnumHelper.cs
Normal file
60
FunGame.Core/Api/Utility/EnumHelper.cs
Normal 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 "";
|
||||
}
|
||||
}
|
||||
}
|
81
FunGame.Core/Api/Utility/General.cs
Normal file
81
FunGame.Core/Api/Utility/General.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
108
FunGame.Core/Api/Utility/INIHelper.cs
Normal file
108
FunGame.Core/Api/Utility/INIHelper.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
86
FunGame.Core/Api/Utility/ReflectionHelper.cs
Normal file
86
FunGame.Core/Api/Utility/ReflectionHelper.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
@ -6,11 +6,11 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace FunGame.Core.Api.Model.Enum
|
||||
namespace Milimoe.FunGame.Core.Entity.Enum
|
||||
{
|
||||
/**
|
||||
* 这里存放框架实现相关的State Type Result Method
|
||||
* 添加FunGame.Core.Api接口和实现时,需要在这里同步添加:InterfaceType、InterfaceMethod
|
||||
* 添加Milimoe.FunGame.Core.Api接口和实现时,需要在这里同步添加:InterfaceType、InterfaceMethod
|
||||
*/
|
||||
|
||||
#region State
|
||||
@ -76,8 +76,8 @@ namespace FunGame.Core.Api.Model.Enum
|
||||
|
||||
public enum InterfaceType
|
||||
{
|
||||
ClientConnectInterface,
|
||||
ServerInterface
|
||||
IClient,
|
||||
IServer
|
||||
}
|
||||
|
||||
public enum LightType
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Enum
|
||||
namespace Milimoe.FunGame.Core.Entity.Enum
|
||||
{
|
||||
public static class FunGameEnums
|
||||
{
|
13
FunGame.Core/Entity/Event/GeneralEventHandler.cs
Normal file
13
FunGame.Core/Entity/Event/GeneralEventHandler.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class ActiveItem : Item
|
||||
{
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class ActiveSkill : Skill
|
||||
{
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class Character
|
||||
{
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class CharacterStatistics
|
||||
{
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class GameStatistics
|
||||
{
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public abstract class Item
|
||||
{
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class PassiveItem : Item
|
||||
{
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class PassiveSkill : Skill
|
||||
{
|
@ -6,7 +6,7 @@ using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class Room
|
||||
{
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public abstract class Skill
|
||||
{
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class Stock
|
||||
{
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class User
|
||||
{
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Core.Api.Model.Entity
|
||||
namespace Milimoe.FunGame.Core.Entity.General
|
||||
{
|
||||
public class UserStatistics
|
||||
{
|
@ -4,13 +4,13 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Company>Milimoe</Company>
|
||||
<BaseOutputPath>..\bin</BaseOutputPath>
|
||||
<Company>Milimoe</Company>
|
||||
<Authors>Milimoe</Authors>
|
||||
<Title>FunGame</Title>
|
||||
<PackageOutputPath>..\bin</PackageOutputPath>
|
||||
<AssemblyVersion>1.0</AssemblyVersion>
|
||||
<FileVersion>1.0</FileVersion>
|
||||
<PackageOutputPath>..\bin</PackageOutputPath>
|
||||
<Title>FunGame.Core</Title>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
@ -21,11 +21,4 @@
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FunGame.Core.Api\FunGame.Core.Api.csproj">
|
||||
<Private>False</Private>
|
||||
<CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
118
FunGame.Core/Interface/Event/Events.cs
Normal file
118
FunGame.Core/Interface/Event/Events.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
22
FunGame.Core/Interface/Example.cs
Normal file
22
FunGame.Core/Interface/Example.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
14
FunGame.Core/Interface/General/IClient.cs
Normal file
14
FunGame.Core/Interface/General/IClient.cs
Normal 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();
|
||||
}
|
||||
}
|
14
FunGame.Core/Interface/General/IServer.cs
Normal file
14
FunGame.Core/Interface/General/IServer.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
13
FunGame.Core/Others/Config/Config.cs
Normal file
13
FunGame.Core/Others/Config/Config.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
12
FunGame.Core/Service/MySQLManager.cs
Normal file
12
FunGame.Core/Service/MySQLManager.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
12
FunGame.Core/Service/PluginManager.cs
Normal file
12
FunGame.Core/Service/PluginManager.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
12
FunGame.Core/Service/RedisManager.cs
Normal file
12
FunGame.Core/Service/RedisManager.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
12
FunGame.Core/Service/ResourceManager.cs
Normal file
12
FunGame.Core/Service/ResourceManager.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
12
FunGame.Core/Service/SocketManager.cs
Normal file
12
FunGame.Core/Service/SocketManager.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
12
FunGame.Core/Service/ThreadManager.cs
Normal file
12
FunGame.Core/Service/ThreadManager.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace FunGame.Desktop.Models.Component
|
||||
namespace Milimoe.FunGame.Desktop.Entity.Component
|
||||
{
|
||||
partial class ExitButton
|
||||
{
|
@ -6,7 +6,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FunGame.Desktop.Models.Component
|
||||
namespace Milimoe.FunGame.Desktop.Entity.Component
|
||||
{
|
||||
public partial class ExitButton : Button
|
||||
{
|
||||
@ -15,7 +15,7 @@ namespace FunGame.Desktop.Models.Component
|
||||
InitializeComponent();
|
||||
Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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.BorderSize = 0;
|
||||
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();
|
||||
Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
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.BorderSize = 0;
|
||||
FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
|
@ -1,4 +1,4 @@
|
||||
namespace FunGame.Desktop.Models.Component
|
||||
namespace Milimoe.FunGame.Desktop.Entity.Component
|
||||
{
|
||||
partial class ShowMessage
|
||||
{
|
||||
@ -32,11 +32,11 @@
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShowMessage));
|
||||
this.MsgText = new System.Windows.Forms.Label();
|
||||
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.MidButton = new System.Windows.Forms.Button();
|
||||
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.InputText = new System.Windows.Forms.TextBox();
|
||||
this.TransparentRect.SuspendLayout();
|
||||
@ -133,7 +133,7 @@
|
||||
this.TransparentRect.Name = "TransparentRect";
|
||||
this.TransparentRect.Opacity = 125;
|
||||
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.TabIndex = 103;
|
||||
this.TransparentRect.TabStop = false;
|
@ -7,9 +7,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
namespace FunGame.Desktop.Models.Component
|
||||
{
|
||||
partial class TextArea
|
||||
partial class TextArea : RichTextBox
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
@ -8,7 +8,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace FunGame.Desktop.Models.Component
|
||||
namespace Milimoe.FunGame.Desktop.Entity.Component
|
||||
{
|
||||
[ToolboxBitmap(typeof(TextBox))]
|
||||
partial class TextArea : RichTextBox
|
@ -1,4 +1,4 @@
|
||||
namespace FunGame.Desktop.Models.Component
|
||||
namespace Milimoe.FunGame.Desktop.Entity.Component
|
||||
{
|
||||
partial class TransparentRect
|
||||
{
|
@ -7,7 +7,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace FunGame.Desktop.Models.Component
|
||||
namespace Milimoe.FunGame.Desktop.Entity.Component
|
||||
{
|
||||
partial class TransparentRect : GroupBox
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
@ -15,7 +15,7 @@
|
||||
<SignAssembly>False</SignAssembly>
|
||||
<Authors>Milimoe</Authors>
|
||||
<Product>FunGame</Product>
|
||||
<Title>FunGame</Title>
|
||||
<Title>FunGame.Desktop</Title>
|
||||
<PackageOutputPath>..\bin</PackageOutputPath>
|
||||
<AssemblyVersion>1.0</AssemblyVersion>
|
||||
<FileVersion>1.0</FileVersion>
|
||||
@ -49,6 +49,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
<Folder Include="UI\Login\" />
|
||||
<Folder Include="UI\Register\" />
|
||||
<Folder Include="UI\RoomSetting\" />
|
||||
@ -58,10 +59,10 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FunGame.Core.Api\FunGame.Core.Api.csproj">
|
||||
<ProjectReference Include="..\FunGame.Core\FunGame.Core.csproj">
|
||||
<CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\FunGame.Core\FunGame.Core.csproj">
|
||||
<ProjectReference Include="..\FunGame.Implement\FunGame.Implement.csproj">
|
||||
<CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 66 KiB |
@ -4,10 +4,10 @@ using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FunGame.Core.Api.Model.Enum;
|
||||
using FunGame.Core.Api.Util;
|
||||
using Milimoe.FunGame.Core.Entity.Enum;
|
||||
using Milimoe.FunGame.Core.Api.Utility;
|
||||
|
||||
namespace FunGame.Desktop.Models.Config
|
||||
namespace Milimoe.FunGame.Desktop.Others
|
||||
{
|
||||
public static class Config
|
||||
{
|
@ -1,11 +1,11 @@
|
||||
using FunGame.Core.Api.Model.Entity;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Milimoe.FunGame.Core.Entity.General;
|
||||
|
||||
namespace FunGame.Desktop.Models.Config
|
||||
namespace Milimoe.FunGame.Desktop.Others
|
||||
{
|
||||
public class Usercfg
|
||||
{
|
12
FunGame.Desktop/Properties/Resources.Designer.cs
generated
12
FunGame.Desktop/Properties/Resources.Designer.cs
generated
@ -8,7 +8,7 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FunGame.Desktop.Properties {
|
||||
namespace Milimoe.FunGame.Desktop.Properties {
|
||||
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>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
|
@ -133,9 +133,6 @@
|
||||
<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>
|
||||
</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">
|
||||
<value>..\images\min.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
|
32
FunGame.Desktop/UI/Main/Main.Designer.cs
generated
32
FunGame.Desktop/UI/Main/Main.Designer.cs
generated
@ -1,7 +1,7 @@
|
||||
using FunGame.Desktop.Models.Component;
|
||||
using FunGame.Desktop.Models.Config;
|
||||
using Milimoe.FunGame.Desktop.Entity.Component;
|
||||
using Milimoe.FunGame.Desktop.Others;
|
||||
|
||||
namespace FunGame.Desktop.UI
|
||||
namespace Milimoe.FunGame.Desktop.UI
|
||||
{
|
||||
partial class Main
|
||||
{
|
||||
@ -33,7 +33,7 @@ namespace FunGame.Desktop.UI
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
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.MinForm = new System.Windows.Forms.Button();
|
||||
this.Connection = new System.Windows.Forms.Label();
|
||||
@ -55,10 +55,10 @@ namespace FunGame.Desktop.UI
|
||||
this.QueryRoom = new System.Windows.Forms.Button();
|
||||
this.RoomList = new System.Windows.Forms.ListBox();
|
||||
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.TransparentRectControl = new FunGame.Desktop.Models.Component.TransparentRect();
|
||||
this.GameInfo = new FunGame.Desktop.Models.Component.TextArea();
|
||||
this.TransparentRectControl = new FunGame.Desktop.Entity.Component.TransparentRect();
|
||||
this.GameInfo = new FunGame.Desktop.Entity.Component.TextArea();
|
||||
this.QuitRoom = new System.Windows.Forms.Button();
|
||||
this.CreateRoom = 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.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.BorderSize = 0;
|
||||
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.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.FlatAppearance.BorderColor = System.Drawing.Color.LightGray;
|
||||
this.MinForm.FlatAppearance.BorderSize = 0;
|
||||
@ -142,7 +142,7 @@ namespace FunGame.Desktop.UI
|
||||
// Light
|
||||
//
|
||||
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.Name = "Light";
|
||||
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.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.FlatAppearance.BorderSize = 0;
|
||||
this.SendTalkText.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Teal;
|
||||
@ -433,7 +433,7 @@ namespace FunGame.Desktop.UI
|
||||
this.TransparentRectControl.Name = "TransparentRectControl";
|
||||
this.TransparentRectControl.Opacity = 125;
|
||||
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.TabIndex = 2;
|
||||
this.TransparentRectControl.TabStop = false;
|
||||
@ -559,7 +559,7 @@ namespace FunGame.Desktop.UI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
|
||||
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.Controls.Add(this.StopMatch);
|
||||
this.Controls.Add(this.Copyright);
|
||||
@ -637,8 +637,8 @@ namespace FunGame.Desktop.UI
|
||||
private Button Store;
|
||||
private LinkLabel Copyright;
|
||||
private Button StopMatch;
|
||||
private Models.Component.TextArea GameInfo;
|
||||
private Models.Component.TextArea NoticeText;
|
||||
private Models.Component.TransparentRect TransparentRectControl;
|
||||
private Entity.Component.TextArea GameInfo;
|
||||
private Entity.Component.TextArea NoticeText;
|
||||
private Entity.Component.TransparentRect TransparentRectControl;
|
||||
}
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
using FunGame.Desktop.Models.Component;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Sockets;
|
||||
using System.Net;
|
||||
using System.Windows.Forms;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using FunGame.Core.Api.Model.Entity;
|
||||
using FunGame.Desktop.Models.Config;
|
||||
using FunGame.Desktop.Utils;
|
||||
using FunGame.Core.Api.Model.Enum;
|
||||
using FunGame.Core.Api.Util;
|
||||
using Milimoe.FunGame.Core.Api.Utility;
|
||||
using Milimoe.FunGame.Core.Entity.General;
|
||||
using Milimoe.FunGame.Core.Entity.Enum;
|
||||
using Milimoe.FunGame.Desktop.Entity.Component;
|
||||
using Milimoe.FunGame.Desktop.Others;
|
||||
using Milimoe.FunGame.Desktop.Utils;
|
||||
|
||||
namespace FunGame.Desktop.UI
|
||||
namespace Milimoe.FunGame.Desktop.UI
|
||||
{
|
||||
public partial class Main : Form
|
||||
{
|
||||
@ -291,7 +291,7 @@ namespace FunGame.Desktop.UI
|
||||
{
|
||||
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)
|
||||
{
|
||||
string[] s = ipaddress.Split(':');
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace FunGame.Desktop.UI
|
||||
namespace Milimoe.FunGame.Desktop.UI
|
||||
{
|
||||
internal static class Start
|
||||
{
|
||||
|
@ -8,13 +8,13 @@ using System.Threading.Tasks;
|
||||
using FunGame.Desktop.Models.Component;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Net.NetworkInformation;
|
||||
using FunGame.Core.Api.Model.Entity;
|
||||
using FunGame.Core.Api.Model.Enum;
|
||||
using FunGame.Core.Api.Util;
|
||||
using FunGame.Desktop.Models.Config;
|
||||
using FunGame.Desktop.UI;
|
||||
using Milimoe.FunGame.Core.Entity.General;
|
||||
using Milimoe.FunGame.Core.Entity.Enum;
|
||||
using Milimoe.FunGame.Desktop.Others;
|
||||
using Milimoe.FunGame.Desktop.UI;
|
||||
using Milimoe.FunGame.Core.Api.Utility;
|
||||
|
||||
namespace FunGame.Desktop.Utils
|
||||
namespace Milimoe.FunGame.Desktop.Utils
|
||||
{
|
||||
public class SocketHelper
|
||||
{
|
||||
|
@ -1,16 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<BaseOutputPath>..\bin</BaseOutputPath>
|
||||
<Company>Milimoe</Company>
|
||||
<BaseOutputPath>..\bin</BaseOutputPath>
|
||||
<Authors>Milimoe</Authors>
|
||||
<Title>FunGame.Implement</Title>
|
||||
<PackageOutputPath>..\bin</PackageOutputPath>
|
||||
<AssemblyVersion>1.0</AssemblyVersion>
|
||||
<FileVersion>1.0</FileVersion>
|
||||
<PackageOutputPath>..\bin</PackageOutputPath>
|
||||
<Title>FunGame</Title>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
@ -21,4 +21,11 @@
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FunGame.Core\FunGame.Core.csproj">
|
||||
<Private>False</Private>
|
||||
<CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@ -7,7 +7,7 @@
|
||||
<BaseOutputPath>..\bin\</BaseOutputPath>
|
||||
<Authors>Milimoe</Authors>
|
||||
<Company>Milimoe</Company>
|
||||
<Title>FunGame</Title>
|
||||
<Title>FunGameSDK</Title>
|
||||
<AssemblyVersion>1.0</AssemblyVersion>
|
||||
<FileVersion>1.0</FileVersion>
|
||||
<PackageOutputPath>..\bin\plugin</PackageOutputPath>
|
||||
@ -21,4 +21,8 @@
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FunGame.Core\FunGame.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
17
FunGame.sln
17
FunGame.sln
@ -8,16 +8,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Desktop", "FunGame.
|
||||
{CC6C83C6-5818-4565-8873-67587FED1D0A} = {CC6C83C6-5818-4565-8873-67587FED1D0A}
|
||||
EndProjectSection
|
||||
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
|
||||
{842BB22E-4309-4ADD-93CD-A981CE10C30E} = {842BB22E-4309-4ADD-93CD-A981CE10C30E}
|
||||
EndProjectSection
|
||||
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
|
||||
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
|
||||
{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
|
||||
EndProject
|
||||
Global
|
||||
@ -42,6 +49,10 @@ Global
|
||||
{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.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
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
Loading…
x
Reference in New Issue
Block a user