im not sure if this will help any but this is how i view role names via php
PHP Code:
<?php
$GameServer = "localhost";
$GamedbPort = "29400";
$userid = "1024"; //Change User ID to what ever user id you want :)
function grin($data)
{
if($data < 64)
return strrev(pack("C", $data));
else if($data < 16384)
return strrev(pack("S", ($data | 0x8000)));
else if($data < 536870912)
return strrev(pack("I", ($data | 0xC0000000)));
return strrev(pack("c", -32) . pack("I", $data));
}
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if(!$sock)
{
die(socket_strerror(socket_last_error()));
}
if(socket_connect($sock, $GameServer, $GamedbPort))
{
socket_set_block($sock);
$data = grin(3401)."\x08\x80\x00\x00\x01".pack("N", $userid);
$sbytes = socket_send($sock, $data, 8192, 0);
$rbytes = socket_recv($sock, $buf, 8192, 0);
$strlarge = unpack( "H", substr( $buf, 2, 1 ) );
if(substr($strlarge[1], 0, 1) == "8")
{
$start = 12;
}
else
{
$start = 11;
}
$rolescount = unpack( "c", substr( $buf, $start, 1 ) );
$start = $start+1;
$top ="<center><font color=Red><b> Your Role's</b></center></font>
<center><table border cellpadding=1 overflow=auto height=50px width=450px>
<td width='200' align='center'><font color=#6599FF>Role_id</td>
<td width='200' align='center'><font color=#6599FF>Name</td>
</font></tr>";
echo $top;
for($nothing=0; $i<$rolescount[1]; $i++)
{
$roleid = unpack( "N", substr( $buf, $start, 4 ) );
$start = $start+4;
$namelarge = unpack( "c*", substr( $buf, $start, 1 ) );
$start = $start+1;
$rolename = iconv( "UTF-16", "UTF-8", substr( $buf, $start, $namelarge[1] ) );
$start = $start+$namelarge[1];
$roles_acc .= "<tr>
<td><center><b><font color=Red> {$roleid[1]} </font></b></center></td>
<td><center><b><font color=Red> {$rolename} </font></b></center></td>";
}
echo $roles_acc;
$bot = "</table><br /><br />";
echo $bot;
}
?>