Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        private static string DecompileCommand(byte[] data)
        {
            MeleeCMDAction act = ActionCommon.GetMeleeCMDAction((byte)(data[0] >> 2));

            string o = act.Name + "(";

            if (act != null)
            {
                o += act.Decompile(data);
            }
            else
            {
                for (int i = 0; i < data.Length; i++)
                {
                    if (i == 0)
                    {
                        o += "0x" + (data[i] & 0x3).ToString("x");
                    }
                    else
                    {
                        o += ",0x" + data[i].ToString("x");
                    }
                }
            }

            o += ");";
            return(o);
        }
Ejemplo n.º 2
0
        private static byte[] CompileCommand(string name, string[] parameters)
        {
            if (name.Equals(""))
            {
                return(new byte[0]);
            }

            MeleeCMDAction action = ActionCommon.GetMeleeCMDAction(name);

            byte[] data = new byte[] { (byte)(action.Command << 2), 0, 0, 0 };
            if (action != null)
            {
                data = action.Compile(parameters);
                if (data == null)
                {
                    //ErrorCode = CompileError.ParameterCount;
                    return(null);
                }
            }

            return(data);
        }