|
Pages: [1]
|
 |
|
Author
|
Topic: Webmap For SFC3 Need SFC2 Minds for help!!! (Read 918 times)
|
S31-Riptide
Ensign
Offline
Gender: 
Posts: 142
|
One way to get your attention  I've been working on a conversion for Webmap to SFC3... I've gotten most of it done... but.... I still can't get the news to show up properly.... anyone with experience in webmap if you can point me in the right direction, it would be greatly appreciated! I'm not that strong in PhP, but the info being grabbed from the database is pure text, hence why I'm confused as to why it is not showing up as text???? http://www.gameserver.sfc3.net/wm/I don't have the IRC hooked up yet, as I'm still waiting for the connection info from Scratch.  here is the php script in question.... I did have to rename the "Idiom" to "MessageEnglish" as there is a slight difference between the sfc2 db and the sfc3 db... is the Idiom column in sfc2 text or hex??? anyone know??? Thanks in advance... Here is the php script.... $ID = array(); $PersistenceLevel = array(); $UrgencyLevel = array(); $Category = array(); $MessageEnglishSize = array(); $MessageEnglish = array(); $NewsTime = array(); $TimeDetail = array(); $Color = array();
$MessageEnglishtext = ""; $MessageEnglishtextcorr = ""; $testchar = ""; $test=0;
$caturgcolor = array(); $caturgcolor[0][0] = "#B6B7FE"; $caturgcolor[0][1] = "#A9A9F1"; $caturgcolor[0][2] = "#9594E0"; $caturgcolor[0][3] = "#8282CE"; $caturgcolor[0][4] = "#6C6CBA"; $caturgcolor[0][5] = "#5B5CAA"; $caturgcolor[1][0] = "#EB873D"; $caturgcolor[1][1] = "#DE7032"; $caturgcolor[1][2] = "#CE5524"; $caturgcolor[1][3] = "#BE3B18"; $caturgcolor[1][4] = "#AF210B"; $caturgcolor[1][5] = "#A20C01"; $caturgcolor[2][0] = "#00EB72"; $caturgcolor[2][1] = "#00D668"; $caturgcolor[2][2] = "#00BC5B"; $caturgcolor[2][3] = "#00A44F"; $caturgcolor[2][4] = "#008A42"; $caturgcolor[2][5] = "#007639";
$link = mysql_connect($D2dbhostname .":" .$D2dbport, $D2dbuser, $D2dbpass); mysql_select_db($D2db);
$query = "SELECT UrgencyLevel,Category,MessageEnglish FROM newsstory ORDER BY NewsTime,MessageEnglish"; $result = mysql_query($query); $a=0; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$UrgencyLevel[$a] = $line['UrgencyLevel']; $Category[$a] = $line['Category']; $MessageEnglish[$a] = $line['MessageEnglish'];
$a=$a+1; } mysql_free_result($result); mysql_close($link);
echo ("<br>"); for ($i=$a;$i--;) { for ($j=0; $j<strlen($MessageEnglish[$i])/2; $j++) { $MessageEnglishtext.=chr(base_convert(substr($MessageEnglish[$i],$j*2,2),16,10)); }
$test=0; for ($k=0; $k<strlen($MessageEnglishtext)-1; $k++) { $testchar = substr($MessageEnglishtext, $k, 1); if($testchar == ".") { $MessageEnglishtextcorr = substr($MessageEnglishtext, $k+2); $test=1; } if($testchar == "!") { $MessageEnglishtextcorr = substr($MessageEnglishtext, $k+2); $test=1; } } if($test == 0) { $MessageEnglishtextcorr = substr($MessageEnglishtext, 1); }
echo ("<b>"); echo ("<font color="); echo $caturgcolor[$Category[$i]][$UrgencyLevel[$i]]; echo (">");
echo $MessageEnglishtextcorr; echo ("</font>"); echo ("</b><br><br>");
$MessageEnglishtext = ""; $MessageEnglishtextcorr = ""; }
|
|
|
|
« Last Edit: August 26, 2006, 04:48:36 pm by Riptide »
|
Logged
|
|
|
|
Bonk
Ringworld Child
Administrator
Captain
Offline
Posts: 9420
Tanj!
|
The news idioms are stored as a blob in the OP database, but are stored as plain text in the SFC3 database. SFC3 news table: create table NewsStory ( ID bigint not null, Locked DateTime, LockID int,
PersistenceLevel bigint not null, UrgencyLevel bigint not null, Category bigint not null, MessageEnglish text not null, MessageGerman text not null, NewsTime bigint not null, TimeDetail bigint not null, Color bigint not null,
primary key (ID) );
SFC:OP news table CREATE TABLE newsstory ( ID int(11) NOT NULL default '0', LOCKED datetime default NULL, LOCKID int(11) default NULL, PersistenceLevel int(11) NOT NULL default '0', UrgencyLevel int(11) NOT NULL default '0', Category int(11) NOT NULL default '0', IdiomSize int(11) NOT NULL default '0', Idiom blob NOT NULL, NewsTime int(11) NOT NULL default '0', TimeDetail int(11) NOT NULL default '0', Color int(11) NOT NULL default '0', PRIMARY KEY (ID) ) TYPE=MyISAM;
So you can just dump the code that translates the blob into plain text and try something like this: <?php $UrgencyLevel = array(); $Category = array(); $MessageEnglish = array();
$caturgcolor = array(); $caturgcolor[0][0] = "#B6B7FE"; $caturgcolor[0][1] = "#A9A9F1"; $caturgcolor[0][2] = "#9594E0"; $caturgcolor[0][3] = "#8282CE"; $caturgcolor[0][4] = "#6C6CBA"; $caturgcolor[0][5] = "#5B5CAA"; $caturgcolor[1][0] = "#EB873D"; $caturgcolor[1][1] = "#DE7032"; $caturgcolor[1][2] = "#CE5524"; $caturgcolor[1][3] = "#BE3B18"; $caturgcolor[1][4] = "#AF210B"; $caturgcolor[1][5] = "#A20C01"; $caturgcolor[2][0] = "#00EB72"; $caturgcolor[2][1] = "#00D668"; $caturgcolor[2][2] = "#00BC5B"; $caturgcolor[2][3] = "#00A44F"; $caturgcolor[2][4] = "#008A42"; $caturgcolor[2][5] = "#007639";
$link = mysql_connect($D2dbhostname .":" .$D2dbport, $D2dbuser, $D2dbpass); mysql_select_db($D2db); $query = "SELECT UrgencyLevel,Category,MessageEnglish FROM NewsStory ORDER BY NewsTime,MessageEnglish"; $result = mysql_query($query); $a=0; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $UrgencyLevel[$a] = $line['UrgencyLevel']; $Category[$a] = $line['Category']; $MessageEnglish[$a] = $line['MessageEnglish']; $a=$a+1; } mysql_free_result($result); mysql_close($link); $news_html = '<br> '; for ($i=$a;$i--;) { $news_html .= '<b><font color="'. $caturgcolor[$Category[$i]][$UrgencyLevel[$i]]. '">'. $MessageEnglish[$i]. '</font></b><br><br> '; } echo $news_html; ?>
Quite a bit simpler and should work for you. (<?php ?> tags added to code snippet here for forums syntax highligting only).
|
|
|
|
« Last Edit: August 27, 2006, 09:42:01 am by Bonk »
|
Logged
|
Reality is what doesn't go away when you stop believing in it. - Philip K. Dick
|
|
|
Bonk
Ringworld Child
Administrator
Captain
Offline
Posts: 9420
Tanj!
|
I just had a look at your link and noticed a few things...
The stardate is not correct. It looks like they have stripped some of the blobs from the database and are storing the values as integers (makes good sense). So, on the index page code you should modify the stardate code accordingly, just ditch the blob conversion stuff and use the integers from the db to caclulate the stardate directly.
It also looks like the racelist is no longer stored as a blob, so you will want to modify its code accordingly and edit the racenames in the webmap config file for SFC3 as well.
The map itself poops out on a max execution time error (30s). The SQL webmap should only take a second or two to generate. I suspect that it is generating loads of undefined index errors on the webserver related to the lack of a cartel layer on the SFC3 map (which will increase the execution time hideously as it logs all those errors). Strip all the cartel layer related code and that ought to help.
It will help considerably if you have access to the webserver logs to see what errors are actually being generated.
The two dynaverse server database creation queries are attached for comparison to aid in your conversion.
|
|
|
« Last Edit: August 27, 2006, 08:58:20 am by Bonk »
|
Logged
|
Reality is what doesn't go away when you stop believing in it. - Philip K. Dick
|
|
|
S31-Riptide
Ensign
Offline
Gender: 
Posts: 142
|
Thanks Bonk... you are the undisputed Ubber Dynaverse Man!!!
|
|
|
|
|
Logged
|
|
|
|
Chris Jones
MOD PRODUCER
Lt.
Offline
Gender: 
Posts: 532
Galaxy Class - as seen in DS9
|
Riptide =
Did you get this to work in any form yet?
I'm thinking of setting up a D3 for my Mega Mod..
|
|
|
|
|
Logged
|
..Because the game does not have to remain the same.. The Future of Star Trek does NOT lie in the past - as in.. Star Trek XI: The Wonder Years - will flop..  Celebrating the 20th Anniversary of TNG.. Favorite TNG: Yesterday's Enterprise 
|
|
|
S31-Riptide
Ensign
Offline
Gender: 
Posts: 142
|
Chris, I've gotten the MySQL portion working but, mysql is just as unstable in sfc3 as sfc2 if not a bit more... we've been doing some testing with it.. I'm still trying to track down the version someone has done already for SFC3 for the flatfile. I'm struggling with the flatfile conversion. 
|
|
|
|
|
Logged
|
|
|
|
|
|
S31-Chuck
Section 31 CO
Ensign
Offline
Posts: 10
|
So far it seems stable and running well... I love the MySQL and real time updates in the viewer.
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |