Jump to content

GoalE

Veteran Driver
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

4 Truck?

2 Followers

About GoalE

  • Rank
    No Cargo
  • Birthday 07/07/1995

Profile Information

  • Gender
    Male
  • Preferred Trucks
    Mercedes
  • EU Garage Location
    United Kingdom: London
  • Known languages
    English, Hindi, php, sql

Recent Profile Visitors

565 profile views
  1. Hello everyone!

    I wanted to make this post for a while now.. Here it is.

     

    Almost a year has passed since i first joined TruckersMP community. Quickly, i became a part of ELS (a vtc) which was led by EnLight. The people in this vtc were among the first people i met in this game and we got along just fine. I met many amazing people through the course of this 1 year.

     

    Due to some problems within the vtc, we decided to transform into an Event Organizing Team.. and so FleetMaster Events (FME) was born. But, due to lack of activity FME has also dissolved.

     

    I want to thank this community because it motivated me to develop web applications and learn a lot of stuff which helped me a lot IRL.

     

    Its been a pleasure to be a part of ELS and FME.

  2. GoalE

    API Per-City Info?

    There are two ways to achieve your goal if you want to do it yourself. Both will require ETS2MAP API. http://tracker.ets2map.com/v2/fullmap The above link provides you with JSON response of each and every truck that is online in game. Both methods will require you to find out X and Y coordinates of the city as well as its radius. You will need to create a table where you will store it. For example: city_id city_name x y radius 1 london 2 5 10 (assume) 2 .......... .... .... ..... (and so on) $city_data will fetch data from above table. SELECT * FROM table_name; 1. First Way (NOT RECOMMENDED) (Your Server IP may get banned from using ets2map API)(It will make too many requests on ets2map API and we do not want this to happen) https://tracker.ets2map.com/v2/server_id/x/y/radius It will return JSON reponse containing location and truckersmp_id and other information of each truck that is online in that circle in the game on a particular server. The ets2map API provides us to find the location of each and every truck in a particular circle, if you know the center of circle coordinate and its radius. When you will request this URL for each of the cities that your table has, it will generate tremendous amount of load on the server itself <?php foreach($servers as $server){ foreach($city_data as $circle){ $response = json_decode(file_get_contents(https://tracker.ets2map.com/v2/$server->server_id/$circle->x/$circle->y/$circle->radius)); //CACHE HERE } } ?> The variable $response will pull in data of each online truck in every iteration. So you will need to cache it. Put this script in a cronjob that will run after a specific period of time and then you can fetch the data from the locally stored cache rather than requesting for data every time a user requests it. I am also assuming that you have TruckersMP id of your Drivers in your VTC Management system. So once the data of each city as per server is cached, You can only find the drivers that belong to your VTC. I will not be discussing this part bcoz I am assuming you already know this. $server has mapping of server_id to server names. REMEMBER: server id on truckersmp API is different from ets2map API. Make sure you manually check it and create the required table accordingly. I have messaged 'Tuxy Fluffyclaws' some time ago regarding this above issue. Got no response. 2. Second Way (RECOMMENDED) (Your server will be the one who is doing work here)(Only 1 request will be sent to ETS2MAP API) I am assuming you have created the city_data table which has all the coordinates and radius of city that you want to check for as shown above. <?php $response = json_decode(file_get_contents(http://tracker.ets2map.com/v2/fullmap)); //FILTER THIS RESPONSE SO that it has only your own VTC drivers. foreach($city_data as $circle){ //TRAVERSE THE RESPONSE HERE foreach($response->trucks AS $truck){ //WE NEED TO FIND WHETHER THAT TRUCK LIES INSIDE THAT CIRCLE OR NOT if(sqrt(pow(($circle->x - $truck->x),2)+pow(($circle->y - $truck->y),2)) <= $circle->radius){ //TRUCK is in this city //push the data of the truck in an array. array_push(data fetched from $truck) } } //array will have all the location of trucks in a particular city. //CACHE this array and mark it as trucks in $circle->city_name. //EMPTY ARRAY for next iteration of city. } ?> Instead of caching the above result, you can show the output to a user whenever they request the page. Once again i would suggest putting this script in a cronjob. When a user fetches for information.. you would only need to fetch data from cached files. In the above script, you will get data from every server.. not one particular server.. if you want to find server also it can done using $truck->server --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- I never really liked this response.. they never made it public. Someone (allegedly) already had access to the documentations/or verbally told, while the rest of the community did not. It is not limited to cities.. and it does not have to be a circle.. It can be of any shape and size. I hope the above written stuff helps the community in creating their desired applications. There are endless things you can do with the ETS2MAP API (thank you devs for this) <3
  3. GoalE

    Found a Bug by Getting Banned

    Still waiting for some sort of acknowledgement / confirmation / explanation on this matter. Another Rant in spoiler below.. Not forcing anyone to read.
  4. The Server List API is showing a different server id as compared to ETS2MAP api. you might have to manually add the correct id with their server names in a table. Example: server_name server_id ETS2 EU2 2 ETS2 EU4 7
  5. Its very easy to find out TruckersMP ID if you know the Player id & Server. Here is the PHP code: <?php $give_pid = $_POST['p_id'];// Input this from html form. $give_server = $_POST['server']; // There can be multiple people with same pid on different servers. so we take server as input also $url = "http://tracker.ets2map.com/v2/fullmap"; $response = file_get_contents($url); $trucks = json_decode($response); foreach($trucks->Trucks AS $truck){ if($truck->p_id == $give_pid && $truck->server == $give_server){ $find_mp_id = $truck->mp_id; $flag=0; break; }else{ $flag=1; } if($flag != 1){ echo $find_mp_id; }else{ echo "Not Found"; } //SERVER ID can be found here https://api.truckersmp.com/v2/servers ?> WARNING: The API that is returning server info shows wrong server id. For all those who are saying its not possible.. please do some research. Then come to a conclusion.
  6. GoalE

    How to make a job logger

    If you don't want to build PC Application.... there is another alternative. Requires only Online Application: You will need to create an HTML form where your VTC members can submit the information manually. I have seen some VTC use this instead of a PC application. No matter what.. you will be needing an Online platform though.
  7. GoalE

    How to make a job logger

    Making a job logger consists of two things: 1. PC application 2. Some sort of server side application Details: 1 . PC APPLICATION: You need to build some sort of PC application that should collect data from game and send it as POST/GET to a webpage. More details in the post below 2 . Online Application: This is where the magic happens. You will need to setup a database. Make sure you make logins for your VTC members. Since you will need some sort of identification to distinguish between jobs that are submitted to you via the POST/GET method. You will need to build your own web application to present the data in a presentable form. Alternatives: 1. Virtual Trucking Manager This is a pre-built application for job logging. 2. Jammerxd Refer to this if u want to make your own Web Application. It already has a PC application. It can also be used to track people LIVE. Resources: https://github.com/Funbit/ets2-telemetry-server I hope this helps!
  8. Topic Title: In-game name not showing correctly on Appeal Page TruckersMP ID: 1180771 How to reproduce: Make sure to have different names on TruckersMP and Steam. Do something so that you get banned(This is for the testing purposes only, I am not encouraging anyone to break TruckersMP rules). On the appeal page, you will see the wrong name under this category "Your In-game name when banned" Source: My appeal page - https://truckersmp.com/appeals/view/74093 (I have attached a screenshot of the appeal page if you are not able to see it, I believe admins can.) Evidence - http://imgur.com/zWCRjpM As you can see that the person who got banned in-game has a different name as compared to the appeal page. Possible Fixes below in Spoiler below ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
×