Files
Ragon/Ragon.Server/Sources/RagonServerConfiguration.cs
T

48 lines
1.4 KiB
C#
Raw Permalink Normal View History

2023-03-06 10:06:43 +04:00
/*
2024-05-19 12:26:42 +03:00
* Copyright 2023-2024 Eduard Kargin <kargin.eduard@gmail.com>
2023-03-06 10:06:43 +04:00
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace Ragon.Server;
public enum ServerType
{
ENET,
WEBSOCKET,
}
2022-12-16 00:05:46 +04:00
[Serializable]
2023-07-01 07:47:57 +03:00
public struct RagonServerConfiguration
2022-12-16 00:05:46 +04:00
{
2022-12-20 12:20:52 -08:00
public string ServerKey;
public string ServerAddress;
2022-12-20 12:20:52 -08:00
public ushort ServerTickRate;
public string Protocol;
2022-12-16 00:05:46 +04:00
public ushort Port;
public int LimitConnections;
public int LimitPlayersPerRoom;
public int LimitRooms;
2023-07-01 07:47:57 +03:00
public int LimitBufferedEvents;
2024-08-17 10:29:27 +03:00
public int LimitUserDataSize;
public int LimitPropertySize;
2025-10-04 15:08:53 +03:00
public int LimitConnectionsPerProject;
2022-12-16 00:05:46 +04:00
2023-03-06 10:06:43 +04:00
private static Dictionary<string, ServerType> _serverTypes = new Dictionary<string, ServerType>()
{
{ "enet", Server.ServerType.ENET },
{ "websocket", Server.ServerType.WEBSOCKET }
2023-03-06 10:06:43 +04:00
};
2023-03-06 10:06:43 +04:00
public static ServerType GetServerType(string type) => _serverTypes[type];
2022-12-16 00:05:46 +04:00
}