mirror of
https://github.com/project-redbud/FunGame-Server.git
synced 2025-04-22 20:19:35 +08:00
添加UpdateRoom
This commit is contained in:
parent
4c9b729463
commit
2f5cdbd32b
@ -32,11 +32,11 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="FunGame.Core">
|
<Reference Include="FunGame.Core">
|
||||||
<HintPath>..\..\FunGame\bin\Server\Debug\net7.0\FunGame.Core.dll</HintPath>
|
<HintPath>..\..\FunGame\bin\Debug\net7.0-windows\FunGame.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MySql.Data">
|
<Reference Include="MySql.Data">
|
||||||
<HintPath>..\..\FunGame\bin\Server\Debug\net6.0\MySql.Data.dll</HintPath>
|
<HintPath>..\..\FunGame\bin\Server\Debug\net7.0\MySql.Data.dll</HintPath>
|
||||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json">
|
<Reference Include="Newtonsoft.Json">
|
||||||
@ -44,11 +44,11 @@
|
|||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Configuration.ConfigurationManager">
|
<Reference Include="System.Configuration.ConfigurationManager">
|
||||||
<HintPath>..\..\FunGame\bin\Server\Debug\net6.0\System.Configuration.ConfigurationManager.dll</HintPath>
|
<HintPath>..\..\FunGame\bin\Server\Debug\net7.0\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Security.Permissions">
|
<Reference Include="System.Security.Permissions">
|
||||||
<HintPath>..\..\FunGame\bin\Server\Debug\net6.0\System.Security.Permissions.dll</HintPath>
|
<HintPath>..\..\FunGame\bin\Server\Debug\net7.0\System.Security.Permissions.dll</HintPath>
|
||||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -313,12 +313,20 @@ namespace Milimoe.FunGame.Server.Model
|
|||||||
return Send(socket, type, false, msg);
|
return Send(socket, type, false, msg);
|
||||||
|
|
||||||
case SocketMessageType.UpdateRoom:
|
case SocketMessageType.UpdateRoom:
|
||||||
List<Room> list = new();
|
Config.RoomList = new(Server);
|
||||||
if (Config.RoomList != null)
|
DataSet DsRoom = SQLHelper.ExecuteDataSet(RoomQuery.Select_Rooms, out SQLResult TestResult);
|
||||||
|
if (TestResult == SQLResult.Success)
|
||||||
{
|
{
|
||||||
list = Config.RoomList.GetList();
|
for (int i = 0; i < DsRoom.Tables[0].Rows.Count; )
|
||||||
|
{
|
||||||
|
DataRow row = DsRoom.Tables[0].Rows[0];
|
||||||
|
DataSet DsUser = SQLHelper.ExecuteDataSet(UserQuery.Select_DuplicateUsername((string)row[RoomQuery.Column_RoomMasterName]), out TestResult);
|
||||||
|
Room room = Factory.GetInstance<Room>(DsRoom, DsUser);
|
||||||
|
Config.RoomList.AddRoom(room);
|
||||||
|
DsRoom.Tables[0].Rows.Remove(row);
|
||||||
}
|
}
|
||||||
return Send(socket, type, list);
|
}
|
||||||
|
return Send(socket, type, Config.RoomList.GetList());
|
||||||
|
|
||||||
case SocketMessageType.CreateRoom:
|
case SocketMessageType.CreateRoom:
|
||||||
break;
|
break;
|
||||||
|
@ -15,6 +15,10 @@ namespace Milimoe.FunGame.Server.Utility
|
|||||||
public override string Script { get; set; } = "";
|
public override string Script { get; set; } = "";
|
||||||
public override CommandType CommandType { get; set; } = CommandType.Text;
|
public override CommandType CommandType { get; set; } = CommandType.Text;
|
||||||
public override SQLResult Result => _Result;
|
public override SQLResult Result => _Result;
|
||||||
|
public override bool Success
|
||||||
|
{
|
||||||
|
get => Result == SQLResult.Success;
|
||||||
|
}
|
||||||
public override SQLServerInfo ServerInfo => _ServerInfo ?? SQLServerInfo.Create();
|
public override SQLServerInfo ServerInfo => _ServerInfo ?? SQLServerInfo.Create();
|
||||||
public override int UpdateRows => _UpdateRows;
|
public override int UpdateRows => _UpdateRows;
|
||||||
public override DataSet DataSet => _DataSet;
|
public override DataSet DataSet => _DataSet;
|
||||||
@ -110,15 +114,16 @@ namespace Milimoe.FunGame.Server.Utility
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建单次使用的SQLHelper(执行完毕会自动Close连接)
|
/// 创建SQLHelper
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="IsOneTime">是否是单次使用(执行完毕会自动Close连接)</param>
|
||||||
/// <param name="script">存储过程名称或者script语句</param>
|
/// <param name="script">存储过程名称或者script语句</param>
|
||||||
/// <param name="type">存储过程, 文本, 等等</param>
|
/// <param name="type">存储过程, 文本, 等等</param>
|
||||||
/// <param name="parameters">执行命令所用参数的集合</param>
|
/// <param name="parameters">执行命令所用参数的集合</param>
|
||||||
public MySQLHelper(string script = "", CommandType type = CommandType.Text, params MySqlParameter[] parameters)
|
public MySQLHelper(string script = "", bool IsOneTime = true, CommandType type = CommandType.Text, params MySqlParameter[] parameters)
|
||||||
{
|
{
|
||||||
_IsOneTime = true;
|
|
||||||
Script = script;
|
Script = script;
|
||||||
|
_IsOneTime = IsOneTime;
|
||||||
CommandType = type;
|
CommandType = type;
|
||||||
Parameters = parameters;
|
Parameters = parameters;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user