This project is basically a copy of the famous R/place from Reddit. I tried to redevelop the same concept without using their sourcecode. It is an acceptable prototype, for the moment, but I wish to add more features on the way. If you wish to help me, contact me via Github :)
If you wish to contact me, you can also join my Discord server using the invitation code 'fvv8NHx'.
For those who don't know R/place, this website is following a simple concept. You have a large board of pixels (300x300), and you can place one each 5 minutes. You can choose the color and the coordinates, and replacing a colored pixel is possible.
Following the same ideas of the developers of R/place, I created an API working with the file api.php that you can reach with pixelbattle.valenwe.fr/api.php. This can be used for two commands: place_pixel and fetch_rect. It uses several arguments, sent as a GET request, for each command:
Possible colors are any color between the Hex codes 0 to ffffff.
Returns: "1" if success, else "0".
Example: api.php?place_pixel&username=test&password=test99&x=1&y=1&color=bl
Output: "1"
Returns, if the coordinates are coherent, the list of pixels (x, y, color) in the rectangle divided by "|".
Example: api.php?fetch_rect&x1=1&x2=5&y1=1&y2=2
Output: "1 1 ffffff|1 2 ffffff|2 1 ffffff|2 2 ffffff|3 1 ffffff|3 2 ffffff|4 1 ffffff|4 2 ffffff|5 1 ffffff|5 2 ffffff"