Register to post in forums, or Log in to your existing account
 

This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.     Home » Forums » zExplorer Discussion
gpouliot
Beginner


Joined: 13 Jun 2004
Posts: 11
Location: Canada

PostPosted: Sun Jun 13, 2004 6:35 pm   

Database Server Scripts Questions
 
Zugg,

First off, let me say that I'm experienced with PHP (not an expert, but experienced). In fact, I've even design a similar PHP backend for a program that a friend of mine made. I'm definately not having trouble with the PHP or MySQL.

Before I get to the questions, I also wanted to mention a "bug" that I found with the PHP scripts. When your scripts create the various tables, they created them with a capital first leter (Ex. Games, Users etc). Unfortunately, most of the php pages reference the databases in lower case (Ex. games, users etc). Most databases that I know of are case sensitive. Before the scripts would even work, I had to go in and change all the sql commands in the PHP scripts to the same case so that they would work. If you changed this in your zip file, it would go a long way to making your scripts easier for users to setup.

For reference, Here's what I'm trying to setup:

I want to setup a server for my friends and I to keep track of our progress in AC. The server is at zexplorer.circleofsocius.com. If anyone wants to test it out, you can use the users name test (password=test).

Now on to the Questions:

Question #1:

ZExplorer seems to require an existing MDB file. What would be the best way to create one for Asheron's Call? For testing, I simply emptied the one that ZExplorer uses for AC, renamed it and uploaded it to my site. This seems to work, but I need to make sure that this is what I should be doing.

Question #2:

What the heck should my usergame.txt file look like? Here's the one I'm presently using.

quote:
[Asheron's Call (private)]
BaseURL=http://zexplorer.circleofsocius.com/
cgiGetLoc=getloc.php?gameid=1&lastmodified=<yr>-<mon>-<day>
cgiAddLoc=POST:addloc.php?gameid=1&<ObjTbl.*>&username=<username>&password=<userpass>
cgiEditLoc=POST:addloc.php?gameid=1&locid=<objid>&<ObjTbl.*>&username=<username>&password=<userpass>
cgiAddLocType=POST:addloctype.php?gameid=1&LocType=loc&typeid=<KindTbl.KindID>&<KindTbl.*>&username=<username>&password=<userpass>
cgiAddExitType=POST:addloctype.php?gameid=1&LocType=exit&typeid=<ExitKindTbl.ExitKindID>&<ExitKindTbl.*>&username=<username>&password=<userpass>
cgiAddNote=POST:addnote.php?gameid=1&<NoteTbl.*>&username=<username>&password=<userpass>
cgiEditNote=POST:addnote.php?gameid=1¬eid=<noteid>&<NoteTbl.*>&username=<username>&password=<userpass>
cgiLogin=POST:login.php?username=<username>&password=<userpass>
cgiNewUser=POST:adduser.php?username=<username>&password=<userpass>&userdisp=<displayname>&useremail=<useremail>&showemail=<showemail>
cgiEditUser=POST:edituser.php?username=<username>&password=<newpass>&DispName=<displayname>&Email=<useremail>&ShowEmail=<showemail>&UserPerformingAction=<username>&UserPassword=<userpass>
cgiDeleteLoc=POST:setloc.php?gameid=1&locid=<objid>&value=true&username=<username>&password=<userpass>
cgiDeleteNote=POST:setnote.php?gameid=1¬eid=<noteid>&value=true&username=<username>&password=<userpass>
cgiReportLoc=POST:report.php?gameid=1&locid=<objid>&problem=<problem>&reason=<reason>&username=<username>&password=<userpass>
cgiReportNote=POST:report.php?gameid=1&locid=<objid>¬eid=<noteid>&problem=<problem>&reason=<reason>&username=<username>&password=<userpass>
DBName=privateplaces.mdb
FileURL=http://zexplorer.circleofsocius.com/Files/
FileList=11/18/2002,privateplaces.mdb|11/18/2002,dereth.gif
tag_ObjectTbl=location
tag_NoteList=notes
tag_NoteTbl=comment
DefItem=4
ShowNS=1
FlipY=-1
DateForm=yyyy-mm-dd
Marker=23




I basically copied the AC2 information from Zexplorer.txt and made changes as needed. However, I'm not sure if I've done everything correctly.

Question #3:
When I try to add items to the database in ZExplorer, it seems to work but gives an error message most of the time. When I attempt to publish a location, it says "Error publishing location.". The thing is, it does update the remote MySQL database. I'm not sure why it's giving an error message. When I get an error, the database doesn't seem to be updated correctly. For one thing, the KindID is usually 0 and the IconID is always -1. That's probably not correct?

Question #4:

I can't seem to get ZExplorer to update itself from the database (possibly because of Question #3). Last night, it was generating a valid update.xml file, but now it's always empty. I obviously changed something to stop it from working (probably in my usergame.txt file). However, even when it did generate perfect usable update.xml files, the local database wasn't updating with information from the server.



So, that's my questions. If anyone (Zugg?) is interested in helping me out, it would be much appreciated. If you copy my usergame.txt info from question #2 and use the username and password of test, you can even try things out. However, it's obviously not working correctly right now
Reply with quote
gpouliot
Beginner


Joined: 13 Jun 2004
Posts: 11
Location: Canada

PostPosted: Mon Jun 14, 2004 12:38 am   
 
Ok, I've made some progress...

By using the following information in my usergame.txt file:

quote:
[Asheron's Call (private)]
BaseURL=http://zexplorer.circleofsocius.com/
cgiGetLoc=getloc.php?gameid=1&lastmodified=<yr>-<mon>-<day>
cgiAddLoc=POST:addloc.php?gameid=1&<ObjTbl.*>&username=<username>&password=<userpass>
cgiEditLoc=POST:addloc.php?gameid=1&locid=<objid>&<ObjTbl.*>&username=<username>&password=<userpass>
cgiAddLocType=POST:addloctype.php?gameid=1&LocType=loc&typeid=<KindTbl.KindID>&<KindTbl.*>&username=<username>&password=<userpass>
cgiAddExitType=POST:addloctype.php?gameid=1&LocType=exit&typeid=<ExitKindTbl.ExitKindID>&<ExitKindTbl.*>&username=<username>&password=<userpass>
cgiAddNote=POST:addnote.php?gameid=1&<NoteTbl.*>&username=<username>&password=<userpass>
cgiEditNote=POST:addnote.php?gameid=1¬eid=<noteid>&<NoteTbl.*>&username=<username>&password=<userpass>
cgiLogin=POST:login.php?username=<username>&password=<userpass>
cgiNewUser=POST:adduser.php?username=<username>&password=<userpass>&userdisp=<displayname>&useremail=<useremail>&showemail=<showemail>
cgiEditUser=POST:edituser.php?username=<username>&password=<newpass>&DispName=<displayname>&Email=<useremail>&ShowEmail=<showemail>&UserPerformingAction=<username>&UserPassword=<userpass>
cgiDeleteLoc=POST:setloc.php?gameid=1&locid=<objid>&value=true&username=<username>&password=<userpass>
cgiDeleteNote=POST:setnote.php?gameid=1¬eid=<noteid>&value=true&username=<username>&password=<userpass>
cgiReportLoc=POST:report.php?gameid=1&locid=<objid>&problem=<problem>&reason=<reason>&username=<username>&password=<userpass>
cgiReportNote=POST:report.php?gameid=1&locid=<objid>¬eid=<noteid>&problem=<problem>&reason=<reason>&username=<username>&password=<userpass>
DBName=privateplaces.mdb
FileURL=http://zexplorer.circleofsocius.com/Files/
FileList=9/23/2002,privateplaces.mdb|9/25/2002,dereth.gif
tag_ObjectTbl=location
tag_NoteList=notes
tag_NoteTbl=comment
ShowNS=1
FlipY=-1
DateForm=y-m-d
Marker=23


I am now able to create new Locations. This information updates to the remote database correctly (without errors).

Now I'm experiencing a new problem. The xml file that generates is not completely correct. For some reason, some of the tags are not being completed correctly.

If anyone wants to check it out (using the info in the first post), you're more than welcome too. Presently updating works, but retrieving the information is speratic. It seems to work, but the xml file is not formated correctly and certain things don't display correctly. Notes is a good example. If you enter a note, it will upload to the database correctly. However, if you clear your local database and try to synchronize with the remote database, the notes are corrupted.

I guess I'll keep plugging away and post my progress. I'm pretty close to getting this working.
Reply with quote
gpouliot
Beginner


Joined: 13 Jun 2004
Posts: 11
Location: Canada

PostPosted: Mon Jun 14, 2004 5:28 am   
 
Ok, I figured out why I was having problems updating earlier.

In the process of testing, I recreated my game database several times. However, I didn't realize that my gameid was changing. If you change your game id, you have to update the usergame.txt file accordingly. More specifically, you have to update the gameid line in all of your "cgi" lines (Ex. cgiAddLoc=POST:addloc.php?gameid=1&<ObjTbl.*>&username=<username>&password=<userpass>)

I mentioned in my last post that the update.xml file wasn't being formated correctly. I figured out what the problem was. When everything is setup correctly (and you can updated the database correctly), the desc field is filled in. This field has a bunch of text which is mistaken by IE as actual XML (instead of just raw text). It seems that only IE has a problem with this and Zexplorer is fine with it. In the end it's not an issue.

Ok, now that I have that solved, I've run another problem. This time, I think it might be a problem with Zexplorer.

The comments aren't working correctly when you do a refresh. I have confirmed that they are being stored correctly in the database and also been retrieved correctly (in the xml file).

Here's an example of a comment (from the xml file):

<notes>
<comment>
<NoteId>1</NoteId>
<ObjID>3</ObjID>
<Note>I love this lifestone</Note>
<Category>0</Category>
<Flags>0</Flags>
<UserID>0</UserID>
<Deleted>false</Deleted>
<Modified>2004-06-13 00:00:00</Modified>
</comment>
</notes>


When I enter the comment, everything is fine. However, if I delete the local database and recreate it (from the web server), the comments are all screwed up. This poster is having a similar problem: http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=15536. The actual note text isn't being recreated correctly. Instead of storing "I love this lifestone" in the note field, it stores "1</NoteId> <ObjID>3</ObjID> <Note>I love this lifestone".

It looks like the xml parser is starting at <NoteId> instead of <Note> when it retrieves the comment text.

I don't know if this is something that I can fix or not. Since the script doesn't presently handle the description field for locations, using comments is the only method to describe a location. I was really looking forward to setting this up. However, without the ability to save descriptions and the problem with commments, I can't really use these scripts. I guess I'm going to have to wait patiently and hope this gets resolved.
Reply with quote
gpouliot
Beginner


Joined: 13 Jun 2004
Posts: 11
Location: Canada

PostPosted: Mon Jun 14, 2004 6:49 am   
 
Smile

I found a work around for the comment problem. Since Zexplorer was mistaking <NoteId> for <Note>, I simply renamed the NoteID field in the NoteTbl table to NtId.

That solves the problem and everything seems to be working great. Now, I can use comments as a work around while I wait patiently for desc support to be added. Smile

P.S.

Zugg, I'll zip up the script files and send them too you. With the minor changes I made, it makes them much more user friendly (ex. they work now without needing to be modified.. Smile ).
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jun 14, 2004 9:18 pm   
 
Definitely send me the updated scripts and I'll post that to the zuggsoft.com site. I'm pretty busy with the Emobius email client project right now and really don't have much time to play with these scripts. So, I've very happy that someone with some PHP and MySQL experience is taking a close look at them and improving them. I'm sure everyone else who wants to run a server will really appreciate the help you have provided.

I think the usergame.txt file was documented in one of the files that come with the scripts. If not, it's possible that it is in the zExplorer help file. I'm sure I remember documenting it somewhere. But as you found, the best way is to copy the existing file and experiment. And yes, the gameid needs to be changed for each new game you add to match the gameid in your server database.

The zMapper program is intended to be used to create the initial MDB file. That is also the program that is used to set the scaling between the database coordinate system and the background image files, for example. That is also the program used to create the various icons for each location type. So, I start with zMapper, create the initial map file the way I want it, then use that as the starting point for adding locations with zExplorer. It's actually easier to add the actual locations in zExplorer since the user interface is a bit better.

Thanks again for posting your experience on getting this to work.
Reply with quote
gpouliot
Beginner


Joined: 13 Jun 2004
Posts: 11
Location: Canada

PostPosted: Tue Jun 15, 2004 3:35 am   
 
Ok, I've sent you the updated files.

If you ever need help testing future versions, I'd be more than happy to give them a once over. I'm no PHP expert, but I can sure let you know if I have issues getting the scripts running on my server.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jun 16, 2004 6:48 pm   
 
Oh, sorry, I should have mentioned this, but please send them to the sales@zuggsoft.com account. The main support account filters messages with attachments that don't specifically mention zMUD or AC Explorer. I haven't gotten anything yet, so I think it got filtered.
Reply with quote
gpouliot
Beginner


Joined: 13 Jun 2004
Posts: 11
Location: Canada

PostPosted: Thu Jun 17, 2004 7:31 am   
 
Ok, I've sent the updated script files to sales@zuggsoft.com. The title of the email is "Database Server Script Updates". Please make sure to read through the entire email before taking any action. If you wish to contact me directly, you can either contact me through the email address I sent you the files from or the one listed on my profile on this site. Thanks.
Reply with quote
gpouliot
Beginner


Joined: 13 Jun 2004
Posts: 11
Location: Canada

PostPosted: Mon Jun 21, 2004 5:04 am   
 
Did you get my email?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jun 21, 2004 9:35 pm   
 
Hmm, wierd, I haven't ever gotten anything. Was it bigger than a 5MB attachment? I wouldn't think so since it's just scripts, but that's the only limit on the sales account.
Reply with quote
gpouliot
Beginner


Joined: 13 Jun 2004
Posts: 11
Location: Canada

PostPosted: Mon Jun 21, 2004 10:11 pm   
 
I'll tell you what. When I get home, I'll zip up the files and upload them to my web server. I'll post the location here once I've done that.
Reply with quote
gpouliot
Beginner


Joined: 13 Jun 2004
Posts: 11
Location: Canada

PostPosted: Tue Jun 22, 2004 1:05 am   
 
Zugg,

Ok, I've uploaded the file to my site. You can download it here: http://www.circleofsocius.com/files.zip. Please read the readme for details on what I did.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jun 22, 2004 8:11 pm   
 
Thanks very much for your help on this!! I read your readme file and I understand what you did. Yes, the zExplorer XML parser is pretty basic...it's not even really a parser. Now that I have access to some better XML tools, I'll probably eventually fix this, but not anytime soon since I'm busy with the eMobius project right now. So, I'll go ahead and post both of your problems along with a modified version of the readme file that explains the problem and the fix.

Hopefully I'll get time to update the web page and post these scripts later in the week.

I'll also look into using these versions of the scripts on the zuggsoft.com site to fix any issue people might be having with updating Notes on Horizons, SWG, or AC2.
Reply with quote
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Home » Forums » zExplorer Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
© 2009 Zugg Software. Hosted on Wolfpaw.net