first commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using NitroxClient.Communication.Abstract;
|
||||
using NitroxClient.Communication.Packets.Processors.Abstract;
|
||||
using NitroxClient.MonoBehaviours.Gui.Modals;
|
||||
using NitroxModel.Packets;
|
||||
|
||||
namespace NitroxClient.Communication.Packets.Processors
|
||||
{
|
||||
public class UserKickedProcessor : ClientPacketProcessor<PlayerKicked>
|
||||
{
|
||||
private readonly IMultiplayerSession session;
|
||||
|
||||
public UserKickedProcessor(IMultiplayerSession session)
|
||||
{
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
public override void Process(PlayerKicked packet)
|
||||
{
|
||||
string message = Language.main.Get("Nitrox_PlayerKicked");
|
||||
|
||||
if (!string.IsNullOrEmpty(packet.Reason))
|
||||
{
|
||||
message += $"\n {packet.Reason}";
|
||||
}
|
||||
|
||||
session.Disconnect();
|
||||
Modal.Get<KickedModal>()?.Show(message);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user