View Single Post
  #6  
Old 10-10-2005, 02:28 PM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

you should be able to do this entirely in perl...
the best way I can say to do it is this..
make a directory on your server named 'locales' somewhere, let the path be /home/eqemu/locales. Make it writeable by the user running eqemu.

use a perl command like (check this syntax, im winging it):
Code:
sub commands_init() {
  command_add("locale", "Set your locale", 0);
}

sub locale {
  my $loc = shift;
  if($loc eq "") {
    $client->Message(13, "You must specify a locale: en or fr");
    return;
  }
  my $name = $client->GetName();
  open(F, ">/home/eqemu/locales/$name");
  print F "$loc";
  close(F);
}
then make a plugin:
Code:
sub get_locale {
  my $name = shift;
  open(F, "</home/eqemu/locales/$name");
  my $loc = <F>;
  close(F);
  return($loc);
}

then you can write a quest like:
Code:
sub EVENT_SAY {
  my $locale = plugin::get_locale($name);
  if($locale eq 'en') {
    #....
  } else {#.....
  }
}
}
[/code]

Last edited by fathernitwit; 10-11-2005 at 07:33 PM..
Reply With Quote