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
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 28th Oct 2010 18:34 Edited at: 28th Oct 2010 18:36
Quote: "Or, if you really want to use the mn namespace then you do have to modify MikeNet directly and recompile. The modifications are fairly minor though."


Michael, I have selected this option. My plan is to create a sister class based on NetModeTcpPostfix --> NetModeTcpForHTTP, with a few additions:

bool affixenabledflag;
void SetAffixEnable(bool enabledflag);
bool AffixIsEnabled();

With these additions I will attempt to do something similar to 1.7's SetTransferEverythingTCP() in which I can completely enable/disable finding the Postfix in the DealWithData() at will.

You're coding is much more advanced than mine, so I get a lil lost and confused trying to figure it out all the classes, but, so far, I'm able to recompile.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 29th Oct 2010 15:27
@ Kretaner
Try downloading MikeNet again and installing it, an update was released by TGC yesterday to address some C++ specific issues, including linker errors.

@ TechLord
To add your TCP mode follow these steps:

1. Add your TCP mode to the enum NetMode:rotocolMode found in the header file.

2. Modify NetMode::ConvertToProtocolModeTCP(int mode) to work with your TCP mode.

3. Modify bool NetMode::ValidateProtocolModeTCP( ProtocolMode mode ) to work with your TCP mode.

4. Modify the method NetInstanceProfile::GenerateObjectModeTCP() so that it instantiates your class when your TCP mode is selected.

That should be all you have to do!

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 29th Oct 2010 21:43 Edited at: 29th Oct 2010 21:45
Hi Michael, I've already added my TCP Mode and have similar functions to SetTransferEverythingTCP/GetTransferEverythingTCP (SetAffixEnableTCP/GetAffixEnableTCP) working. I'm using AffixEnabledFlag to enable/disable prefix and postfix checking for all TCP Modes if needed.

Now I'm investigating into the packet construction because DarkNet is still having problems dealing with CR-LF in the PNG file signature.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 30th Oct 2010 00:46
You might be experiencing a problem reported to me with the transfer everything mode concept. Upon receiving a packet that indicates a stream of raw data is about to be received you enable the transfer everything mode. But further data may have already been received before the change in mode causing it to remain in the partial buffer and not be passed to the user.

If you want me to debug your code feel free to email it to me.

Kretaner
14
Years of Service
User Offline
Joined: 19th Oct 2010
Location: Crete, Greece
Posted: 30th Oct 2010 18:10
Hello Michael !

Thanks for the good work - now it's working with Lib's for VS 2008 without Linker errors !

Yes, I forget to write in my first poste that I'm still using VS 2008, because with VS 2010 and the latest SDK's (7 and 7.1) and the 'beta'-versions of the Dark GDK, there were much more troubles for my project.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 4th Nov 2010 22:43
Hi Michael,

I sent you an email with an update for my HTTP implementation. Please advise if you received. Thanks.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 9th Nov 2010 21:29
I have replied, but will respond in more detail ASAP.

By the way everyone, over Christmas I will be doing some work on MikeNet so if you have any feature requests please post them here or email me.

GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 10th Nov 2010 03:47
Quote: "By the way everyone, over Christmas I will be doing some work on MikeNet so if you have any feature requests please post them here or email me."


Mentioned earlier, but just in case:

- Creating an encrypt key without double ints as DBPro doesn't seem to fully support them. Possibly something string based.
- Tieing an encrypt key to a client ID and having encryption/decryption done automatically.
- Easy HTTP file downloading for DBPro users who cannot create their own classes/etc.

That is my Christmas wish list.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 10th Nov 2010 09:02 Edited at: 10th Nov 2010 16:40
Quote: "By the way everyone, over Christmas I will be doing some work on MikeNet so if you have any feature requests please post them here or email me."
I would only request to see more Examples that demonstrate various network configuration (Server/Client, Peer-to-Peer) and applications such as chat. I can understand conceptually how the UDP Operations System work, but, I'm not certain how I would apply it in my Game.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 10th Nov 2010 18:46
Quote: "- Tieing an encrypt key to a client ID and having encryption/decryption done automatically."


I actually did that on my own for one version of WAO. I abandoned that method because it seemed unnecessary. Instead I went to a scheme that started with an initial Key, and used that to encrypt and send the new key to the clients. Then once an hour the key changed and was resent to all the clients. The next version of that will use my own encryption method for the key, and send that in an unencrypted packet that is only received when the previous encrypted packet has the right command bytes in it. The point being there's no need for Mike to do this for us. Having the encryption that he's provided so far has worked quite well. If we rely on him to do all the encryption work, then if someone cracks it we're all vulnerable. If we use the existing encryption, but use our own methods to protect the key, it will be harder for someone to break our individual games.

I could see the need for HTTP download support, but maybe not built in to the library. Perhaps a coding example of how to use the existing commands. That would accomplish the goal, and allow people to learn from the code. I still prefer to write my own file download routine. (I'm just hard headed that way I guess..)

My suggestion is to not bloat a sleek fast running network library with unnecessary features. I actually liked the way it was. We had instancing, encryption, TCP and UDP modes that worked well. If the new version is still that but faster, so much the better. But don't let it grow into something that tries to be everything to everyone.

Now I just need to figure out how to implement compression.

Quote: "I would only request to see more Examples that demonstrate various network configuration "


I'll second that.

I haven't yet played with the new version. I'm hoping to get to that in the next week or so. If not to much has changed in the way the commands work I'll be very happy. With moving from DBPro to C++, and Mike mentioning that the new version is faster, this is going to be quite good for WAO.

I can't wait to get all this other stuff out of the way so I can get back to programming.

- Tearing down the Haunted House
- Finishing the Aloha JV Gold Football Season Highlights DVD
- Building the mobile power cart for the Beaverton Modular Railroad club

and my wife wants to go to Florida for Christmas... (I'm never gonna get this done...)

GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 10th Nov 2010 19:41
Quote: "If we use the existing encryption, but use our own methods to protect the key, it will be harder for someone to break our individual games."


I guess what I meant is that we still handle the creating and communicating the key to the client in whatever fashion we deem worthy, but then after that the key is stored and auto-used. I guess it is a very small thing.

Quote: "Perhaps a coding example of how to use the existing commands"


I tried that with the last version and the commands did not really allow for it. The only way to download a file was to switch to where you receive the data byte by byte, which made parsing the header information a complete nightmare.

I really want to try out the new version to see what it can do, but most of my projects are done and working great, so I need a new project to break it in....

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Nov 2010 00:36 Edited at: 11th Nov 2010 00:41
Quote: "I guess what I meant is that we still handle the creating and communicating the key to the client in whatever fashion we deem worthy, but then after that the key is stored and auto-used. I guess it is a very small thing."


Ah. I see.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 11th Nov 2010 01:23
Quote: "- Creating an encrypt key without double ints as DBPro doesn't seem to fully support them. Possibly something string based."

Really? What about the double integer data type .

Quote: "Easy HTTP file downloading for DBPro users who cannot create their own classes/etc."

That's at the top of my to do list.

Quote: "Tieing an encrypt key to a client ID and having encryption/decryption done automatically."

Probably won't be implemented because its too high level and not that difficult to code anyway.



To me compression is probably the most obvious thing that's missing from the API at the moment. Luckily it will be very easy to make it multi-threaded in the same way that I did encryption. So I want to try and do that over Christmas.

DarkNet 2.0 hasn't changed much on the surface, usage is more or less the same. On the inside its completely different and very easy to work with. There might be some noticeable performance improvements, but definitely stability improvements.

GIDustin
16
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 11th Nov 2010 01:30
Quote: "Really? What about the double integer data type ."


The double integer data type would work perfectly, IF you could use bitwise operations on it, which you can't. I want to make the encrypt key based on the user's password, that way the user doesnt have to send the password over the line. That is why a string based option would be great. I could convert the string to a double int ... if I had bitwise operations, which double ints do not support. That is my dilemma.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 11th Nov 2010 12:31
Quote: "The double integer data type would work perfectly, IF you could use bitwise operations on it, which you can't. I want to make the encrypt key based on the user's password, that way the user doesnt have to send the password over the line. That is why a string based option would be great. I could convert the string to a double int ... if I had bitwise operations, which double ints do not support. That is my dilemma."

Good news! You can get around that issue already. If you want to use a string, or you want to use integers then just:
- Add the strings / integers or any other data type to a packet.
- Change the used size so that it is a multiple of 8.
- Set the cursor position to 0.
- Use mnGetDoubleInt.

This works because packets store all data as bytes.

Also I think IanM's plugin has commands that can use bitwise operators on double integers.

DigitalFury
14
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 13th Nov 2010 03:05 Edited at: 13th Nov 2010 04:39
@Michael P -

I can't seem to get this to work:

Use this for the client:


It won't connect to the server. I checked and "MyDNS.game-server.cc" is pointing to my IP address. I also tried my IP address directly and it doesn't work. Why?

Client Code:


Server Code:



Got any more examples finished?
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 13th Nov 2010 22:47
If your client and server are on your internal network, then it wont be able to connect to the server through your external IP address. Use the internal IP address of the server to connect to instead.

If you are connecting to your server via the external IP address from another network / location, then the router at the server location needs to be forwarding your chosen port to your server.

DigitalFury
14
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 13th Nov 2010 23:18
@KISTech - "mn Set Profile Local" - What is the external equalivant of this command? I guess I will have to figure the port of my server. The documentation has changed and it seems that Michael P hasn't finished DBP the help and examples quite yet.

Thanks

DigitalFury
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 14th Nov 2010 19:45
In your code you set "localPort" to 6789. So change that to whatever you intend to use. Then on your router forward that port to your server.

DigitalFury
14
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 14th Nov 2010 20:55
@KISTech -

Quote: "Then on your router forward that port to your server. "


Can't do that. I am using Dyn-DNS.

Made a new thread. It explains everything:

http://forum.thegamecreators.com/?m=forum_view&t=177804&b=1

Thanks,

DigitalFury
OldPMan
TGC Store Seller
16
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 1st Dec 2010 20:56
I read the whole topic from beginning to end, but have not found a solution to my problem (all 670 messages).
is there any possibility to create a server to work through the Internet on a computer which has a dynamic IP?
the thing is that a very large number of people in Russia have the same internet as I have - it's USB modems, and most of them have the same external IP.
My IP from IPConfig does not match the IP of whatismiip.com. I understand that my IP from IPConfig a local IP assigned by my ISP.
from the Internet to me nobody can connect. am I right?
I then arrange a game on the Internet?

.....already beside..... for all
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 1st Dec 2010 23:50
So you want to host a server behind a router of some sort?

You need the ports to be forwarded to your computer. You could try doing this with Universal Plug and Play (a module in DarkNet) but otherwise you will have to do this manually. If you can't port forward because of your internet connection then you can't host a server, so you might want to rent a server from elsewhere that you can upload and run your executables on.

OldPMan
TGC Store Seller
16
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 2nd Dec 2010 00:33
I tried to start the demo UPnP it fails.


I've tried so as to start the service that relate to UPnP, but it seems that I have not found anything because the program UPnPtest.exe fails last 2 tests out of 8.


This means that I can not use UPnP?

.....already beside..... for all
OldPMan
TGC Store Seller
16
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 2nd Dec 2010 00:46 Edited at: 2nd Dec 2010 00:49
Quote: "This means that I can not use UPnP?"

Excuse me for this question. I realized that if the modem is connected via USB then UPnp will not work.
Thank you very much for your quick reply.

I just wanted to make something people could create a game and play with each other (so that the server is located in any of the players).
it seems that this is an impossible idea?

.....already beside..... for all
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 10th Dec 2010 20:56
@ RUSSIA
Yeah that's possible but you need something called NAT punch-through which is quite difficult to implement. I will be looking at adding support for this soon.

@ All
With all this talk of a cyber war revolving around wikileaks I've decided I'm going to look at implementing security measures that will reduce the impact of distributed denial of service attacks and ensure that your server will keep running in all situations (although of course a large scale attack will cause performance deterioration).

I'll also try and make a video explaining how the security measures work as I think its pretty interesting.

thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 11th Dec 2010 22:17
Hi, I just bought MikeNet this week, and so far everything seems awesome. One of the biggest things that I've been excited about is the voice chat capabilities... but I haven't gotten it to work yet. Do you have any other examples besides the cube world client/server?


Eminent
14
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 12th Dec 2010 17:17
The code-base is your friend :
Voice Chat system from the guy who made Evochron series(at least it's what it says):



OldPMan
TGC Store Seller
16
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 12th Dec 2010 19:03 Edited at: 12th Dec 2010 19:05
@ Michael, I've heard that the NAT punch-through is very difficult. It would be really cool if you get it done. Thank you.

Quote: "I'll also try and make a video explaining how the security measures work as I think its pretty interesting."
You are doing a lot of work.

Regards Andrew

.....already beside..... for all
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 12th Dec 2010 23:15
@ Emminent
That code is from v1 but luckily v2 is very similar to v1 in terms of usage so you should be able to quite easily convert the code. Note that the sound output compatibility issues that were experienced in rare cases are now probably fixed (although this is unconfirmed) in v2 due to the rewrite.

@ thenerd
Yes I will be converting the code soon, I ran out of time which is why the code isn't already converted; I aim to have this done by Christmas day . Usage is fairly self explanatory though so you shouldn't have much trouble implementing it, if you do have any specific problems feel free to post them.

@ RUSSIA
The problem I have with NAT punch-through is that its quite difficult to debug, its not very high on my to do list at the moment but I will see if I can find time for it.

@ All
Quote: "You are doing a lot of work."

I only work hard on DarkNet a few weeks a year, if I had more time I'd implement much more but DarkNet is in a good place at the moment and I'm really glad that I've kept on developing it. The modules currently in place can't be improved except for adding more functionality, and this really is the first release where I can say that without any doubt.

I plan to start work on a game project that uses DarkNet so look out for this on the WIP boards, its something that I think I will enjoy working on and it will be quite different to anything you've seen before that's been made with a TGC product. That's all I'm going to say now in case I don't deliver on this .

Also, as I hinted at previously, I would like to start making developer diaries where I talk about a new feature in DarkNet and how it was implemented, but this is pretty time consuming so I'm not too sure if it will materialise.

Kretaner
14
Years of Service
User Offline
Joined: 19th Oct 2010
Location: Crete, Greece
Posted: 16th Dec 2010 10:38
mn::GetLocalIPUDP() - Unexpected Error in mn::GetLocalAddresssUDP ?

Hey !
I'm suffering since a couple of hours with the following troubles:
I was using the code from the old 'Cube World (Advanced)' example to setup my server and clients. I changed the code now to the new 2.0 classes.
Compiling works, but in Debug mode (VS2008) I become this error message:

'DarkNet-Unexpected Error:
An error ocurred in mn::GetLocalAddressUDP whilst retrieving an instance object from agroup, instance is no longer active at line 149 pf file 'NetInstanceGroup.cpp'. Error code 0. Version 'Release v2.0'

I'm wondering abut this because it happens when I'm using mn::GetLocalIPUDP.

Here is the code of the class until the error break at mn::GetLocalIPUDP(zeile-1):


Thanks for help !
Norman
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 16th Dec 2010 12:56
Have a look at the documentation. You are using mn::GetLocalIPUDP which retrieves the local UDP IP that an instance is bound to.

What it looks like you want to do is retrieve the IP of a local interface which can be done using mn::GetLocalInterfaceStr.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 14th Jan 2011 14:56 Edited at: 14th Jan 2011 20:04
Hi guys, unfortunately I haven't found the time to finish the update so its going to be delayed by at least 3 months.

The reason for this is I've been working hard to secure a year technology internship, and have just received an offer from Barclays Capital. DarkNet was very helpful in the interview, I essentially talked about it for an hour solid so a big thank you to everyone who helped to keep me motivated and give me ideas!

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 14th Jan 2011 17:31
Outstanding!!

Very glad that your hard work has paid off.

hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 29th Jan 2011 10:26
So i love this plug in.

but with my new game i wanna be able to have a server hosted online that people can connect to find other players then it goes peer to peer so the server isnt doing all the work.

2.0Gh AM2 Processor, 9800GT, 2Gb Ram
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 31st Jan 2011 20:04
That's pretty hard to do with DarkNet, you need to use NAT punch-through or you'l have problems with most of your users across the internet.

hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 31st Jan 2011 21:20
Well im just working on LAN atm. Which is a bit tricky cause im trying to use the broadcast server and im getting stuck on trying to get a user to be able to host a game while getting there own client ID.

2.0Gh AM2 Processor, 9800GT, 2Gb Ram
hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 11th Feb 2011 01:41
MP are you able to help me with the nat stuff. im just not getting it. also i cant seam to get broadcasting to work.

2.0Gh AM2 Processor, 9800GT, 2Gb Ram
Kretaner
14
Years of Service
User Offline
Joined: 19th Oct 2010
Location: Crete, Greece
Posted: 15th Feb 2011 18:07
Problem with using mn::StartBroadcast before mn::StartServer (during transfering the old Cube examplt to DarkNet2).

When I'm using mn::StartBroadcast before mn::StartServer I get this error message (it doesn't happend when I'm not using mn::StartBroadcats):
'An error occurred in mn::StartServer whilst binding a socket at line 265 of file 'NetSocketSimple.cpp'. Error code 10048....

Here are the relevant code fragments:

...and a little bit later...


The error happens when the mn::StartServer command follows after using the mn::StartBroadcast command in the first code snippte. If I'm disable mn::StartBroadcast then the error doesn't happens.

I'm just trying to use the old Cube example from DarkNet1 whith DarkNet2, but soemthing isn't working properly anymore.

Thanks fpr alittle bit help, because it's a hard work only with the little new example which is with DarkNet2 to use all this many commands in the right way and order !
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 16th Feb 2011 02:06
You are binding the server to the same port as the broadcasting socket. The server needs exclusive access to the UDP port it is bound to, so another instance or UDP socket can't be bound to the same address and port.

Kretaner
14
Years of Service
User Offline
Joined: 19th Oct 2010
Location: Crete, Greece
Posted: 21st Feb 2011 18:43
Thanks Michael for the quick answer - now this problem is solved.
But now I'm struggeling since a couple of hours with the connection of the server to itselfes.
Here I'm starting now sucesfull the server:

I'm copying at the beginning the (local) IP and Port to use if later to connect to the server - and in this case the server to itselfes:

I was using different modifications and orders. So far as I understand, I have to setup again a new profile and instance to connect the server to itselfes - but anyway I have to connect to the same port and IP as the server is using.
Unfortunatly I always have this error in the last code line (mn::Connect):
...in mn::Connect whilst binding a socket at line 265 of file 'NetSocketSimple.cpp'. Error code 10048...

What could be wrong ? I can not use a other IP or Port as in the case of the previous problem with broadcasting.

Thanks for a little bit help again !
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Feb 2011 02:06
Get rid of this line:


You are binding the client to the same address as the server, and since the server is already bound to this address it is already in use. If you don't specify a local IP and port then winsock will allocate one automatically (this is what most applications do).

hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 8th Mar 2011 02:21 Edited at: 8th Mar 2011 02:22
So at the moment im trying to get a simple broadcast instance to work once i get it set up i try sending and receiving simple lines of text but none of the users receives the packet.



This is the main part of the code im trying to get to work

2.0Gh AM2 Processor, 9800GT, 2Gb Ram
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 8th Mar 2011 23:40
Here's some DBP code explaining how to use broadcasting:


Broadcasting is a little buggy atm (see comments in code) but you can get it working.

hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 9th Mar 2011 00:20
Thanks heaps. works wonderful now.

2.0Gh AM2 Processor, 9800GT, 2Gb Ram
hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 9th Mar 2011 00:42 Edited at: 9th Mar 2011 00:44
I jsut realized it still isnt working.

Now the program receives its own packets it send but other people on the lan still dont receive packets

2.0Gh AM2 Processor, 9800GT, 2Gb Ram
Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 12th Mar 2011 17:13
Hi Michael, long time no see.
I have been working with darknet, got into something and haven't been able to solute it. Don't know if someone had the same issue somewhere, because there are now so many darknet thread and have look into some without success.

http://forum.thegamecreators.com/?m=forum_view&t=182653&b=1

It would be great if you can help me.

Cheers.

AlfaX
hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 13th Mar 2011 10:35
ok using the code u gave me ive discovered i can only receive packets from the ip set in the broadcast instance. so how can we receive from all computers on the lan. not just the single ip

2.0Gh AM2 Processor, 9800GT, 2Gb Ram
Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 13th Mar 2011 21:09 Edited at: 13th Mar 2011 21:09
You can poll through ip's.

(Maybe there is a way to receive from all although)
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 13th Mar 2011 21:15 Edited at: 13th Mar 2011 21:18
@ hookkshot
Each local IP corresponds to a different LAN. So just send to each LAN individually.

@ Alfa X
Are you trying to run a peer to peer game across the internet? You really want something called NAT punch-through. For now you can use Universal Plug and Play (but that is very unreliable).

I've been thinking about writing a peer to peer module for DarkNet and might try and do that over Easter, but I'm not sure how hard it will be.

In theory you should be able to do NAT punch-through with DarkNet at the moment, and if you're using C++ then you definitely can using the sockets.

NAT punch-through involves a server which is publicly accessible to all clients but does not actually host the game, it just helps the peers to connect to each other when they are behind a NAT enabled router. When peers are handshaking they connect to the public server, who 'punches' a hole through their NAT and manages to temporarily forward a port so that the two can connect. Without this no ports are forwarded and so any communications between the peers just gets discarded because the router doesn't know what to do with the packets.

hookkshot
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 14th Mar 2011 03:30
But the to IP's i received from are on the same LAN

192.168.1.122 and 192.168.1.113

when i use the send profile and send to 255.255.255.255

a computer will only receive it from the receive instance if u set the receive instance IP to that of the computer you want to receive from

i could poll through IP's but i would have to create a broadcast instance for every IP

2.0Gh AM2 Processor, 9800GT, 2Gb Ram

Login to post a reply

Server time is: 2024-11-21 19:28:41
Your offset time is: 2024-11-21 19:28:41