Full Version : Server Freeze
xmlspawner >>Troubleshooting >>Server Freeze


<< Prev | Next >>

Jason- 04-23-2010
Ive narrowed it down. When using the IF keyword, and the [elsespawn] argument is the same subgroup as the IF, the server freezes. It doesnt crash, or give a log or anything but I took some time t figure out exactly what was doing it. I'm assuming something needs to be added below so that its recognizing the elsespawn being used in the same subgroup.

CODE

case typeKeyword.IF:
                       {

                           // the syntax is IF/condition/thengroup [/elsegroup]
                           string[] arglist = ParseSlashArgs(substitutedtypeName, 5);
                           string condition = null;
                           int thengroup = -1;
                           int elsegroup = -1;
                           if (arglist.Length < 3)
                           {
                               status_str = "insufficient args to IF";
                           }
                           else
                           {
                               condition = arglist[1];
                               try
                               {
                                   thengroup = int.Parse(arglist[2]);
                               }
                               catch { status_str = "invalid thengroup arg to IF"; }
                           }
                           if (arglist.Length > 3)
                           {
                               try
                               {
                                   elsegroup = int.Parse(arglist[3]);
                               }
                               catch { status_str = "invalid elsegroup arg to IF"; }
                           }

                           if (status_str != null)
                           {
                               return false;
                           }

                           // test the condition
                           if (TestItemProperty(spawner, spawner, condition, triggermob, out status_str))
                           {
                               // try to spawn the thengroup
                               if (thengroup >= 0 && spawner != null && !spawner.Deleted)
                               {

                                   // spawn the subgroup
                                   spawner.SpawnSubGroup(thengroup);

                                   // advance the sequence to that group
                                   //spawner.SequentialSpawn = thengroup;
                               }
                               // and suppress sequential advancement
                               //spawner.HoldSequence = true;
                           }
                           else
                           {
                           
                               // try to spawn the elsegroup
                               if (elsegroup >= 0 && spawner != null && !spawner.Deleted)
                               {

                                   // spawn the subgroup
                                   spawner.SpawnSubGroup(elsegroup);

                                   // advance the sequence to that group
                                   //spawner.SequentialSpawn = elsegroup;
                               }
                               // and suppress sequential advancement
                               //spawner.HoldSequence = true;
                           }
                           TheSpawn.SpawnedObjects.Add(new KeywordTag(substitutedtypeName, spawner));

                           break;
                       }