Author Topic: Differences between Dedicated and Non-Dedi | Planted Bricks and Loaded Bricks  (Read 1226 times)

I've been reffering to other add-ons when I can't figure out how to do X but I've noticed that some add-ons have code that intentionally doesn't load them in dedicated servers, in dedi LAN or in non-dedi and other add-ons, particularly server_ add-ons have two different codes. One for fxdtsbrick::onPlant and one for onLoad. What's the difference between Non-dedi, dedi and dedi lan and plating a brick and loading a brick, codewise?

Could you post the relevant code of one or more of these cases? The only reason I could think of is if they are using gui objects within the server side part of the code, like using a GUI list for sorting.

The difference between onLoadPlant and onPlant is that onPlant is called when a player plants the brick, and onLoadPlant is when a save is loaded.

I don't remember all of the add-ons I looked into but these are two I have burned into my head:

Code: [Select]
if($server::lan)
{
error("CityRPG cannot support LAN servers because of conflicts within the Saving system.\nThis will most likely never be added due to the severity of this incompatibility/nTerminating...");
return;
}

Code: [Select]
if($server::dedicated) {
error("Gamemode_Stranded cannot run in a dedicated server.");
return;
}

In LAN servers, everyone's ID is "LAN" which makes add-ons that save persistent data based on bl_id not work, and also removes any build trust ability

As far as not allowing dedicated servers, I don't see any reason for this. My guess is it was something that for some reason required an admin to be present, and the maker didn't feel like working around that requirement

onPlant and onLoad are exactly what they say they are: onPlant fires when a user plants a brick, onLoad fires when a brick is loaded from a save file

So brick saving does not save the added attributes so I have to re-add them with OnLoad, correct?

So brick saving does not save the added attributes so I have to re-add them with OnLoad, correct?

If by added attributes you mean custom variables, no, you gotta re add them.

One for fxdtsbrick::onPlant and one for onLoad.

The method names are onPlant and onLoadPlant.