Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorldController.cs
More file actions
Latest commit
34 lines (29 loc) · 1.19 KB
/
Copy pathHelloWorldController.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
usingSystem.Web.Mvc;
usingTCAdmin.SDK.Web.MVC.Controllers;
namespaceGame
{
publicclassHelloWorldModel
{
publicstringMessage{get;set;}
publicstringServiceStartedOn{get;set;}
publicTCAdmin.GameHosting.SDK.Objects.ServiceService{get;set;}
}
publicclassHelloWorldController:BaseServiceController
{
[HttpGet]
[ParentAction("Service","Home")]
publicActionResultIndex(intid)
{
//Make sure the user has permission this feature
EnforceFeaturePermission("FileManager");
varmodel=newHelloWorldModel();
//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}");
returnView("HelloWorld",model);
}
}
}