Jump to content

AdmiralMorketh

Members
  • Content Count

    24
  • Donations

    0.00 GBP 
  • Joined

  • Last visited

Community Reputation

0 Neutral

About AdmiralMorketh

  • Rank
    Junior Member
  • Birthday November 6
  1. Now i just ran into a problem of getting a new IP from my ISP and i wrote a little script that im using on a Cronjob (written in perl) to grab the External IP address and updating the information in the realmlist table to help in keeping a steady connection this is the ipupdate.pl (i keep mine in the bin directory of mangos) #!/usr/bin/perl -w # DBI is the standard database interface for Perl # DBD is the Perl module that we use to connect to the Mysql database # LWP will be used for using web addresses use LWP::Simple; use DBI; use DBD::mysql; use warnings; #---------------------------------------------------------------------- # grab the external ip of our server for updating chomp(my $eip = get('http://ifconfig.me/ip')); print "External IP: ",$eip,"\n"; # open the accessDB file to retrieve the database name, host name, user name and password open(ACCESS_INFO, "<..\/etc\/dynRealm") || die "Can't access login credentials: ..\/etc\/dynRealm"; # assign the values in the accessDB file to the variables my $database = <ACCESS_INFO>; my $host = <ACCESS_INFO>; my $userid = <ACCESS_INFO>; my $passwd = <ACCESS_INFO>; # the chomp() function will remove any newline character from the end of a string chomp ($database, $host, $userid, $passwd); # close the accessDB file close(ACCESS_INFO); #---------------------------------------------------------------------- # invoke the ConnectToMySQL sub-routine to make the database connection $connection = ConnectToMySql($database); # set the value of your SQL query $querySel = "SELECT id,name,address FROM realmd.realmlist WHERE id = 1"; $queryIns = "UPDATE realmd.realmlist SET address = ? WHERE id = 1"; # prepare your statement for connecting to the database $statement = $connection->prepare($queryIns); $statement2 = $connection->prepare($querySel); # execute your SQL statement $statement->execute($eip); $statement2->execute(); # retrieve the values returned from executing your SQL statement @data = $statement2->fetchrow_array(); # print the first (and only) value from the @data array # we add a \n for a new line (carriage return) print join("\t",@data),"\n"; # exit the script exit; #--- start sub-routine ------------------------------------------------ sub ConnectToMySql { #---------------------------------------------------------------------- my ($db) = @_; # assign the values to your connection variable my $connectionInfo="dbi:mysql:$db;$host"; # make connection to database my $l_connection = DBI->connect($connectionInfo,$userid,$passwd); # the value of this connection is returned by the sub-routine return $l_connection; } #--- end sub-routine -------------------------------------------------- here is the dynRealm file i have mine set up in the mangos/etc directory (sticking with the style of the developers) realmd localhost USERNAME PASSWORD change the USERNAME and PASSWORD fields to match your installation this script can be ran using a cron job (and because an ISP shouldnt really change your lease very offten you can safely run this about once a week or you can also place the perl script (Above) in your /etc/cron.weekly/ to let the cron daemon run this on a weekly basis if you do this you should also change the paths in this line: open(ACCESS_INFO, "<..\/etc\/dynRealm") || die "Can't access login credentials: ..\/etc\/dynRealm"; to match the location of your dynRealm connection file As a note you dont need FULL database permissions for this user only need UPDATE and SELECT on realmd
  2. another solution utilized by myself and a few friends is to set up 2 entries in the realm list one with the WAN IP and the second with the LAN IP if you would like to hide the LAN realm from anyone else you may set the allowedSecurityLevel field or even setting the realm in a different timezone would do the trick
  3. I have reproduced the results with both level 4 and level 0 accounts, after a brand new compile as of last night. also the bug didn't seem to "work" until AFTER purchasing the flight skills.

Contact Us

To contact us click here
You can also email us at [email protected]

Privacy Policy | Terms & Conditions

Repositories

The Link to the master list
of MaNGOS repositories:
Copyright © getMaNGOS. All rights Reserved.

This website is in no way associated with or endorsed by Blizzard Entertainment®
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use