hedgewars/CCHandlers.inc
changeset 4389 d1c65b60cd68
parent 4365 4f2b1a152979
child 4398 36d7e4b6ca81
equal deleted inserted replaced
4388:b14e24444bca 4389:d1c65b60cd68
   845 procedure chHistory(var s: shortstring);
   845 procedure chHistory(var s: shortstring);
   846 begin
   846 begin
   847     s:= s; // avoid compiler hint
   847     s:= s; // avoid compiler hint
   848     uChat.showAll:= not uChat.showAll
   848     uChat.showAll:= not uChat.showAll
   849 end;
   849 end;
       
   850 
       
   851 procedure chLandCheck(var s: shortstring);
       
   852 begin
       
   853 {$IFDEF DEBUGFILE}
       
   854     AddFileLog('CheckLandDigest: ' + s + ' digest : ' + digest);
       
   855 {$ENDIF}
       
   856     if digest = '' then
       
   857         digest:= s
       
   858     else
       
   859         TryDo(s = digest, 'Different maps generated, sorry', true);
       
   860 end;
       
   861 
       
   862 procedure chSendLandDigest(var s: shortstring);
       
   863 var adler, i: LongInt;
       
   864 begin
       
   865     adler:= 1;
       
   866     for i:= 0 to LAND_HEIGHT-1 do
       
   867         Adler32Update(adler, @Land[i,0], LAND_WIDTH);
       
   868     s:= 'M' + IntToStr(adler);
       
   869 
       
   870     chLandCheck(s);
       
   871     SendIPCRaw(@s[0], Length(s) + 1)
       
   872 end;