hedgewars/uFLNetProtocol.pas
branchqmlfrontend
changeset 11440 330c14f4ba69
parent 11437 6e641b5453f9
child 11441 908aed8525f9
equal deleted inserted replaced
11439:dd1350a475d9 11440:330c14f4ba69
   108         netSetMazeSize(p.param1);
   108         netSetMazeSize(p.param1);
   109         updatePreviewIfNeeded
   109         updatePreviewIfNeeded
   110     end
   110     end
   111 end;
   111 end;
   112 
   112 
       
   113 var schemeIndex: LongInt;
       
   114     tmpScheme: TScheme;
       
   115 
   113 procedure handler_CFG_SCHEME(var p: TCmdParam);
   116 procedure handler_CFG_SCHEME(var p: TCmdParam);
   114 begin
   117 begin
   115 end;
   118     schemeIndex:= 0
       
   119 end;
       
   120 
       
   121 const schemeFields: array[0..43] of pointer = (
       
   122       @tmpScheme.schemeName          //  0
       
   123     , @tmpScheme.fortsmode           //  1
       
   124     , @tmpScheme.divteams            //  2
       
   125     , @tmpScheme.solidland           //  3
       
   126     , @tmpScheme.border              //  4
       
   127     , @tmpScheme.lowgrav             //  5
       
   128     , @tmpScheme.laser               //  6
       
   129     , @tmpScheme.invulnerability     //  7
       
   130     , @tmpScheme.resethealth         //  8
       
   131     , @tmpScheme.vampiric            //  9
       
   132     , @tmpScheme.karma               // 10
       
   133     , @tmpScheme.artillery           // 11
       
   134     , @tmpScheme.randomorder         // 12
       
   135     , @tmpScheme.king                // 13
       
   136     , @tmpScheme.placehog            // 14
       
   137     , @tmpScheme.sharedammo          // 15
       
   138     , @tmpScheme.disablegirders      // 16
       
   139     , @tmpScheme.disablelandobjects  // 17
       
   140     , @tmpScheme.aisurvival          // 18
       
   141     , @tmpScheme.infattack           // 19
       
   142     , @tmpScheme.resetweps           // 20
       
   143     , @tmpScheme.perhogammo          // 21
       
   144     , @tmpScheme.disablewind         // 22
       
   145     , @tmpScheme.morewind            // 23
       
   146     , @tmpScheme.tagteam             // 24
       
   147     , @tmpScheme.bottomborder        // 25
       
   148     , @tmpScheme.damagefactor        // 26
       
   149     , @tmpScheme.turntime            // 27
       
   150     , @tmpScheme.health              // 28
       
   151     , @tmpScheme.suddendeath         // 29
       
   152     , @tmpScheme.caseprobability     // 30
       
   153     , @tmpScheme.minestime           // 31
       
   154     , @tmpScheme.minesnum            // 32
       
   155     , @tmpScheme.minedudpct          // 33
       
   156     , @tmpScheme.explosives          // 34
       
   157     , @tmpScheme.airmines            // 35
       
   158     , @tmpScheme.healthprobability   // 36
       
   159     , @tmpScheme.healthcaseamount    // 37
       
   160     , @tmpScheme.waterrise           // 38
       
   161     , @tmpScheme.healthdecrease      // 39
       
   162     , @tmpScheme.ropepct             // 40
       
   163     , @tmpScheme.getawaytime         // 41
       
   164     , @tmpScheme.worldedge           // 42
       
   165     , @tmpScheme.scriptparam         // 43
       
   166    );
   116 
   167 
   117 procedure handler_CFG_SCHEME_s(var s: TCmdParamS);
   168 procedure handler_CFG_SCHEME_s(var s: TCmdParamS);
   118 begin
   169 begin
       
   170     if(schemeIndex = 0) then
       
   171         tmpScheme.schemeName:= s.str1
       
   172     else
       
   173     if(schemeIndex = 43) then
       
   174         tmpScheme.scriptparam:= copy(s.str1, 2, length(s.str1) - 1)
       
   175     else
       
   176     if(schemeIndex < 26) then
       
   177         PBoolean(schemeFields[schemeIndex])^:= s.str1[1] = 't'
       
   178     else
       
   179     if(schemeIndex < 43) then
       
   180         PLongInt(schemeFields[schemeIndex])^:= strToInt(s.str1);
       
   181 
       
   182     if(schemeIndex = 43) then
       
   183         netSetScheme(tmpScheme);
       
   184 
       
   185     inc(schemeIndex);
   119 end;
   186 end;
   120 
   187 
   121 procedure handler_CFG_SCRIPT(var p: TCmdParamS);
   188 procedure handler_CFG_SCRIPT(var p: TCmdParamS);
   122 begin
   189 begin
   123     if isInRoom then
   190     if isInRoom then