Vertigo
Joined: Aug 02, 2003
|
  Posted:
Aug 10, 2003 - 08:35 |
|
what about writing the (scrambled of course) random seed number in the
save file ?
so same moves -> same results. randomize at start of saving to prevent easy cheating.(in case the opponent didn't made exaxtly the same moves)
for scrambling (host computer deliver uniquenr (maybe from networkcard + proxy name + html roster mix,mix,mix) client computer does same,both are used to descamble ) so no copy to other copy of javabb
and try it out .
for disconnecting and then making other moves (to avoid the fumbles encountered before) i do think the human factor will get this real fast.
(after all your opponent sees what you are doing - and no way is this a gentlemen cheat like disconnecting and making a td )
i don't know if dice validation is checking connecting between clients,
but it should (even freezing the game if disconnected). |
|
|
SkiJunkie
Joined: Aug 02, 2003
|
  Posted:
Aug 11, 2003 - 02:21 |
|
|
Vertigo
Joined: Aug 02, 2003
|
  Posted:
Aug 11, 2003 - 19:32 |
|
wee, the class programmer should be burned in a public place. private seed number - yeah supersecret make it private -.
spend 3 hours searching how to access private members (i know that this is per design a no - but the serializeclass of java does it)
well in vain - so going with the cows use the serializerinterface :
static byte[] fromtRand(Random r)
{ byte[] save;save =new byte[1]; // for compiler error
try {
ByteArrayOutputStream b = new ByteArrayOutputStream();
ObjectOutput s = new ObjectOutputStream(b);
s.writeObject(r);
save = b.toByteArray();
} catch(Exception e) { save=null; };
return save;
}
static Random toRand(byte[] save)
{ try {
ByteArrayInputStream bb = new ByteArrayInputStream(save);
ObjectInput ss = new ObjectInputStream(bb);
r=(java.util.Random) ss.readObject();
} catch(Exception e) { r = null; };
} |
|
|
SkiJunkie
Joined: Aug 02, 2003
|
  Posted:
Aug 11, 2003 - 20:57 |
|
I hadn't thought about serializing the random object itself. Try it out and let me know if it works. Create a random class. Use it to generate some random numbers, serialize it, generate another set of random numbers, then unserialize it, generate the 2nd set again and see if they match. |
_________________ --SkiJunkie
________________________________
Java BBowl - http://www.geocities.com/javabbowl
Mirror - http://javabbowl.no-ip.org
Mirror - http://home.austin.rr.com/javabbowl |
|
Vertigo
Joined: Aug 02, 2003
|
  Posted:
Aug 11, 2003 - 21:32 |
|
did already, looking in the sourcecode of random and searching for seed
was the way that showed me this option.
byte[] odo;
odo = fromRand(r);
System.out.println(odo[0]+":"+r.nextInt(100));
r = toRand(odo);
System.out.println(r.nextInt(100)); |
|
|
SkiJunkie
Joined: Aug 02, 2003
|
  Posted:
Aug 11, 2003 - 22:27 |
|
Do you realize this CAN actually lead to cheating?
Example:
I start a turn.
Start lineman 1: gfi (2+) rolls 4. ends move.
Start lineman 2: dodge (3+) rolls 2, no reroll player falls and dies (apoth screen comes up).
hmm...so I know I just rolled a 4 then a 2 plus whatever the armor and injury rolls are. So I unplug forcing a game reload and start the turn over.
This time I dodge lineman 2 first cause I know I will roll a 4. Then I gfi lineman 2 because I know I will roll a 2. Then do whatever else will succeed with the armor and injury rolls that I know were made. |
_________________ --SkiJunkie
________________________________
Java BBowl - http://www.geocities.com/javabbowl
Mirror - http://javabbowl.no-ip.org
Mirror - http://home.austin.rr.com/javabbowl |
|
Vertigo
Joined: Aug 02, 2003
|
  Posted:
Aug 12, 2003 - 07:56 |
|
for disconnecting and then making other moves (to avoid the fumbles encountered before) i do think the human factor will get this real fast.
(after all your opponent sees what you are doing - and no way is this a gentlemen cheat like disconnecting and making a td )
i don't know if dice validation is checking connecting between clients,
but it should (even freezing the game if disconnected).
yes this is the biggest problem |
|
|
Mr-Klipp
Joined: Aug 02, 2003
|
  Posted:
Aug 12, 2003 - 08:32 |
|
Asking a lot of course, but what would really sort all of this out is a more complete save state that saved the complete current condition of the game and is updated after each random roll. The settlers of catan client I use does this and it is quite handy when dealing with dropped games. |
_________________ Looking to get your minis painted? Look no further.
The Finishing Touch |
|
SkiJunkie
Joined: Aug 02, 2003
|
  Posted:
Aug 12, 2003 - 17:04 |
|
|
Xeterog
Joined: Aug 02, 2003
|
  Posted:
Aug 14, 2003 - 08:30 |
|
Can't wait...it's only bitten me twice so far, but it's still very disturbing when your opponent gains from a disconnect. |
_________________ - Xeterog |
|
Pardus
Joined: Aug 02, 2003
|
  Posted:
Aug 14, 2003 - 09:07 |
|
disconnecting over a player death is not as bad as disconnecting cause they might lose a game.... that pisses me off to no end |
|
|
Xeterog
Joined: Aug 02, 2003
|
  Posted:
Aug 14, 2003 - 09:32 |
|
Well, disconnects happen for many reasons...not all of them caused by a coach... |
_________________ - Xeterog |
|
MixX
Joined: Aug 02, 2003
|
  Posted:
Sep 25, 2003 - 12:28 |
|
too true, I have a quite dodgy connection at times, it might get upgraded in the future (that's the dorm administration's call, not mine unfortunately). Have only disconnected a few times from a game, and I have never gained on it (except for once, where my opponent suffered a niggled-player-won't-play he didn't do the first time, on the other hand his treeman showed up this time which he didn't the first, so..)
This is not to say a save-after-every-roll wouldn't be great, 'cos it would! |
|
|
tgrozow
Joined: Aug 02, 2003
|
  Posted:
Sep 25, 2003 - 15:10 |
|
i don't know how the save code works, but if it's a public function or object that get's called at the end of each turn, why not just add a call to it at the end of each player move? |
|
|
Mr-Klipp
Joined: Aug 02, 2003
|
  Posted:
Sep 25, 2003 - 15:33 |
|
The save code does not save the individual player states at all(ie what skills have been used, what players have moved, if a reroll has been used, etc), only the team states(half, score, rerolls, etc), therefore it would need to be completly recoded to allow for saving after each player movement, much less each random roll. From what I hear, it is planned, it's just something that will take some time and is thus far out in the future. |
_________________ Looking to get your minis painted? Look no further.
The Finishing Touch |
|
|