hedgewars/uCommandHandlers.pas
changeset 7151 ec15d9e1a7e3
parent 7104 2468316c1d9d
child 7180 53ffc8853008
child 7187 aff30d80bd7b
equal deleted inserted replaced
7148:c7ee9592c9a1 7151:ec15d9e1a7e3
    84     SendIPC(_S'H');
    84     SendIPC(_S'H');
    85     GameState:= gsExit
    85     GameState:= gsExit
    86 end;
    86 end;
    87 
    87 
    88 procedure chCheckProto(var s: shortstring);
    88 procedure chCheckProto(var s: shortstring);
    89 var i: LongInt;
    89 var i, c: LongInt;
    90 begin
    90 begin
    91     if isDeveloperMode then
    91     if isDeveloperMode then
    92         begin
    92         begin
    93         val(s, i);
    93         val(s, i, c);
    94         TryDo(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true);
    94         TryDo(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true);
    95         TryDo(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true);
    95         TryDo(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true);
    96         end
    96         end
    97 end;
    97 end;
    98 
    98 
   681     ZoomValue:= cDefaultZoomLevel;
   681     ZoomValue:= cDefaultZoomLevel;
   682 end;
   682 end;
   683 
   683 
   684 procedure chMapGen(var s: shortstring);
   684 procedure chMapGen(var s: shortstring);
   685 begin
   685 begin
   686 val(s, cMapGen)
   686 cMapGen:= StrToInt(s)
   687 end;
   687 end;
   688 
   688 
   689 procedure chTemplateFilter(var s: shortstring);
   689 procedure chTemplateFilter(var s: shortstring);
   690 begin
   690 begin
   691 val(s, cTemplateFilter)
   691 cTemplateFilter:= StrToInt(s)
   692 end;
   692 end;
   693 
   693 
   694 procedure chInactDelay(var s: shortstring);
   694 procedure chInactDelay(var s: shortstring);
   695 begin
   695 begin
   696 val(s, cInactDelay)
   696 cInactDelay:= StrToInt(s)
   697 end;
   697 end;
   698 
   698 
   699 procedure chReadyDelay(var s: shortstring);
   699 procedure chReadyDelay(var s: shortstring);
   700 begin
   700 begin
   701 val(s, cReadyDelay)
   701 cReadyDelay:= StrToInt(s)
   702 end;
   702 end;
   703 
   703 
   704 procedure chCaseFactor(var s: shortstring);
   704 procedure chCaseFactor(var s: shortstring);
   705 begin
   705 begin
   706 val(s, cCaseFactor)
   706 cCaseFactor:= StrToInt(s)
   707 end;
   707 end;
   708 
   708 
   709 procedure chHealthCaseProb(var s: shortstring);
   709 procedure chHealthCaseProb(var s: shortstring);
   710 begin
   710 begin
   711 val(s, cHealthCaseProb)
   711 cHealthCaseProb:= StrToInt(s)
   712 end;
   712 end;
   713 
   713 
   714 procedure chHealthCaseAmount(var s: shortstring);
   714 procedure chHealthCaseAmount(var s: shortstring);
   715 begin
   715 begin
   716 val(s, cHealthCaseAmount)
   716 cHealthCaseAmount:= StrToInt(s)
   717 end;
   717 end;
   718 
   718 
   719 procedure chSuddenDTurns(var s: shortstring);
   719 procedure chSuddenDTurns(var s: shortstring);
   720 begin
   720 begin
   721 val(s, cSuddenDTurns)
   721 cSuddenDTurns:= StrToInt(s)
   722 end;
   722 end;
   723 
   723 
   724 procedure chWaterRise(var s: shortstring);
   724 procedure chWaterRise(var s: shortstring);
   725 begin
   725 begin
   726 val(s, cWaterRise)
   726 cWaterRise:= StrToInt(s)
   727 end;
   727 end;
   728 
   728 
   729 procedure chHealthDecrease(var s: shortstring);
   729 procedure chHealthDecrease(var s: shortstring);
   730 begin
   730 begin
   731 val(s, cHealthDecrease)
   731 cHealthDecrease:= StrToInt(s)
   732 end;
   732 end;
   733 
   733 
   734 procedure chDamagePercent(var s: shortstring);
   734 procedure chDamagePercent(var s: shortstring);
   735 begin
   735 begin
   736 val(s, cDamagePercent)
   736 cDamagePercent:= StrToInt(s)
   737 end;
   737 end;
   738 
   738 
   739 procedure chRopePercent(var s: shortstring);
   739 procedure chRopePercent(var s: shortstring);
   740 begin
   740 begin
   741 val(s, cRopePercent)
   741 cRopePercent:= StrToInt(s)
   742 end;
   742 end;
   743 
   743 
   744 procedure chGetAwayTime(var s: shortstring);
   744 procedure chGetAwayTime(var s: shortstring);
   745 begin
   745 begin
   746 val(s, cGetAwayTime)
   746 cGetAwayTime:= StrToInt(s)
   747 end;
   747 end;
   748 
   748 
   749 procedure chMineDudPercent(var s: shortstring);
   749 procedure chMineDudPercent(var s: shortstring);
   750 begin
   750 begin
   751 val(s, cMineDudPercent)
   751 cMineDudPercent:= StrToInt(s)
   752 end;
   752 end;
   753 
   753 
   754 procedure chLandMines(var s: shortstring);
   754 procedure chLandMines(var s: shortstring);
   755 begin
   755 begin
   756 val(s, cLandMines)
   756 cLandMines:= StrToInt(s)
   757 end;
   757 end;
   758 
   758 
   759 procedure chExplosives(var s: shortstring);
   759 procedure chExplosives(var s: shortstring);
   760 begin
   760 begin
   761 val(s, cExplosives)
   761 cExplosives:= StrToInt(s)
   762 end;
   762 end;
   763 
   763 
   764 procedure chGameFlags(var s: shortstring);
   764 procedure chGameFlags(var s: shortstring);
   765 begin
   765 begin
   766 val(s, GameFlags)
   766 GameFlags:= StrToInt(s)
   767 end;
   767 end;
   768 
   768 
   769 procedure chHedgehogTurnTime(var s: shortstring);
   769 procedure chHedgehogTurnTime(var s: shortstring);
   770 begin
   770 begin
   771 val(s, cHedgehogTurnTime)
   771 cHedgehogTurnTime:= StrToInt(s)
   772 end;
   772 end;
   773 
   773 
   774 procedure chMinesTime(var s: shortstring);
   774 procedure chMinesTime(var s: shortstring);
   775 begin
   775 begin
   776 val(s, cMinesTime)
   776 cMinesTime:= StrToInt(s)
   777 end;
   777 end;
   778 
   778 
   779 procedure chFastUntilLag(var s: shortstring);
   779 procedure chFastUntilLag(var s: shortstring);
   780 var i: LongInt;
   780 begin
   781 begin
   781 fastUntilLag:= StrToInt(s) <> 0
   782 val(s, i);
       
   783 fastUntilLag:= i <> 0
       
   784 end;
   782 end;
   785 
   783 
   786 procedure initModule;
   784 procedure initModule;
   787 begin
   785 begin
   788 //////// Begin top sorted by freq analysis not including chatmsg
   786 //////// Begin top sorted by freq analysis not including chatmsg