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 / MikeNet - Multiplayer Plugin

Author
Message
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 19th Jul 2011 19:00
Quote: "what IPs are available on your system?"

Sorry I really don't know. I suppose I could try to find out, but wouldn't the examples not work if this were a problem?

I'm usually just using "home" to connect to something hosted on my own computer, but entering my local IP doesn't work either.

swis
No, it's not pokemon.
Joined: Tues Dec 16th 2008
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 20th Jul 2011 22:34
What is TotalPlayers set to? (on the server side)

swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 21st Jul 2011 01:13 Edited at: 21st Jul 2011 01:14
Quote: "What is TotalPlayers set to? (on the server side)"

hehe, told you it was something rediculous. It's actually PlayerCount, and I remeber accidentally typing TotalPlayers a few times, thought I fixed it These seem to be the only kinds of mistakes I make, maybe that's good. Well thanks a LOT Michael. That took forever to crack. Couldn't do it on my own.

swis
No, it's not pokemon.
Joined: Tues Dec 16th 2008
RedFlames
17
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 27th Jul 2011 16:14 Edited at: 27th Jul 2011 16:37
Hey Mike,
I just implemented the Mn Shutdown Client command to understand how it works, and I thought it would do the following: If the client uses shutdown first, it'll be in NO_SEND state to receive a final server response, and then the server (which would return NO_RECV for the specified client) calls Shutdown to set the states to NO_SEND_RECV. If the server shuts a client down, the roles are reversed and the client needs to call Mn shutdown?
With my test setup, which is based off the "UDP & TCP Networking Demo" I get these results instead:
Server calls shutdown on client: Client-side returns 3 (NO_RECV), but server still gets 1 (CONNECTED). If the client calls Shutdown now it behaves as if the Client disconnected (Mn Client Left is triggered, Mn Client Connected returns 0 on both sides).
Now If a client starts the shutdown, but the above method had already been used on that Client number, it will disconnect immediatly. Without any previous shutdowns, it'll go into state 2 (NO_SEND), while the server still returns 1 (CONNECTED) instead of NO_RECV.

For the first problem (immediate disconnecting), I feel like I missed some reset thingy, like calling Mn Disconnect Client manually? But still the return values on the server are not what the help files say...

Oh and on something different: If I'm using encryption, my packets need a minimum size of 32 bytes (don't know if that differs depending on key sizes, but it's what I'm using now), so if I wanted to e.g. send an 8 bytes packet... what's the most efficient way of doing that? right now I'm adding strings of whitespaces and clearing the Recv / Send packets after I got the important data.

Thanks for your help so far,
RedFlames
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 27th Jul 2011 18:23
Is graceful disconnection enabled on both the client and the server side?

And there is no data limit on encryption, although it is done in 16 byte chunks. So if you try to encrypt 12 bytes of data for example, it will be automatically padded out with 4 extra bytes.

RedFlames
17
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 27th Jul 2011 22:38 Edited at: 27th Jul 2011 22:46
Oh... i guess then I was using the encrypion on the wrong packets, and had fixed that, while thinking it was caused by the size difference

And yes, Graceful disconnect was enabled on both, although i quickly put that together, I'll write a cleaner version and look at it again tonight. Any info on the return values? Is that how it is supposed to behave? Or might graceful disconnect not be completely enabled and thus only returning "connected" on the server? But the server is still able to iniate the shutdown...

Anyways, thanks for the info on encryption I'll clean that up first, graceful disconnect can wait a bit.

Edit: Oh and how do the "Send All" commands react to the graceful disconnect? Do I need to check all send commands against the client connection status to prevent errors?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 30th Jul 2011 16:09 Edited at: 30th Jul 2011 16:11
@ RedFlames
The way you are describing what should happen seems correct. Have a look at this demo code and see where you're going wrong:

Client:


Server:


Correct me if I'm wrong but I don't think send operations ever generate an error, you rely on the return value to determine their status; so you don't need to worry about mnSendAllTCP erroring.

@ All
The website is down because the people hosting it are incompetent (www.freezone.co.uk) so I need to switch provider. Also I am on holiday until the 15th so will not be available until then.

Happy coding everyone !

RedFlames
17
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 2nd Aug 2011 05:08
Mike, thanks for the example code. I just had the time to actually read through the comments and understand how the commands work together, and I noticed something odd:

Sometimes (which seems to be pretty random, some work, some don't) the server does not receive the final TCP packet. For example I connected 2 clients at the same time, they both worked. So I tried starting 3 clients, and the server doesn't show the string from the second client... as the clients ARE sending those packets, maybe the server somehow shuts down before getting the last packet?
Actually, this is something completely different I think... While uploading the image and looking at the code one more time I noticed it says "String received from client..." instead of printing "Final string received from client". So mnClientConnected still might be returning "wrong" values for me, right? This is very odd...

Just now I modified the server like this:


The Client is the code you posted, I had just added
Quote: "
Print LocalHost$
Wait Key
"

after the DNS lookup, but that shouldn't be influencing anything...

So, with the "new" server code I quickly put in some variables to keep track of the ConnectionStatus and how often it's value changes during the time a client is connected (between "Joined" and "Left" message basically). The result for me is: Every client only switches to "connected" as long as it is connected to the server, and the output string is "1" for EVERY client. If I do not clear the strings between conecting clients it output something along the lines of "0610", so its just a transition from "disconnected" -> "connecting" -> "connected" -> "disconnected" without the Graceful Disconnect information.

Again, I wrote a lot of stuff while modifying my code and the results But I hope this helps track down the issue/my obvious mistake/aliens screwing up my LAN controller

RedFlames
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 18th Aug 2011 02:31
Okay I'll have a look into this, should get back to you early next week latest.

Mugen Wizardry
User Banned
Posted: 29th Aug 2011 15:49
Can someone PLEASE help me convert this code to Darknet version 2?

I would like everyone to be able to use it....

Here's the darknet version 1 code:



Thank you for your kindness

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 19th Oct 2011 15:28
I have great trouble making arrays from received memblocks :-(

Here is the code I send the array with:


and here I receive it:


I then print username$ but it just says "CF$", sometimes it also gives me garbled strings when I change to code :-(

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
mmogamerplayer
13
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 4th Nov 2011 08:00
I like this thread,thank u for sharing

I love playing mmorpg games
GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 12th Dec 2011 05:58
Michael:

Awhile back you sent me a new version of DarkNet via email, version 2.0.2. I was checking and the latest available via TGC is 2.0.1. The version you sent me lacks documentation, and your website appears to be down.

Did you move your website somewhere? Is there a newer version that just hasn't been released by TGC?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 12th Dec 2011 09:54
http://www.mikenetapi.net. That version just has a bug fix so should have same documentation as 2.0.1.

GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 2nd Jan 2012 09:26 Edited at: 2nd Jan 2012 23:31
Michael,

It looks like a client can use "mn Get Percent TCP" to see how much of a packet they have received. Is there a way for the server to see how much of the packet they have sent? I want to make an FTP type utility that sends one packet after another, but waits until the prior packet is mostly sent before starting. Right now the program sends 24MB of packets all at once and I guess they all sit in the DarkNet queue to be sent, but my server app is already saying that they are done.

Thanks!

Edit: Also, your sound commands are very different than before. Do you have an example project on that?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 3rd Jan 2012 20:21
That is possible synchronously but not asynchronously. This is pretty basic functionality so you would have thought I'd have added support for it

My new years resolution is to work more on this project so hopefully I can find time to add this feature in

And the sound commands are more or less the same, just with sound profiles now. I don't have any sample code to hand, still need to convert it from v1.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 4th Jan 2012 17:30
There are a lot of pages!

Simple question: can it do peer-to-peer?

The fastest code is the code never written.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 4th Jan 2012 20:42
It can but not properly - it will fail when NAT enabled routers (which most people have) are used. Also it is not directly supported, so you would have to do quite alot of the coding work yourself.

This has been on my to do list for a long time, I will also try to get that done.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 4th Jan 2012 21:26
I have done p2p before but it's a lot of work. I was hoping to find something that had UDP on p2p.

The fastest code is the code never written.
GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 6th Jan 2012 04:10
Quote: "And the sound commands are more or less the same, just with sound profiles now. I don't have any sample code to hand, still need to convert it from v1."


Yeah, I can't even find the v1 example code for sound commands. I almost have it working, but the server is saying it isn't receiving any UDP packets so I must have missed something. Probably using the wrong UDP mode...
GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 7th Jan 2012 06:29
Michael,

Having problems converting the old voice chat code to the new version. I can send a UDP packet with the word "test" just fine, but if I try to send voice data, the server acts like it never received the packet. My thought is that it has something to do with the memory limits. I tried both of:


But it did not change the return value of


The "get limit" command returned 0 afterwards. I have logging enabled on my client and the voice packets are roughly 44000 in size, so the default packet limit of 1024 is clearly not enough, and I am having a hard time getting that limit changed.

I am only using UDP for voice chat so I don't need multiple operations, and I have tried using UDP modes 1 and 4.

Any quick suggestions?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 8th Jan 2012 23:11
This code works for me, and demonstrates two ways to change the receive limit - the other way is to set it in the instance profile:


GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 8th Jan 2012 23:47 Edited at: 8th Jan 2012 23:50
Quote: "This code works for me"


Yeah, those commands are very close to how I have it setup, but any packet over 1024 bytes is discarded. I ran this as my test:


and the server:


On my Server screen, it receives 3 of the packets, sized at 256, 512, and 768 (the header info may have pushed the 1024 one over the 1024 threshold). The other 17 packets never get logged.

One thing I noticed when browsing for commands is: MN GET RECV SIZE UDP, which returns 1024 for me, but I didn't see a "SET" command or if this is even related to my problem.

Also, just so you can see the setup:


Produces:

15:55:12.93979 Warning: Server local TCP port: 11146
15:55:12.93979 Warning: Server local UDP port: 11146
15:55:12.93979 Warning: Server local UDP Enabled: 1
15:55:12.93979 Warning: Server local UDP Mode: 4
15:55:12.93979 Warning: Server UDP Recv size: 1024
15:55:12.93979 Warning: Server Memory Limit Recv tcp: -1
15:55:12.93979 Warning: Server Memory Limit send tcp: -1
15:55:12.93979 Warning: Server Memory Limit Recv udp: 75000
15:55:12.93979 Warning: Server Memory Limit send udp: -1
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 9th Jan 2012 00:45
Ah you are confusing two seperate things:
- Queue memory limits: when a packet is received it is put into a queue and then you retrieve data from this queue using mnRecv commands. There are commands which restrict the size of this queue; these are the 'memory limit' commands.
- Buffer sizes: packets larger than this size cannot be received. So this is the size you want to change using mnSetProfileBufferSizes.

GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 9th Jan 2012 01:09
Ah ha, that fixed it. Now I just gotta tweak the sound input/output buffers. What would you recommend using for the buffer/time gap/data cap for sound input/output?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 9th Jan 2012 01:19
There's defaults in the sound profiles which worked well in my tests. If you want lower latency then lower the values but if you want to improve quality then increase the values. If the values are too low you will see stuttering.

Also if you expect this to be used on particularly bad connections where the latency fluctuates alot, then you want to keep the values relatively high.

GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 9th Jan 2012 01:26
How do you access those defaults? Put "-1" in there?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 9th Jan 2012 02:11
Ah okay these values don't use profiles.

In my tests I used:
- numBuffers: 2. Should keep this > 1 so that the gap between a buffer becoming full, being read and then being requeued is covered.
- buffTimeLength: 300. If this is lowered numBuffers should be increased because the gap I described earlier becomes more frequent and so more buffers are needed to increase likelihood of it being covered. This incurs a latency so e.g. if this is 300 sound data won't be retrieved until after 300ms.

-msStoredDataCap: 300. If this is too long the end of each stream being played will have a noticeable blip. If this is too short overall consistency of the stream may be impaired as gaps appear.

- timeGapGap: 500. This is in milliseconds, this incurs a delay (if 500 the delay is 500ms) and the usage is similar to msStoredDataGap in its impact on the stream.

Qqite
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 12th Jan 2012 05:12 Edited at: 12th Jan 2012 05:13
Hey Michael,

I'm still pretty new to C++ and would like to start my first network project with your library. So I purchased it the other day and although it works great in DBPro, I can't quite get up and running in C++.

Here's my problem: I'm not using Microsoft Visual Studio. I am using Dev-C++. Why? Because I need to be able to work on my project across multiple computers, so I need it to work on a flashdrive.

So my problem is that I can't really find a way to include the library files. I think I got the header files included correctly because I can include FullInclude.h but, of course, it throws an error saying it can't reference to any library files.

Do you have any experience with Dev-C++? Even if you don't do you have any general hints to what I might be doing wrong?

Thanks in advance,
Qqite

Ventures of the worlds around us are limited only by our imagination.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 12th Jan 2012 21:05
No experience I'm afraid. I'm not sure if visual studio libs work with other compilers. You can however make calls to the standard DLL.

GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 17th Jan 2012 21:23
Michael,

Another voice question. I want to set it up so that my clients can alter the volume of incoming voice packets based on the client. Each client has their own output instance to keep things simple.

I saw the command mn set data volume, but it requires bits per sample as a parameter, and there is no mn get bits per sample { packet } command.

What is the best way to do this? Do I need to send my bits per second with each voice packet or is there a way of getting that info from the packet?

Thanks!
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 17th Jan 2012 22:45
Packets are just raw bytes of data - in this case sound data. So the reason you have to specify bits per sample, is that it can't work it out itself.

You can send it with each packet, or you can send it at the start, or just hard code it. Bits per sample is specified in the sound profile.

Qqite
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 18th Jan 2012 06:12 Edited at: 18th Jan 2012 06:15
Hello again Michael,
So I'm still trying hard to get a portable version of your tools working. Heres the update: I have dropped Dev-C++ and am now trying to work with Code::Blocks. I really like the editor and it has the ability to compile with the VC compiler (so I can use your plugin). So I got basic code to work with the VC compiler.
So far I have the following included: .Net SDK, Windows SDK, Visual C++ Includes, DarkNet VC 2008 (because the compiler in CodeBlocks works with 2008, not 2010.

Right now all I can do is compile simple Hello World programs using iostream, but as soon as I use anything from DarkNet I get a ton of errors I've never seen before. (I can include it fine, but complains when I use any functions)

I have tried both VC2010 compiler/DarkNet VC 2010 just to test and I got pretty much the same errors.

Heres the list of errors I got (note: from CodeBlocks, not VC)

p.s. I've tried compiling in both release and debug :\



Test code:


Ventures of the worlds around us are limited only by our imagination.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 18th Jan 2012 20:01
Make sure you have code generation set to multi threaded, not multi threaded debug or multi threaded DLL. Let me know if that helps.

There are some libraries that you may want to exclude - I remember that helping sometimes, unfortunately I can't remember what libraries you want to exclude, it might be somewhere in this thread.

Qqite
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 18th Jan 2012 22:20
Still same problem. Errors are complaining about __invoke_watson being already defined.
Heres the error list now that I have multithreading enabled:



Ventures of the worlds around us are limited only by our imagination.
GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 19th Jan 2012 03:30 Edited at: 25th Jan 2012 02:53
Michael,

I am having the damnest time with voice chat. It is working sporadically and I am not sure how to debug it. I have logging on my server, and it says that client 1 sent a UDP packet, and that the server forwarded it to clients 2 and 3, but only one of them actually hears the voice chat. Both clients show a spike in network usage at the time, so the packet did arrive at both clients, but it never made it to the UDP queue on one of them. I have my queue memory limits and my profile buffer sizes set to numbers far above what I am expecting. The thing is that in my scenario, at a random point in time, client 3 will start receiving voice packets again, and maybe client 2 will stop receiving them. It also seems that if a client stops receiving UDP packets, they also lose the ability to send them... There are also times when everyone connected is sending and receiving just fine.

I thought maybe the packets were out of order and therefore discarded, so I changed the mode to 3, and nothing really changed.

Is there any way to turn on debug type messages from DarkNet? I would like to know when a packet is received, but dropped due to some limitation or rule or invalid operation. Right now I am just changing random settings and hoping for the best.

Also, mn set data volume is not working at all for me. I figured out that the default bits per sample is 8, and using that, I get alot of static if I use the volume command, and the actual volume doesn't appear to change. Then I changed my global "OUTBOUND_VOICE_MOD" variable to a "double integer" as DarkNet is expecting one, and the noisiness seems to go away, but the volume is still unaffected.

I am betting there is just one simple little setting, hiding behind all these other settings, that is tripping me up. Hopefully you read all that and was thinking "Oh yup, I know what he did wrong"

Thanks!

Attachments

Login to view attachments
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Jan 2012 19:55 Edited at: 22nd Jan 2012 20:04
@Qqite
I had a look over some old posts and here's what I found which solved similar linker errors I had years ago; let me know if this works:
-Changed 'Project settings | C/C++ | Code Generation | Runtime Library' to 'Multi-threaded (/MT)'
-Changed 'Project settings | Linker | Input | Ignore Specific Library' to 'libc.lib;msvcrt.lib;libcd.lib;libcmtd.lib;msvcrtd.lib' (see link)

Original thread (from 2008 ):
http://forum.thegamecreators.com/?m=forum_view&t=121864&b=22

Link:
http://msdn2.microsoft.com/en-us/library/aa267384(VS.60).aspx

@ GIDustin
If you show me some code I will debug it for you.

Do you have a Dolby 5.1 enabled sound card by any chance?

GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 22nd Jan 2012 21:52 Edited at: 23rd Jan 2012 06:25
Michael,

My Server program is 6k lines and my Client is 18k. I just copy/pasted all the voice chat related lines into a new project and I will check if I have the same problems with it. If I do, I will post that.

Edit: As for Dolby, I am not sure... It is an onBoard sound card, but this motherboard is a gaming one, so it isn't your typical onBoard card. Where would I check that?

Attachments

Login to view attachments
GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 23rd Jan 2012 06:28 Edited at: 25th Jan 2012 04:01
OK, I made a test program and ran it with a friend. Worked fine for about 30 minutes, then we both went quiet.

The way I have this program setup is that each time you transmit, you send both a TCP and UDP packet. Your client will show the TCP and UDP packets from each client. Every time you transmit, you should see "TCP" by your name, but no UDP (the server will not send voice back to you). For everyone else, you should always see both. If you see TCP with no UDP, then the voice packets are getting lost.

Here is a screenshot of what it looks like when it is failing. It should be saying "UDP" next to client 2 there.



Let me know what you think, and thanks for looking into it!

Edit: The client is setup to communicate with my server ATM, which is running the Server code in that zip file. If you want to test, you can either use that or change to something else.

Edit2: SO I did another test where you send an ID in front of each UDP packet, and the others "confirm" via TCP if they received it. here is a screenshot:


There are also times when someone hasnt said anything in a long time, they stop receiving UDP packets until they send one themselves.

Edit3: Updated this zip file with the version we use now. If you are lucky, you can come chat with us while we play UWO!

Attachments

Login to view attachments
Qqite
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 28th Jan 2012 21:01
Hey Michael,
I've given up trying to setup everything from scratch xD
I just took the example and am using that now for my project (since it doesn't seem to depend on external include of DarkNet and has all the right settings)

Thanks for your help though!
-Qqite

Ventures of the worlds around us are limited only by our imagination.
Qqite
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 9th Feb 2012 04:31 Edited at: 9th Feb 2012 04:33
Does anyone know how to disconnect and reconnect using a different IP on the same instance?
I've tried both

and

Both times end in an error saying "...whilst attempting to connect socket..."

Ventures of the worlds around us are limited only by our imagination.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 9th Feb 2012 20:11 Edited at: 9th Feb 2012 20:14
@ Qqite
Both should work really, you sure the ip and port variables are initialized properly? Can you show me the error message.

@ GIDustin
I finally had a look at your code. There doesn't seem to be anything wrong with it. I think its the host that's the problem. When I connected to your host I didn't get any UDP packets transferring, when I ran it locally it worked perfectly.

Are you sure its an issue with the sound commands not UDP communication in general? Did you ever replicate the issue locally? You could try using a different port, maybe there's something running on the host that is hijacking the port.

Quote: "There are also times when someone hasnt said anything in a long time, they stop receiving UDP packets until they send one themselves."

This happens when crappy routers are involved. A NAT enabled router (which most are) has a mappings table which maps router ports to local IP/ports within the network. Bad routers let mappings expire too quickly. The solution is to send a ping packet every now and then to keep the mapping alive.

GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 11th Feb 2012 19:24
Quote: "Are you sure its an issue with the sound commands not UDP communication in general? Did you ever replicate the issue locally? You could try using a different port, maybe there's something running on the host that is hijacking the port."


There is a very good chance that it is UDP related and not voice related. I added a 2 second ping just to test that and will let you know how that goes. I am fairly sure nothing else is jacking that port. It is a barebones version of windows that runs nothing but DBPro server apps I made, and they all use different ports.

The whole NAT router thing, would that be a problem with the router the server is behind only, or also the home routers of the clients connected?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 11th Feb 2012 20:46
Quote: "The whole NAT router thing, would that be a problem with the router the server is behind only, or also the home routers of the clients connected?"

It would be only on the client side.

Qqite
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 26th Feb 2012 07:00 Edited at: 26th Feb 2012 07:03
This is more of a general request than a specific question but here is my scenario:
I have a login server take all connections from Clients that will ask for login information. If the client logs in with an account correctly he is given a list of servers that are connected to the login server.
The Client selects a server to connect to and the login server tells the client the IP and port of the new server.
Heres my problem: Securely getting that client from the login server over to the general servers with account information.

Atm I have it setup so that the login tells the general server to expect a connection from said client's IP and when they do connect tie them x, y, and z account info.

This works, but the problem is that it seems very unsafe to just let an IP dictate which account goes to which. Also, things might go wrong if a lot of people try to login close to the same time from the same IP (like from a school or behind a home router).

What would be the best way to transfer a client from one server to another?

Ventures of the worlds around us are limited only by our imagination.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 27th Feb 2012 22:06 Edited at: 27th Feb 2012 22:07
This is the sort of thing you should look into: http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange

A public key on the client and the login server are combined to form a shared private key unique and only known to that client and login server. You can pass this key to the general servers and they can reject clients which don't provide a valid key.

Blitzbat
12
Years of Service
User Offline
Joined: 11th Mar 2012
Location:
Posted: 11th Mar 2012 17:02
Hi ,

I have some problems with your library.

If I create a server on my local machine I can't connect to it.
I alway get a connection time out.

The DNS_B method return 0.0.0.0 for localhost. I just set the local and remote address to 127.0.0.1 but it does not work too.

Any suggestions about that?

Thanks!
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 11th Mar 2012 22:11
Make sure you set the local address on the client side to 127.0.0.1 too - DNS_B returning 0.0.0.0 is a bug in windows, for some reason the default hosts file has it set to that.

And if that doesn't work you could always use the LAN address e.g. 192.168.1.2.

Qqite
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 13th Mar 2012 21:34
Hey Michael, I'm having a problem with sending a rather large packet. This packet consists of about 30 integers and 10 floats. Connection is setup where the client request account data from server and the server returns the rather large packet.

When I have the sending and receiving packets set to 1kb, the server crashes with an unknown break (using c++ for server). But when I set the packets to 1mb the server stays online but disconnected the client...

Am I doing something wrong to send large packets?

Ventures of the worlds around us are limited only by our imagination.
Qqite
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 15th Mar 2012 01:01 Edited at: 15th Mar 2012 01:05
Hmm, through some experimenting I got it to work. I used
to make the client be able to receive such a large packet. I was changing the size of packets but I guess I do not fully understand buffers then. I guess I had to change
instead.

Ventures of the worlds around us are limited only by our imagination.

Login to post a reply

Server time is: 2024-11-24 09:12:10
Your offset time is: 2024-11-24 09:12:10