]> code.citadel.org Git - citadel.git/commitdiff
stuff
authorArt Cancro <ajc@citadel.org>
Mon, 22 Feb 1999 03:57:46 +0000 (03:57 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 22 Feb 1999 03:57:46 +0000 (03:57 +0000)
daphne/citclient.cpp
daphne/citclient.hpp
daphne/daphne
daphne/userlogin.cpp

index 3ef6c9d1f1200da80c6e4c997b5ee4eae2256521..d7d6ea20ee4d61b2b835a157bf2dc285aa04c3ee 100644 (file)
@@ -22,6 +22,7 @@ int CitClient::attach(const wxString& host, const wxString& port) {
        if (sock.IsConnected()) {
                serv_gets(ServerReady);
                // FIX ... add check for not allowed to log in
+               initialize_session();
                return(0);
        }
        else return(1);
@@ -68,6 +69,7 @@ bool CitClient::IsConnected(void) {
 void CitClient::serv_gets(wxString& buf) {
        char charbuf[2];
 
+       buf.Empty();
        do {
                sock.Read(charbuf, 1);
                if (isprint(charbuf[0])) buf.Append(charbuf[0], 1);
@@ -122,3 +124,39 @@ int CitClient::serv_trans(wxString& command) {
        wxString junkbuf;
        return serv_trans(command, junkbuf);
 }
+
+// Set up some things that we do at the beginning of every session
+void CitClient::initialize_session(void)  {
+       wxStringList info;
+       wxString sendcmd;
+       wxString recvcmd;
+       int i;
+       wxString *infoptr;
+       wxString infoline;
+
+       sendcmd = "IDEN 0|6|000|Daphne";
+       serv_trans(sendcmd);
+
+       sendcmd = "INFO";
+       if (serv_trans(sendcmd, recvcmd, info)==1) {
+               for (i=0; i<info.Number(); ++i) {
+                       infoptr = (wxString *) info.Nth(i)->GetData();
+                       infoline.Printf("%s", infoptr);
+                       switch(i) {
+                       case 0:         SessionID       = atoi(infoline);
+                       case 1:         NodeName        = infoline;
+                       case 2:         HumanNode       = infoline;
+                       case 3:         FQDN            = infoline;
+                       case 4:         ServerSoftware  = infoline;
+                       case 5:         ServerRev       = atoi(infoline);
+                       case 6:         GeoLocation     = infoline;
+                       case 7:         SysAdmin        = infoline;
+                       case 8:         ServerType      = atoi(infoline);
+                       case 9:         MorePrompt      = infoline;
+                       case 10:        UseFloors       = ((atoi(infoline)>0)
+                                                       ? TRUE : FALSE);
+                       case 11:        PagingLevel     = atoi(infoline);
+                       }
+               }
+       }
+}
index bc5ceaece079c6c4789b572f901553f11bde9019..cf533093fb617f73ea09b27807a8ff6114b0848e 100644 (file)
@@ -4,11 +4,11 @@ class CitClient {
 public:
        CitClient(void);
        ~CitClient(void);
+
+       // High-level Citadel IPC methods
        int attach(const wxString& host, const wxString& port);
        void detach(void);
        bool IsConnected(void);
-       void serv_gets(wxString& buf);
-       void serv_puts(wxString buf);
        int CitClient::serv_trans(
                        wxString& command,
                        wxString& response,
@@ -16,9 +16,27 @@ public:
                         );
        int CitClient::serv_trans(wxString& command, wxString& response);
        int CitClient::serv_trans(wxString& command);
+
+       // Various things we learn about the server
+       int SessionID;
+       wxString NodeName;
+       wxString HumanNode;
+       wxString FQDN;
+       wxString ServerSoftware;
+       int ServerRev;
+       wxString GeoLocation;
+       wxString SysAdmin;
+       int ServerType;
+       wxString MorePrompt;
+       bool UseFloors;
+       int PagingLevel;
+
 private:
+       void serv_gets(wxString& buf);
+       void serv_puts(wxString buf);
        wxSocketClient sock;
        wxIPV4address addr;
+       void CitClient::initialize_session(void);
 };
 
 
index effaa714a9f1b2edd750cd5491988cbe2d6e369d..9effde8b2369c1b01361bcb021a9bd18b82841cc 100755 (executable)
Binary files a/daphne/daphne and b/daphne/daphne differ
index 553ac45fb88c7d8d7a6df2f9940e8c3912b9cd89..da81a83d7247dbdd684d1d9ab4ee657b13bca377 100644 (file)
@@ -131,6 +131,36 @@ UserLogin::UserLogin(CitClient *sock, wxMDIParentFrame *MyMDI)
                "exit_button"
                );
 
+
+       wxPanel *hnodepanel = new wxPanel(this, -1, wxDefaultPosition,
+                       wxDefaultSize, 0L, "");
+       hnodepanel->SetBackgroundColour(wxColour(0x00, 0x00, 0x77));
+       hnodepanel->SetForegroundColour(wxColour(0xFF, 0xFF, 0x00));
+
+       wxStaticText *humannode = new wxStaticText(
+               hnodepanel, -1, citsock->HumanNode,
+               wxDefaultPosition, wxDefaultSize, 0, "");
+       humannode->SetBackgroundColour(wxColour(0x00, 0x00, 0x77));
+       humannode->SetForegroundColour(wxColour(0xFF, 0xFF, 0x00));
+       humannode->SetFont(wxFont(24, wxDEFAULT, wxNORMAL, wxNORMAL,
+                               FALSE, ""));
+
+       wxLayoutConstraints *t0 = new wxLayoutConstraints;
+       t0->top.SameAs(this, wxTop, 10);
+       t0->height.SameAs(this, wxTop, 50);
+       t0->left.SameAs(this, wxLeft, 10);
+       t0->right.SameAs(this, wxRight, 10);
+       hnodepanel->SetConstraints(t0);
+
+       wxLayoutConstraints *t1 = new wxLayoutConstraints;
+       t1->top.SameAs(this, wxTop, 10);
+       t1->height.AsIs();
+       //t1->left.SameAs(this, wxLeft, 10);
+       //t1->right.SameAs(this, wxRight, 10);
+       t1->centreX.SameAs(this, wxCentreX);
+       t1->width.AsIs();
+       humannode->SetConstraints(t1);
+
        wxLayoutConstraints *c1 = new wxLayoutConstraints;
        c1->bottom.SameAs(this, wxBottom, 10);          // 10 from the bottom
        c1->centreX.SameAs(this, wxCentreX);            // in the middle