{"action":"created","comment":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/23887994","id":23887994,"diff_hunk":"@@ -0,0 +1,42 @@\n+﻿#region Copyright & License Information\n+/*\n+ * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)\n+ * This file is part of OpenRA, which is free software. It is made\n+ * available to you under the terms of the GNU General Public License\n+ * as published by the Free Software Foundation. For more information,\n+ * see COPYING.\n+ */\n+#endregion\n+\n+using System;\n+using System.IO;\n+\n+namespace OpenRA.Mods.D2k.UtilityCommands\n+{\n+\tclass ImportD2kMapCommand : IUtilityCommand\n+\t{\n+\t\tpublic string Name { get { return \"--import-d2k-map\"; } }\n+\n+\t\t[Desc(\"FILENAME\", \"TILESET\", \"Convert a legacy Dune 2000 MAP file to the OpenRA format.\")]\n+\t\tpublic void Run(ModData modData, string[] args)\n+\t\t{\n+\t\t\t// HACK: The engine code assumes that Game.modData is set.\n+\t\t\tGame.ModData = modData;\n+\n+\t\t\tvar rules = Game.ModData.RulesetCache.LoadDefaultRules();\n+\n+\t\t\tvar map = D2kMapImporter.Import(args[1], modData.Manifest.Mod.Id, args[2], rules);\n+\n+\t\t\tif (map == null)\n+\t\t\t\treturn;\n+\n+\t\t    var dir = Path.Combine(Environment.CurrentDirectory, \"mods\", \"d2k\", \"maps\", \"Imported\");","path":"OpenRA.Mods.D2k/UtilityCommands/ImportD2kMapCommand.cs","position":33,"original_position":33,"commit_id":"6e195a3e10b283773ae3ddd374b55284752950d3","original_commit_id":"6e195a3e10b283773ae3ddd374b55284752950d3","user":{"login":"Mailaender","id":756669,"avatar_url":"https://avatars.githubusercontent.com/u/756669?v=3","gravatar_id":"","url":"https://api.github.com/users/Mailaender","html_url":"https://github.com/Mailaender","followers_url":"https://api.github.com/users/Mailaender/followers","following_url":"https://api.github.com/users/Mailaender/following{/other_user}","gists_url":"https://api.github.com/users/Mailaender/gists{/gist_id}","starred_url":"https://api.github.com/users/Mailaender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mailaender/subscriptions","organizations_url":"https://api.github.com/users/Mailaender/orgs","repos_url":"https://api.github.com/users/Mailaender/repos","events_url":"https://api.github.com/users/Mailaender/events{/privacy}","received_events_url":"https://api.github.com/users/Mailaender/received_events","type":"User","site_admin":false},"body":"This will crash if you don't run the utility with admin rights once installed. It should also not be hard-coded. Please change this to:\r\n\r\n```csharp\r\nvar userMapFolder = Game.ModData.Manifest.MapFolders.First(f => f.Value == \"User\").Key;\r\n\tif (userMapFolder.StartsWith(\"~\"))\r\n\t\tuserMapFolder = userMapFolder.Substring(1);\r\n\r\nvar dir = Platform.UnresolvePath(userMapFolder);\r\n```","created_at":"2015-01-31T10:02:04Z","updated_at":"2015-01-31T10:02:04Z","html_url":"https://github.com/OpenRA/OpenRA/pull/7135#discussion_r23887994","pull_request_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7135","_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/23887994"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/7135#discussion_r23887994"},"pull_request":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7135"}}},"pull_request":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7135","id":26078989,"html_url":"https://github.com/OpenRA/OpenRA/pull/7135","diff_url":"https://github.com/OpenRA/OpenRA/pull/7135.diff","patch_url":"https://github.com/OpenRA/OpenRA/pull/7135.patch","issue_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/7135","number":7135,"state":"open","locked":false,"title":"D2k: Add map importer","user":{"login":"penev92","id":7137365,"avatar_url":"https://avatars.githubusercontent.com/u/7137365?v=3","gravatar_id":"","url":"https://api.github.com/users/penev92","html_url":"https://github.com/penev92","followers_url":"https://api.github.com/users/penev92/followers","following_url":"https://api.github.com/users/penev92/following{/other_user}","gists_url":"https://api.github.com/users/penev92/gists{/gist_id}","starred_url":"https://api.github.com/users/penev92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penev92/subscriptions","organizations_url":"https://api.github.com/users/penev92/orgs","repos_url":"https://api.github.com/users/penev92/repos","events_url":"https://api.github.com/users/penev92/events{/privacy}","received_events_url":"https://api.github.com/users/penev92/received_events","type":"User","site_admin":false},"body":"This is my initial attempt to create a map importer for Dune 2000 .MAP files. (#4281)\r\nCurrent status:\r\n - Imports terrain\r\n - Imports resources (spice)\r\n - Imports actors (neutral, atreides and harkonnen; I will add the rest soon)\r\n\r\nIssues:\r\n - Missing tiles from arrakis.yaml tileset file  (#5875)\r\n - Currently cannot add player references for mission maps\r\n\r\nThis is 90% working with skirmish maps (from what I've seen), excluding 10% for the missing tiles.\r\nWhile this will import mission maps as well, the player reference issue does cause some problems there. This can be manually fixed in the `map.yaml` for now. I plan on fixing it properly when there is a Dune 2000 mission file reader implemented (#4280).","created_at":"2014-12-15T15:56:52Z","updated_at":"2015-01-31T10:02:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbbf8149113703b31849294c2dc88a13880e1f25","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7135/commits","review_comments_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7135/comments","review_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/7135/comments","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/6e195a3e10b283773ae3ddd374b55284752950d3","head":{"label":"penev92:bleed_d2kMapImporter","ref":"bleed_d2kMapImporter","sha":"6e195a3e10b283773ae3ddd374b55284752950d3","user":{"login":"penev92","id":7137365,"avatar_url":"https://avatars.githubusercontent.com/u/7137365?v=3","gravatar_id":"","url":"https://api.github.com/users/penev92","html_url":"https://github.com/penev92","followers_url":"https://api.github.com/users/penev92/followers","following_url":"https://api.github.com/users/penev92/following{/other_user}","gists_url":"https://api.github.com/users/penev92/gists{/gist_id}","starred_url":"https://api.github.com/users/penev92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penev92/subscriptions","organizations_url":"https://api.github.com/users/penev92/orgs","repos_url":"https://api.github.com/users/penev92/repos","events_url":"https://api.github.com/users/penev92/events{/privacy}","received_events_url":"https://api.github.com/users/penev92/received_events","type":"User","site_admin":false},"repo":{"id":24796059,"name":"OpenRA","full_name":"penev92/OpenRA","owner":{"login":"penev92","id":7137365,"avatar_url":"https://avatars.githubusercontent.com/u/7137365?v=3","gravatar_id":"","url":"https://api.github.com/users/penev92","html_url":"https://github.com/penev92","followers_url":"https://api.github.com/users/penev92/followers","following_url":"https://api.github.com/users/penev92/following{/other_user}","gists_url":"https://api.github.com/users/penev92/gists{/gist_id}","starred_url":"https://api.github.com/users/penev92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penev92/subscriptions","organizations_url":"https://api.github.com/users/penev92/orgs","repos_url":"https://api.github.com/users/penev92/repos","events_url":"https://api.github.com/users/penev92/events{/privacy}","received_events_url":"https://api.github.com/users/penev92/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/penev92/OpenRA","description":"An open-source implementation of the Command & Conquer: Red Alert engine using .NET/Mono and OpenGL. Runs on Windows, Linux and Mac OS X.","fork":true,"url":"https://api.github.com/repos/penev92/OpenRA","forks_url":"https://api.github.com/repos/penev92/OpenRA/forks","keys_url":"https://api.github.com/repos/penev92/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/penev92/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/penev92/OpenRA/teams","hooks_url":"https://api.github.com/repos/penev92/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/penev92/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/penev92/OpenRA/events","assignees_url":"https://api.github.com/repos/penev92/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/penev92/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/penev92/OpenRA/tags","blobs_url":"https://api.github.com/repos/penev92/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/penev92/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/penev92/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/penev92/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/penev92/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/penev92/OpenRA/languages","stargazers_url":"https://api.github.com/repos/penev92/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/penev92/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/penev92/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/penev92/OpenRA/subscription","commits_url":"https://api.github.com/repos/penev92/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/penev92/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/penev92/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/penev92/OpenRA/issues/comments/{number}","contents_url":"https://api.github.com/repos/penev92/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/penev92/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/penev92/OpenRA/merges","archive_url":"https://api.github.com/repos/penev92/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/penev92/OpenRA/downloads","issues_url":"https://api.github.com/repos/penev92/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/penev92/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/penev92/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/penev92/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/penev92/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/penev92/OpenRA/releases{/id}","created_at":"2014-10-04T17:27:45Z","updated_at":"2014-10-05T20:15:38Z","pushed_at":"2015-01-29T16:24:52Z","git_url":"git://github.com/penev92/OpenRA.git","ssh_url":"git@github.com:penev92/OpenRA.git","clone_url":"https://github.com/penev92/OpenRA.git","svn_url":"https://github.com/penev92/OpenRA","homepage":"http://www.openra.net","size":81420,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"bleed"}},"base":{"label":"OpenRA:bleed","ref":"bleed","sha":"f5f3747338ef5c093d5bc07990a7e482388a393e","user":{"login":"OpenRA","id":409046,"avatar_url":"https://avatars.githubusercontent.com/u/409046?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRA","html_url":"https://github.com/OpenRA","followers_url":"https://api.github.com/users/OpenRA/followers","following_url":"https://api.github.com/users/OpenRA/following{/other_user}","gists_url":"https://api.github.com/users/OpenRA/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRA/subscriptions","organizations_url":"https://api.github.com/users/OpenRA/orgs","repos_url":"https://api.github.com/users/OpenRA/repos","events_url":"https://api.github.com/users/OpenRA/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRA/received_events","type":"Organization","site_admin":false},"repo":{"id":959908,"name":"OpenRA","full_name":"OpenRA/OpenRA","owner":{"login":"OpenRA","id":409046,"avatar_url":"https://avatars.githubusercontent.com/u/409046?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenRA","html_url":"https://github.com/OpenRA","followers_url":"https://api.github.com/users/OpenRA/followers","following_url":"https://api.github.com/users/OpenRA/following{/other_user}","gists_url":"https://api.github.com/users/OpenRA/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenRA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenRA/subscriptions","organizations_url":"https://api.github.com/users/OpenRA/orgs","repos_url":"https://api.github.com/users/OpenRA/repos","events_url":"https://api.github.com/users/OpenRA/events{/privacy}","received_events_url":"https://api.github.com/users/OpenRA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenRA/OpenRA","description":"An open-source implementation of the Command & Conquer: Red Alert engine using .NET/Mono and OpenGL. Runs on Windows, Linux and Mac OS X.","fork":false,"url":"https://api.github.com/repos/OpenRA/OpenRA","forks_url":"https://api.github.com/repos/OpenRA/OpenRA/forks","keys_url":"https://api.github.com/repos/OpenRA/OpenRA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenRA/OpenRA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenRA/OpenRA/teams","hooks_url":"https://api.github.com/repos/OpenRA/OpenRA/hooks","issue_events_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/events{/number}","events_url":"https://api.github.com/repos/OpenRA/OpenRA/events","assignees_url":"https://api.github.com/repos/OpenRA/OpenRA/assignees{/user}","branches_url":"https://api.github.com/repos/OpenRA/OpenRA/branches{/branch}","tags_url":"https://api.github.com/repos/OpenRA/OpenRA/tags","blobs_url":"https://api.github.com/repos/OpenRA/OpenRA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenRA/OpenRA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenRA/OpenRA/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenRA/OpenRA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenRA/OpenRA/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenRA/OpenRA/languages","stargazers_url":"https://api.github.com/repos/OpenRA/OpenRA/stargazers","contributors_url":"https://api.github.com/repos/OpenRA/OpenRA/contributors","subscribers_url":"https://api.github.com/repos/OpenRA/OpenRA/subscribers","subscription_url":"https://api.github.com/repos/OpenRA/OpenRA/subscription","commits_url":"https://api.github.com/repos/OpenRA/OpenRA/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenRA/OpenRA/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenRA/OpenRA/contents/{+path}","compare_url":"https://api.github.com/repos/OpenRA/OpenRA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenRA/OpenRA/merges","archive_url":"https://api.github.com/repos/OpenRA/OpenRA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenRA/OpenRA/downloads","issues_url":"https://api.github.com/repos/OpenRA/OpenRA/issues{/number}","pulls_url":"https://api.github.com/repos/OpenRA/OpenRA/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenRA/OpenRA/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenRA/OpenRA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenRA/OpenRA/labels{/name}","releases_url":"https://api.github.com/repos/OpenRA/OpenRA/releases{/id}","created_at":"2010-10-04T07:38:05Z","updated_at":"2015-01-31T09:55:26Z","pushed_at":"2015-01-31T09:55:26Z","git_url":"git://github.com/OpenRA/OpenRA.git","ssh_url":"git@github.com:OpenRA/OpenRA.git","clone_url":"https://github.com/OpenRA/OpenRA.git","svn_url":"https://github.com/OpenRA/OpenRA","homepage":"http://www.openra.net","size":153579,"stargazers_count":1680,"watchers_count":1680,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":578,"mirror_url":null,"open_issues_count":685,"forks":578,"open_issues":685,"watchers":1680,"default_branch":"bleed"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7135"},"html":{"href":"https://github.com/OpenRA/OpenRA/pull/7135"},"issue":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/7135"},"comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/issues/7135/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7135/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenRA/OpenRA/pulls/7135/commits"},"statuses":{"href":"https://api.github.com/repos/OpenRA/OpenRA/statuses/6e195a3e10b283773ae3ddd374b55284752950d3"}}}}