Ejemplo n.º 1
0
    public static string GetExt(GamePlatformType pt)
    {
        switch (pt)
        {
        case GamePlatformType.Android:
            return(".apk");

        case GamePlatformType.IOS:
            return(".ipa");

        case GamePlatformType.Windows:
            return(".exe");

        case GamePlatformType.OSX:
            return(".pkg");
        }
        return(".exe");
    }
Ejemplo n.º 2
0
        public static string GetGameUrl(GameType type, GamePlatformType platform, string serverGuid)
        {
            switch (type)
            {
                case GameType.Battlefield3:
                    return String.Format("http://battlelog.battlefield.com/bf3/servers/show/pc/{0}", serverGuid);
                case GameType.Battlefield4:
                    switch (platform)
                    {
                        case GamePlatformType.PC:
                            return String.Format("http://battlelog.battlefield.com/bf4/servers/show/pc/{0}", serverGuid);
                        case GamePlatformType.XboxOne:
                            return String.Format("http://battlelog.battlefield.com/bf4/servers/show/XBOXONE/{0}", serverGuid);
                        default:
                            return string.Empty;

                    }
                default:
                    return string.Empty;
            }
        }
Ejemplo n.º 3
0
    public static bool BuildVer(GamePlatformType pt)
    {
        if (Application.dataPath.IndexOf(Exporter.PUBLISH_DIR) == -1)
        {
            EditorUtility.DisplayDialog("错误", "只有发布目录才能发布版本!", "OK");
            return(false);
        }
        string           app_name    = APP_NAME;
        string           target_dir  = ExporterTools.GetRootDir(Exporter.VERSION_DIR);
        string           target_name = app_name + RuntimeInfo.GetExt(pt);
        BuildTargetGroup targetGroup;
        BuildTarget      buildTarget;

        PlayerSettings.bundleVersion = Exporter.CLIENT_VER.Replace('_', '.');
        switch (pt)
        {
        case GamePlatformType.Android:
            targetGroup = BuildTargetGroup.Android;
            buildTarget = BuildTarget.Android;
            PlayerSettings.applicationIdentifier = "com.leduo.buyu";
            PlayerSettings.SetScriptingDefineSymbolsForGroup(targetGroup, "BUYU_PUBLISH");
            break;

        case GamePlatformType.IOS:
            targetGroup = BuildTargetGroup.iOS;
            buildTarget = BuildTarget.iOS;
            PlayerSettings.applicationIdentifier = "com.52leduo.buyu";
            PlayerSettings.SetScriptingDefineSymbolsForGroup(targetGroup, "BUYU_PUBLISH");
            break;

        case GamePlatformType.Windows:
            targetGroup = BuildTargetGroup.Standalone;
            buildTarget = BuildTarget.StandaloneWindows;
            PlayerSettings.applicationIdentifier = "com.52leduo.buyu";
            PlayerSettings.SetScriptingDefineSymbolsForGroup(targetGroup, "BUYU_PUBLISH");
            break;

        default:
            Debug.Log("未知的发布类型");
            return(false);
        }
        string applicationPath = target_dir + "/" + target_name;

        if (File.Exists(applicationPath))
        {
            File.Delete(applicationPath);
        }

        bool bRet = GenericBuild(FindEnabledEditorScenes(), target_dir + "/" + target_name, buildTarget, BuildOptions.None);

        if (bRet)
        {
            EditorUtility.DisplayDialog("成功", "发布成功!", "OK");
            Debug.Log("发布成功!");
            return(true);
        }
        else
        {
            EditorUtility.DisplayDialog("失败", "发布失败!", "OK");
            Debug.Log("发布失败!");
            return(false);
        }
    }
Ejemplo n.º 4
0
        private void HandleRunGame(ManagementBaseObject baseObject)
        {
            var evs = eventService.
                      GetEvents().
                      Where(m => m.EventType == Event.Types.EventType.RunGameEvent).
                      ToList();

            if (evs.Count > 0)
            {
                bool             isGame       = false;
                GamePlatformType gamePlatform = GamePlatformType.Other;

                //判断游戏平台
                var p = ((ManagementBaseObject)(baseObject as ManagementBaseObject)["TargetInstance"]);
                //进程名称
                string processName = p.TryGetProperty("Name");
                //命令
                string commandLine = p.TryGetProperty("CommandLine");
                if (processName == "GameOverlayUI.exe")
                {
                    //steam平台
                    isGame             = true;
                    gamePlatform       = GamePlatformType.Steam;
                    gamePlatformRunLog = DateTime.Now;
                    Debug.WriteLine("已启动steam平台游戏");
                }
                else if (commandLine.Contains("-epicapp"))
                {
                    //epic
                    isGame             = true;
                    gamePlatform       = GamePlatformType.Epic;
                    gamePlatformRunLog = DateTime.Now;
                    Debug.WriteLine("已启动epic平台游戏");
                }
                else if (processName == "TenSafe_1.exe")
                {
                    //腾讯游戏
                    isGame             = true;
                    gamePlatform       = GamePlatformType.Tencent;
                    gamePlatformRunLog = DateTime.Now;
                    Debug.WriteLine("已启动腾讯平台游戏");
                }
                else if (gameAssociatedProcesses.Contains(processName))
                {
                    //游戏关联进程启动
                    TimeSpan diff = DateTime.Now - gamePlatformRunLog;
                    if (diff.TotalMilliseconds > 1000)
                    {
                        isGame = true;
                    }
                }


                if (isGame)
                {
                    foreach (var ev in evs)
                    {
                        eventService.Invoke(ev, gamePlatform.ToString());
                    }
                }
            }
        }
Ejemplo n.º 5
0
 public ServerDetail(string serverName, Guid serverGuid, GameType type, GamePlatformType platform)
 {
     this.Name = serverName;
     this.ServerID = serverGuid.ToString();
     this.GameType = type;
     this.Platform = platform;
 }