HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting Multiplayer or Singleplayer

07-14-2004, 06:05 PM#1
weaaddar
Here is a test map demonstrating my discovery, a method to findout if you are playing in singleplayer or multiplayer.

Basically I generate a gamecache file, store a dummy value in it, then try to save it disk. If its singleplayer the SaveGameCache native returns true, if its multiplayer or if the file in question has no values in it (the reason I store a dummy value in it), it returns false.

Good uses include::
--Forcing the guy to make a lan game if he plays singleplayer so that he can't use cheats?
--Having special features if its multiplayer or singleplayer?
--No real good use?

http://weaaddar.wc3campaigns.com/MorSplayer.w3m

Here it is in function mode
Code:
function WhichMode takes nothing returns boolean
  local gamecache gc = InitGameCache("gc.w3v") 
  call StoreInteger(gc, "test", "test", 9) 
  return SaveGameCache(gc)
endfunction
07-14-2004, 06:15 PM#2
35263526
So simply, and yet noone's thought of it yet.

I emplore your ingenuity. I'll be using this.
07-14-2004, 06:34 PM#3
FyreDaug
Or you could just simply count the players in control of a user....
07-14-2004, 06:50 PM#4
weaaddar
Quote:
Originally Posted by FyreDaug
Or you could just simply count the players in control of a user....
And you are so wrong again FD.
if you do that you could still be playing a lan game with only one user. So that means you can't use cheats or use the save functions. Again its not very useful, but its important if you don't want people using cheats (and thus forcing them to hit the play lan button).
07-24-2004, 02:33 PM#5
Shimrra
There was a trigger in Curse of Time that gave you a defeat if it wa sin singleplayer. The map was protected though, so I'm not completely sure what the trigger was or if it worked like yours or not. Anyway, that's a very good idea. I like the way that it lets you still play alone, but just on a LAN, rather then forcing you to play with other people.
07-24-2004, 03:00 PM#6
Xinlitik
Nice job Weaaddar. I've been wondering if there was a good way to stop them from cheating.
07-26-2004, 11:52 AM#7
Draenaxx
Well, you could just have make a trigger which will destroy the units of a player if he's cheating.
07-26-2004, 09:21 PM#8
weaaddar
How do you detect all the cheats?
How do I detect if you used unlim mana or forgoe cooldown? Those aren't easy things to do.
07-26-2004, 10:26 PM#9
Wolf Boy
I think i might know how. An event detecting if a player types cheat enabled.
07-26-2004, 11:37 PM#10
weaaddar
Try it out I assure you it doesn't work cheats don't fire the chat event at all.
This is the only way I can think of to gaurentee no cehats will be used.
08-03-2004, 07:08 PM#11
aots_assasin
just check the player slot status
08-04-2004, 01:11 AM#12
weaaddar
Hello mr. I can't read.
This still doesn't tell you if the game was launched as a single player game or as a multiplayer game but with only one non computer player.
God, I already said this about 5 posts up
08-05-2004, 04:26 PM#13
HexenLordX
Great job, weaaddar. I've been looking for a similar system to use in my map becuase it has save/load and I wanted to be able to prevent users from playing single player to cheat, then loading on b.net. We discussed it and never found a decent way, but yours seems to work fine.

Just one question, is it flawed in any way? I mean, is it at all possible for people to find a way around it and play multiplayer.
08-05-2004, 08:54 PM#14
Vexorian
Quote:
Originally Posted by HexenLordX
Great job, weaaddar. I've been looking for a similar system to use in my map becuase it has save/load and I wanted to be able to prevent users from playing single player to cheat, then loading on b.net. We discussed it and never found a decent way, but yours seems to work fine.

Just one question, is it flawed in any way? I mean, is it at all possible for people to find a way around it and play multiplayer.
yes, they just remove your check and done
08-05-2004, 10:37 PM#15
weaaddar
true but protecting the map should stop most spurious cheaters.