The Black Tutorials- 2)How to lock a map to your server

Get some cool tips about how to tweak your UT graphic, gameplay, and much more!
Post Reply
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

The Black Tutorials- 2)How to lock a map to your server

Post by JackGriffin »

How to lock your map to your server

First, grab this
MapLock.zip
(3.38 KiB) Downloaded 122 times
Follow these instructions... It is broken into two parts.

PART ONE: How to secure a map.
PART TWO: What to add to the server.

PART ONE:
IMPORTANT: First, make a copy of your map. Once you protect it you will not be able to play it in editor. Protect it last when you are ready to use it on the server.

1) Open the included map in your editor. It is called "MarsDemoMap". I made this originally for Mars' MH server.
2) You can see one actor in that map in the center. It is called "ZoneFog". This is NOT anything to do with zones or fog, it is only so that it appears to be something that doesn't matter if someone opens your map up in editor.
3) Now open the map you want to protect with the same editor. It will close the "MarsDemoMap" and open the new one but that is what we want to happen. Doing it this way will make the editor 'remember' the ZoneFog actor.
4) Find someplace in your map that is out of the way (hidden is best). Open the Actor Class Browser (the little pawn chesspiece) and under "Actor" you should see "ZoneFog" at the bottom. Left-click ZoneFog to highlight it.
5) Place a single "ZoneFog" in your map you want to protect.
6) In this new ZoneFog actor select it's properties.
7) Under "Advanced" change "bHidden" to "True".
8 ) Under "Display" change "DrawScale" to "0.000001". This will hide your protection from people trying to find it.
9) Rebuild your map and it's done. You can still work on the map in editor but you cannot play it now.

What this actor does is destroy any player trying to play the map. Go ahead and try to play the map now in editor. You'll see that your game freezes. Heh heh :):)

So how do we fix this so it works? Do this to your server:

PART TWO:
1) Add this line to your UnrealTournament.ini of your server:
ServerActors=MapUnlocker.SA
2) Place the MapUnlocker.u into the system folder of the server.
3) Do NOT add the file to redirect!! This file NEVER needs to leave your server. As long as you protect it, it should protect you.
4) Start your server normally and enjoy. You will notice nothing wrong, the map will now play normally as long as it remains on your server.

Anyone who tries to use your map by getting it from their cache will see it locks their game up. This protection CAN be bypassed but only a few people are smart enough to figure it all out before this was posted. The smarter you are about it the better it will work. You can add the ZoneFog actor to as many maps as you want.

Code theory: The map mutator is simply destroying any playerpawns it finds. The server actor disables it, allowing the map to be entered. If someone tries to run it on their server without the right server actor then the map will run fine but no one will be able to join. There aren't errors or anything, it just doesn't work. As long as the actor destroys the mod then the map plays without issues.

You can grab the source code and tweak it however you like. You don't have to use 'Zone Fog' if you don't want. You can make up your own actor name, just make it sound official. You can have multiple protections on the same map with this method so long as your server actor destroys them. There are many, many other ways to invoke serveractor protection on a map or mod and this is the simplest way but it also gives a straightforward example for you to follow. Any other way of doing this will start like this and get more complex but it's the basis you need to understand.
So long, and thanks for all the fish
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: The Black Tutorials- 2)How to lock a map to your server

Post by Barbie »

So how do we fix this so it works?
I noticed this kind of protection on Mars007 server and also posted a solution there, but post was deleted by Mars. ^^

I run some of that protected maps on my server, and in the map specific hacks section I just remove these Actors (I've picked up their names in the Editor):

Code: Select all

function int RemoveCopyProtection(out int PredictedResult) {
local int result;
local Actor A;
	PredictedResult += 2;
	if (FindActor('UT_SmokeGen0', A))
	{
		A.Destroy();
		result++;
	}
	if (FindActor('SmokeLightning0', A))
	{
		A.Destroy();
		result++;
	}
	return result;
}
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: The Black Tutorials- 2)How to lock a map to your server

Post by Chamberly »

Keep it going, I'm saving all the copy I can, then look at them later in months when I get time.
Image
Image
Image Edit: Why does my sig not work anymore?
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: The Black Tutorials- 2)How to lock a map to your server

Post by JackGriffin »

Barbie wrote:I've picked up their names in the Editor
It's possible to suppress that and/or make it so it cannot be removed or even seen. That's not really why I posted this though as it's not my intention to create new methods from scratch. It's more of a way to answer a lot of odd forum posts from over the years that I knew why something didn't work but I couldn't really answer. There's a methodology here that should be learned but not necessarily used.
So long, and thanks for all the fish
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: The Black Tutorials- 2)How to lock a map to your server

Post by sektor2111 »

Bah...
I would like to see a server with stuff playable at a good frame-rate rather than lagging and blowing up server. One of reasons for NOT being interested about such work protected or unprotected it's because breaks default mapping rules:
- less zoned;
- more polys;
- large open areas for running 2 days ? Why ?
- bot support - UFS (Unknown Flying Subject);
- monster tricky - What !? That's impossible! :loool:
Worth to be protected then ? For me: Not even a try.

Looks like I have to quit mooing with codes and get a hand in Editor. At least I will play my cubes completely Un-Protected... and I have my reasons to NOT protect them - community if will survive can use them even if I'm gone... without respawn.

In meantime when some server will get turned off, all stuff and work will be gone - because it was "protected"...
Yes, I got some idea about protecting, it won't even compile using default Engine...
Right now I'm undecided: digging more in codes or start doing feign mapper ? And... I'm not gonna sign them...
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: The Black Tutorials- 2)How to lock a map to your server

Post by JackGriffin »

I'm not really interested in protect/don't protect discussion. Everyone knows how I feel about sharing. The point is this stuff exists, it's out there in the wild because I've seen it, and it's a good idea for people to see how it works so they can deal with it. The methods I outlined are not hard to do but they also aren't hard to defeat. As far as I have ever seen no map has ever went above this level of locking that I've run across so this tutorial, while seeming to be negative, actually gives almost anyone the tools to now play any map that seemed to be unavailable to them before.

I love you Nels but trust me, we all get you won't play or use trash stuff.
So long, and thanks for all the fish
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: The Black Tutorials- 2)How to lock a map to your server

Post by Higor »

NoMapProtection.u in the Siege download also contains a protection cracker, this one used on some Siege maps.
Basically, an actor disguised as a Brush

EDIT:
Oh right, it's a hacked compilation. You're not supposed to be able to edit bStatic and bNoDelete on actors. :lol2:

Code: Select all

event PreBeginPlay()
{
	local brush B;
	local string s;

	ForEach AllActors (class'Brush', B)
	{
		if ( (Mover(B) == none) && (B.class != class'Engine.Brush') )
		{
			s = string(B.Class);
			s = Mid( s, instr(s,".")+1, 5);
			if ( s ~= "Brush" )
			{
				B.bStatic = false;
				B.bNoDelete = false;
				B.Destroy();
			}
		}
	}
	Destroy();
//Do not stay in the mutator chain
}
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: The Black Tutorials- 2)How to lock a map to your server

Post by sektor2111 »

Higor wrote:You're not supposed to be able to edit bStatic and bNoDelete on actors
Indeed, But I could ruin paths in maps rammed crushers, using a sort of "Wild" compilation, I exchange I couldn't Create them in UScript. Aside In some "protection" I can destroy PlayerStart/s :satan:, then join if you can and perhaps a Pawn "patrolling" will do a nice server- crash. That "brush" thing I guess it's doable using even Console...
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: The Black Tutorials- 2)How to lock a map to your server

Post by sektor2111 »

In section Pink Tutorials - ooops I mean Black Tutorials, you have forgot that a map can do more damage than you think, including stealing adminpassword as long as this "private" variable is not that private as it claims, and not only such things. You can imagine that I won't even show any hint about concept. When map is not "at home" might spread a "Covid" in the place which is not the Home of The Map.

Bumping reason: In a recent topic was a discussion about things, including Private variables... Ahah :satan: veeeery private...
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: The Black Tutorials- 2)How to lock a map to your server

Post by Feralidragon »

As I mentioned several times before: private variables are not meant to be "secure" variables, the "private" keyword is not meant to be interpreted in that sense, and this is true not only for UnrealScript but also almost every language in the world where you can declare variables as such, especially considering that in some of these mainstream languages you can use reflection to change a private variable to a protected or public one.

The "private" keyword is only meant to say that this variable is only meant to be accessible from the class it's declared in, and then the language simply enforces this either at compile-time or run-time, with the sole objective of limiting what can change the value of this variable, and keep it completely controlled from within the class.

So using private variables for things like passwords expecting that the variable will remain protected from external access is wrong and naive, that's not what they're for.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: The Black Tutorials- 2)How to lock a map to your server

Post by sektor2111 »

I might owe small explanations about how I managed to see the problem.
Two dudes were getting used with adding a password to the game in a public server and... leaving it like that, closed to other players. I decided to deactivate this "practice" making server to guard itself. First time things weren't cute with plain UScript attempt, but... I changed strategy... and ServerActor delegated to guard server against "admins" was reacting properly restoring server in an Open-For-Everyone server. I understand that some players are jerks messing up around - ruining other's fun, but restricting a public server that way was... not the best attitude. We can setup restrictions from outside for jesters, instead of rejecting every player. Then, you can imagine a map crawling through variables, doing restrictions or making a mess in server... because I do not recommend such practices - are against development and against community in end - I won't talk more or what is doable even for client trying to play such map Outside of Map's Home.
Post Reply