2023-02-08 21:33:22 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace MainServer.Controllers.Game;
|
|
|
|
|
|
|
|
|
|
[ApiController]
|
|
|
|
|
[Route("alive")]
|
|
|
|
|
public class AliveController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
[HttpGet("i.php")]
|
|
|
|
|
public IActionResult AliveCheck()
|
|
|
|
|
{
|
|
|
|
|
var remoteIpAddress = Request.HttpContext.Connection.RemoteIpAddress;
|
|
|
|
|
var serverIpAddress = Request.HttpContext.Connection.LocalIpAddress;
|
|
|
|
|
var response = $"REMOTE ADDRESS:{remoteIpAddress}\n" +
|
|
|
|
|
"SERVER NAME:GCLocalServer\n" +
|
|
|
|
|
$"SERVER ADDR:{serverIpAddress}";
|
|
|
|
|
return Ok(response);
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-14 02:47:08 +08:00
|
|
|
|
[HttpGet("{id}/Alive.txt")]
|
2023-02-08 21:33:22 +08:00
|
|
|
|
public IActionResult GetAliveFile()
|
|
|
|
|
{
|
|
|
|
|
return Ok("");
|
|
|
|
|
}
|
|
|
|
|
}
|