Giter Club home page Giter Club logo

arma3urlfetch's People

Contributors

fuxx avatar nerdalertdk avatar pixlcrashr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

arma3urlfetch's Issues

How to perform POST request?

Hi Vincent,

first of all i really like the approach to use a http client to send my data to my backend instead of using extdb to connect my database directly.

Right now i try to send some data to my backend but i am very new to SQF and i cant find a documentation how to make a manual post request to my backend. Maybe you have some advice what i am doing wrong here.

while {true} do {

	_serverName = serverName;
	_worldName = worldName;

	_justPlayers = allPlayers - entities "HeadlessClient_F";
	{
		_player = _x;
		_name = name _player;
		_uid = getPlayerUID _player;
		
		_uidParameter = format ["ping[arma_id]=%1", _uid];

		[
			"FUNC", 
			[
				"#url=https://x.x.royal-combat-force.de/x",
				"#method=POST",
				"#postData", _uidParameter
			]
	    ] callExtensions "arma3urlfetch";

	} forEach _justPlayers;
	Sleep 15;
};

I want to send the player id to my backend as post, i always get an error that i am missing a ; near /ping (which is part of the URL. Maybe you can post a example for making a manual post request :)

From the RPT

23:56:16 Error in expression <d=POST",
"#postData", _uidParameter
]
] callExtensions "arma3urlfetch";

} forEa>
23:56:16   Error position: <callExtensions "arma3urlfetch";

} forEa>
23:56:16   Error Missing ;
23:56:16 File rcf_custom\stats\pingpong.sqf, line 23
23:56:16 Error in expression <d=POST",
"#postData", _uidParameter
]
] callExtensions "arma3urlfetch";

} forEa>
23:56:16   Error position: <callExtensions "arma3urlfetch";

} forEa>
23:56:16   Error Missing ;

Greetings and thanks for the support,
Stefan

Machine testing

Reproducing steps:

  1. Download/install ArmA3URLFetch: http://steamcommunity.com/sharedfiles/filedetails/?id=1138271370
  2. turn on your ArmA 3 logging
  3. start ArmA 3 without battleye and with this mod
  4. go into 3DEN editor and place any player
  5. go into the game and run the following snippet in debug console:
    [] spawn { hint str (["https://httpbin.org/get", "GET", ["sexy=ss3"], true] call a3uf_common_fnc_request); };
  6. if your game crashes install the following VSC++ Redis version: https://steamcommunity.com/linkfilter/?url=https://www.microsoft.com/de-de/download/details.aspx?id=48145
  7. retry
  8. after retrying, post your results in this issue

The following format for results are:

Running System: Windows/Linux 32-/64-bit
First run successful: yes/no
Second run successful: yes/no
Error log: (as attachment; logs are saved (on windows) in %localappdata%\Arma 3)

I appreciate your help!

Sincerely
-Vincent

HTTP_USER_AGENT is missing

Hi

First of thanks for urlfetch, works greate.

Curl don't send an HTTP_USER_AGENT string
this is normal best practice to send an HTTP_USER_AGENT with an program identificer.

If you add HTTP_USER_AGENT could you also add OS info, like linux/windows and version :)

would help but my c++ knowledge is not there yet

Merge to VC12 for the extension

@fuxx

On vanilla installations of Windows 10 and Server 2016 there is no VC++ 2015 redist package installed therefor the dll can not be loaded and calling the extension fails with an error in the .rpt file.

This is due the compilation of CURL with VC++ 2015 which links against MSVCP140.dll

The extension should now be compiled by the VC12 compiler.
Would you like to re-check the extension again? (Just use one of the artifacts of the latest commit(s))

Add more specific error codes

  • add/change error codes for argument parser
  • add them to the Wiki
  • add functionality to return HTTP status code on curl failure (e.g. 408)
  • add argument for setting the possible timeout (in seconds)

Compile libssl/libcrypto manually

The libssl and libcrypto libraries shall be build manually because otherwise they do not support different Linux distributions.
Currently, builds of this project have to be separated by their distributions (focused on Debian and Ubuntu).

Status Stack Buffer Overrun

As i progress, using the Addon to establish an authorization workflow, i now stumbled across the following error:
"0xC0000409 - STATUS_STACK_BUFFER_OVERRUN".

Here's my request:

_cliendid = ["http://192.168.0.102:8000/api/user", "GET", [], true] call a3uf_common_fnc_addClient;

access_token = "7c9f8d58da05147b9cfe0bfb9210603668c924bc";

_token_string = format ["Bearer %1", access_token];

[_cliendid, [["Content-Type", "application/json"], ["Authorization", _token_string]]] call a3uf_common_fnc_setClientHeaders;

_response = [_cliendid] call a3uf_common_fnc_clientRequest;

Its a function, spawned by user input, which calls a local api endpoint, maybe its just a headers problem.

Thanks in advance,

Luke

Recompile to Linux .so?

i want to use this mods in linux server i love it but linux don't support dll file
is there anyway to use with linux?

Add CI support

Because testing on a local machine is not that efficent, we should add CI support to this repository.
First, we have to accomplish #16 to add that CI support.

After that, we have to create both windows and linux CI's because this modification uses both operating systems.

We also have to find a provider who hosts Windows servers and/or containers -> Open to discuss.

-debugCallExtension security and obscurity implications

In case of a client-side deployment, this parameter prohibits security through obscurity.

Affected are for example API tokens.

Basically everything a client would need, but shouldn't see or know himself that gets send to or through the extension.

Sincerely Rage

Add makefile

We need a makefile to easily build this modification on multiple different operating systems.
Moreover, we have to automize the process of building and including static libcurl and libssh libraries.

GETRQ: 601 instead of 602?

21:07:28 ["",601,0]
21:07:28 ["",600,0]
21:07:28 ["",600,0]
21:07:28 ["",600,0]
21:07:28 ["",600,0]
21:07:28 ["",600,0]
21:07:28 ["",600,0]
21:07:28 ["",600,0]
21:07:29 ["",600,0]
21:07:29 ["",600,0]
21:07:29 ["",600,0]

This is a result of GETRQ code snippet in a cycle. Previous versions were reporting 602 code as intended to be that extension still going on with SENDRQ. Now it instantly falls to 601 which is failed.
Mistake? Thanks.

RvExtensionArgs Support.

Theoretisch

Ist das egal

Praktisch

vereinfacht sich das Parsen von Daten innerhalb der Extension immens.

Der eigentliche Call wird etwas verständlicher.

Die Extension kann einen eigenen Fehler -Code zurück geben.
Debugging in Arma und stati der Extension können dadurch verbessert werden.

Gruß Rage

Error Generic Error in expression

Hey,

today i wanted to test your addon for my multiplayer mission, unfortunately, it doesn't work yet.

There's my example code: "_response = ["https://jsonplaceholder.typicode.com/posts/1", "GET"] call a3uf_common_fnc_request;"

This is the current error:
arma_3_url_fetch_error

Bad Gateway and possibly other connection errors crash the game

This is likely linked to #36 , whenever our webservice is unreachable or has a timeout for whatever reason the entire game server crashes. Is there any workaround to use?

we are calling it like this within a spawned function:

	private _response = [
		format ["https://***%1", _endpoint],
		_method,
		["Content-Type", "application/json", "X-Remove-Null", "true", "Authorization", "Bearer ***"],
		_data,
		true
	] call a3uf_common_fnc_request;

Add request body content

Currently there is no functionality to add body contents like application/text or application/json.
We should add this to increase the functionality of this HTTP client.
The functionality is identical to the current way of setting client parameters or headers.

Roadmap:

  • add fn_setClientBody.sqf
  • add new client functionality SETCLIB
    • same parameters as SETCLIP or SETCLIH

Roadmap to v1.0-beta

For the next version of ArmA3URLFetch there several feature unimplemented, such as:

  • Result strings bigger than 10240 (means we need a function which returns only a part of a string) #14
  • Add a function documentation #13

If there are other features left, we will add it here.

Future systems

For the future, we've got an idea of (again) new system, which is eventually the final system:

For example, a new object client is defined.

This client contains information about a default request. Those information could be the URL, the header or the method and so on.

Thus, you use your predefined client to request an URL. When you request the information saved by the client, you can also overwrite the default parameters given.

In the end it should be an more object oriented way than now.

-Vincent

Linux compatibility

Hi there, we've encountered a lot of reports that extension fails to load on Linux version of dedicated server. Reports origin from Ubuntu 16.04, Debian 9.5.0 and sometimes other linux systems. We've checked that ldd reports all dependencies to be in place on the same OS.
Might it be so some of the libs doesn't support specific OS, and if they do - what types of OS are currently 100% supported?
Thanks.

String sizes bigger than 10240

There have to be a functionality to receive more than 10240 as input.
Well we can not change the ArmA 3 extension input limitation, but we can remove each time we call GETRQ a part of the byte size 10240 from the result string Requests::Result.

[QUESTION]: SENDRQ, GETRQ, GETST codes.

In a return codes page it was stated that those commands handle HTTP codes (>100). But I seem to be recieving only 0 and 1, which is done and pending custom codes from extension. How to handle something like 200, 404 or 502 for example?
Thanks.

EDIT: Also all of those commands support HTTP codes >100?

CPU Unexpected load.

Windows servers running DLL with no players are experiencing some huge CPU loads (~30-40% average). This was tested on both desktop and server type of CPU's (i7-7700K and Xeon E5 1650-v4) but both servers were running Windows 2016 Standart. There are nothing else in common but 2016 OS, so that might be an issue source. Servers do not experience any load without DLL used.
Thanks.

SENDRQ: 500 Internal Server Error [Windows]

We met some reports with SENDRQ returning 500 code on first try, which tells that server is unable to process the condition. We did an experiment and used old version (1.0) of A3UF and it succeeded with the same conditions. It's a paradox, since tests shown that client and server confirmed not to be a source of a problem. Might that be a code exception related to 1.1 update in windows version?
Thanks.

Add headers to a3uf_common_fnc_addClient

Hi

Is there an easy way to use headers with a3uf_common_fnc_request
Our api uses an auth token in the header for validation and it would help for simplicity
in the sqf code if we could use a3uf_common_fnc_request instead of a3uf_common_fnc_setClientHeaders/a3uf_common_fnc_clientRequest

Like so

private _response = [
    <string/url>, //the url of an request
    <string/method>, //the HTTP method; most of the time it is "GET"
    <array/params>, //(optional) parameters of the url request
    <array/headers>, //(optional) headers of the url request
    <bool/decodeJson> //(optional) should a json response converted?
] call a3uf_common_fnc_request;

char* to int conversion

The STAT and RECV section has a problem with checking the correct value. There is a error free char* to int conversion needed.

Add POST data feature

POST data is a very important feature to add because it is used in web applications literally every time.

  • Add POST data with new "parameter" #postData
  • #postData can be inserted multiple times in a request and unlimited arguments can be passed to #postData

ParseSimpleArray in Arma Support

Aktuelles JSON parsing

passiert vollends in Arma.

Funktionieren tut das mit Sicherheit gut, Performance ist allerdings fragwürdig.

Seit einiger Zeit gibt es den Befehl
ParseSimpleArray
Der mehrdimensionale Arrays aus einem String Parsen kann.

M.m nach ist das der aktuellen SQF Implementierung vor zu ziehen.

Vorallem weil JSON Arrays identisch zu Arma Arrays sind.

Gruß Rage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.