logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Real World Time
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Wed Jan 02, 2008 0:55    Post subject: Reply with quote

I'll see what else you need to cope with a VS2008 build.

Visual Studio 2008 - vcredist
Guessing it has some extra stuff over the VS2005 version.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Clisair



Joined: 27 Jun 2006
Posts: 9

PostPosted: Wed Jan 02, 2008 21:38    Post subject: Reply with quote

Sorry, but if I have to install all this and all that then your plugin is not going to work. To me the deffinition of a plugin is that you just plug it in. I don't recall anything being said that so much would be needed to just run a dll file with nwnx2.

Since this is not going to work, could you point me in the direction of being able to do this with scripting and sqlite?

*sigh*

I really need another scripter to help....
_________________
Firinn Of Elisair
http://www.elisair.com/
Back to top
View user's profile Send private message Visit poster's website
Disco



Joined: 06 Dec 2006
Posts: 152

PostPosted: Thu Jan 03, 2008 12:06    Post subject: Reply with quote

I was on holidays, so didn't check this during the last week.

I don't want to sound ungrateful (I am not, I understand you are busy) but Clisair has a point about plugins not going well with additional installs. I can't use your work either now, simply because I don't have install rights on our server. I doubt I am the only one not having his own rig running the game.

I guess the reason I didn't spot this with the first version of the new plugin is me having installed Visual C++ 2005 when testing it, and removing most of that before I checked out the next one.
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Thu Jan 03, 2008 16:07    Post subject: Reply with quote

Yeah, I appreciate that...

It'll be 12-18 months before commercial/open source applications appear using the latest Visual Studio offerings. - then you'll HAVE the redist packs installed, or you'll have an installer do it.
I've got to move (move with) my Dev team, so no choice on the upgrades.

This is one of the many reasons why I've supplied my source - Anyone can retro-fit it to their own needs. Unfortunately there are not too many active developers visiting the boards.

This code/functionality is also slated to be included in the official 'Time' plugin. I don't know how far off that release is.

Cheers
Gryphyn
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Jan 03, 2008 16:19    Post subject: Reply with quote

The preferred VS version for NWNX2 development is VS 6.0.
I couldn't recompile it with VS 6.0 because it's using wxWidgets.
BTW, the base class definition is incorrect. The base class in NWNX2 is CNWNXBase.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Disco



Joined: 06 Dec 2006
Posts: 152

PostPosted: Mon Jan 07, 2008 12:23    Post subject: Reply with quote

Anyway, is there a way to get it working without installing a lot of extra stuff? Isn't it possible to import the libs in your plugin? I guess most people would mind a big dll less than a install puzzle, really.
Back to top
View user's profile Send private message
milliorn



Joined: 03 Jun 2006
Posts: 29

PostPosted: Sat Apr 05, 2008 9:57    Post subject: Reply with quote

THANK YOU for putting this available. I got it to work with an without the Redistribution Package. I been wanting something like this for a while, an thought I show my appreciation for it Very Happy I did encounter the problems posted on this thread, but careful reading got me through it Smile Downloading the Package is not really a problem imo for the gain.
Back to top
View user's profile Send private message
hedgehog



Joined: 05 Jun 2008
Posts: 2

PostPosted: Thu Jun 05, 2008 18:06    Post subject: Solution for SQLite Reply with quote

I'm using SQLite, too. And had trouble with this. But it's really simple, at the end.

Code:

// This works fine with SQLite:
string sDate;
string sSQL = "SELECT datetime('now','localtime')";
SQLExecDirect(sSQL);
if(SQLFetch() == SQL_SUCCESS)
    sDate = SQLGetData(1);
else
    sDate = "Database error";

// Don't know if MySQL has the function datetime. So try to get the time in another way, if datetime not worked.
// _Should_ work with MySQL, operating system independent.
if(sDate == "Database error")
{
    sSQL = "SELECT CURRENT_TIMESTAMP";
    SQLExecDirect(sSQL);
    if(SQLFetch() == SQL_SUCCESS)
        sDate = SQLGetData(1);
    else
        sDate = "Database error");
}


You get the Timestamp in the string sDate, with which you can work at your will. I'm only using this to set the correct Moduletime/-date corresponding to the realworld-date in the OnModuleLoad.
You have to include "aps_include", of course.
It's a 24h-format: sDate = "YYYY-MM-DD HH:MM:SS". Don't know what's given back in countries which are not using the international time-format (e.g. the US), but should be the same anywhere.
The Realtime plugin is much more comfortable. But its not suitable where you cannot install on or running a non Windows-Server.

The strange thing is, aps/nwnx includes current_timestamp in it's defined functions for SQLite. But it's saved as a string with the content "current_timestamp" in the database. *wonder* Maybe it's a problem with newer versions of SQLite ODBC drivers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
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


Powered by phpBB © 2001, 2005 phpBB Group