Jump to content

PHP -snip-


wishy

Recommended Posts

http://prntscr.com/rg25vd

 

 

Help to enable api i need this D:

<?
$config['username'] = "MYACC AUTORIZATED";             // api username
$config['pwd'] = "WHERE IS API PASSWORD?";                 // api password
$config['server'] = "MYIPSERVER";                 // your game api server ip:port

$config['pageSize'] = "20";                 // amount of players per page
$config['page'] = "0";                         // what page to show
$config['sortDirection'] = "Descending";     // Descending or Ascending
?>

Link to comment
Share on other sites

16 minutes ago, Celtos said:

http://prntscr.com/rg25vd

 

 

Help to enable api i need this D:

<?
$config['username'] = "MYACC AUTORIZATED";             // api username
$config['pwd'] = "WHERE IS API PASSWORD?";                 // api password
$config['server'] = "MYIPSERVER";                 // your game api server ip:port

$config['pageSize'] = "20";                 // amount of players per page
$config['page'] = "0";                         // what page to show
$config['sortDirection'] = "Descending";     // Descending or Ascending
?>

https://docs.freemmorpgmaker.com/api/v1/introduction/setup.html

 

create an account ingame,

give it api access (Grant API Access in the link above)

 

use that account login + pwd

 

server = ip:port (example: 127.0.0.1:5400)

Link to comment
Share on other sites

My API IP:

 

theceltosservidorsul.brazilsouth.cloudapp.azure.com:5401

 

Its listen :(

 

CONFIG

Quote

{
  "RouteAuthorization": {},
  "Hosts": [
    "http://localhost:5401"
  ],
  "Cors": [],
  "DataProtectionKey": "THERE IS A BIG BIG SEQUENCIE OF CHARS...",
  "Enabled": true,
  "DebugMode": false,
  "SeedMode": false,
  "RefreshTokenLifetime": 15,
  "ThrottlePolicy": {
    "IpThrottling": true,
    "IpWhitelist": [],
    "IpRules": {},
    "ClientThrottling": true,
    "ClientWhitelist": [],
    "ClientRules": {
      "test": {
        "PerSecond": 1,
        "PerMinute": 10,
        "PerHour": 0,
        "PerDay": 0,
        "PerWeek": 0
      }
    },
    "EndpointThrottling": true,
    "EndpointWhitelist": [],
    "EndpointRules": {
      "/api/oauth/token": {
        "PerSecond": 1,
        "PerMinute": 5,
        "PerHour": 0,
        "PerDay": 0,
        "PerWeek": 0
      }
    },
    "StackBlockedRequests": true,
    "Rates": {
      "Second": 1,
      "Minute": 60
    }
  },
  "FallbackClientKey": "test",
  "RequestLogLevel": 128
}

 

Link to comment
Share on other sites

3 minutes ago, Celtos said:

My API IP:

 

theceltosservidorsul.brazilsouth.cloudapp.azure.com:5401

 

Its listen :(

http://theceltosservidorsul.brazilsouth.cloudapp.azure.com:5401/api/oauth/token should show: 
{"error":"grant_type_missing"}

 

but it shows: 

Bad Request - Invalid Hostname

HTTP Error 400. The request hostname is invalid.

Link to comment
Share on other sites

In the Server/Resourcs/config/api.config.json

make sure it has

Hosts": [
    "http://localhost:5401",
    "http://theceltosservidorsul.brazilsouth.cloudapp.azure.com:5401"
  ],

or

Hosts": [
    "http://localhost:5401",
    "http://104.41.13.150:5401"
  ],

and

"Enabled": true,

 

Link to comment
Share on other sites

When i put external IP 

 

get error

Quote

  "Hosts": [
    "http://localhost:5401",
    "http://104.41.13.150:5401"
  ],

 

Quote

2020-03-13 23:43:38.345 [Error] Failed to start API.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: The format of the specified network name is invalid
   at System.Net.HttpListener.AddAllPrefixes()
   at System.Net.HttpListener.Start()
   at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory)
   at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, IDictionary`2 properties)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create(IAppBuilder builder)
   at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context)
   at Intersect.Server.Web.RestApi.RestApi.Start() in C:\TeamCity\buildAgent\work\40dc5d27074313da\Intersect.Server\Web\RestApi\RestApi.cs:line 74
 

 

Link to comment
Share on other sites

Quote

 

Server Started. Using UDP Port #5400
API listening on 'http://localhost:5401'.
API listening on 'http://theceltosservidorsul.brazilsouth.cloudapp.azure.com:5401'.


Connection Information:
   Public IP: 104.41.13.150
   Public Port: 5400

 

 

 

But still

 

Quote

Ranking

couldn't connect to host

 

Link to comment
Share on other sites

$config['username'] = "MY ACCOUNT";             // api username
$config['pwd'] = "THE PASS OF ACCOUNT";                 // api password
$config['server'] = "theceltosservidorsul.brazilsouth.cloudapp.azure.com:5401";     

Link to comment
Share on other sites

3 minutes ago, Celtos said:

$config['username'] = "MY ACCOUNT";             // api username
$config['pwd'] = "THE PASS OF ACCOUNT";                 // api password
$config['server'] = "theceltosservidorsul.brazilsouth.cloudapp.azure.com:5401";     

this should work if that account has api access -> in console: api MY ACCOUNT true

Link to comment
Share on other sites

Still <?

Quote

 

$config['username'] = "MY ACCOUNT";             // api username
$config['pwd'] = "THE PASS OF ACCOUNT";   
$config['server'] = "theceltosservidorsul.brazilsouth.cloudapp.azure.com:5401";                 // your game api server ip:port

$config['pageSize'] = "20";                 // amount of players per page
$config['page'] = "0";                         // what page to show
$config['sortDirection'] = "Descending";     // Descending or Ascending
?>

 

 

ANd get 

 

Quote

Ranking

couldn't connect to host

 

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
×
×
  • Create New...