mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-21 09:11:20 +00:00
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
50 lines
1.6 KiB
C#
Executable file
50 lines
1.6 KiB
C#
Executable file
using FSO.Server.Protocol.Gluon.Packets;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace FSO.Server.Protocol.Gluon
|
|
{
|
|
public class GluonPackets
|
|
{
|
|
public static Dictionary<ushort, Type> GLUON_PACKET_BY_TYPEID;
|
|
public static Type[] ELECTRON_PACKETS = new Type[] {
|
|
typeof(AdvertiseCapacity),
|
|
typeof(TransferClaim),
|
|
typeof(TransferClaimResponse),
|
|
typeof(RequestLotClientTermination),
|
|
typeof(ShardShutdownRequest),
|
|
typeof(ShardShutdownCompleteResponse),
|
|
typeof(HealthPing),
|
|
typeof(HealthPingResponse),
|
|
typeof(RequestTask),
|
|
typeof(RequestTaskResponse),
|
|
typeof(NotifyLotRoommateChange),
|
|
typeof(MatchmakerNotify),
|
|
typeof(CityNotify),
|
|
typeof(TuningChanged),
|
|
typeof(SendCityMail)
|
|
};
|
|
|
|
static GluonPackets()
|
|
{
|
|
GLUON_PACKET_BY_TYPEID = new Dictionary<ushort, Type>();
|
|
foreach (Type packetType in ELECTRON_PACKETS)
|
|
{
|
|
IGluonPacket packet = (IGluonPacket)Activator.CreateInstance(packetType);
|
|
GLUON_PACKET_BY_TYPEID.Add(packet.GetPacketType().GetPacketCode(), packetType);
|
|
}
|
|
}
|
|
|
|
public static Type GetByPacketCode(ushort code)
|
|
{
|
|
if (GLUON_PACKET_BY_TYPEID.ContainsKey(code))
|
|
{
|
|
return GLUON_PACKET_BY_TYPEID[code];
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|