using Epic.OnlineServices.AntiCheatCommon;
using Facepunch;
using Network;
using Network;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Oxide.Core.Plugins;
using ProtoBuf;
using Steamworks;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("NoSteam", "Sopelka", "1.0.0")]
[Description("NoSteam")]
class NoSteam : RustPlugin
{
[HookMethod("OnUserApprove")]
object OnUserApprove(Connection connection)
{
if(Performance.report.frameRate < 10)
{
//Net.sv.Kick(connection, "Зайдите чуть позже, ведуться Тех работы... Посетите >> bulbarust.ru", false);
//return false;
}
connection.authStatusSteam = "ok";
connection.authStatusEAC = "ok";
connection.authStatusNexus = "ok";
connection.authStatusCentralizedBans = "ok";
connection.authStatusPremiumServer = "ok";
connection.active = true;
connection.rejected = false;
connection.state = Connection.State.InQueue;
ConVar.Server.secure = false;
EACServer.OnJoinGame(connection);
PlatformService.Instance.UpdatePlayerSession(connection.userid, connection.username);
connection.encryptionLevel = 1;
global::ConnectionAuth.m_AuthConnection.Remove(connection);
ConnectionQueue smr = new ConnectionQueue();
smr.queue.Remove(connection);
connection.state = Connection.State.Welcoming;
smr.nextMessageTime = 0f;
smr.joining.Add(connection);
using (Approval approval = Facepunch.Pool.Get<Approval>())
{
uint num = (uint)ConVar.Server.encryption;
if (num > 1U && connection.os == "editor" && DeveloperList.Contains(connection.ownerid))
{
num = 1U;
}
if (num > 1U && !ConVar.Server.secure)
{
num = 1U;
}
approval.level = UnityEngine.Application.loadedLevelName;
approval.levelConfig = global::World.Config.JsonString;
approval.levelTransfer = global::World.Transfer;
approval.levelUrl = global::World.Url;
approval.levelSeed = global::World.Seed;
approval.levelSize = global::World.Size;
approval.checksum = global::World.Checksum;
approval.hostname = ConVar.Server.hostname;
approval.official = ConVar.Server.official;
approval.encryption = num;
approval.version = BuildInfo.Current.Scm.Branch + "#" + BuildInfo.Current.Scm.ChangeId;
approval.nexus = global::World.Nexus;
approval.nexusEndpoint = ConVar.Nexus.endpoint;
approval.nexusId = NexusServer.NexusId.GetValueOrDefault();
NetWrite netWrite = Network.Net.sv.StartWrite();
netWrite.PacketID(Message.Type.Approved);
approval.WriteToStream(netWrite, false, 2097152);
netWrite.Send(new SendInfo(connection));
connection.encryptionLevel = num;
}
connection.connected = true;
// new ConnectionAuth().Approve(connection);
NextFrame(delegate { ConVar.Server.secure = true; });
return false;
}
}
}