40 lines
986 B
C#
40 lines
986 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using GTANetworkAPI;
|
|
using ReallifeGamemode.Server.Core.API;
|
|
using ReallifeGamemode.Server.Types;
|
|
|
|
namespace ReallifeGamemode.Server.Core.RageMP
|
|
{
|
|
public static class RageExtensions
|
|
{
|
|
public static Vector3 ToVector3(this Position position)
|
|
{
|
|
return new Vector3(position.X, position.Y, position.Z);
|
|
}
|
|
|
|
public static Position ToPosition(this Vector3 vector)
|
|
{
|
|
return new Position(vector.X, vector.Y, vector.Z);
|
|
}
|
|
|
|
public static DisconnectReason ToDisconnectReason(this DisconnectionType disconnectionType)
|
|
{
|
|
switch (disconnectionType)
|
|
{
|
|
case DisconnectionType.Left:
|
|
return DisconnectReason.Quit;
|
|
|
|
case DisconnectionType.Kicked:
|
|
return DisconnectReason.Kick;
|
|
|
|
case DisconnectionType.Timeout:
|
|
return DisconnectReason.Timeout;
|
|
default:
|
|
return DisconnectReason.Unknown;
|
|
}
|
|
}
|
|
}
|
|
}
|