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!

Full instructions for myrunuo (02/13/04)

Ceday

Page
hmz, are you sure you started your SQL server?
because before that transaction error, it says unable to connect DB.

Zulu, i think he has 1.1, otherwise it doesnt even compile.
 

Zulu

Wanderer
char_guild is a number that points to the guild database.

I fixed....
char_guildtitle should be both varchar..(table:myrunuo_characters)
 

Zulu

Wanderer
In mysql directory C:\mysql\bin

double click on the file winmysqladmin.exe

It is the mysql admin program. you can start/stop mysql from there and check stats.
 

Ceday

Page
string guildId = ( mob.Guild == null ? "NULL" : mob.Guild.Id.ToString() );

it is INT but its converted to string in the scripts. So, it should be varchar.

Actually, default scripts could be more efficient. Some boolean values are stored as char too, instead of bit value. Actually efficient is not the right word but it would more appropriate..
 

tobagin

Sorceror
Zulu said:
tobagin said:
mySQL database is over internet, could that be a problem?

Yes, that is the problem...

I am not even close to being an expert in mysql. You might have to open the correct ports on the firewall and proper account to access stuff. The best thing is check out the docs.

Some documents are located...
http://www.mysql.com/documentation/mysql/bychapter/index.html

wouldn't runuo connect the same way on a database in my computer or over internet?
 

Ceday

Page
if you followed the instructions completely,

public static string DatabaseName = "deshard"; //should be "MyRunUO"

btw, edit your post : ip, username, password, all of them are there..
 

tobagin

Sorceror
thanks for show me that the ip, username, password, all of them are there..
but in my database I created a database with the name deshard and not MyRunUO
 

Zulu

Wanderer
MySQL uses port 3306 by default and you will have to make sure that site you are connecting has that port open in the firewall.
 

Zulu

Wanderer
I have not written a bunch of asp.net scripts. I have put together a script to access the mysql database and display info. I am not sure how to get it to have a hyper link in it.

<a href='player.aspx?id=char_id'>char_public</a>

If you have updates or tips, updates to this or any scripts please post them.

players.aspx
[code:1]<%@ Page Language="C#" ClassName="DisplayNamesPage" AutoEventWireup="False"
EnableSessionState="False" EnableViewState="False" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Odbc" %>

<script runat="server">
private const string ConnStr = "Driver={MySQL ODBC 3.51 Driver};" +
"Server=localhost;Database=MyRunUO;uid=;pwd=;option=3";

protected override void OnInit(EventArgs e)
{
base.OnInit(e);

using(OdbcConnection con = new OdbcConnection(ConnStr))
using(OdbcCommand cmd = new OdbcCommand("select char_id,char_name,char_public from myrunuo_characters WHERE char_public = '1' ORDER by char_name", con))
{
con.Open();
dgrAllNames.DataSource = cmd.ExecuteReader(
CommandBehavior.CloseConnection |
CommandBehavior.SingleResult);
dgrAllNames.DataBind();
}
}
</script>

<html>
<head>
<title>Shard Players</title>
<style>
body { font: 100% Verdana; }
</style>
</head>
<body>

<p align="center">All records in the 'myrunuo table:</p>

<asp:DataGrid ID="dgrAllNames" HorizontalAlign="Center" CellPadding="3" Runat="server" />[/code:1]
 

stormwolff

Knight
Thanks for sharing your ideas on myrunuo zulu

Ok I setup my database and added the players.asp to my server.

The players.asp loads the list of players names but when I click on one of the names it does not load the player+id page is it supposed to?

http://www.stormowlf.org/players.asp

[code:1]<html>
<head>
<title>Shard Players</title>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%
' open mysql database.
strConn = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=MyRunUO;User Id=*******;Password=*******;"
Set con = Server.CreateObject("ADODB.Connection")
con.Open strConn

' execute sql statement.
Set rs = con.Execute("select char_id,char_name,char_public from myrunuo_characters WHERE char_public = '0' ORDER by char_name")

' if not end of file, then IF is true.
if NOT rs.eof then

'get all data from database.
alldata=rs.getrows

'cycle through all records and display hyper link with shard player.
for tempcol=0 to ubound(alldata,2)
response.write "<a href='player.asp?id=" & alldata(0,tempcol) & "'>" & alldata(1,tempcol) & "</a>"
next
else
response.write "No players could be found."
end if
%>
</body>
</html>
[/code:1]
 

Zulu

Wanderer
stormwolff, the player.asp is posted in the next message below.

I was hoping someone would fix the asp.net version and I could have included their fixes.
 

Zulu

Wanderer
This is what I have done already. This version you can download includes:

- asp version of the player.asp page.
**this one does all the work, it creates the paperdoll, skills, etc**
- mysql tables for myrunuo database.
- standard & enhanced paperdoll images.
- asp, php and asp.net version of other files.

http://142.179.148.248/myrunuo.zip

to do:
- include a working version of asp.net
- finish the player.asp for .php
- finish the guild.asp page

**I am doing this in free time and sometimes I do not always catch errors or have time to test right now. Any help will not be ignored.**

**can anyone help with writing java code that will read mul files and extract the paperdoll image and hue.**
 

tobagin

Sorceror
Here is my help to you

player.php
[code:1]<? $id=$HTTP_GET_VARS["id"]; ?>
<html>
<head>
<title>View Player</title>
<style>
.pd {
position: absolute;
top : 55px;
left : 118px;
}
.pdstatus{
position: absolute;
top : 272px;
left : 296px;
}
.pdname{
position: absolute;
top : 304px;
left : 150px;
width : 184px;
height : 38px;
}
.pdback{
position: absolute;
top : 40px;
left : 110px;
}
.pdskill{
position: absolute;
top : 380px;
left : 40px;
width: 366px;
height: 105px;
}

</style>
</head>

<body bgcolor="#ffffff" text="#000000" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">

<?
if ($id!="")
{


$strConn="DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=MyRunUO;User Id=;Password=;";
// $con is of type "ADODB.Connection"

$a2p_connstr=$strConn
$a2p_uid=strstr($a2p_connstr,'uid');
$a2p_uid=substr($d,strpos($d,'=')+1,strpos($d,';')-strpos($d,'=')-1);
$a2p_pwd=strstr($a2p_connstr,'pwd');
$a2p_pwd=substr($d,strpos($d,'=')+1,strpos($d,';')-strpos($d,'=')-1);
$con=mysql_connect("localhost",$a2p_uid,$a2p_pwd);
mysql_select_db("",$con);

$rs=$rs_query=mysql_query(("select * from myrunuo_characters_layers WHERE char_id = '".$id."' ORDER by layer_id"),$con);
$rs=mysql_fetch_array($rs_query);
$alldata=;
$allrows=count($alldata);

$rs=$rs_query=mysql_query(("select * from myrunuo_characters WHERE char_id = '".$id."'"),$con);
$rs=mysql_fetch_array($rs_query);
$chrdata=;

$rs=$rs_query=mysql_query(("select * from myrunuo_characters_skills WHERE char_id = '".$id."' ORDER by skill_value"),$con);
$rs=mysql_fetch_array($rs_query);
$skilldata=;

$skillnames=array("Alchemy","Anatomy","Animal Lore","Item ID","Arms Lore","Parrying","Begging","Blacksmithing","Bowcraft","Peacemaking","Camping","Carpentry","Cartography","Cooking","Detecting Hidden","Enticement","Evaluating Intel","Healing","Fishing","Forensics","Herding","Hiding","Provocation","Inscription","Lock Picking","Magery","Magic Resistance","Tactics","Snooping","Musicianship","Poisoning","Archery","Spirit Speak","Stealing","Tailoring","Taming","Taste ID","Tinkering","Tracking","Veterinary","Swordsmanship","Macefighting","Fencing","Wrestling","Lumberjacking","Mining","Meditation","Stealth","Remove Trap","Necromancy","Focus","Chivalry");

$char_name=$chrdata[1][0];
$char_female="true";
$char_dir=12+$chrdata[5][0];
if ($chrdata[5][0]==1)
{
$char_female="false";
}
$char_bodyhue=$chrdata[10][0];
if ($char_bodyhue==33770)
{
$char_bodyhue=1001;
}
$char_guild=$chrdata[7][0];
$char_guildtitle=$chrdata[8][0];
$char_nototitle=$chrdata[9][0];
?>

<table width="466" height="540" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<div class="pdback"><img src="images/2001.gif" alt="" width="262" height="324"></div>
<div class="pd"><img src="http://www.riven.ru:9090/sys/returnImages.htm?item=<? echo $char_dir; ?>&hue=<? echo $char_bodyhue; ?>" width="260" height="237"></div>
<div class="pd"><img src="images/50422.gif" alt="" width="260" height="237"></div>
<?
for ($tempcol=0; $tempcol<=$allrows; $tempcol=$tempcol+1)
{

print "<div class='pd'><img src='http://www.riven.ru:9090/sys/returnImages.htm?item=".$alldata[2][$tempcol]."&hue=".$alldata[3][$tempcol]."&male=".$char_female."'></div>";

}

?>
<div class="pdname"><font face="Verdana, Arial" color="white" size="2"><b><? echo $char_nototitle; ?></b></font></div>
</td></tr>

<tr><td align="center" valign="top">
<div class="pdskill">
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align="center"><a href="http://guide.uo.com/skill_<? echo $skilldata[1][0]; ?>.html"><img src="<? echo skillimage($skilldata[1][0]); ?>" border=0 width=125 height=80 alt="<? echo $skillnames[$skilldata[1][0]]; ?>"></a><font face="Arial" color="white" size="2"><? echo $skillnames[$skilldata[1][0]]; ?></font></td>
<td align="center"><a href="http://guide.uo.com/skill_<? echo $skilldata[1][1]; ?>.html"><img src="<? echo skillimage($skilldata[1][1]); ?>" border=0 width=125 height=80 alt="<? echo $skillnames[$skilldata[1][1]]; ?>"></a><font face="Arial" color="white" size="2"><? echo $skillnames[$skilldata[1][1]]; ?></font></td>
<td align="center"><a href="http://guide.uo.com/skill_<? echo $skilldata[1][2]; ?>.html"><img src="<? echo skillimage($skilldata[1][2]); ?>" border=0 width=125 height=80 alt="<? echo $skillnames[$skilldata[1][2]]; ?>"></a><font face="Arial" color="white" size="2"><? echo $skillnames[$skilldata[1][2]]; ?></font></td>
</tr>
</table>
</div></td></tr>

<?
if ($char_guild!="")
{

?>
<tr><td align="center" valign="top">
<?
$rs=$rs_query=mysql_query(("select * from myrunuo_guilds WHERE guild_id = '".$char_guild."' ORDER by guild_name"),$con);
$rs=mysql_fetch_array($rs_query);
$guilddata=;
?>
<font face="Verdana, Arial" color="#000000" size="3"><b>Guild:</b>    <a href="guilds.asp?id=<? echo $guilddata[0][0]; ?>"><? echo $guilddata[1][0]; ?></a></font>
<? } ?>
</td>
</tr>
<?
}


function skillimage($skill)
{
extract($GLOBALS);



$temp="";
if ($skill>=100)
{
$temp="g";
}
$skillimage="images/".$skill.$temp.".gif";

return $function_ret;
}
?>
</table>
</body>
</html>[/code:1]
let me know if anything is wrong because I could not test it yet!
 

Voran

Wanderer
I'm getting an error:
[code:1]F:\mysql\bin>mysql -u root mysql
ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)[/code:1]
I've installed the MySQL in F:, before anyone says.
 

Mortis

Knight
I have all 10 pages of ths post on my harddrive. From before the forum time warp.

Just wondering if I should repost it all.
 

psz

Administrator
Put it on a website, actually... When the "timewarp" gets fixed, I don't think we'll need two copies ;->
 
Top