Azuriom/Plugin-Vote

Support to new verified websites (RU)

Closed this issue · 8 comments

The problem currently is that there are no Russian monitoring sites from the list of Azureum servers for awarding votes:(

Sites that can be added:

  1. https://minecraftrating.ru/
  2. https://topcraft.club/
  3. https://minecraft-statistic.net/
  4. https://mctop.su/

Could you send the link to the API documentation for these websites ?

Could you send the link to the API documentation for these websites ?

they provide files with a script to connect to the site

mctop.su
topcraft
minecraft-statistic.net you have to ask them at the post office (info@minecraft-statistic.net )
minecraftrating.ru

Could you send the link to the API documentation for these websites ?

I already have written some code for support, but I don’t know how to properly get IPs of players and get api keys from Azuriom settings
I’ll send here these code, it works, but bad

It seems that they check themselves for this so as not to vote several times from one IP

@MrMicky-FR check out that

        $this->register(VoteVerifier::for('minecraftrating.ru')
            ->requireKey('api_key')
            ->verifyByPingback(function (Request $request) {
                $username	= $request->input('username');
                $ip		  	= $request->input('ip');
                $timestamp	= $request->input('timestamp');
                $signature	= $request->input('signature');
                                                            // This is api key from minecraftrating.ru panel
                $signature_serv = sha1($username.$timestamp."5c3eeeb0d33c6fdc2bf8d0de4b64d8");

                abort_if($signature === null, 401);

                if ($signature === $signature_serv) {
                    Cache::put("vote.sites.minecraftrating.ru.{$ip}", true, now()->addMinutes(10));

                    return response()->noContent(200);
                }

                return response()->noContent(403);
            }));
        $this->register(VoteVerifier::for('mctop.su')
            ->requireKey('api_key')
            ->verifyByPingback(function (Request $request) {
                $username	= $request->input('nickname');
                $signature	= $request->input('token');


                abort_if($signature === null, 401);
                                                // This is api key from mctop.su panel
                $signature_serv = md5($username."510dcfcbe9f5271a059fb40a0c003573");

                if ($signature === $signature_serv) {
                    $receiver = User::firstWhere('name', $username);
                    Cache::put("vote.sites.mctop.su.{$receiver->last_login_ip}", true, now()->addMinutes(10));

                    return response('ok', 200);
                }

                return response()->noContent(403);
            }));

        $this->register(VoteVerifier::for('hotmc.ru')
            ->requireKey('api_key')
            ->verifyByPingback(function (Request $request) {
                $username	= $request->input('nick');
                $time       = $request->input('time');
                $signature	= $request->input('sign');

                abort_if($signature === null, 401);
                                                        // This is api key from hotmc.ru panel
                $signature_serv = sha1($username.$time."FVwUYjgO0kxriPqC3JFatUjVw1gNmA");

                if ($signature == $signature_serv) {
                    $receiver = User::firstWhere('name', $username);
                    Cache::put("vote.sites.hotmc.ru.{$receiver->last_login_ip}", true, now()->addMinutes(10));

                    return response('ok', 200);
                }

                return response()->noContent(403);
            }));

It seems that they check themselves for this so as not to vote several times from one IP

I'm telling about another thing, hotmc and mctop doesn't send an IP of player with success vote request, so I get last_login_ip from DB, but it may be not user's IP at this moment.
And I didn't write code for getting an api_key from admin panel settings.

oh okay