-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorldController.cs
More file actions
34 lines (29 loc) · 1.19 KB
/
HelloWorldController.cs
File metadata and controls
34 lines (29 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Web.Mvc;
using TCAdmin.SDK.Web.MVC.Controllers;
namespace Game
{
public class HelloWorldModel
{
public string Message { get; set; }
public string ServiceStartedOn { get; set; }
public TCAdmin.GameHosting.SDK.Objects.Service Service { get; set; }
}
public class HelloWorldController : BaseServiceController
{
[HttpGet]
[ParentAction("Service", "Home")]
public ActionResult Index(int id)
{
//Make sure the user has permission this feature
EnforceFeaturePermission("FileManager");
var model = new HelloWorldModel();
//Gets the current service
model.Service = TCAdmin.GameHosting.SDK.Objects.Service.GetSelectedService();
//Sets the message variable
model.Message = "Hello World!";
//Gets information about the service startup
model.ServiceStartedOn = string.Format($"{model.Service.ConnectionInfo} was started on {TCAdmin.SDK.Misc.Dates.UniversalTimeToCurrentTimeZone(model.Service.Status.StartTime)} with process id {model.Service.Status.ProcessId}");
return View("HelloWorld", model);
}
}
}