Exemple #1
0
    public static int UploadRoleInfo(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 10 && LuaScriptMgr.CheckTypes(L, 1, typeof(int), typeof(int), typeof(string), typeof(int), typeof(int), typeof(int), typeof(string), typeof(string), typeof(double), typeof(double)))
        {
            int    sendType       = (int)LuaScriptMgr.GetNumber(L, 1);
            int    playerId       = (int)LuaScriptMgr.GetNumber(L, 2);
            string roleName       = LuaScriptMgr.GetString(L, 3);
            int    roleLevel      = (int)LuaScriptMgr.GetNumber(L, 4);
            int    vipLevel       = (int)LuaScriptMgr.GetNumber(L, 5);
            int    serverId       = (int)LuaScriptMgr.GetNumber(L, 6);
            string serverName     = LuaScriptMgr.GetString(L, 7);
            string laborUnion     = LuaScriptMgr.GetString(L, 8);
            double roleCreateTime = (double)LuaScriptMgr.GetNumber(L, 9);
            double roleLevelMTime = (double)LuaScriptMgr.GetNumber(L, 10);

            PlatformControl.UploadRoleInfo(sendType, playerId, roleName, roleLevel, vipLevel, serverId, serverName, laborUnion, roleCreateTime, roleLevelMTime);
        }
        else
        {
            LogParamError("UploadRoleInfo", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #2
0
        private void DevConfigForm_Load(object sender, EventArgs e)
        {
            //di do cy
            diControl1.DiExs = Machine.Ins.DiExs.Values.ToList();
            diControl1.LoadFramework();
            diControl1.FrameworkActivate();
            doControl1.DoExs = Machine.Ins.DoExs.Values.ToList();
            doControl1.LoadFramework();
            doControl1.FrameworkActivate();
            vioControl1.VioExs = Machine.Ins.VioExs.Values.ToList();
            vioControl1.LoadFramework();
            vioControl1.FrameworkActivate();
            cyliderControl1.CyExs = Machine.Ins.CylinderExs.Values.ToList();
            cyliderControl1.LoadFramework();
            cyliderControl1.FrameworkActivate();

            //load platforms
            var platforms = Machine.Ins.Platforms.Values;

            tabControlPlatform.TabPages.Clear();
            foreach (var p in platforms)
            {
                tabControlPlatform.TabPages.Add(p.Name, p.Description + $"({p.Name})");
                var platformControl = new PlatformControl()
                {
                    Dock = DockStyle.Fill,
                };
                platformControl.LoadPlatform(p);

                tabControlPlatform.TabPages[p.Name].Controls.Add(platformControl);
            }


            //config
            propertyGridSettings.SelectedObject = Machine.Ins.Settings;
            richTextBoxMachine.Text             = Machine.Ins.SerializeToString();


            //product
            tabControl1.SelectedTab = tabPageProduct;
            measureProjectSelctionControl1.Station     = Machine.Ins.Find <Station>("MainStation");
            measureProjectSelctionControl1.ProjecType  = typeof(MeasureProjectA);
            measureProjectSelctionControl1.ProjectFile = Machine.Ins.Settings.MeasureProjectFile;
            measureProjectSelctionControl1.SelectMeasureProjectUpdateEvent += f =>
            {
                Machine.Ins.Settings.MeasureProjectFile = f;
                Machine.Ins.Settings.Save();
            };
            measureProjectSelctionControl1.LoadMeasureProject();


            //calib
            stationControl.Machine = Machine.Ins;
            stationControl.Station = Machine.Ins.Find <Station>("MainStation");


            //test page

            cameraExDebugControl1.Camera = (Machine.Ins.Find <StationTask>("MeasureTask") as MeasureTask)?.Camera;
        }
Exemple #3
0
    public static int ExitGame(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 0)
        {
            PlatformControl.ExitGame();
        }
        else
        {
            LogParamError("ExitGame", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #4
0
    public static int ShowGoogleAchievementView(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 0)
        {
            PlatformControl.ShowGoogleAchievementView();
        }
        else
        {
            LogParamError("ShowGoogleAchievementView", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #5
0
    public static int CompleteGoogleAchievement(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(string)))
        {
            string id = LuaScriptMgr.GetString(L, 1);
            PlatformControl.CompleteGoogleAchievement(id);
        }
        else
        {
            LogParamError("CompleteGoogleAchievement", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #6
0
    public static int GetLoginJson(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 1;

        if (count == 0)
        {
            LuaScriptMgr.Push(L, PlatformControl.GetLoginJson());
        }
        else
        {
            LuaScriptMgr.Push(L, string.Empty);
            LogParamError("GetLoginJson", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #7
0
    public static int GoogleGameLogout(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(LuaFunction)))
        {
            var callback = LuaScriptMgr.GetLuaFunction(L, 1);
            PlatformControl.GoogleGameLogout(callback);
        }
        else
        {
            LogParamError("GoogleGameLogout", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #8
0
    public static int IsPlatformExitGame(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 1;

        if (count == 0)
        {
            LuaScriptMgr.Push(L, PlatformControl.IsPlatformExitGame());
        }
        else
        {
            LogParamError("IsPlatformExitGame", count);
            LuaScriptMgr.Push(L, false);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #9
0
    public static int GetPlatformType(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 1;

        if (count == 0)
        {
            int type = (int)PlatformControl.GetPlatformType();
            LuaScriptMgr.Push(L, type);
        }
        else
        {
            LogParamError("GetPlatformType", count);
            LuaScriptMgr.Push(L, -1);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #10
0
    public static int SetGoogleAchievementCompletionLevel(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(string), typeof(int)))
        {
            string id    = LuaScriptMgr.GetString(L, 1);
            int    level = (int)LuaScriptMgr.GetNumber(L, 2);
            PlatformControl.SetGoogleAchievementCompletionLevel(id, level);
        }
        else
        {
            LogParamError("SetGoogleAchievementCompletionLevel", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #11
0
    public static int IsGoogleGameLogined(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 1;

        if (count == 0)
        {
            bool isGoogleLogined = PlatformControl.IsGoogleGameLogined();
            LuaScriptMgr.Push(L, isGoogleLogined);
        }
        else
        {
            LogParamError("IsGoogleGameLogined", count);
            LuaScriptMgr.Push(L, false);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
        private void MainConfigForm_Load(object sender, EventArgs e)
        {
            diControl1.DiExs = Machine.DemoMachine.Ins.DiExs.Values.ToList();
            diControl1.LoadFramework();
            diControl1.FrameworkActivate();


            doControl1.DoExs = Machine.DemoMachine.Ins.DoExs.Values.ToList();
            doControl1.LoadFramework();
            doControl1.FrameworkActivate();

            cylinderControl1.CyExs = Machine.DemoMachine.Ins.CylinderExs.Values.ToList();
            cylinderControl1.LoadFramework();
            cylinderControl1.FrameworkActivate();


            vioControl1.VioExs = Machine.DemoMachine.Ins.VioExs.Values.ToList();
            vioControl1.LoadFramework();
            vioControl1.FrameworkActivate();


            tabControlPlatforms.TabPages.Clear();


            foreach (var p in Machine.DemoMachine.Ins.Platforms.Values)
            {
                var platformControl = new PlatformControl()
                {
                    Dock = DockStyle.Fill,
                };
                platformControl.LoadPlatform(p);

                tabControlPlatforms.TabPages.Add(new TabPage($"{p.Name} {p.Description}")
                {
                    Controls =
                    {
                        platformControl,
                    }
                });
            }


            propertyGridSettings.SelectedObject = Machine.DemoMachine.Ins.Settings;
            propertyGridSettings.ExpandAllGridItems();
        }
Exemple #13
0
    public static int RegisterCallback(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 3 && LuaScriptMgr.CheckTypes(L, 1, typeof(LuaFunction), typeof(LuaFunction), typeof(LuaFunction)))
        {
            var fnLoginCallback  = LuaScriptMgr.GetLuaFunction(L, 1);
            var fnLogoutCallback = LuaScriptMgr.GetLuaFunction(L, 2);
            var fnBuyCallback    = LuaScriptMgr.GetLuaFunction(L, 3);
            PlatformControl.RegisterCallback(fnLoginCallback, fnLogoutCallback, fnBuyCallback);
        }
        else
        {
            LogParamError("RegisterCallback", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #14
0
    public static int GetPushStatus(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 1;

        if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(int)))
        {
            int  type   = (int)LuaScriptMgr.GetNumber(L, 1);
            bool enable = PlatformControl.GetPushStatus(type);
            LuaScriptMgr.Push(L, enable);
        }
        else
        {
            LogParamError("GetPushStatus", count);
            LuaScriptMgr.Push(L, false);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #15
0
    public static int GetCustomData(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 1;

        if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(string)))
        {
            string key  = LuaScriptMgr.GetString(L, 1);
            string data = PlatformControl.GetCustomData(key);
            LuaScriptMgr.Push(L, data);
        }
        else
        {
            LogParamError("GetCustomData", count);
            LuaScriptMgr.Push(L, string.Empty);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #16
0
    public static int Login(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 0)
        {
            PlatformControl.Login();
        }
        else if ((count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(int))))
        {
            int type = (int)LuaScriptMgr.GetNumber(L, 1);
            PlatformControl.Login(type);
        }
        else
        {
            LogParamError("Login", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #17
0
    public static int ShowCustomerCenter(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 0)
        {
            PlatformControl.ShowCustomerCenter();
        }
        else if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(LuaFunction)))
        {
            var callback = LuaScriptMgr.GetLuaFunction(L, 1);
            PlatformControl.ShowCustomerCenter(callback);
        }
        else
        {
            LogParamError("ShowCustomerCenter", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #18
0
    public static int SetBreakPoint(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(int)))
        {
            int type = (int)LuaScriptMgr.GetNumber(L, 1);
            PlatformControl.SetBreakPoint(type);
        }
        else if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(string)))
        {
            string strPoint = LuaScriptMgr.GetString(L, 1);
            PlatformControl.SetBreakPoint(strPoint);
        }
        else
        {
            LogParamError("SetBreakPoint", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
    public void GeneratePlatform()
    {
        if (platformAmount < templatePlatform.Length)
        {
            PlatformControl perfabs = Instantiate(templatePlatform[platformAmount]);
            perfabs.SetPos(platformLastPos);
            perfabs.transform.SetParent(platformPlace);

            activePlatform.Add(perfabs);
            platformAmount++;
        }
        else
        {
            int ranNumber2 = Random.Range(0, unActivePlatform.Count);
            unActivePlatform[ranNumber2].SetPos(platformLastPos);
            platformLastPos = unActivePlatform[ranNumber2].GetLastPos();

            activePlatform.Add(unActivePlatform[ranNumber2]);
            unActivePlatform.RemoveAt(ranNumber2);
        }
    }
Exemple #20
0
    public static int ShowInAppWeb(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(string)))
        {
            string url = LuaScriptMgr.GetString(L, 1);
            PlatformControl.ShowInAppWeb(url);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(LuaFunction)))
        {
            string url      = LuaScriptMgr.GetString(L, 1);
            var    callback = LuaScriptMgr.GetLuaFunction(L, 2);
            PlatformControl.ShowInAppWeb(url, callback);
        }
        else
        {
            LogParamError("ShowInAppWeb", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #21
0
    public static int EnablePush(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(bool), typeof(int)))
        {
            bool enable = LuaScriptMgr.GetBoolean(L, 1);
            int  type   = (int)LuaScriptMgr.GetNumber(L, 2);
            PlatformControl.EnablePush(enable, type);
        }
        else if (count == 3 && LuaScriptMgr.CheckTypes(L, 1, typeof(bool), typeof(int), typeof(LuaFunction)))
        {
            bool enable   = LuaScriptMgr.GetBoolean(L, 1);
            int  type     = (int)LuaScriptMgr.GetNumber(L, 2);
            var  callback = LuaScriptMgr.GetLuaFunction(L, 3);
            PlatformControl.EnablePush(enable, type, callback);
        }
        else
        {
            LogParamError("EnablePush", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }
Exemple #22
0
        private void MachineForm_Load(object sender, EventArgs e)
        {
            Text = EnvironmentManager.Ins.LastDevProject;


            // di do cy vio
            diControl1.DiExs = Machine.Ins.DiExs.Values.ToList();
            diControl1.LoadFramework();
            diControl1.FrameworkActivate();
            doControl1.DoExs = Machine.Ins.DoExs.Values.ToList();
            doControl1.LoadFramework();
            doControl1.FrameworkActivate();
            cylinderControl1.CyExs = Machine.Ins.CylinderExs.Values.ToList();
            cylinderControl1.LoadFramework();
            cylinderControl1.FrameworkActivate();
            vioControl1.VioExs = Machine.Ins.VioExs.Values.ToList();
            vioControl1.LoadFramework();
            vioControl1.FrameworkActivate();

            // platforms
            foreach (var p in Machine.Ins.Platforms.Values)
            {
                tabControl1.TabPages.Add(p.Name, p.Description + $"({p.Name})");
                var platformControl = new PlatformControl()
                {
                    Dock = DockStyle.Fill,
                };
                platformControl.LoadPlatform(p);

                tabControl1.TabPages[p.Name].Controls.Add(platformControl);
            }


            //config
            richTextBoxMachine.Text = Machine.Ins.SerializeToString();
        }
        private void MainConfigForm_Load(object sender, EventArgs e)
        {
            HideOnClose = true;

            diControl1.DiExs = DemoMachine.Ins.DiExs.Values.ToList();
            diControl1.LoadFramework();
            diControl1.FrameworkActivate();


            doControl1.DoExs = DemoMachine.Ins.DoExs.Values.ToList();
            doControl1.LoadFramework();
            doControl1.FrameworkActivate();

            cylinderControl1.CyExs = DemoMachine.Ins.CylinderExs.Values.ToList();
            cylinderControl1.LoadFramework();
            cylinderControl1.FrameworkActivate();


            vioControl1.VioExs = DemoMachine.Ins.VioExs.Values.ToList();
            vioControl1.LoadFramework();
            vioControl1.FrameworkActivate();


            tabControlPlatforms.TabPages.Clear();

            foreach (var p in DemoMachine.Ins.Platforms.Values)
            {
                var platformControl = new PlatformControl()
                {
                    Dock = DockStyle.Fill,
                };
                platformControl.LoadPlatform(p);

                tabControlPlatforms.TabPages.Add(new TabPage($"{p.Name} {p.Description}")
                {
                    Controls =
                    {
                        platformControl,
                    }
                });
            }



            tabControlDevices.TabPages.Clear();

            foreach (var p in DemoMachine.Ins.Devices.Values)
            {
                var uc = p.CreateDeviceControl();
                uc.Dock = DockStyle.Fill;

                tabControlDevices.TabPages.Add(new TabPage($"{p.Name} {p.Description}")
                {
                    Controls =
                    {
                        uc,
                    }
                });
            }


            tabControlMachine.TabPages.Clear();
            foreach (var s in DemoMachine.Ins.Stations)
            {
                tabControlMachine.TabPages.Add(new TabPage($"{s.Value.Name} {s.Value.Description}")
                {
                    Controls =
                    {
                        new StationStateControl()
                        {
                            Dock    = DockStyle.Fill,
                            Station = s.Value,
                            Machine = s.Value.Machine
                        },
                    }
                });
            }


            tabControlScripts.TabPages.Clear();
            foreach (var s in DemoMachine.Ins.Tasks)
            {
                if (s.Value is PyScriptTask)
                {
                    var psc = new PyScriptControl()
                    {
                        Dock = DockStyle.Fill,
                    };

                    psc.LoadTask(s.Value as PyScriptTask);

                    tabControlScripts.TabPages.Add(new TabPage($"{s.Value.Name} {s.Value.Description}")
                    {
                        Controls =
                        {
                            psc,
                        }
                    });
                }
            }


            propertyGridSettings.SelectedObject = DemoMachine.Ins.Settings;
            propertyGridSettings.ExpandAllGridItems();
        }
 public void SetUnActivePlatform(PlatformControl platform)
 {
     unActivePlatform.Add(platform);
     activePlatform.Remove(platform);
 }
Exemple #25
0
        private void DevConfigForm_Load(object sender, EventArgs e)
        {
            //di/do tab
            diControl1.DiExs = Machine.Ins.DiExs.Values.ToList();
            diControl1.LoadFramework();
            doControl1.DoExs = Machine.Ins.DoExs.Values.ToList();
            doControl1.LoadFramework();
            vioControl1.VioExs = Machine.Ins.VioExs.Values.ToList();
            vioControl1.LoadFramework();
            cyliderControl1.CyExs = Machine.Ins.CylinderExs.Values.ToList();
            cyliderControl1.LoadFramework();

            //platform tab
            var platforms = Machine.Ins.Platforms.Values;

            tabControlPlatform.TabPages.Clear();
            foreach (var p in platforms)
            {
                tabControlPlatform.TabPages.Add(p.Name, p.Description + $"({p.Name})");
                var platformControl = new PlatformControl()
                {
                    Dock = DockStyle.Fill,
                };
                platformControl.LoadPlatform(p);

                tabControlPlatform.TabPages[p.Name].Controls.Add(platformControl);
            }


            //config
            propertyGridMachineConfig.SelectedObject = Machine.Ins.Settings;
            richTextBoxMachine.Text = Machine.Ins.SerializeToString();


            //calib
            stationStateControlLeft.Machine  = Machine.Ins;
            stationStateControlLeft.Station  = Machine.Ins.Find <Station>("LeftStation");
            stationStateControlRight.Machine = Machine.Ins;
            stationStateControlRight.Station = Machine.Ins.Find <Station>("RightStation");


            //product
            measureProjectSelctionControl1.Station     = Machine.Ins.Find <Station>("LeftStation");
            measureProjectSelctionControl1.ProjecType  = typeof(MeasureProject1);
            measureProjectSelctionControl1.ProjectFile = Machine.Ins.Settings.LeftProjectFilePath;
            measureProjectSelctionControl1.SelectMeasureProjectUpdateEvent += f =>
            {
                Machine.Ins.Settings.LeftProjectFilePath = f;
                Machine.Ins.Settings.Save();
            };

            measureProjectSelctionControl1.LoadMeasureProject();

            measureProjectSelctionControl2.Station     = Machine.Ins.Find <Station>("RightStation");
            measureProjectSelctionControl2.ProjecType  = typeof(MeasureProject1);
            measureProjectSelctionControl2.ProjectFile = Machine.Ins.Settings.RightProjectFilePath;
            measureProjectSelctionControl2.SelectMeasureProjectUpdateEvent += f =>
            {
                Machine.Ins.Settings.RightProjectFilePath = f;
                Machine.Ins.Settings.Save();
            };

            measureProjectSelctionControl2.LoadMeasureProject();


            tabControlMain.SelectedTab = tabPageProduct;

            FrameworkActivate();
        }