G
G
German Shestak2020-11-20 14:16:02
Android
German Shestak, 2020-11-20 14:16:02

To make the correct request to the game server (I am writing a bot)?

Good day to all. I was puzzled by the question of writing a bot for the game (for the most part, because I have free time, I want to do something)
I downloaded Fiddler, I track requests. I was able to log in, get profile information, although not without torment, after all, this is my first experience.
Stopped on such a problem. Take some action.

The request code that I caught:

Request

POST https://pvppru2s00.plrm.zone/GeoPortalRus2/Segment... HTTP/1.1
Host: pvppru2s00.plrm.zone
Connection: keep-alive
Content-Length: 339
sign-code: 83c580cfdeed86942844d42829808fdf5cbb701c4f8f772579e6454aae018ea9
Origin: https://cdn01.x-plarium.com
signin-session:
signin-userId:
server-method: Buy
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
client-ver: 628
signin-authSeed:
X-Requested-With: ShockwaveFlash/23.0.0.162
signin-authKey:
locale-name: ru-RU
Content-Type: text/html
client-type: 1
Accept: */*
Referer: https://cdn01.x-plarium.com/geo/new_client/prod/pp...
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9

{"km":19,"sm":[],"y":null,"t":1605869739556,"o":{"s":0,"n":false,"g":false,"o":{"tci":null,"i":8,"bi":{},"t":102,"d":null,"gi":{"m":false,"x":45,"s":0,"y":13,"z":0},"c":{"s":null,"d":false,"f":null,"l":1},"ti":null}},"u":1605869552930,"sb":0,"q":[79,33,68,70,71,72,73,74,75,76,45,46,47,48,81,50,77,20,53,54,55,80,30,78],"g":186626,"r":468}

If my sign-code does not change during authorization (at least 2 days), then other requests come with their own code (it’s understandable, but you can somehow fake it, because the bot for this game has existed for about years 5)
Where can I get the rest of the parameters that I know I deleted in HEADERS, just in case.
There is a question about sign-code, where does it come from. Is it encryption for HTTPS or is it simpler? How to make your own?
And the second question is about the strange timestamp. "u":1605869552930 -> this is the login time, how to get know. But I am very embarrassed that it is 3 digits more than the real one. Moreover, if these figures are cut off, then the translation turns out to be quite normal time. Very strange for me, I hope that someone came across this.
In general, I understand that it is necessary to collect the same requests in one heap and see what changes in them, thanks to this I learned to pull out a lot of information from the response that comes after authorization, but problems began in the rest of the information. For example "g": 186626, it changes very strange, but it doesn't seem to be random.

In general, what to do, how to be?)
UPD: node.js indicated, as I plan to write a bot on it

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
doctorcat, 2016-09-15
@doctorcat

codepen.io/anon/pen/VKazBQ

B
bot8, 2016-09-15
@bot8

d6055785cb734be9b704740eb77a003f.png

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="#D4D7DC"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center_horizontal">
    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="30dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="dark"
            android:layout_marginTop="20dp"
            android:layout_marginLeft="10dp"
            android:layout_marginBottom="20dp"
            android:text="Какой-то текст..."
            android:textSize="17dp"/>
    </android.support.v7.widget.CardView>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="250dp"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:weightSum="100">
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:layout_marginBottom="-6dp"
            android:layout_marginTop="-6dp"
            android:src="@drawable/Desert" />
    </LinearLayout>
    <android.support.v7.widget.CardView
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="dark"
            android:layout_marginTop="20dp"
            android:layout_marginLeft="10dp"
            android:layout_marginBottom="20dp"
            android:text="Какой-то Другой текст..."
            android:textSize="17dp"/>
    </android.support.v7.widget.CardView>
</LinearLayout>

M
mitaichik, 2016-09-15
@mitaichik

Look in the direction of android:scaleType, there seemed to be something like that

V
Vladimir, 2016-09-16
@naivekook

you should be like this

<android.support.v7.widget.CardView
   <LinearLayout>
       <TextView/>
       <ImageView/>
       <TextView/>
   </LinearLayout>
</android.support.v7.widget.CardView>

A
Alex Rubera, 2016-09-22
@alx

The solution with two CardViews proposed above had to be abandoned, because. in my opinion, this contradicts the very concept of CardView ("one card - one CardView"). Therefore, I replaced them with RelativeLayout and set the indents like this:

<LinearLayout>
    <RelativeLayout
        ...
        android:layout_marginStart="10dp"
        android:layout_marginEnd="10dp">
        <TextView />
        <TextView />
    </RelativeLayout>
    <ImageView />
    <RelativeLayout
        ...
        android:layout_marginStart="10dp"
        android:layout_marginEnd="10dp">
        <TextView />
        <TextView />
    </RelativeLayout>
</LinearLayout>

Now I'm thinking how to properly raise the picture and cast a shadow. I try like this:
<ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:scaleType="fitCenter"
        android:elevation="2dp"
        android:background="@drawable/image_bg"/>

where
<!-- res/drawable/image_bg.xml -->
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <stroke android:width="2dip" android:color="#4e4e4e" />
</shape>

But the result is not the same.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question