Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Multiplayer don't work!

Author
Message
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 13th May 2008 21:24
I cannot find any games on the "Client Program", which I have done whith my "Master Program"! I run the Master anc Client on same computer, whith same IP number.

The Master Program:


The Client Program:
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 13th May 2008 21:51
Did you try 127.0.0.1 for your IP address?

CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 14th May 2008 21:27 Edited at: 14th May 2008 21:27
Yes, the Master said that it find a game, but the client say that in don't find a game? Is the code wrong, or is my computer crasy?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th May 2008 21:49
Microsoft dropped Direct Play. DarkGDK uses DirectX. DirectPlay is part of DirectX. It has issues. Stop while you're ahead. Even if you get it working I've heard it doesn't cooperate with routers (whatever that means)

RakNet (complicated), WinSock (fastest Performer - stock OS TCP/IP sockets more or less), Multi-Sync By Benjamin - Works Well I hear.

Papa Stiffy
17
Years of Service
User Offline
Joined: 22nd Sep 2007
Location:
Posted: 15th May 2008 05:14
Quote: "Even if you get it working I've heard it doesn't cooperate with routers (whatever that means)
"

I've tried Direct Play, and no, it's terrible when working with routers. It simply would not let two people behind routers(a common thing for household internet lines) to connect.

http://cobaltgames.moonfruit.com
-------Biatchin' Games-------
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 15th May 2008 05:24
LOL
Quote: "(a common thing for household internet lines)"
thanx for the confirmation. I know what routers are but thanx to you I know specifically where it chokes... Direct Play doesn't sound direct at all... Boy... I miss the old IPX Lan Gaming.. that was dead on

CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 15th May 2008 22:44
I try Multi-Sync!
Nice, I get big errors when I try to run this:


Errors:
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 16th May 2008 03:18
You're passing a string constant to NetGetError, which can't be written over.

CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 16th May 2008 22:05
But... How should i do if I what to get the error if NetHost or NetConnect fails?
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 19th May 2008 21:14
Please, help me!
It fails on the NetConnect(), and I whant to know why, with NetGetError()!
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 19th May 2008 21:27
The trouble is that NetGetError() requires a buffer to store the error message text, and you are giving it a literal string, which is not the same thing at all. Try this code instead:

CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 20th May 2008 22:18 Edited at: 20th May 2008 22:36
I get the same error! Should I install or use anything before I can run Multi-Sync. I only get this error when I run the same program two times at the same time.

If I only run the program once, it cannot pass the NetConnect() function!

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 20th May 2008 22:21
Do you get that error with jinzai's exact code? If not, post the code.

CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 20th May 2008 22:38
I use the exact code... Strange. :S
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 21st May 2008 07:57
Are you running Vista by any chance? I have experienced some trouble with returning strings in Vista, but I don't run Vista...so, I cannot troubleshoot the bug effectively. This occurs with a plug-in written for DBPro that is run in Vista, but it may be of no consequence in this situation, since the plug-in makes device driver calls and that might be the real issue.

I have a client/server that uses MultiSync in DBPro that I run like that...it works flawlessly and connects immediately.
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 21st May 2008 21:31
I use Windows XP HOME. Win XP Pro have more network support, maybee it only work in this version of XP.
Or the Multi-Sync maybee only work om Dark BASIC Pro and not Dark GDK...
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd May 2008 15:51
Well... perhaps you're right. I was under the impression the home edition lacks some things like folder sharing, but winsock is integral from things like email, browsing the internet etc. And I believe Multi-sync is a "organized for game programming" WinSock Wrapper.. That's my impression anyways.

I hope you don't give up and at least track the issue down to the very "roadblock" that would prevent multi-sync use on home edition. I tend to think game networking is very "Home" oriented and should be possible. (I hope so anyway.)

CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 23rd May 2008 22:18 Edited at: 23rd May 2008 22:19
I test WinSock and see if this fails too.

It don't work. The code:


The errors:


I don't understand the header file, it says:
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 23rd May 2008 23:09
Quote: "I don't understand the header file, it says:"


It looks like what it's saying is that if WINSOCK_PLUGIN_API is defined (usually an indication that some header file with the #define in it is being used for development of a particular API, in this case DBP = Dark Basic Pro)to use the first prototype else use the second prototype. This is because the DB Pro uses DWORD to provide the address of a string whereas the Windows API is more prone to use a pointer to a string. The same applies to the footprint of the function parameters which also accounts of an extra parameter telling the size of the character buffer.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 24th May 2008 00:47
Quote: "I try Multi-Sync!
"


where did you find Multi Sinc? I tried looking for it, but I get stuff that doesn't work with c++, like it is different.

Also, where would you find WinSock? I get the same problem, just like a program, and it isn't meant for c++.

I tried Rak-Net but, it was really complicated like to the max complex.

thanks!

~~Its not about what you know, its about how you figure it out.~~
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th May 2008 02:14 Edited at: 24th May 2008 02:20
Hopefully, you will not feel insulted by my words, but...

1. I don't think you are giving each option enough chance to work. It is not a very simple matter to do any of the things you are doing...it takes much practice, and patience. It just does.

2. Benjamin's code works well; I cannot imagine it not working in the scenario you have given. It would be prudent if you just stuck with trying to get that working for now. If nothing else it gives you the practice and helps with the patience that I just mentioned in item 1.

3. Your last effort is not really using WinSock at that level, that's another bit of someone else's code, I assume. (Barnski's? I really have no idea.) Also, that function call (?) is not right at all. LPSTR is a type, and you need to declare a variable for the return; it looks like you just copied the prototype in there?

LPSTR get_error_msg(text, 60);

4. For that matter, MultiSync, or Rak-Net or anything else must use Winsock, it is the implementation of Berkley Sockets for the Windows platform...its called Winsock.

5. If you want to use Winsock yourself, that is a far more complex matter and it takes a lot to just implement sockets that you do not currently have convenient access to. (Like the message handler, for starters.)

This is a highly specialized programming area that you are experimenting in; it is not surprising that it is difficult to get going.

If you would, please just go back to MultiSync. It is very easy to use, and takes care of the nasty business I am referring to in item 5.

Now, if you are still with me...I think your original problem is two things. First check that your program is set to use the Multi-Byte character set, and not set to use UNICODE. That will conflict with ASCII string useage right away.

Next, I am not sure if perhaps your system is not waiting long enough for the connection to be made. It should be instantaneous, but TCP/IP can be slower than a fast CPU.

Your use of XP Home should not be an issue for MultiSync, Rak-Net, or anything else...basically, they work with the same code that IE uses, and you seem to be able to connect to the Internet, so...I'd look elsewhere for the issue. Since you are using the loopback address, the packets aren't even leaving your machine, so it is your TCP/IP stack that is being used and again that seems to work.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th May 2008 12:05 Edited at: 24th May 2008 12:35
After much downloading, installing, repairing, reinstalling, rerepairing, and manual configuration...I have the exact snippet that I posted above working in a project now.

MultiSync not only works fine, but it is seamless to integrate into the project directory, too. Very impressive, Benjamin!

I did change the default setting for Character Set...the template does not set it, so that's a big problem at the start. I set it to Multi-Byte Character Set in the project settings. MultiSync does not have any debug libraries, but...that is not a limitation, imo.

Another thing that the templates do that is problematic is that they create too many levels of project directory, which can be confusing, too. That is likely related to the structure of a solution in VS, and I think I can make the template not do that...I will try it and let you know.

To use MultiSync, download the rar file, and extract it. If you are using it with DBPro and GDK, I think you should extract it where it recommends...but, to use it in GDK...you should copy the files from the folder Other Languages into the project directory...I mean the second level, where your source files are.

Study this if that doesn't make sense to you:


Another (!) thing that the wizard does that is not helpful is generate this line, which starts the whole thing off on a bad note:
#include "DarkGDK.h"

Change that to this:
#include <DarkGDK.h>

Then add this:
#include "multisync.h"

The reason for that is this...DarkGDK.h starts including the include files for GDK, which all use the literal include. The first line changes it to start looking in the include path for VS, which already has the proper location included, so the relative method works fine if you begin in the correct folder. It is a problem if you don't.

Next, you have put multisync.h into the project directory....the one that is the current directory when the file main.cpp gets compiled, so use the literal for that one. That include file already takes care of its library dependency, so you need to copy the .lib, .exp, and .dll files into the same directory. When you make a final exe, you would include your executable, and multisyncdll.dll. Remember that multisyncdll.dll must be in the same directory as the executable. If, for example, you decide to run your executable from the Release directory...you must also have multisyncdll.dll in that directory. To fix that permanently, you can copy it to one of the three directories that Windows will search for DLLs.

After getting that to work, the first problem that you will encounter with this code is your firewall. Answer the error message correctly by allowing MultiSync to access the TCP/IP stack so that it can do its job.

The next time you run the program, you should see this from your code:

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 24th May 2008 16:04
I have just stumbled upon this thread, and I have taken an interest in it. I have Multi-Sinc, and I want to get it working. OYur tutorial on how was really good, I almost have it, but I have a couple of questions.

Quote: "Next, you have put multisync.h into the project directory...."

Is that the place with all the other header files?

Quote: "so you need to copy the .lib, .exp, and .dll files into the same directory"


Which directroy is that?

jinzai, that was a great tutorial anyways!

~~Its not about what you know, its about how you figure it out.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th May 2008 19:13
JinZai Rocks.... I think he means put it in your project's directory - which is where whatever "project" your working on in vs2008 has your typical "main.cpp" file.

However let me point out that my other libraries, like dark physics and darkai, and sparky's I personally find it VERY conveinant to have the *.h with the DarkGDK's stock *.h file, and the same for the *.libs. Just one stop shopping for the compiler/linker duo.

jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th May 2008 21:31
To answer both of your questions...yes.

The directory issue is just as I suspected. What's happening is that the template makes a folder for the solution, and a folder for the project. Both have the same name, so you get two levels of folders.

To fix it...you need to untick the Make Directory for Solution, OR select Add To Solution if you are simply adding another project to an existing solution.
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 24th May 2008 21:59 Edited at: 24th May 2008 22:01
Okey, Host work, but not Connect.



It print "Error2:", but not the tempstr.

And I have the files in my folder and even in the Debug folder.

Attachments

Login to view attachments
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th May 2008 23:56
Well, that's your code there. You are writing a peer to peer type of network application, but this is a client server situation, so...it will never work that way.

I have that working, too. If you comment out the second half of your program...the part that tries to connect, that is...leaving only the part that works, you will have a basic server, that will print out "Host work.". Do that, and then, rename the executable in some way so that it will not get overwritten by the next step...creating a client from the second half of your code.

To do that...simply uncomment the client-like portion, and comment the first half of the code. When you have that built...start the host, and get past the firewall complaint.

Then, start the new client...it will print "Connect work", just as you'd expect it to.
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 25th May 2008 00:26
Quote: "However let me point out that my other libraries, like dark physics and darkai, and sparky's I personally find it VERY conveinant to have the *.h with the DarkGDK's stock *.h file, and the same for the *.libs. Just one stop shopping for the compiler/linker duo."


that is where I keep my stuff, and I wa wondering if I could keep it there instead of in the project.

~~Its not about what you know, its about how you figure it out.~~
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 25th May 2008 02:34
Yes, that should also work fine...but, you will still need to keep MultiSyncDLL.dll in the same folder as your application.
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 25th May 2008 02:42
Ok, thanks!

~~Its not about what you know, its about how you figure it out.~~
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 26th May 2008 19:42
Quote: "Very impressive, Benjamin!"

Thanks.

I would have offered some assistance recently only a) I've been very busy lately, b) I don't have Dark GDK installed on my PC, and c) my PC is currently in for repairs.

However, I see that Jinzai has given some helpful advice.

CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 28th May 2008 21:24
Thank you!

Now I what to get to number of connected players on my host. Byt I only get 0 whole the time!

Host:


Client:
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 30th May 2008 04:19
You should call NetPlayerJoined frequently (once a loop should be sufficient) to acknowledge joined players, which will increment the count returned by NetGetPlayerAmount.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th May 2008 04:56
Quote: "(once a loop should be sufficient)"


That sounds like ALOT. Is that to much IO? Or you think testing stuff coming in is less overhead than transmitting?

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 30th May 2008 05:28
I don't think checking for players once a frame is too much overhead, considering all the function does is check a list (no IO occurs).

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th May 2008 05:39
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 3rd Jun 2008 21:02
Thanks again!

Now I what to send messages between the host and client. But... I cannot send a message from the client to the host! Please help!

Host:


Client:

Login to post a reply

Server time is: 2024-09-29 21:23:47
Your offset time is: 2024-09-29 21:23:47