RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

PHP scripts for MyRunUO

Voran

Wanderer
I'm having three small problems with this -
Firstly, I can't get the paperdoll to display. I've created a uofiles folder in my webspace, and put the gump, gumpidx and tiledata files in there. I've also put the paperdoll art into the images folder - all I get is the dread red x of doom.
Secondly, the date last updated is displaying wrong - it's reading 14/09/2004 as 09/14/2004 - or "last updated February 9, 2005". I'm not competent enough in php to fix this.
Thirdly, I have a lot of custom gump art in my verdata - how do I set it to read gumps from verdata as well as gump.mul?

Superb script!
 

panther

Sorceror
Voran said:
I'm having three small problems with this -
Firstly, I can't get the paperdoll to display. I've created a uofiles folder in my webspace, and put the gump, gumpidx and tiledata files in there. I've also put the paperdoll art into the images folder - all I get is the dread red x of doom.
Secondly, the date last updated is displaying wrong - it's reading 14/09/2004 as 09/14/2004 - or "last updated February 9, 2005". I'm not competent enough in php to fix this.
Thirdly, I have a lot of custom gump art in my verdata - how do I set it to read gumps from verdata as well as gump.mul?

Superb script!
To troubleshoot the paperdoll you can start by trying to load the paperdoll directly using something like:
http://domain.com/myrunuo/paperdoll.php?id=555
Make sure you leave $validhosts blank when you do this or it will fail to load. If you don't get any errors to show up this way then check your logs.

As for the timestamp, it appears that PHP's strtotime function regards a date string such as "3/5/04" based on U.S. format which would translate to March 5th, 2004, while your system is storing the date string in the SQL database in the more popular format that would be "5/3/04" for the same date. While the best solution would be for MyRunUO (the server side of it) to store dates as a UNIX timestamp, the most immediate solution is to rearrange the timestamp string after it's loaded from the database. Since I need to publish a version 1.01 anyway (fixes some display problems of special characters in character and guild names), I'll see about adding a switch for this.
 

Voran

Wanderer
D'oh - simple fix in the end. It seems my website is picky: Tiledata instead of tiledata caused the problems.

One last query - is there any way to make the viewer view the verdata files, so I can display my custom clothes?
 

panther

Sorceror
Voran said:
D'oh - simple fix in the end. It seems my website is picky: Tiledata instead of tiledata caused the problems.

One last query - is there any way to make the viewer view the verdata files, so I can display my custom clothes?
Sounds like your web server isn't running Windows. Only Windows is non-case sensitive.

Yes, I'm sure there is a way to make the viewer view the verdata files. I'll be glad to post the modified version once you're done. <g>
 

weaselboy246

Wanderer
Ok, i feel pretty stupid, i can't configure my MYSQL to work... and somehow the localhost got un-privileged.... I can't do a single thing to it.... anyone know the counter?
 

panther

Sorceror
weaselboy246 said:
Ok, i feel pretty stupid, i can't configure my MYSQL to work... and somehow the localhost got un-privileged.... I can't do a single thing to it.... anyone know the counter?
I believe you can start clean again simply by shutting down your MySQL server then delete everything in your mysql\data directory and start the server back up.
 

panther

Sorceror
MyRunUO PHP 1.01

I've posted version 1.01 which includes fixes for some display errors where html codes were showing up in player and guild names.
 

kiss

Sorceror
timestamps

Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in c:\www\bbs\myrunuo\status.php on line 188

oh...I got this error too. Anyone can help solve it?
 

panther

Sorceror
Timestamp problem

kiss said:
Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in c:\www\bbs\myrunuo\status.php on line 188

oh...I got this error too. Anyone can help solve it?
A fix for the timestamp issue (a problem with timestamps not being stored in GNU standard format) would be to replace the following:

Code:
if ($timestamp != "")
  $dt = date("F j, Y, g:i a", strtotime($timestamp));
else
  $dt = date("F j, Y, g:i a");

with:

Code:
if ($timestamp != "") {
  $tsa = explode("/", $timestamp);
  $timestamp = $tsa[1]."/".$tsa[0]."/".$tsa[2];
  $dt = date("F j, Y, g:i a", strtotime($timestamp));
}
else
  $dt = date("F j, Y, g:i a");

These strings appear in status.php, players.php, guilds.php, guild.php, and skills.php.
 

Igon

Wanderer
MySql on DMZ

Web Server Setup:
-- Windows 2000 Server
-- IIS
-- PHP
-- MySql
-- MySQL ODBC 3.51 driver

Network Setup:
-- RunUO server on LAN side of Firewall
-- Web Server on DMZ side
-- All ports from the LAN to DMZ are open

Files edited:
Config.cs
-- public static bool Enabled = true;
-- public static string DatabaseDriver = "{MySQL ODBC 3.51 Driver}";
-- public static string DatabaseServer = "###.###.###.###"; //DMZ Address of server
-- public static string DatabaseName = "MyRunUO";
-- public static string DatabaseUserID = "root";
-- public static string DatabasePassword = "********"; //root password

myrunuo.inc.php
-- $SQLhost = "localhost";
-- $SQLport = "3306";
-- $SQLuser = "root";
-- $SQLpass = "********";
-- $SQLdb = "myrunuo";

Everything compiles fine but RunUO cannt connect to mysql:
MyRunUO: Updating Status Database
MyRunUO: Unable to connect to the database
System.Data.Odbc.OdbcException: Error [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
at System.Data.Odbc.OdbcConnection.Open()
at Server.Engines.MyRunUO.DatabaseCommandQueue.Thread_Start()


-- Edit 1 --

Installd MySQL ODBC Driver on Shard Server, now the error reported is:
MyRunUO: Updating Status Database
MyRunUO: Unable to connect to the database
System.Data.Odbc.OdbcException: Error [HY000] [MySQL][ODBC 3.51 Driver] Access denied for user 'root@Stuff' (Using password: YES)
ERROR [HY000] [MySQL][ODBC 3.51 Driver] Access denied for user 'root@Stuff' (Using password: YES)
at System.Data.Odbc.OdbcConnection.Open()
at Server.Engines.MyRunUO.DatabaseCommandQueue.Thread_Start()

root@% has All Global Privlidges


-- Edit 2 --
Solved above issue by adding an IP address specific user into MySQL (although I would thing root@% sould have worked)
[UpdateMyRunUO now completes successfully and the tables are populated.

New error when [UpdateWebStatus is run:
MyRunUO: Updating Status Database
MyRunUO: Excption caught in database thread
System.Data.Odbc.OdbcException: ERROR[HY000] [MySQL][ODBC 3.51 Driver] [mysqld-4.0.18-nt]Column count doesn't match value count at row 1
at System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle, SQL_HANDLE hTyte, RETCODE retcode)
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject (CommandBehavior behavior, String method)
at System.Data.Odbc.OdbcCommand.ExecuteNonQuery()
at Server.Engines.MyRunUO.DatabaseCommandQueue.Thread_Start()
MyRunUO: Status database updated in 0.0 Seconds


-- Edit 3 --
Solved above issue by replacing the following line in MyRunUOStatus.cs
Code:
m_Command.Enqueue( String.Format( "INSERT INTO myrunuo_status VALUES ({0})", mob.Serial.Value.ToString() ) );
with
Code:
m_Command.Enqueue( String.Format( "INSERT INTO myrunuo_status (char_id, char_location, char_map, char_Karma, char_fame) VALUES ({0},'{1},{2},{3}','{4}',{5},{6})", mob.Serial.Value.ToString(), mob.X.ToString(),mob.Y.ToString(),mob.Z.ToString(), mob.Map, mob.Karma, mob.Fame  ));


-- Edit 4 --
My last issue is the ever popular Red X.
Where would uofiles and ultima.dll need to be placed for a phpbb install.
I have tried several different locations with no success. Here is my current directory structure.
-- Domain Home Directory c:\Inetpub\wwwroot\phpBB2
-- MyRunUO Home Directory: c:\Inetpub\wwwroot\phpBB2\myrunuo

When trying to go directly to the paperdoll.php as suggested by Panther i get the following error: (http://domain.com/myrunuo/paperdoll.php?id=555)

-- Fatal error: Call to undefined function: imagecreatefrompng() in C:\Inetpub\wwwroot\phpBB2\myrunuo\paperdoll.php on line 396
 

panther

Sorceror
Igon said:
-- Edit 3 --
Solved above issue by replacing the following line in MyRunUOStatus.cs
It sounds like you're not using the updated MyRunUO package (not included with my PHP package).

Igon said:
-- Edit 4 --
-- Fatal error: Call to undefined function: imagecreatefrompng() in C:\Inetpub\wwwroot\phpBB2\myrunuo\paperdoll.php on line 396
Your PHP does not have this function. Either it's too old of a version or you just don't have the php_gd2.dll extension enabled (check your INI file).
 

Igon

Wanderer
Thanks for your help.
panther said:
It sounds like you're not using the updated MyRunUO package (not included with my PHP package).
I am using the MyRunUO package from the following link:http://142.179.148.248/MYRunUO-1.0-RC0.zip, But like a dope, i didnt replace the scripts with the new ones.


panther said:
Your PHP does not have this function. Either it's too old of a version or you just don't have the php_gd2.dll extension enabled (check your INI file).
You are correct, my PHP.ini file had that extension commented out. Not only that, but there was no php_gd2.dll anywhere on the server.
I just downloaded the zipped PHP file and extracted the extensions folder. That fixed it right up.

One minor issue left. On the guild.php page, only some of the players have links to their paperdoll, while on players.php, all are linked.

What am I missing?
 

panther

Sorceror
Igon said:
One minor issue left. On the guild.php page, only some of the players have links to their paperdoll, while on players.php, all are linked.
I'm not sure, I don't see how it could list a member without having a link. Unless you mean that it just won't take you to the page when you click it?
 

DaLaw66

Sorceror
Blank paperdoll!

Hello all
I extracted everything, set it all up and it works exept for one small problem
The paperdoll image is empty



Please assist!
 

panther

Sorceror
DaLaw66 said:
Hello all
I extracted everything, set it all up and it works exept for one small problem
The paperdoll image is empty
Well, it's good that the paperdoll comes up at least....
Two things I can think of:
One is that perhaps there's a problem reading your .mul files.
Two is that for some reason your database isn't getting updated with the character layers data. Try logging into your database and run the following:
SELECT * FROM myrunuo_characters_layers WHERE char_id=2;
(replacing the character ID number with one that matches your character)
This should list something along the lines of:
Code:
+---------+----------+---------+----------+
| char_id | layer_id | item_id | item_hue |
+---------+----------+---------+----------+
|       2 |       13 |    5055 |        0 |
|       2 |        9 |    5128 |        0 |
|       2 |        7 |    8269 |     1149 |
|       2 |        6 |    5099 |        0 |
|       2 |        5 |    5139 |        0 |
|       2 |        4 |    5441 |     1433 |
|       2 |        3 |    5102 |        0 |
|       2 |        2 |    5899 |     1306 |
|       2 |        1 |    5054 |        0 |
|       2 |        0 |    5397 |     1302 |
+---------+----------+---------+----------+
If it returns an empty set then there's a problem with either the database table or your MyRunUO routines that are in RunUO.
 

DaLaw66

Sorceror
Ok, so this is what I got for char 2001, and its still blank on paperdoll the paperdoll (for 2001)
char_id layer_id item_id item_hue
2001 0 7939 0
2001 1 8251 1102
 

Igon

Wanderer
panther said:
I'm not sure, I don't see how it could list a member without having a link. Unless you mean that it just won't take you to the page when you click it?
I mean, on the page showing all the members from a particular guild (guild.php), only some people have links to the paperdoll page (player.php). The others have no link at all.

When you go to the page that lists all players (players.php), everybody has a link to player.php.

I am thinking that once the player logs on and the databases are updated, that is what triggers the link to get set. See attached screenshot.

 

Viky

Wanderer
Igon said:
I mean, on the page showing all the members from a particular guild (guild.php), only some people have links to the paperdoll page (player.php). The others have no link at all.

When you go to the page that lists all players (players.php), everybody has a link to player.php.

I am thinking that once the player logs on and the databases are updated, that is what triggers the link to get set. See attached screenshot.

I have same problem.
 
Top