Esempio n. 1
0
        /// <summary>
        /// Functions which initiates the regenerations of the mod´s structures: parsing of input files and creating of new CEditableStructs.
        /// </summary>
        private void regenStructures()
        {
            GlobalVars.Structures.Clear();

            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(GlobalParams.InputFilesDirectory);
            System.IO.FileInfo[]    fi = di.GetFiles("*" + GlobalParams.InputFilesExtension);

            CEditableStruct tempStructure = new CEditableStruct(string.Empty, 0, 0, 0, 0, new List <SParameter>());
            int             errorLine     = 0;
            int             retVal        = 0;

            // Load all files
            for (int i = 0; i < fi.Length; i++)
            {
                retVal = CInputParser.CreateStructure(fi[i].FullName, ref tempStructure, ref errorLine);

                if (retVal != 0)
                {
                    Game.Console.Print("Error loading file \"" + fi[i].Name + "\": error code: " + retVal.ToString() + " on line " + errorLine.ToString());
                }
                else
                {
                    Game.Console.Print("Successfully loaded file \"" + fi[i].Name + "\"!");
                    GlobalVars.Structures.Add(tempStructure);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Prints a structure´s parameters to the console.
        /// </summary>
        /// <param name="parameters">The console input.</param>
        private void printStructureParams_console(ParameterCollection parameters)
        {
            if (parameters.Count == 0)
            {
                Game.Console.Print("usage: si_printparams <structure name>");
                return;
            }

            string structName = parameters.ToString(0);

            CEditableStruct tempStruct = GlobalVars.Structures.Find(x => x.Name == structName);

            if (tempStruct == null)
            {
                Game.Console.Print("No struct found with name \"" + structName + "\"!");
                return;
            }

            Game.Console.Print("Listing parameters for structure \"" + structName + "\":");

            SParameter tempParameter = new SParameter();

            for (int i = 0; i < tempStruct.NumParams; i++)
            {
                tempStruct.GetGenericParamByIndex(i, out tempParameter);
                Game.Console.Print(tempParameter.ParamName.ToString() + "  " + "0x" + String.Format("{0:X}", tempParameter.Offset) + "  " + tempParameter.Type.ToString() + "  " + tempParameter.MinVal.ToString() + "  " + tempParameter.MaxVal.ToString());
            }
        }
Esempio n. 3
0
        private void getParamName_scriptCmd(GTA.Script sender, GTA.ObjectCollection parameters)
        {
            // si_getparamnum <call identifier> <structure name> <param index>
            if (parameters.Count < 3)
            {
                // Error code -1: invalid parameter count
                SendScriptCommand(sender, "si_getparamname_response", parameters[0], 1);
                return;
            }

            string structName = parameters.Convert <string>(1);

            CEditableStruct tempStruct = GlobalVars.Structures.Find(x => x.Name == structName);

            if (tempStruct == null)
            {
                // Error code -3: invalid struct name
                SendScriptCommand(sender, "si_getparamname_response", parameters[0], 3);
                return;
            }

            int paramIndex = parameters.Convert <int>(2);

            if (paramIndex < 0 || paramIndex >= tempStruct.NumParams)
            {
                // Error code -4: invalid parameter index
                SendScriptCommand(sender, "si_getparamname_response", parameters[0], 4);
            }

            SParameter tempParameter = new SParameter();

            tempStruct.GetGenericParamByIndex(paramIndex, out tempParameter);

            SendScriptCommand(sender, "si_getelementsnum_response", parameters[0], tempParameter.ParamName);
        }
Esempio n. 4
0
        /// <summary>
        /// Gets a parameter's value.
        /// </summary>
        /// <param name="index">The parameter's index.</param>
        /// <returns>A string representing the parameter's value.</returns>
        private string getParamValue(int index)
        {
            SParameter      tempParam  = new SParameter();
            CEditableStruct tempStruct = GlobalVars.Structures[this.currentStructIndex];

            tempStruct.GetGenericParamByIndex(index, out tempParam);

            if (tempParam.Type == typeof(float))
            {
                float value = 0f;

                tempStruct.GetParamValue(this.currentElementIndex, index, ref value);
                return(value.ToString());
            }
            else if (tempParam.Type == typeof(string))
            {
                string value = string.Empty;
                tempStruct.GetParamValue(this.currentElementIndex, index, ref value);
                return(value);
            }
            else if (tempParam.Type == typeof(char))
            {
                char value = '\0';
                tempStruct.GetParamValue(this.currentElementIndex, index, ref value);
                return(value.ToString());
            }
            else if (tempParam.Type == typeof(int))
            {
                int value = 0;
                tempStruct.GetParamValue(this.currentElementIndex, index, ref value);
                return(value.ToString());
            }
            else if (tempParam.Type == typeof(uint))
            {
                uint value = 0;
                tempStruct.GetParamValue(this.currentElementIndex, index, ref value);
                return(value.ToString());
            }
            else if (tempParam.Type == typeof(short))
            {
                short value = 0;
                tempStruct.GetParamValue(this.currentElementIndex, index, ref value);
                return(value.ToString());
            }
            else if (tempParam.Type == typeof(double))
            {
                double value = 0f;
                tempStruct.GetParamValue(this.currentElementIndex, index, ref value);
                return(value.ToString());
            }
            else if (tempParam.Type == typeof(long))
            {
                long value = 0;
                tempStruct.GetParamValue(this.currentElementIndex, index, ref value);
                return(value.ToString());
            }

            return(string.Empty);
        }
Esempio n. 5
0
        private void getParamNum_scriptCmd(GTA.Script sender, GTA.ObjectCollection parameters)
        {
            // si_getparamnum <call identifier> <structure name>
            if (parameters.Count < 2)
            {
                // Error code 1: invalid parameter count
                SendScriptCommand(sender, "si_getparamnum_response", parameters[0], 1);
                return;
            }

            string structName = parameters.Convert <string>(1);

            CEditableStruct tempStruct = GlobalVars.Structures.Find(x => x.Name == structName);

            if (tempStruct == null)
            {
                // Error code 3: invalid struct name
                SendScriptCommand(sender, "si_getparamnum_response", parameters[0], 3);
                return;
            }

            SendScriptCommand(sender, "si_getparamnum_response", parameters[0], tempStruct.NumParams);
        }
Esempio n. 6
0
        /// <summary>
        /// Creates a new CEditableStruct from an input file.
        /// </summary>
        /// <param name="filePath">The file path to the input file.</param>
        /// <param name="structure">The structure to create.</param>
        /// <param name="errorLine">The error line. When an error has occured this value will be adjusted accordingly.</param>
        /// <returns>0: success.
        /// 1: invalid number of elements in file header.
        /// 2: error parsing element 2 of file header (invalid integer).
        /// 3: error parsing element 3 of file header (invalid integer).
        /// 4: error parsing element 4 of file header (invalid integer).
        /// 5: invalid number of elements in parameter-describing line.
        /// 6: error parsing element 1 of parameter-line (invalid integer).
        /// 7: invalid parameter type
        /// 8: invalid float value for parameter.
        /// 9: invalid 4th element (invalid float)
        /// 10: failed to open input file
        /// 11: invalid parameter type 'char[]': invalid string length specified.</returns>
        public static int CreateStructure(string filePath, ref CEditableStruct structure, ref int errorLine)
        {
            string structName = string.Empty;

            int structSize = 0, structOffset = 0, numElements = 0;
            List <SParameter> parameters = new List <SParameter>();

            System.IO.StreamReader sr;
            try
            {
                sr = new StreamReader(filePath);
            }
            catch (SystemException se)
            {
                // Failed to open the file! :O Error code 10
                return(10);
            }

            string line = string.Empty;

            int numLines     = 0;
            int numRealLines = 0;

            char[] delimiter = new char[1];
            delimiter[0] = ' ';

            while (line != null)
            {
                line = sr.ReadLine();
                numLines++;

                if (!IgnoreLine(line))
                {
                    numRealLines++;

                    // We have the header, hopefully :)
                    if (numRealLines == 1)
                    {
                        string[] elements = line.Split(delimiter, StringSplitOptions.None);

                        if (elements.Length != 4)
                        {
                            // We are expecting 4 elements
                            errorLine = numLines;

                            // Error code 1: invalid number of elements in file header.
                            sr.Close();
                            return(1);
                        }

                        structName = elements[0];

                        // If integer parsing failed...

                        if (!TryParseInteger(elements[1], ref structSize))
                        {
                            errorLine = numLines;
                            // Error code 2: error parsing parameter 2 of file header (invalid integer).
                            sr.Close();
                            return(2);
                        }

                        if (!TryParseInteger(elements[2], ref structOffset))
                        {
                            errorLine = numLines;
                            // Error code 3: error parsing parameter 3 of file header (invalid integer).
                            sr.Close();
                            return(3);
                        }

                        if (!TryParseInteger(elements[3], ref numElements))
                        {
                            errorLine = numLines;
                            // Error code 4: error parsing parameter 4 of file header (invalid integer).
                            sr.Close();
                            return(4);
                        }
                    }
                    else
                    {
                        // We are loading in parameters :)
                        SParameter tempParam = new SParameter();

                        string[] elements = line.Split(delimiter, StringSplitOptions.None);

                        if (elements.Length != 5)
                        {
                            // We are expecting 5 elements
                            errorLine = numLines;

                            // Error code 5: invalid number of elements in parameter line.
                            sr.Close();
                            return(5);
                        }

                        tempParam.ParamName = elements[0];

                        if (!TryParseInteger(elements[1], ref tempParam.Offset))
                        {
                            errorLine = numLines;

                            // Error code 6: error parsing parameter 1 of a parameter (invalid integer)
                            sr.Close();
                            return(6);
                        }

                        if (elements[2].Contains("CHAR["))
                        {
                            // Cleanup
                            elements[2] = elements[2].Replace("CHAR", string.Empty);
                            elements[2] = elements[2].Replace("[", string.Empty);
                            elements[2] = elements[2].Replace("]", string.Empty);
                            // Done

                            if (!int.TryParse(elements[2], out tempParam.StringSize))
                            {
                                // Error code 11: invalid parameter type 'CHAR[]': invalid string length specified.
                                sr.Close();
                                return(11);
                            }

                            tempParam.Type = typeof(string);
                        }
                        else
                        {
                            switch (elements[2])
                            {
                            case "INT":
                                tempParam.Type = typeof(int);
                                break;

                            case "UINT":
                                tempParam.Type = typeof(uint);
                                break;

                            case "FLOAT":
                                tempParam.Type = typeof(float);
                                break;

                            case "SHORT":
                                tempParam.Type = typeof(short);
                                break;

                            case "LONG":
                                tempParam.Type = typeof(long);
                                break;

                            case "DOUBLE":
                                tempParam.Type = typeof(double);
                                break;

                            case "CHAR":
                                tempParam.Type       = typeof(char);
                                tempParam.StringSize = 1;
                                break;

                            default:
                                errorLine = numLines;

                                // Error code 7: invalid parameter type
                                sr.Close();
                                return(7);
                            }

                            tempParam.StringSize = 0;
                        }

                        if (elements[3] == "NONE")
                        {
                            tempParam.MinVal = 0xCAFED00D;
                        }
                        else
                        {
                            if (!float.TryParse(elements[3], out tempParam.MinVal))
                            {
                                errorLine = numLines;

                                // Error code 8: invalid parameter 3 (invalid float)
                                sr.Close();
                                return(8);
                            }
                        }

                        if (elements[4] == "NONE")
                        {
                            tempParam.MaxVal = 0xCAFED00D;
                        }
                        else
                        {
                            if (!float.TryParse(elements[3], out tempParam.MaxVal))
                            {
                                errorLine = numLines;

                                // Error code 8: invalid parameter 4 (invalid float)
                                sr.Close();
                                return(9);
                            }
                        }

                        parameters.Add(tempParam);
                    }
                }
            }

            structure = new CEditableStruct(structName, GlobalVars.BaseAddress, structOffset, structSize, numElements, parameters);
            sr.Close();
            return(0);
        }
Esempio n. 7
0
        /// <summary>
        /// Prints a structure´s parameter values to the console.
        /// </summary>
        /// <param name="parameters">The console input.</param>
        private void printStructureValues_console(ParameterCollection parameters)
        {
            if (parameters.Count < 2)
            {
                Game.Console.Print("usage: si_printvalues <structure name> <element index>");
                return;
            }

            string structName = parameters.ToString(0);
            int    index      = 0;

            if (!int.TryParse(parameters.ToString(1), out index))
            {
                Game.Console.Print("Invalid index specified!");
                return;
            }

            CEditableStruct tempStruct = GlobalVars.Structures.Find(x => x.Name == structName);

            if (tempStruct == null)
            {
                Game.Console.Print("No struct found with name \"" + structName + "\"!");
                return;
            }

            SParameter tempParam = new SParameter();

            for (int i = 0; i < tempStruct.NumParams; i++)
            {
                tempStruct.GetGenericParamByIndex(i, out tempParam);

                if (tempParam.Type == typeof(float))
                {
                    float value = 0f;
                    tempStruct.GetParamValue(index, i, ref value);
                    Game.Console.Print(tempParam.ParamName + " " + value.ToString());
                }
                else if (tempParam.Type == typeof(uint))
                {
                    uint value = 0;
                    tempStruct.GetParamValue(index, i, ref value);
                    Game.Console.Print(tempParam.ParamName + " " + value.ToString());
                }
                else if (tempParam.Type == typeof(string))
                {
                    string value = string.Empty;
                    tempStruct.GetParamValue(index, i, ref value);
                    Game.Console.Print(tempParam.ParamName + " " + value);
                }
                else if (tempParam.Type == typeof(char))
                {
                    char value = '\0';
                    tempStruct.GetParamValue(index, i, ref value);
                    Game.Console.Print(tempParam.ParamName + " " + value);
                }
                else if (tempParam.Type == typeof(int))
                {
                    int value = 0;
                    tempStruct.GetParamValue(index, i, ref value);
                    Game.Console.Print(tempParam.ParamName + " " + value.ToString());
                }
                else if (tempParam.Type == typeof(short))
                {
                    short value = 0;
                    tempStruct.GetParamValue(index, i, ref value);
                    Game.Console.Print(tempParam.ParamName + " " + value.ToString());
                }
                else if (tempParam.Type == typeof(double))
                {
                    double value = 0f;
                    tempStruct.GetParamValue(index, i, ref value);
                    Game.Console.Print(tempParam.ParamName + " " + value.ToString());
                }
                else if (tempParam.Type == typeof(long))
                {
                    long value = 0;
                    tempStruct.GetParamValue(index, i, ref value);
                    Game.Console.Print(tempParam.ParamName + " " + value.ToString());
                }
                else if (tempParam.Type == typeof(char[]))
                {
                    int value = 0;
                    tempStruct.GetParamValue(index, i, ref value);
                    Game.Console.Print(tempParam.ParamName + " " + value.ToString());
                }
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Edits a structure's parameter value, using the console input.
        /// </summary>
        /// <param name="parameters">The console input..</param>
        private void editStructureParam_console(ParameterCollection parameters)
        {
            if (parameters.Count < 4)
            {
                Game.Console.Print("usage: si_editparam <structure name> <element index> <param name> <new value>");
                return;
            }

            string structName = parameters.ToString(0);

            int index = 0;

            if (!int.TryParse(parameters.ToString(1), out index))
            {
                Game.Console.Print("Invalid index specified!");
                return;
            }

            CEditableStruct tempStruct = GlobalVars.Structures.Find(x => x.Name == structName);

            if (tempStruct == null)
            {
                Game.Console.Print("No struct found with name \"" + structName + "\"!");
                return;
            }

            string     paramName = parameters.ToString(2);
            SParameter tempParam = new SParameter();

            if (tempStruct.GetGenericParamByName(paramName, ref tempParam) != 0)
            {
                Game.Console.Print("No parameter found with name \"" + paramName + "\"!");
                return;
            }

            if (tempParam.Type == typeof(int))
            {
                int newVal = parameters.ToInteger(3);
                int retVal = tempStruct.SetParamValue <int>(index, paramName, newVal);

                if (retVal == -1)
                {
                    Game.Console.Print("Invalid parameter index number");
                    return;
                }
                else
                {
                    Game.Console.Print("Parameter changed");
                }
            }
            else if (tempParam.Type == typeof(uint))
            {
                uint newVal = uint.Parse(parameters.ToString(3));
                int  retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    Game.Console.Print("Invalid parameter index number");
                    return;
                }
                else
                {
                    Game.Console.Print("Parameter changed");
                }
            }
            else if (tempParam.Type == typeof(string))
            {
                string newVal = parameters.ToString(3);
                int    retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    Game.Console.Print("Invalid parameter index number");
                    return;
                }
                else if (retVal == -3)
                {
                    Game.Console.Print("Input string too long! Max size: " + tempParam.StringSize.ToString() + ", your input: " + newVal.Length);
                    return;
                }
            }
            else if (tempParam.Type == typeof(char))
            {
                string newValString = parameters.ToString(3);
                char   newVal       = '\0';
                int    retVal       = 0;

                if (newValString != string.Empty)
                {
                    newVal = newValString[0];
                    if (retVal == -1)
                    {
                        Game.Console.Print("Invalid parameter index number");
                        return;
                    }
                    else
                    {
                        Game.Console.Print("Parameter changed");
                    }
                }
                else
                {
                    Game.Console.Print("Invalid char entered!");
                    return;
                }
            }
            else if (tempParam.Type == typeof(float))
            {
                float newVal = parameters.ToFloat(3);
                int   retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    Game.Console.Print("Invalid parameter index number");
                    return;
                }
                else
                {
                    Game.Console.Print("Parameter changed");
                }
            }
            else if (tempParam.Type == typeof(double))
            {
                double newVal = parameters.ToFloat(3);
                int    retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    Game.Console.Print("Invalid parameter index number");
                    return;
                }
                else
                {
                    Game.Console.Print("Parameter changed");
                }
            }
            else if (tempParam.Type == typeof(short))
            {
                short newVal = (short)parameters.ToInteger(3);
                int   retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    Game.Console.Print("Invalid parameter index number");
                    return;
                }
                else
                {
                    Game.Console.Print("Parameter changed");
                }
            }
            else if (tempParam.Type == typeof(long))
            {
                long newVal = parameters.ToInteger(3);
                int  retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    Game.Console.Print("Invalid parameter index number");
                    return;
                }
                else
                {
                    Game.Console.Print("Parameter changed");
                }
            }
        }
Esempio n. 9
0
        private void setParamValue_scriptCmd(GTA.Script sender, GTA.ObjectCollection parameters)
        {
            if (parameters.Count < 5)
            {
                // Error code 1: invalid parameter count
                SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 1);
                return;
            }

            string structName = parameters.Convert <string>(1);

            int index = 0;

            if (!int.TryParse(parameters.Convert <string>(2), out index))
            {
                // Error code 2: invalid index
                SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 2);
                return;
            }

            CEditableStruct tempStruct = GlobalVars.Structures.Find(x => x.Name == structName);

            if (tempStruct == null)
            {
                // Error code 3: invalid struct name
                SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 3);
                return;
            }

            string     paramName = parameters.Convert <string>(3);
            SParameter tempParam = new SParameter();

            if (tempStruct.GetGenericParamByName(paramName, ref tempParam) != 0)
            {
                // Error code 4: invalid param name
                SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 4);
                return;
            }

            if (tempParam.Type == typeof(int))
            {
                int newVal = parameters.Convert <int>(4);
                int retVal = tempStruct.SetParamValue <int>(index, paramName, newVal);

                if (retVal == -1)
                {
                    // Error code 5: invalid param index number
                    SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 5);
                    return;
                }
            }
            else if (tempParam.Type == typeof(string))
            {
                string newVal = parameters.Convert <string>(4);
                int    retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    // Error code 5: invalid param index number
                    SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 5);
                    return;
                }
                else if (retVal == -3)
                {
                    // Error code 6: input string too long
                    SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 6);
                    return;
                }
            }
            else if (tempParam.Type == typeof(char))
            {
                string newValString = parameters.Convert <string>(4);
                char   newVal       = '\0';
                int    retVal       = 0;

                if (newValString != string.Empty)
                {
                    newVal = newValString[0];
                    if (retVal == -1)
                    {
                        // Error code 5: invalid param index number
                        SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 5);
                        return;
                    }
                }
                else
                {
                    // Error code 6: invalid character entered
                    SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 6);
                    return;
                }
            }
            else if (tempParam.Type == typeof(float))
            {
                float newVal = parameters.Convert <float>(4);
                int   retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    // Error code 5: invalid param index number
                    SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 5);
                    return;
                }
            }
            else if (tempParam.Type == typeof(double))
            {
                double newVal = parameters.Convert <float>(4);
                int    retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    // Error code 5: invalid param index number
                    SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 5);
                    return;
                }
            }
            else if (tempParam.Type == typeof(short))
            {
                short newVal = parameters.Convert <short>(4);
                int   retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    // Error code 5: invalid param index number
                    SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 5);
                    return;
                }
            }
            else if (tempParam.Type == typeof(long))
            {
                long newVal = parameters.Convert <long>(4);
                int  retVal = tempStruct.SetParamValue(index, paramName, newVal);

                if (retVal == -1)
                {
                    // Error code 5: invalid param index number
                    SendScriptCommand(sender, "si_setparamvalue_response", parameters[0], 5);
                    return;
                }
            }

            // Success! :D
            SendScriptCommand(sender, "si_setparamvalue_respons", parameters[0], 0);
        }
Esempio n. 10
0
        private void getParamValue_scriptCmd(GTA.Script sender, GTA.ObjectCollection parameters)
        {
            // si_getparamvalue <call identifier> <structure name> <element index> <parameter name>
            if (parameters.Count < 4)
            {
                // Error code 1: invalid parameter count
                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 1);
                return;
            }

            string structName = parameters.Convert <string>(1);

            int index = 0;

            if (!int.TryParse(parameters.Convert <string>(2), out index))
            {
                // Error code 2: invalid index
                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 2);
                return;
            }

            CEditableStruct tempStruct = GlobalVars.Structures.Find(x => x.Name == structName);

            if (tempStruct == null)
            {
                // Error code 3: invalid struct name
                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 3);
                return;
            }

            string     paramName = parameters.Convert <string>(3);
            SParameter tempParam = new SParameter();

            if (tempStruct.GetGenericParamByName(paramName, ref tempParam) != 0)
            {
                // Error code 4: invalid param name
                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 4);
                return;
            }

            if (tempParam.Type == typeof(int))
            {
                int retVal = 0;
                tempStruct.GetParamValue(index, paramName, ref retVal);

                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 0, retVal);
            }
            else if (tempParam.Type == typeof(string))
            {
                string retVal = string.Empty;
                tempStruct.GetParamValue(index, paramName, ref retVal);

                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 0, retVal);
            }
            else if (tempParam.Type == typeof(char))
            {
                char retVal = char.MinValue;
                tempStruct.GetParamValue(index, paramName, ref retVal);

                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 0, retVal);
            }
            else if (tempParam.Type == typeof(float))
            {
                float retVal = 0f;
                tempStruct.GetParamValue(index, paramName, ref retVal);

                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 0, retVal);
            }
            else if (tempParam.Type == typeof(double))
            {
                double retVal = 0f;
                tempStruct.GetParamValue(index, paramName, ref retVal);

                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 0, retVal);
            }
            else if (tempParam.Type == typeof(short))
            {
                short retVal = 0;
                tempStruct.GetParamValue(index, paramName, ref retVal);

                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 0, retVal);
            }
            else if (tempParam.Type == typeof(long))
            {
                long retVal = 0;
                tempStruct.GetParamValue(index, paramName, ref retVal);

                SendScriptCommand(sender, "si_getparamvalue_response", parameters[0], 0, retVal);
            }

            return;
        }