Jump to content

building skins is broken after FP update

Closed 1.1.9 1.1.10

Aeryn Sun
Aeryn Sun

Posted

with todays update, the building skin plugin is broken, will not load.

 

 

image.png

the_doctor

Posted (edited)

I made these changes and it seems to be working. Use at your own risk or wait for an update. 

EDIT: If this isn't allowed, just let me know and I'll remove it. Just trying to help out. 
 

Quote

OnPlayerConnected Method
Replace:

if (!storedData.PlayerData.TryGetValue(player.userID, out var data))

With:

if (!storedData.PlayerData.TryGetValue(player.userID.Get(), out var data))

Replace:

storedData.PlayerData[player.userID] = data;

With:

storedData.PlayerData[player.userID.Get()] = data;


OnPlayerRespawned Method
Replace:

var data = storedData.PlayerData.TryGetValue(player.userID, out var playerData) ? playerData : null;

With:

var data = storedData.PlayerData.TryGetValue(player.userID.Get(), out var playerData) ? playerData : null;


OnHammerHit Method
Replace:

var playerData = storedData.PlayerData[player.userID];

With:

var playerData = storedData.PlayerData[player.userID.Get()];

Replace:

if ((config.BuildingBlocked && !player.CanBuild() || block.OwnerID != player.userID) && !permission.UserHasPermission(player.UserIDString, permissionAdmin)) return;

With:

if ((config.BuildingBlocked && !player.CanBuild() || block.OwnerID != player.userID.Get()) && !permission.UserHasPermission(player.UserIDString, permissionAdmin)) return;


OnStructureUpgrade Method
Replace:

var playerData = storedData.PlayerData[player.userID];

With:

var playerData = storedData.PlayerData[player.userID.Get()];

OnLootEntity Method
Replace:

if (config.ChangeSkinTC && cupboard.OwnerID != player.userID) return;

With:

if (config.ChangeSkinTC && cupboard.OwnerID != player.userID.Get()) return;


StopCoroutine Method
Replace:

if (!runningCoroutines.ContainsKey(player.userID)) return;

With:

if (!runningCoroutines.ContainsKey(player.userID.Get())) return;

Replace:

var coroutine = runningCoroutines[player.userID];

With:

var coroutine = runningCoroutines[player.userID.Get()];

Replace:

runningCoroutines.Remove(player.userID);

With:

runningCoroutines.Remove(player.userID.Get());

Replace:

if (entity is BuildingPrivlidge)
{
    if (config.ChangeSkinTC && entity.OwnerID != player.userID) return;
    TCupboardLayer(player);
}


With:

if (entity is BuildingPrivlidge)
{
    if (config.ChangeSkinTC && entity.OwnerID != player.userID.Get()) return;
    TCupboardLayer(player);
}


StartCoroutine Method
Replace:

if (runningCoroutines.ContainsKey(player.userID)) return;

With:

if (runningCoroutines.ContainsKey(player.userID.Get())) return;

Replace:

if (coroutine != null) runningCoroutines[player.userID] = coroutine;

With:

if (coroutine != null) runningCoroutines[player.userID.Get()] = coroutine;


CmdConsoleHandler Method
Replace:

var playerData = storedData.PlayerData[player.userID];

With:

var playerData = storedData.PlayerData[player.userID.Get()];


CmdChangeSkin Method
Replace:

if (runningCoroutines.ContainsKey(player.userID)) ...

With:

if (runningCoroutines.ContainsKey(player.userID.Get())) ...

Replace:

var targetOwner = arg.Length > 1 ? ulong.Parse(arg[1]) : player.userID;

With:

var targetOwner = arg.Length > 1 ? ulong.Parse(arg[1]) : player.userID.Get();

Replace:

PrintToChat(player, GetMessage(targetOwner != player.userID ? "Lang_UpdateAllTarget" : "Lang_UpdateAll", player));

With:

PrintToChat(player, GetMessage(targetOwner != player.userID.Get() ? "Lang_UpdateAllTarget" : "Lang_UpdateAll", player));


UpgradeSkin Method
Replace:

var playerData = storedData.PlayerData[player.userID];

With:

var playerData = storedData.PlayerData[player.userID.Get()];


ImageLayers Method
Replace:

var playerData = storedData.PlayerData[player.userID];

With:

var playerData = storedData.PlayerData[player.userID.Get()];


SettingsLayer Method
Replace:

var playerData = storedData.PlayerData[player.userID];

With:

var playerData = storedData.PlayerData[player.userID.Get()];


ColorLayer Method
Replace:

var playerData = storedData.PlayerData[player.userID];

With:

var playerData = storedData.PlayerData[player.userID.Get()];


TCupboardLayer Method
Replace:

var isRunning = runningCoroutines.ContainsKey(player.userID);

With:
 

var isRunning = runningCoroutines.ContainsKey(player.userID.Get());

 

 

Edited by the_doctor
0risk0fun

Posted

This compiler error depends on Version 1.1.9
[Error] Error while compiling BuildingSkins: Type of conditional expression cannot be determined because 'ulong' and 'BasePlayer.EncryptedValue' implicitly convert to one another | Line: 500, Pos: 39

Line 500: (previous) //var targetOwner = arg.Length > 1 ? ulong.Parse(arg[1]) : player.userID;

Fixing this issue by:  var targetOwner = arg.Length > 1 ? ulong.Parse(arg[1]) : player.userID.Get();

or by writing a Method() to do the job...

kaysharp

Posted

Changed Status from Pending to Closed

Changed Fixed In to 1.1.10

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.2k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.