Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUDs ➜ General ➜ Help With ScratchMUD

Help With ScratchMUD

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3 4  

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #30 on Fri 17 Feb 2006 02:09 AM (UTC)
Message
I don't really know, actually. I just suspect that it's been defined to equal SOCKET, and you haven't included the winsock header files. It's just a random guess, really.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Cash   USA  (626 posts)  Bio
Date Reply #31 on Fri 17 Feb 2006 07:24 AM (UTC)
Message
I think you are right, I recall the same exact problem.

~Nick Cash
http://www.nick-cash.com
Top

Posted by IAmSlime   USA  (26 posts)  Bio
Date Reply #32 on Sat 18 Feb 2006 10:50 PM (UTC)
Message
Contents of Avatar.CPP

///////////////////////////////////////////////////////////
///////////////// Have an itch? Scratch it! ///////////////
///////////////////////// SCRATCH /////////////////////////
///////////////////// A MUD Server ////////////////////
///////////////////// By: Jared Devall ////////////////////
///////////////////// Thanks: ////////////////////
///////////////////// DIKU/Merc/ROM ////////////////////
///////////////////// Aetas/Deus Gang ////////////////////
///////////////////// Beej ////////////////////
///////////////////////////////////////////////////////////


//#include <crypt.h> Gone For Now
#include <cstdarg>
#include <cstdio>
#include <fstream>
#include <map>
#include <mysql/mysql.h>
#include "smysql.h"
#include "avatar.h"
#include "colorTable.h"
#include "stringutil.h"
#include "timestamp.h"

using namespace std;

Avatar::Avatar( ) {
_disconnected = false;
_socket = new Socket;
_gotInput = false;
_status = LOGIN;
}

Would that line "_socket = new Socket;" be the one?

"Life Sucks, Then You Die."
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #33 on Sun 19 Feb 2006 01:13 AM (UTC)
Message
No, we're looking for a typedef or a #define, or something like that.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Cash   USA  (626 posts)  Bio
Date Reply #34 on Sun 19 Feb 2006 05:15 AM (UTC)
Message
The problem lies with the includes that come with Dev-C++, not the code base. Try locating a line like this (winsock.h):

typedef u_int SOCKET;

If it is within an #ifdef, simply move it outside of it.

~Nick Cash
http://www.nick-cash.com
Top

Posted by IAmSlime   USA  (26 posts)  Bio
Date Reply #35 on Sun 19 Feb 2006 06:45 PM (UTC)
Message
/*

Definitions for winsock 1.1

Portions Copyright (c) 1980, 1983, 1988, 1993
The Regents of the University of California. All rights reserved.

Portions Copyright (c) 1993 by Digital Equipment Corporation.
*/

#ifndef _WINSOCK_H
#define _WINSOCK_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif

#define _GNU_H_WINDOWS32_SOCKETS
#include <windows.h>

#ifdef __cplusplus
extern "C" {
#endif

#if !defined ( _BSDTYPES_DEFINED )
/* also defined in gmon.h and in cygwin's sys/types */
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
#define _BSDTYPES_DEFINED
#endif /* !defined _BSDTYPES_DEFINED */
typedef u_int SOCKET;
#ifndef FD_SETSIZE
#define FD_SETSIZE 64
#endif


Ok, that seems to be the section you're talking about, WhiteKnight.. But I don't really understand what your asking me to do.

"Life Sucks, Then You Die."
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #36 on Sun 19 Feb 2006 10:53 PM (UTC)
Message
Actually, we're looking for the definition of my_socket, which is probably defined as being SOCKET, and if SOCKET isn't defined before my_socket, my_socket will not resolve to a useful type...

(does that make any sense?)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by IAmSlime   USA  (26 posts)  Bio
Date Reply #37 on Mon 20 Feb 2006 01:46 AM (UTC)

Amended on Mon 20 Feb 2006 01:47 AM (UTC) by IAmSlime

Message
Err.. Sorta, Ksilyan. I understand the logic of what you're saying. That if SOCKET isn't defined before it's called upon, that's what's causing the error.. But I'm not finding any lines like that, except maybe this one that I commented out earlier to get rid of errors;

// my_socket fd; /* For Perl DBI/dbd (Using Windows, Added By Slime)*/
unsigned long max_packet,max_packet_size;
unsigned int pkt_nr,compress_pkt_nr;
unsigned int write_timeout, read_timeout, retry_count;
int fcntl;
my_bool compress;
/*
The following variable is set if we are doing several queries in one
command ( as in LOAD TABLE ... FROM MASTER ),
and do not want to confuse the client with OK at the wrong time
*/
unsigned long remain_in_buf,length, buf_length, where_b;
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
my_bool no_send_ok;
/*
Pointer to query object in query cache, do not equal NULL (0) for
queries in cache that have not stored its results yet
*/
#endif

I'm shootin' an email to Valiant_Dragon@Yahoo.Com (The Codebase Maker) right now to ask him a few questions as well, but I'm guessin' it could be awhile before he gets back in touch. He seems to be a rather busy person.

"Life Sucks, Then You Die."
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #38 on Mon 20 Feb 2006 05:40 AM (UTC)
Message
No, that probably isn't it. You want to look for typedef xyz my_socket, or perhaps #define my_socket xyz.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Rendelven   (2 posts)  Bio
Date Reply #39 on Mon 20 Feb 2006 01:09 PM (UTC)
Message
Greetings,

I apologize for my website being down. I host it on my own computer and occasionally take it down here and there.

The 'crypt' problem is the same problem every other MUD has. You must have crypt installed correctly on your machine for it to work, or you could comment it out and not have encrypted passwords.

The MySQL problem, however, was my fault. :) I believe Nick got it correct with pointing out that you didn't need the redundant RESULT. You could just do this:

std::vector< LMAP > _info;


I notice you seem to be trying to use the MFC Socket class. If you will look in socket.h/socket.cpp you will see that I have my own SocketServer and Socket class defined.

With the 2 errors above properly fixed and MySQL properly installed you shouldn't have any problems compiling the code.

R.
Top

Posted by Nick Cash   USA  (626 posts)  Bio
Date Reply #40 on Mon 20 Feb 2006 04:01 PM (UTC)
Message
The problem is, in fact, that SOCKET is not defined when my_socket is defined, which is defined as SOCKET. The headers and #ifdefs that come with Dev-C++ can be kind of screwy sometimes. This is especially true for some of the downloadable packages. Check to make sure that SOCKET is, in fact, being defined in winsock.h, and that winsock.h is included in mysql_com.h.

Or you could do another hackish approach and merely redefine my_socket to u_int or related.

Oh, nice little base by the way. It was just the thing I was looking for (that is, a Socketmud of the C++ world).

~Nick Cash
http://www.nick-cash.com
Top

Posted by Rendelven   (2 posts)  Bio
Date Reply #41 on Mon 20 Feb 2006 04:29 PM (UTC)
Message
As I said before, I don't use any of the native winsock API for handling sockets. I simply use BSD sockets and just initialize winsock. You should not have to use SOCKET.

You will have to include the winsock library to your Dev-C++ project. As well as the crypt and mysql libraries. I haven't worked with Dev-C++ in a while so I'm not sure exactly how to do it. I may open it up later as I recently got a Windows box and see if I can get it running for you windows folk. :)

If you download the source and make the needed change in smysql.h, and include the correct libraries - what errors do you have?

R.
Top

Posted by IAmSlime   USA  (26 posts)  Bio
Date Reply #42 on Sun 26 Feb 2006 02:27 AM (UTC)
Message
Well, I still can't get it goin. Still the Line 299 and 300 errors... When do you think you might get that Windows Version up, Rendelven?

"Life Sucks, Then You Die."
Top

Posted by IAmSlime   USA  (26 posts)  Bio
Date Reply #43 on Tue 28 Feb 2006 10:16 PM (UTC)
Message
Would the program found at this link be of any use in this situation?

http://www.magicunix.com/

"Life Sucks, Then You Die."
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #44 on Tue 28 Feb 2006 10:25 PM (UTC)
Message
Probably not. It's an IDE, not a compiler. Did you try Whiteknight's suggestion of just defining SOCKET to u_int? (unsigned int)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


134,158 views.

This is page 3, subject is 4 pages long:  [Previous page]  1  2  3 4  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.