mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
Update commands.h
add private ips are operator as well as error message for non operators
This commit is contained in:
@@ -13,21 +13,6 @@
|
||||
#include "ai.h"
|
||||
#include "moderation.h"
|
||||
|
||||
inline bool IsOperator(APlayerState* PlayerState, AFortPlayerController* PlayerController)
|
||||
{
|
||||
auto& IP = PlayerState->GetSavedNetworkAddress();
|
||||
auto IPStr = IP.ToString();
|
||||
|
||||
// std::cout << "IPStr: " << IPStr << '\n';
|
||||
|
||||
if (IPStr == "127.0.0.1" || IPStr == "68.134.74.228" || IPStr == "26.66.97.190" || IsOp(PlayerController))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
inline void SendMessageToConsole(AFortPlayerController* PlayerController, const FString& Msg)
|
||||
{
|
||||
float MsgLifetime = 1; // unused by ue
|
||||
@@ -47,4 +32,32 @@ inline void SendMessageToConsole(AFortPlayerController* PlayerController, const
|
||||
// LOG_INFO(LogDev, "{}", brah);
|
||||
}
|
||||
|
||||
inline bool IsPrivateIP(std::string IPStr) {
|
||||
if (IPStr.find("192.168") == 0 || IPStr.find("10.0") == 0 || IPStr.find("172.16") == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool IsOperator(APlayerState* PlayerState, AFortPlayerController* PlayerController)
|
||||
{
|
||||
auto& IP = PlayerState->GetSavedNetworkAddress();
|
||||
auto IPStr = IP.ToString();
|
||||
|
||||
// std::cout << "IPStr: " << IPStr << '\n';
|
||||
|
||||
if (IPStr == "127.0.0.1" || IPStr == "68.134.74.228" || IPStr == "26.66.97.190" || IsOp(PlayerController))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (Globals::bPrivateIPsAreOperator) {
|
||||
return IsPrivateIP(IPStr);
|
||||
}
|
||||
|
||||
SendMessageToConsole(PlayerController, L"You are not an Operator!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg);
|
||||
Reference in New Issue
Block a user