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
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 25th Jul 2009 21:13 Edited at: 26th Jul 2009 21:07
@ AlexI
Google has told me that windows.h is still including the old winsock (winsock.h) which has compatibility issues with winsock2.h. I don't think I can do anything about that, but it shouldn't be too much of a problem. I have updated the documentation so that it mentions this issue.

Website
DarkNet now has a website, tell me what you think

http://www.DarkNetworking.net

v1.1.6
I am about to send off v1.1.6 which includes the following:
- Improved receive performance
- mnEncrypt now allocates new memory if not enough is available
- mnDisableDebug no longer disables mnGet or mnDecrypt error messages, it now only disables internal receive related client and server message boxes.
- Significantly improved performance while auto resize TCP is enabled in standard TM_SIZE TCP mode.
- Added mnGetProfileAmount and mnGetProfileType firewall commands.
- Added mnGetAutoResizeTCP.
- Updated UPnP and File Transfer demos to use new commands

Bug fixes:
- mnChangeBufferSizeTCP did not work.
- mnSendTCP and mnSendUDP didn't check client ID parameter in server state, UM_CATCH_ALL (3) and UM_CATCH_ALL_NO (4).
- mnSetSendTimeout now properly disconnects clients after the timeout period expires.
- mnGetTCPRecvSizeA and mnGetTCPRecvSizeB now return correct value.
- mnSetAutoResizeTCP caused unexpected error if client ID was 0 in server state.
- Updated documentation, alot of firewall commands were missing because the program I use to generate the HTML files didn't load the entire document.

GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 26th Jul 2009 00:50
Got another error for ya Mike. Using the non-blocking connect and mn poll connect.

An error occured in an internal function (_clHandShake) whilst getting data from a packet. The end of the packet was reached before all the data could be extracted from the packet. .....

The error happens almost immediately after trying to connect. The server and client are running on the same machine.

Any suggestions?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 26th Jul 2009 21:00
Did you disable TCP handshake (mnDisableTCPHandshake) on the server but not the client? If you want to disable the TCP handshake you have to do it on both sides.

The client is expecting to receive a handshake packet of a certain size from the server. The server doesn't send this because TCP handshake is disabled; instead it sends a packet sent by you using mnSendTCP which is too small.

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 26th Jul 2009 21:55 Edited at: 26th Jul 2009 22:21
Quote: "[quote]Can you add something which gets the current volume of the microphone, this way when the volume is over X amount it will automatically start recording/sending"

I will have a go
[/quote]
It would be nice if you could add the above

EDIT: its already there ( mnGetDataVolume )

EDIT: Does mnGetDataVolume only work on output packets?

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 26th Jul 2009 23:00 Edited at: 26th Jul 2009 23:02
It works on packets containing sound wave data. You can use it on packets retrieved using mnGetInputData.

By the way, you can download the updated documentation from the DarkNet website: http://www.darknetworking.net/Documentation.html. Some files are missing from the v1.1.5 documentation.

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 26th Jul 2009 23:31 Edited at: 26th Jul 2009 23:36
Any idea why I get these 2 messages then?

Errors:


Main Loop Code:



Full code:


Thanks,
Alex

Attachments

Login to view attachments
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 27th Jul 2009 02:54
Here is the corrected code, which works for me using the demo sound server:


You were passing iResult to mnGetDataVolume which is not a packet. You also need to check the return value of mnGetInputData to check that data was received.

I don't know why got an error with _ManageSoundOutput, perhaps that is related to the initial access violation due to using mnGetDataVolume wrongly?

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 30th Jul 2009 20:41 Edited at: 30th Jul 2009 21:19
Great job , cant wait to implement this in my game.

[Edit]

Sorry i am new to this but i am getting a few errors adding it to my current project.



I did everything you said to in the PDF file.

Attachments

Login to view attachments
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 1st Aug 2009 19:59
@ Marsh0
You have to include MikeNet before DarkGDK.h.

@ All
I am away from the 2nd of August to the 16th of August on holiday in the USA so I won't be around to respond to emails or posts.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 3rd Aug 2009 03:07 Edited at: 3rd Aug 2009 03:07
Should have mentioned where in the US. If it were Oregon we could meet up and have a pint.

Alfa x
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 3rd Aug 2009 19:01
Colombia is great for vacations
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 3rd Aug 2009 20:11
I want to visit Amsterdam, Fiji, the US Virgin Islands, Jamaica, and Hawaii sometime..

(not necessarily in that order..)

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 5th Aug 2009 06:22 Edited at: 5th Aug 2009 06:24
Im in San Francisco right now, driving down to LA day after tomorrow, staying in LA a couple days and then going to Las Vegas. Im on iphone using hotel Internet right now

GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 11th Aug 2009 01:59 Edited at: 11th Aug 2009 02:50
Mike! Mikey, Michael, ol' buddy ol' pal!

Gotta question for ya.

mn Add String(SendPacket,"",0,1)

works just fine, but when the server tries:

meh$ = mn Get String(RecPacket,0,1)

it crashes. Attempting to retrieve any empty string causes a crash. There are times when an empty string is what needs to be sent. Is this something that you can fix? Is there an easy work-around without having to check all my strings before I send them, and set some kind of flag if they are empty?

Thanks for all the support you have provided thus far!
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Aug 2009 02:16
mn Add and mn Get don't use the instance, they use the packet.

So if you've named your packets,

Send
Recv

Then it would be,

mn Add String Send, " ", 0, 1

and

mn Get String(Recv, 0, 1)

GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 11th Aug 2009 02:51
My code had it the right way, I just screwed up the example above. Fixed the code in the post above but the underlying problem still exists.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Aug 2009 19:01
I just re-read your error. Now I understand.

I don't think DarkNet will handle an empty string. I could be wrong, but it's just a guess.

Try sending just a single space instead. Then when you receive it on the other end if you really need it to be empty, then reset the variable to "".

N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 11th Aug 2009 19:04
Yer i'd try sending a space " " then at the other end use trim$ from matrixplugins, that will get rid of any spaces thus leaving it as a blank string ""

Yours
N3wton

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 18th Aug 2009 13:36
I looked into it and found that there is a problem with mnAddString on strings smaller than 4 bytes, it increases the used size too far. Maybe this is causing your problem?

I've fixed this ready for the next version and I can confirm that empty strings do work.

GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 18th Aug 2009 15:41
Quote: "I've fixed this ready for the next version and I can confirm that empty strings do work."


Can't wait!
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 25th Aug 2009 21:05 Edited at: 25th Aug 2009 21:06
v1.1.6 can now be downloaded from TGC; they took ages to upload the update but it is finally available

There's going to be an article about DarkNet in the next TGC newsletter; it covers the key improvements and added functionality resulting from v1.1.5 and v1.1.6 in more detail than you've seen anywhere else. There's also a good explanation of the packet system and how exactly memory size, used size and cursor position work and interact with each other.

Alfa x
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 26th Aug 2009 01:03
This will be included in the documentation of MikeNet?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 26th Aug 2009 12:16 Edited at: 26th Aug 2009 12:16
Yes elements of it I will probably copy into the documentation for the next version.

You can see some of what will be in the newsletter on the website here and here.

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 7th Sep 2009 23:15
Hello, i cannot figure out why this is not working. Currently i can get my server to recieve packets. But no matter what i do the client cannot seem to get any here is my code. Any help would be greatly appreciated.

Server Code (just what is applicable). It receives the packet fine. But it either doesnt send a packet or the client doesnt receive.


Client

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 8th Sep 2009 11:09
You are excluding a client using mnSendTCPAll on the server side. This client is probably the one you want to send too? Change the client to exclude parameter to 0 to send to all clients.

Also, your mnGets should match your mnAdds but they do not. You've done mnAddInt, mnAddInt and mnGetFloat, mnGetFloat. It should be mnAddInt, mnAddInt and mnGetInt, mnGetInt or mnAddFloat, mnAddFloat and mnGetFloat, mnGetFloat.

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 8th Sep 2009 19:02
Quote: "You are excluding a client using mnSendTCPAll on the server side. This client is probably the one you want to send too? Change the client to exclude parameter to 0 to send to all clients."


Thank you , i am not 100% sure what you mean. I fixed the second part of what you said. To match the ints with ints. But i am not sure how i can change my code to except all clients?. Sorry i am fairly new to c++ could you explain it a tad more.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 8th Sep 2009 22:23 Edited at: 8th Sep 2009 22:24
Change:
mnSendTCPAll(0,SendPacket,false,false,Client);

To:
mnSendTCPAll(0,SendPacket,false,false,0);

If the last (exclude) parameter is not 0 then the packet will be sent to all clients except the one with that ID. So, if 3 clients are connected and the exclude parameter is 2 then the packet will be sent to client 1 and 3 but not 2. if the exclude parameter is 0 then the packet will be sent to all clients (1, 2 and 3).

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 8th Sep 2009 22:46
Ah, sorry for my ignorance . It works great.
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 9th Sep 2009 09:46 Edited at: 9th Sep 2009 09:48
Alright, here to pester you with more questions. For the life of my i cant figure this out. I figure i should get some sleep tonight and it will probably be simple for you. Thanks for any help i can receive.


Ok, so basically i am sending my players position to the server, the server is receiving it fine and sending it back to the client. The client is receiving it fine if i send it to all clients. But if i tell it to send to all clients BUT the one the packet is sent from it doesnt send to any. It makes no sense. Because if my ClientID = 1 no one will get my packet. But if i just put a 1 everyone will get it but 1.

Here is my code. Please explain my mistakes

Server


Client (send)


Client (Recieve)


Not sure if im making sense. It works 100%. I just cant get it to only send to other clients unless i put the client number in manually.

Thanks again, sorry for all the trouble.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 9th Sep 2009 12:17
What UDP mode are you using? If you are using 'per client' (1) or 'per client, per operation' (2) then the packet has to contain certain data (see documentation for more information).

It would help if I could see more code, specifically the actual mnRecvUDP and any related code.

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 9th Sep 2009 16:51 Edited at: 9th Sep 2009 23:56
nm
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 11th Sep 2009 12:42
@ All
There is a rather large empty space on the first page of the DarkNet website and I want to fill this with something interesting.

My idea is to have a collage of screenshots from various applications/games that people have worked on using DarkNet. So if you want to see your project on the website please provide me with a screenshot. I can provide a link back to your work in return.

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 11th Sep 2009 19:21 Edited at: 13th Sep 2009 19:33
This is the game engine im currently making, you cannot really tell that im using mikenet i suppose, but you will notice that the main character marsh is me, but Niko is another player on another client. when another client logs in you can walk around and see each other. Fairly simple kind of like the cube world demo i guess. But if you want to use it i would be honoured.

Linkback if you do use it. www.freemmorpgmaker.com

Attachments

Login to view attachments
Alfa x
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 13th Sep 2009 16:46
Hi Mike.

Use any image from:

http://forum.thegamecreators.com/?m=forum_view&t=111037&b=8
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 13th Sep 2009 20:39
I'm in the midst of a total rewrite of Worlds Apart Online, but the previous version has some screenshots in the WIP thread.

http://forum.thegamecreators.com/?m=forum_view&t=148222&b=8

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 13th Sep 2009 22:22 Edited at: 13th Sep 2009 22:25
Sweet! It's inspiring to see DarkNet used in such high quality projects I've decided I'm going to have an entire page dedicated to projects that use DarkNet.

You may be wondering what is happening for the next version. I'm working on some performance improvements, which I think will be the last ever major performance increase to the networking module.

In addition to this I have a few ideas that I will probably implement:
- mnFinish option to not reset settings such as mnDisableUDP.
- Ability to send UDP packets to addresses that there is no connection to, and similarly receive UDP packets from an unknown source.
- Ability to receive out of order UDP packets that would usually be discarded.
- Ability to deal with errors in the worker thread using the standard error system. Currently an error message box is displayed regardless.
- NAT punch-through demo.
- mnSetFunction for .NET and maybe even DBP.
- Documentation improvements.

In the long term, I want to look at:
- Packet compression.
- Web cam support (similar to the sound module).
- Expansion of the Universal Plug and Play (UPnP) module; UPnP can be used for more than just NAT traversal.

Right now DarkNet is very refined and relatively bug free. Only one minor bug has been found with mnAddString where the used size increases more than it should with small strings.

Thanks for all the suggestions and feedback everyone has given

Alfa x
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 14th Sep 2009 16:32
Quote: "
You may be wondering what is happening for the next version. I'm working on some performance improvements, which I think will be the last ever major performance increase to the networking module."


More performance. . Wow. It applies to sound streaming too?.

Quote: "- Web cam support (similar to the sound module)."


So you can stream video and watch it using MikeNet???. if this is true, I'm very very eager to watch it because it's mandatory and central to the work I will develop in the next months and in which I will be dedicated.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 14th Sep 2009 22:17
I have updated the website with a page about your projects. If anyone else wants to see their work there then please post here. If you want anything changed/added please let me know.

Here is the link, let me know what you think:
http://www.darknetworking.net/InAction.html

Quote: "More performance. . Wow. It applies to sound streaming too?."

Performance will improve in these areas:
- Receiving, especially on multiple instances.
- Sending.
- Encryption and Decryption. Currently this is single threaded, I intend to make it multi-threaded.

Quote: "So you can stream video and watch it using MikeNet???. if this is true, I'm very very eager to watch it because it's mandatory and central to the work I will develop in the next months and in which I will be dedicated."

Yes, that is the aim. It is a long term goal though, so don't expect anything any time soon. I will keep this thread updated.

Usage will probably be very similar to that of the DarkNet sound module, since the basic principals are the same.

Alfa x
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 14th Sep 2009 22:28
Quote: "I have updated the website with a page about your projects. If anyone else wants to see their work there then please post here. If you want anything changed/added please let me know.

Here is the link, let me know what you think:
http://www.darknetworking.net/InAction.html
"


I like it. It's fine.
Isocadia
14
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 17th Sep 2009 19:56 Edited at: 17th Sep 2009 20:31
Well, I got a simple question, is there a good beginners tutorial for darknet, cause the documentation given on the site, well i can't really figure it out.

Thanks for your help.

Isocadia

Edit: So i downloaded the project, and when i try to compile it, it says missing Lua.h and Nxphysics.h or something, and when i add them to the visual studio folder, it says its missing all the files that they include etc. it seems as if alot of the h files can't be found. Is this a problem only on my comp and if it is, how do i solve it??
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 17th Sep 2009 21:48 Edited at: 17th Sep 2009 21:48
Quote: "Well, I got a simple question, is there a good beginners tutorial for darknet, cause the documentation given on the site, well i can't really figure it out."

Not that I know of, I might write one if I get the time. The documentation is for reference purposes, the best way to learn is by:
- Looking at the demo projects
- Trying things out

DarkNet isn't really that difficult to use once you get going.

Quote: "Edit: So i downloaded the project, and when i try to compile it, it says missing Lua.h and Nxphysics.h or something, and when i add them to the visual studio folder, it says its missing all the files that they include etc. it seems as if alot of the h files can't be found. Is this a problem only on my comp and if it is, how do i solve it??"

Those files are not DarkNet related, what project are you trying to compile?

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 18th Sep 2009 19:03
v1.1.7
I have just sent off v1.1.7. I decided to release this now because there is a critical bug fix to the firewall module.

Changes:
- Performance has improved for sending data. Non blocking (asynchronous) now performs just as well as blocking (synchronous).

- Performance has improved for receiving data, especially when dealing with a large number of instances or clients.

- mnAdd commands now increase the memory size so you no longer have to use mnSetMemorySize or mnChangeMemorySize before adding data. Note that changing the memory size regularly will reduce performance significantly.

- Fixed a bug where mnStartFirewall could throw an error on some systems.

- Fixed a bug where mnAddStringC increased the used size too much when adding small strings.

- Fixed a vista compatibility problem with some of the demo projects. This problem meant that connections could not complete. Note that this problem was fixed by simply changing the demo project code.

Isocadia
14
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 18th Sep 2009 20:07
@Michael: Oops, very funny, posted this here instead of in Super Game engine post, worked on both at the same time xD. But I still get one error and it is darknet related. I get a missing MikeNetdllplugin or something. I saw that you could download it using your downloader or something in another post, but i can't find it back xD. So i hope that you can help me.

Isocadia
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 19th Sep 2009 03:25
I think you are better off asking for help on the project's thread, I don't know enough about it

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 21st Sep 2009 23:19
So, i know someone else asked this question a week or so ago.

I have my project working, but whenever i send info i send say 10 packets at once. Then they are received by the server in order. But i really dont want to be sending all 10 packets every single time. So i figured i would just use 1 receive and then use a if statement to check if the starting character is a certain number to tell which packet is for. But then i realized the program would error if it was a integer receiving a string or vice versa.

So how do i send only 1 packet, then have the server receive it without sending a whole bunch of packets in a certain order. Not sure if this makes any sense to you.

Anyway, once again thanks for any help i receive.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Sep 2009 04:55
The way I do it is to have a byte prefix that is used to determine the purpose of the packet. Based on this your application can use a different combination of mnGet commands. Take a look at the demo code to see an example.

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 22nd Sep 2009 05:27
Ah, i figured it out thanks a ton. I was thinking that i should add a prefix to every single packet. Instead of just adding another one telling the server whats to come. Sorry for bugging you with so many questions.
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 30th Sep 2009 09:10
Sorry for double post, not sure if you would check the thread if i just edited my old one.

I have run into a problem that makes no sense to me. I have everything working well. When each player logs into the game they see each other. But whenever i try to send new info then it doesnt work. There name shows up but not there sprites. I have tested this thouroughly everything works fine until i send a new packet from the server to the client.

Client Send Packet(Works Fine)


Server Recieve Packet(works Fine) Then Sends (sprites no longer show if i send a packet)


Client Recieve Packet


Even if nothing happens when the client recieves it. It still stops working. It makes no sense. Any ideas? It isnt messing with anything becouse the client does nothing when it recieves the packet. It only messes up when the server sends a new packet.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 30th Sep 2009 14:28
That is strange. You might be using DGDK incorrectly, or you might have some kind of memory corruption at another point in your code, it could just be coincidence that this alteration causes the problem to become apparent.

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 30th Sep 2009 19:06 Edited at: 30th Sep 2009 19:25
The same thing happens when the server sends out other packets, if i sent you the code to your email would you have a look perhaps? if not it is fine.

Also if it is memory corruption would that that be due to the client or the server? or both?

Login to post a reply

Server time is: 2024-03-28 10:24:36
Your offset time is: 2024-03-28 10:24:36