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.

Program Announcements / Multisync v1.0 - Multiplayer plugin

Author
Message
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 30th Apr 2008 14:58
Quote: "But what is the default server port? Since Net Set Port does not appear to work over here."

The default is 3999. If you want to change it make sure you call net set port before you host/connect.

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 30th Apr 2008 18:00
Odd, opening that port has no use.

And I tried that with Net Set Port, but it had no effect. Note that I have no active firewall on my PC.
Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 30th Apr 2008 18:24
If you haven't tried it get someonone who is isn't on your private network to connect to your server.

If I try to connect on the same network I have to use private IP instead of public IP. It will not allow you to use Public if your on the same network, you will get a time out error.

'Ooh 'eck chief'...'crumbs'
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 30th Apr 2008 18:49
Quote: "If you haven't tried it get someonone who is isn't on your private network to connect to your server.

If I try to connect on the same network I have to use private IP instead of public IP. It will not allow you to use Public if your on the same network, you will get a time out error."


Multisync uses Winsock as far as I know, and Winsock does allow that... Since I used Winsock in VB alot and have connected to my own PC through that.

I could be wrong though.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 1st May 2008 21:25
Quote: "And I tried that with Net Set Port, but it had no effect."

Are you sure about this? When hosting, open command prompt and type netstat -a, and the connection you're listening on should appear here with the port you're using.

You can't listen for internet connections (or LAN for that matter) using the loopback address, as data on that interface never touches any NIC you have installed. Replace it with your computer's LAN address and it should work correctly (assuming your router is set up properly, and the firewalls on either end allow the connection). Note that you can't connect to yourself over the internet.

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 1st May 2008 21:29
Quote: "You can't listen for internet connections (or LAN for that matter) using the loopback address, as data on that interface never touches any NIC you have installed. Replace it with your computer's LAN address and it should work correctly (assuming your router is set up properly, and the firewalls on either end allow the connection). Note that you can't connect to yourself over the internet."


works fine when using Winsock through Visual Basic to me.

Anyhow, for some reason when I set it to use my external IP, no one from my LAN can join anymore, and vice versa.

The Net Set Port was my mistake, as I made it set it twice for some silly reason.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 1st May 2008 21:36 Edited at: 1st May 2008 21:36
Quote: "works fine when using Winsock through Visual Basic to me."

That's because it doesn't go through a NIC. The loopback interface allows applications on a single machine to communicate with each other.

Quote: "Anyhow, for some reason when I set it to use my external IP"

If you're on a LAN then you need to listen on your computer's LAN address. Unless you're directly connected to the internet (which more likely your router is) your computer won't let you listen for connections using the external IP.

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 1st May 2008 21:45
I've port forwarded, and asked someone to test the connection... It partially worked, but disconnected after a while. Might just be my internet though. But it does work(kindof).

Too bad that I have to choose between getting on myself, or letting others on it.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 1st May 2008 21:47
You can connect to yourself from the same machine or another machine on the network, just connect to the server machine's LAN address.

Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 2nd May 2008 04:21 Edited at: 2nd May 2008 05:40
Wow I've been using Tempest all along but now I think it's time to switch!

Besides the firewall support, what would you say is the most significant difference between the two?

EDIT: how in the world does it add the app to the windows firewall without making anything pop up?

EDIT: maybe it's just the network, but I noticed a slight lag a few times, where, in the example, if you turned one way then another way it would keep turning the other way for a bit then jerk back. Maybe it's just the way the example is coded?

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 2nd May 2008 14:47
Quote: "You can connect to yourself from the same machine or another machine on the network, just connect to the server machine's LAN address."


Not over here, as it appears that the server is not hosted at all when using the external IP. while all the ports are open and ported to my PC.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 2nd May 2008 18:27 Edited at: 2nd May 2008 18:28
Quote: "Besides the firewall support, what would you say is the most significant difference between the two?"

Well apart from the two major differences that Multisync is strictly Client/Server, and uses TCP, I'd say it's also much more stable than Tempest.

Quote: "EDIT: how in the world does it add the app to the windows firewall without making anything pop up?"

There's a Windows Firewall API that allows programs to do things such as adding rules to the firewall. However, it's only possible to do these things when using an administrator username.

Quote: "Maybe it's just the way the example is coded?"

Indeed, it is.

Quote: "Not over here, as it appears that the server is not hosted at all when using the external IP. while all the ports are open and ported to my PC."

You can't connect to yourself using your external IP, you have to specify your computer's LAN address.

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 2nd May 2008 20:59
Quote: "You can't connect to yourself using your external IP, you have to specify your computer's LAN address."


I did so, but the server errors me when I connect, that it stopped hosting...(If Net Connected() = 0)
hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 3rd May 2008 07:55
hey was just wondering if im able to use a server to detect my computers ip address

www.silentshade.hookkshot.com
Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 5th May 2008 11:13 Edited at: 5th May 2008 11:14
yes you can, I don't know an easy way to do it but I have one of those nice dll's installed, that gogasfree .dll includes a command called *getmyip()* and combining this with a print/text command will allow your server to show your public ip. (although I guess this is pretty easy to do )

'Ooh 'eck chief'...'crumbs'
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 5th May 2008 11:25
Thanks Ben. I tried it out and I've successfully connected over the internet to the host. Thanks!

azzido
16
Years of Service
User Offline
Joined: 16th May 2008
Location:
Posted: 16th May 2008 18:21
Has somebody tried to do the servercode with purebasic - becaus on my vhost i can´t run darkbasic - i have no directx9 - i try to rewrite the server example to purebasic - but i still get lost - can anyone help?

Sorry about my bad english.
SageTech
19
Years of Service
User Offline
Joined: 3rd Dec 2004
Location: Orlando, Florida
Posted: 28th May 2008 02:36 Edited at: 28th May 2008 02:37
Hey ben, I would post this in the tempest thread, but since its locked, ill post here. I'm just wondering what happened with tempest, are you no longer developing it? I used it in my game extensively, and the P2P system I require cant really be done with multi sync.


The world is doomed...unless you >>>>>> Click Here <<<<<<
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 30th May 2008 04:30
Quote: "I'm just wondering what happened with tempest, are you no longer developing it?"

Correct. I stopped working on it to focus on Multisync, which I felt had more potential. P2P has a fair few issues, such as connectivity between all peers and synchronization.

Ben Johnson
17
Years of Service
User Offline
Joined: 6th Jul 2007
Location:
Posted: 31st May 2008 05:30
Would it be possible for you to implement a channel system to Multisync.

What I mean is a way to connect to and host multiple connects. Such as a server application being able to connect to another net host.

So the command would work something like the File read and write system using a number handle for each connection like:
Net Host 1,2000

I can explain further if you need me to.
Papa Stiffy
17
Years of Service
User Offline
Joined: 22nd Sep 2007
Location:
Posted: 31st May 2008 23:19
I'm fairly new to networking, but when I use Net Get Player Port it gives me a different number every time.
This could be good or bad, but should I just use the return value from this command and use it in Net Set Port to connect over TCP/IP?

http://cobaltgames.moonfruit.com
-------Biatchin' Games-------
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st May 2008 23:54 Edited at: 1st Jun 2008 00:00
Quote: "but when I use Net Get Player Port it gives me a different number every time."

Are you testing the server and client on the same machine? And what do you mean it gives you a different port number each time, how are you detecting this?

Papa Stiffy
17
Years of Service
User Offline
Joined: 22nd Sep 2007
Location:
Posted: 1st Jun 2008 00:54
I'm using Net get player port after the server has detected that another player has connected.
I've also asked you Benjamin on another Thread a question about the port forwarding and on it I ask a few questions I can't seem to figure out.
http://forum.thegamecreators.com/?m=forum_view&t=130598&b=18

http://cobaltgames.moonfruit.com
-------Biatchin' Games-------
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 1st Jun 2008 01:51
Ah I see. The reason you get a different port each time for the clients is because an arbitrary port is used to listen for data on. This is not an issue though, as the client always initiates the connection, meaning the port that the client uses doesn't matter.

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 7th Jun 2008 18:23
Quote: "Would it be possible for you to implement a channel system to Multisync.

What I mean is a way to connect to and host multiple connects. Such as a server application being able to connect to another net host.

So the command would work something like the File read and write system using a number handle for each connection like:
Net Host 1,2000

I can explain further if you need me to."


Yeah, could you add that? I mean, with that I could have all servers also connected to a masterserver and upload their playercount.
And then, when a client wants to see the serverlist, it connects to the masterserver and so on...
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 7th Jun 2008 20:14
@Benjamin,

I've posted a question in DLL talk, but I'll repost it here. (should have put it here in the first place..)

I've written a file update routine for my game using Multisync and the code looks pretty efficient. Once it was all done and working I plugged in a few lines of code to see what the transfer rate was, and to my surprise it capped out at 3 K bits per second.

I also noticed that on the client end CPU usage was pegged at 100%. The server is running about 17-19%.

I've tried a few more things to optimize my code, but it's not making any difference. Have you done any performance tests in the past and found this to be about the best speed that Multisync can do?

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Jun 2008 14:11
Quote: "Once it was all done and working I plugged in a few lines of code to see what the transfer rate was, and to my surprise it capped out at 3 K bits per second."

You mean kilobytes or kilobits? Either way, I think the limit is due to the size of the buffers used. Only a certain amount of data will queue at a time, and because the buffers aren't very big this isn't a lot of data (not enough for general file transfers at least). When I have my PC back I'll work on making it more efficient for this purpose.

Quote: "I also noticed that on the client end CPU usage was pegged at 100%. The server is running about 17-19%."

This probably isn't Multisync's fault. An application will run as fast as you allow it, unless you call the Sleep WinAPI function to release some CPU time.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 9th Jun 2008 00:12
It was "bits" per second.

amount = bytes transferred

bps = ((amount * 8) / ((timer() - start) / 1000))

I'm moving 1,000 bytes per packet sent. I saw in the docs the maximum is 2048. Maybe I'll try that and see if it helps.

Looking forward to any updates you can manage.

Thanks.

aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 10th Jun 2008 07:51
Does this work with DarkGDK for C++?
Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 10th Jun 2008 20:12
yes, there's a header for c++ included. But you'll have to add windows message processing to your program.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Jun 2008 21:00 Edited at: 11th Jun 2008 21:29
Changing the packet size to 2048 made little difference.

In my loop where I'm reading the bytes and writing them to the file I changed this,

temp = Net get byte()
write byte 1, temp

to this,

write byte 1, Net get byte()

That bumped it up to 5K bits per second, but that's still pretty slow. I don't yet know if it has much to do with file access or not. That might be slowing it down. I'll run a test on just data in memory and see what happens.

[edit]
BINGO!! The file access is slowing it down significantly. When I changed to just sending data from memory the speed jumped up to 520K bits per second. Granted this is on a 100Mbit LAN so it's still pretty slow, but a hell of a lot faster then before.

Maybe I'll try reading in up to 1 meg of the file at a shot and sending that from memory. There will be delays at the 1 meg mark, but the overall transfer should go faster.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 12th Jun 2008 18:59
Makes sense to me. File access should never be done a single byte at a time, as access time is costly.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 12th Jun 2008 21:24
LOL.. I made it that way based on the File Transfer demo with MultiSync..

At least it's moving faster.. Thanks.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 13th Jun 2008 20:32
Quote: "I made it that way based on the File Transfer demo with MultiSync.."

Well, let's pretend I wanted to keep it as simple as possible. Which I did.

You're welcome.

bergice
17
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 16th Jun 2008 16:48
Looks really good!
Are there any tutorials for this?


Programming Recorder: 3,0 months of dark basic
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Jun 2008 19:06
There are examples included with it. It's pretty easy to use.

Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 21st Jun 2008 08:23 Edited at: 21st Jun 2008 08:26
Ok, little question. The help file says: "You can also reset the message data by calling NET SEND with a player number of 0." Does this mean I can't send from a client to the host, because the host ID is 0?

I'm wondering if this is my problem because I just "translated" my code from Tempest to Multisync, and it doesn't entirely work.

Also, is there a command that will just return your ID? It seems a tad more difficult for the host to recieve a pack from a player, determine who it came from, and then send the ID back to the player it came from.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 22nd Jun 2008 01:39
The "Net send 0" thing is really meant only to run on the server.

On the server the command "Net message from()" returns the ID of the player the current message is coming from.

If I understand what you're after, let's say you have 2 players and they are chatting. One sends a private message to the other, and you're looking for a way to tell who the message should go to, and be able to tell that person who it's from. Right?

Since most chat systems deal with people based on their character name, on the server you'll need to keep track of the users that are connected and what their character names are. I keep an array of the current players and track their server ID (from the command above), their database ID, their character name, their current position, and which level their on. Having that data you can then make the connections to the right player and send the message to them.

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 29th Jun 2008 16:32
hey, the helpfile says:

Quote: "NET SEND [Player Number] [Player Number, Lock Flag]Sends message. The server must specify a player number. The server can also optionally specify a flag that makes the system retain the message data after sending. This data is cleared next time you make a regular send. You can also reset the message data by calling NET SEND with a player number of 0."


But how can I specify this lock flag in C++?!!???!?
I really need it:

Otherwise I have to put the data for every player...

HELP!

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 29th Jun 2008 17:54
Try using this updated version of the header file, it contains NetSendLock which is the function that you want.

Attachments

Login to view attachments
zapakitul
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: In my world
Posted: 29th Jun 2008 19:22
Benjamin can you set up a special multisync DLL with examples and Documentation for GDK? Don't get me wrong, i know that there is one(and i am using it right now) but i would love to have those 3 examples translated to C++, and have the commands displayed in a webpage! Cheers mate

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 29th Jun 2008 19:41
I can't at the moment as I don't have my PC, but when I get it back I'll see about doing that.

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 29th Jun 2008 22:23 Edited at: 29th Jun 2008 22:25
Benjamin, I tried that header, but it gives me a unresolved external symbol. I think I need a new .lib file too...

But ty so far...

Quote: " error LNK2001: Nicht aufgelöstes externes Symbol ""void __cdecl NetSendLock(int,unsigned long)" (?NetSendLock@@YAXHK@Z)"."


Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 30th Jun 2008 02:59
Ah yeah, perhaps it isn't exported. Unfortunately as I said above I don't have my PC at the moment, so I won't be able to change this for a couple of days.

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 3rd Jul 2008 20:54
Hmm, it seems to be defined in the lib file, but not in the way the compiler complains:

in lib:


compiler says:


maybe there's a problem with the function definition in the header?

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 3rd Jul 2008 21:44
Ah yes, I've just checked it again and the second parameter is actually supposed to be a bool rather than an unsigned long.

Attachments

Login to view attachments
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 4th Jul 2008 13:55
Benjamin, If I am on my server, and I send no data to it for more then 30 seconds, it will disconnect me, Why is this happening?

SOTA Engine
Purchase
Source and Non Source versions available!
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 4th Jul 2008 18:45
If data hasn't been received from a client in a certain period of time, the server will ping it. If data still hasn't been received after another period of time, it disconnects the client. In order to let the client respond to ping messages you need to call NetGetMessage at some point.

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 4th Jul 2008 19:08
It calls Net get Message about 360 times per frame, But I changed something with "Net Set Setting 1,300" and suddenly it won't ever disonnect me for no reason anymore, so thats fixed I guess.

SOTA Engine
Purchase
Source and Non Source versions available!
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 4th Jul 2008 20:44
I noticed that the server disconnects after about 10 seconds if your client isn't in a part of the program to respond.

For example when my client is loading a level it takes longer then 10 seconds to load all of the scene objects, so in between the loading of object types I've placed a ping routine that takes the value of timer() sends it to the server, the server sends it back and it's subtracted from the current timer() value to get the ping time in milliseconds. This keeps the connection alive while the level loads.

"Net set setting" ??? Is that a new command??

Login to post a reply

Server time is: 2024-11-21 13:26:17
Your offset time is: 2024-11-21 13:26:17