Jump to content

MVC custome stuff


DeteCT0R

Recommended Posts

There is some code for custome game homepage not the best but its good to start learning :D

 

For custome gametracker image:

@if (Model.ServiceStatus == TCAdmin.Interfaces.Server.ServiceStatus.Running)
       {
           <img src="https://image.gametracker.com/images/maps/160x120/cs/@(Model.CurrentMap).jpg" style="height:150px;width:200px;" />}
       @if (Model.ServiceStatus == TCAdmin.Interfaces.Server.ServiceStatus.Stopped)
       {
           <img src="https://image.gametracker.com/images/maps/160x120/nomap.jpg" style="height:150px;width:200px;" />}

 

For map:

            @(Html.Kendo().Map()
   .Name("map")
   .Center(47.5177557, 19.0580601)
   .Zoom(9)
   .Layers(layers =>
   {
       layers.Add()
           .Type(MapLayerType.Tile)
           .UrlTemplate("http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
           .Subdomains("a", "b", "c")
           .Attribution("© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>");
   })
   .Markers(markers =>
   {
       markers.Add()
           .Location(47.5177557, 19.0580601)
           .Shape(MapMarkersShape.PinTarget)
           .Tooltip(tooltip => tooltip.Content("Budapest, Victor Hugo"));
   })
       )

 

Some little edit need but you can use for custom game homepage.

851customehomepage.png

Link to comment
Share on other sites

  • 3 weeks later...
  • 8 months later...
On 6/15/2019 at 9:11 AM, DeteCT0R said:

Popup message. Maybe in the future i can use better place. Currently its popup when the user click to Start/Stop/Restart. (Its say Command send and the time)

Nothing special :D Just for fun.

328popup.png

how did you achieve that popup it is awsome :).. thats if ur willing to share ?

Link to comment
Share on other sites

Actually i does remember correctly i dont have anymore TCadmin :D.
Its a simple alert with the current time. I did it on version 2.0.127 probably now has more option to do.
Ok thanks no probs I'll see what can do :)

Sent from my SM-G975F using Tapatalk

Link to comment
Share on other sites

  • 5 weeks later...
7 hours ago, CloudNine said:

Anyone know the correct syntax to call a custom variable?

On the service page put this:

@ {
  Service service = new TCAdmin.GameHosting.SDK.Objects.Service(Model.ServiceId);
}

You should then be able to do something like this:

<h3>Rcon Password: @service.Variables["RConPassword"]</h3>

 

I haven't tested it, but its something along those lines.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 172 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use