EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Thin Client (https://www.eqemulator.org/forums/showthread.php?t=41783)

bushman77 02-27-2018 12:25 PM

Thin Client
 
Been playing around with some server studies and i stumbled on to something of interest?

Ive created a simple perl script which posts a site and returns only the variable which stores the server response. (the webserver type does not matter only needs to be configured with a custom route to accept requests from this script (in this case it is a POST request).
The server then can then respond with a string embedded with perl commands

test.pl:
Code:

sub EVENT_SAY {
  if ($text=~/hail/i) {
    use strict;
    use warnings;
    use LWP::UserAgent;
   
    my $url = 'http://localhost:4000/api';
    my $ua      = LWP::UserAgent->new();
    my $response = $ua->post( $url, { 'player' => $name, 'npcid' => 105 } );
    my $content  = $response->decoded_content();
    $content;
  }
}

Found out i can change quests on the fly without needing to issue #reloadquest
Could even use it for character transfers between servers easily aswell

N0ctrnl 02-27-2018 03:37 PM

Code tags homie.


All times are GMT -4. The time now is 04:48 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.