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: 30th Sep 2009 19:30 Edited at: 30th Sep 2009 19:31
Yes you can email it to pryor.michael@gmail.com.

I'd prefer it if you sent the project aswell so attach the folder without any .exe or .ncb files. If that is too much trouble you can just send me the cpp file.

[edit]
It would probably just be the client, assuming thats the only place you notice problems.

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 30th Sep 2009 19:33
As it turns out, i am a idiot.

For some reason i was creating a sprite for the player if it was the first time he connected, but i had the check if a packet was recieved for the first time. Not if a location packet was recieved (with the sprite info).

Again i waste your time, and i apologize. Though i must say your support for your product is astounding.

Also here is a new screen if you want to update your site. More mikenet being used for the chat.

http://www.freemmorpgmaker.com/chat.png
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 30th Sep 2009 19:38
Thanks I try my best I will update the website with the new screenshot, probably next week some time.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 3rd Oct 2009 00:57 Edited at: 3rd Oct 2009 01:42
Have there been any issues with DarkNet on Vista?

My game client runs fine on XP, but not my Vista laptop. This is a recent development, because it worked on Vista in an early release. (the latest one and the one released in August are having this problem.)

[edit]
Nevermind. It's something else going on with Vista. Probably display related or something. Still tracking it down, but at least I was able to prove it wasn't DarkNet.

Dragon Knight
17
Years of Service
User Offline
Joined: 10th Jan 2007
Location: Newcastle
Posted: 5th Oct 2009 05:22
Since I'm back from summer holidays, I think I'm going to try my hand again at this.

I'm going to make a small client / server application to try out sometime this weekend to test if i can hook them up between my home and the uni computers. Should be fun

Thanks Michael, for all the updates and for working on with it

marlou
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location:
Posted: 8th Dec 2009 10:59
HI..Im using MikeNet with DarkGDK...

I get an error on unresolved external symbol on DisconnectServer.
Only 1 error..

I have linked with the WS2_32.lib and MikeNet.lib.
Code Generation:Multi-Threaded Debug DLL
-i keep it in this Multi-threaded debug dll bcoz i get errors with DarkGDK libraries when in MT and MTDebug.
I have ignored specific libraries like atls and atlsd.

I cant make an exe because of the error..pls help..^^

When a person has nothing but a dream, can he dare to dream.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 8th Dec 2009 12:13 Edited at: 25th Dec 2009 01:49
You need to change it to MT or MTDebug. DarkGDK should work with MT. Try creating a new project from one of the templates and looking at the project settings if you still can't get it to work.

Attachments

Login to view attachments
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 9th Dec 2009 20:34 Edited at: 12th Dec 2009 21:04
Ive been using this for awhile now and i must say that it is gosh darn amazing . Thanks for creating it.
marlou
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location:
Posted: 14th Dec 2009 02:53
Yes it worked in MT. Thanks. =)

When a person has nothing but a dream, can he dare to dream.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 25th Dec 2009 01:41 Edited at: 25th Dec 2009 01:57
Hi guys, happy Christmas!

I am still working on DarkNet despite not releasing an update for some time.

I am currently rewriting large parts of DarkNet in order to achieve the following:
- safer code
- easier to read and understand code
- well documented code

I plan to release the source code of DarkNet to those who own a copy of DarkNet (and those who decide to purchase DarkNet later on) once this process is complete.

I am now using doxygen to generate HTML documentation for DarkNet, extracted from the source files themselves. This works in the same way as javadoc for java. The documentation as a result will be much more clean, correct and complete. Documentation will also exist for the source code of DarkNet rather than just the functions you use. Attached is a sample showing the documentation for the clPacket class and here is a screenshot:


While rewriting DarkNet I will be making the changes necessary to support 64 bit which will allow you to use DarkNet with 64 bit applications.

Compatibility with other languages is increasing, with a new DLL who's methods can be called from many languages. Primarily this enables compatibility with Unity3D. This will be released with the next update.

And finally I will be testing DarkNet thoroughly with Windows 7.

The changes being made are sizeable and I have very limited time. As a result it may be a while before I have anything to release but I will keep you updated from time to time.

Happy holidays all!

Attachments

Login to view attachments
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 25th Dec 2009 09:36
Cool , good to see updates.
Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 31st Dec 2009 00:00
Nice updates.

If you could use DarkNet in many applications, it means that if you change engine, you can still use it. Do you plan to do it OS independent in the near future ?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 31st Dec 2009 12:48 Edited at: 19th Apr 2010 22:12
Not in the near future but it is on my to do list as I feel DarkNet's reliance on windows is its biggest weakness at the moment.

Attachments

Login to view attachments
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 31st Dec 2009 20:30
All of our reliance on Windows is our biggest weakness at the moment.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 31st Dec 2009 22:46
I've always wanted to make a DBPro game which has a server which runs on linux. Can't wait until you add this in the not so near future!

Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 2nd Jan 2010 19:20
me too!. .
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 15th Jan 2010 06:43
Anyway to colour your server text? would be very handy.

Thanks

www.touchofdeathproductions.com
Malibu
14
Years of Service
User Offline
Joined: 13th Mar 2010
Location:
Posted: 14th Mar 2010 02:54
Hi all

Is there a Command that identify a single PC like the MAC-Address?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 24th Mar 2010 03:52
Not currently but I may add a command that does this, you could identify a PC by its IP address and port.

Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 29th Mar 2010 21:30
very nice if you do this.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 10th Apr 2010 15:32 Edited at: 10th Apr 2010 16:21
When I try to compile my project. I get this error:


I only get this error when I use the std::cout command.

When I put #include <iostream> before #include <MikeNet.h> I get 5 errors.


The only libaries I am using are Mikenet, iostream and Windows (without the LEAN AND MEAN definition).



I also get this error weather or not I use std::cout:


I am using Visual C++ 2008 Professional. Compiling in release mode.


Edit: Just fixed it. To get rid of the errors I disabled Link time Code Generation. And to get rid of the warning I did added this to the linker command line: /NODEFAULTLIB:LIBCMT.


PS: Is it possible to create a version for GCC?

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 12th Apr 2010 15:35
It should already work with GCC by removing some of the Microsoft specific things which have alternatives.

1. Replace '#pragma once' with a standard header guard.
2. Remove the lines that include libraries and do that manually with GCC.

Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 12th Apr 2010 15:57 Edited at: 12th Apr 2010 20:39
Hi Mike.

I might need help with this. DOnt know if im doing something wrong.

I have a server an a client that sent TCP messages to each other. but the TCP packet got lost at one moment, because of many TCP messages sent to quickly at the same time IMO.

Here is the flow.

The server was created like this:



First the client makes a request for available games:



The server receives packets witha for loop:




if is a game search, then it answers:



The games are received in the client, and filled Ok.:



WHen, the games are available the user (the client) chooses a game,and Joins requesting host data.:




Tehe server returns host data:



In this part of the code packets are not received. It does not receives the packets of new host data:



If I put a delay after OP_GAMEJOIN packet is sent (where the client request host data ), for example:



The Packet is received succesfully.

This can be due to send and receive thought the same IP and POrt TCP packets so fast? (I dont know, and Im a bit confused).

Cheers.

AlfaX.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 12th Apr 2010 20:12
There are a lot of posts to go through, so I'll ask: What are the differences between MikeNet and Multisync 1.4.1?

Does MikeNet use UDP or TCP? Is there an advantage of one over the other?

The fastest code is the code never written.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 15th Apr 2010 18:14
@ Alfa x
Is the client checking whether a TCP packet has been received straight after requesting data? There will be lag where packets take time to be sent and received, so the client needs to wait until mnRecvTCP returns > 0 rather than checking just once.

@ Hawkblood
DarkNet performs better and has alot of extra functionality, most of the things explained here are not in multisync. DarkNet is also more flexible.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 15th Apr 2010 19:40
It's also not free. That's ok.

The fastest code is the code never written.
Jonas
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: What day is it?
Posted: 15th Apr 2010 20:19
In the documentation, the page on mnStart says,

Quote: "Set this parameter to 0 and DarkNet will automatically set this to the number of physical cores on the system."


So it doesn't account for the individual threads? For example, if I were to have, say, the Core i7 980X... it would only use 6 threads and not 12?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 15th Apr 2010 20:29
So the Core i7 980X has 6 physical and 12 logical processors? Please correct me if I'm wrong: having more logical processors doesn't lead to any total performance improvement, it only improves multi tasking. So if I run 6 threads vs 12 threads, 6 threads will actually be slightly faster due to less context switching. I ran a test to confirm this on an old processor with 1 physical and 2 logical.

Anyway if you want you can use mnGetLogicalCPU and pass the return value of that to mnStart.

Jonas
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: What day is it?
Posted: 15th Apr 2010 22:02
Ah, you called me out on that... I guess I should think first next time.

The hyperthreading is to run two programs on the same core, at the same time, more efficiently. I'm going to go crawl back into my dark corner and just write my code now. Thanks for letting me waste your time and finger muscles. I don't know why I was thinking of the signal flow differently.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th Apr 2010 21:23
What is the maximum string length?

I've been getting errors because of this. I thought it was 4.2 billion characters as the prefix is 4 bytes big.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 18th Apr 2010 00:15 Edited at: 18th Apr 2010 00:34
Yes but each character is 1 byte so you need more than 4 GB of RAM to store a string that size. Even if you did have the necessary RAM DarkNet is 32bit so the operating system can only allocate a maximum of 4GB to the application and it will need some of this memory for other tasks.

If you want to send a packet that size you should split it up into smaller chunks.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 18th Apr 2010 02:01
I get errors at about 3000 bytes. :S

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 18th Apr 2010 11:15 Edited at: 19th Apr 2010 22:14
3000 should be okay, can you give me more information on the error you receive? Sending via UDP may cause problems as UDP does struggle with large packets.

Attachments

Login to view attachments
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 18th Apr 2010 19:19
I'm sending TCP packets that are 32K, so ~3K shouldn't be a problem.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 18th Apr 2010 20:30 Edited at: 18th Apr 2010 20:30
You'll have problems if you try to send UDP packets above ~1400 bytes, as the Ethernet limit is about 1500. You'll need to experiment a bit since you also have to account for protocol overhead. I had found the exact figure a while back but I can't remember it (it's probably just MTU - ip header - udp header).
Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 19th Apr 2010 01:32 Edited at: 19th Apr 2010 02:49
Quote: "@ Alfa x
Is the client checking whether a TCP packet has been received straight after requesting data? There will be lag where packets take time to be sent and received, so the client needs to wait until mnRecvTCP returns > 0 rather than checking just once."


thanks, will make a test.

[Edit] Thanks it worked fine. That was the issue.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 19th Apr 2010 18:40 Edited at: 19th Apr 2010 18:42
I've noticed something a bit misleading in the documentation.

On the "Unreliable UDP" page it says,

Quote: "In DarkNet there are 4 different UDP modes which determine how DarkNet deals with UDP data. Below each UDP mode is numbered, this is the number you should pass as a parameter to mnStartServer."


But below that it has the list,

Quote: "
1: Summary of UDP Modes
2: UM_CATCH_ALL
3: UM_CATCH_ALL_NO
4: UM_PER_CLIENT
5: UM_PER_CLIENT_PER_OPERATION
"


Which someone might interpret as the actual numbers to use for the UDP MODE setting, if they were skimming the documentation in a hurry or not paying close enough attention..

Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 19th Apr 2010 20:50
Hi Michel,

Quote: "Is the client checking whether a TCP packet has been received straight after requesting data? There will be lag where packets take time to be sent and received, so the client needs to wait until mnRecvTCP returns > 0 rather than checking just once."


I have a question. What if I want to do other things in the meanwhile, like atending blue-gui events and the like. Since the application is locked- out. There is a method to do this so I can check for packets (wait until),and at the same time do other things(besides threads)?
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 19th Apr 2010 22:01 Edited at: 19th Apr 2010 22:16
@ Alfa X
When I write code using DarkNet I only have one call to mnRecvTCP in my code and I have a connection state associated with each client.

e.g. On the client side:
- Client is not connected at all initially so connection state is C_NOT_CONNECTED.
- Client connects but needs to wait for data from the server before doing anything else so connection state changes to C_WAITING_FOR_DATA_PHASE_1.
- While in this phase mnRecvTCP will deal with TCP packets in a specific way and finish the connection process. When a valid TCP packet is received the mnRecvTCP code changes the connection state to C_CONNECTED and the client is deemed fully connected.

This is what is done internally within DarkNet during the handshaking process and is probably the best and simplest way to do it. By doing this you can have all your blue-gui events as normal in your main loop along with a single call to mnRecvTCP.

@ KISTech
Yes I am aware that the documentation is currently very weak in many places. In the next version you will see much better documentation, I am basically redoing it all, but properly this time.

@ All
I recently finished rewriting the main networking code which took about 20 to 30 hours. It is now very easy to understand, maintain and reuse; in many ways it is beautiful!

Even more exciting is that you can quite easily create your own TCP/UDP modes, sockets and instances under the new class structure. The new structure also makes removing windows dependency and including 64 bit compatibility much more straightforward.

Below are some key class diagrams that show the new structure of DarkNet (internally). To give you an idea of what this means, if you want to create an instance that uses just TCP (for example) you inherit clInstanceTCP and implement the abstract methods, then you have a fully functional instance that can be plugged into DarkNet. Remember that alot of the work will already have been implemented in these base classes.

The class names are fairly self explanatory so you should be able to see what each class is doing, these diagrams are generated by visual studio. I will soon be releasing the documentation for these classes so you can see what each class does precisely and what the new documentation style will be like.

I won't be releasing the update as soon as I hoped. The release date will be by the end of Summer definitely!

Diagrams:






Attachments

Login to view attachments
Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 28th Apr 2010 20:33 Edited at: 28th Apr 2010 21:22
Hi Michael,
I have understood what you say, and thats how it works DarkNet ATM.

Quote: "@ Alfa x
Is the client checking whether a TCP packet has been received straight after requesting data? There will be lag where packets take time to be sent and received, so the client needs to wait until mnRecvTCP returns > 0 rather than checking just once."


Quote: "@ Alfa X
When I write code using DarkNet I only have one call to mnRecvTCP in my code and I have a connection state associated with each client.

e.g. On the client side:
- Client is not connected at all initially so connection state is C_NOT_CONNECTED.
- Client connects but needs to wait for data from the server before doing anything else so connection state changes to C_WAITING_FOR_DATA_PHASE_1.
- While in this phase mnRecvTCP will deal with TCP packets in a specific way and finish the connection process. When a valid TCP packet is received the mnRecvTCP code changes the connection state to C_CONNECTED and the client is deemed fully connected.

This is what is done internally within DarkNet during the handshaking process and is probably the best and simplest way to do it. By doing this you can have all your blue-gui events as normal in your main loop along with a single call to mnRecvTCP."


I have tried them and they work ok. although, I cannot stop the application for each packet, since I sent many packets to/from different clients at the same time to the server and use TCP since I need reliable information.

I assume the delay cannot be avoided, so that is not a option.
Can Darknet keep the sent packed until is fully sent (the other side received), so I can check it in another mnRecvTCP rather than waiting until its >0 ?. I can sent the packet various times until I receive a notification thats it has been received ok, but I think DarkNet can take care of that details for me and keep it in a queue, I don't know if it is possible (or do something that stop packet lost because of the lag).

You have made an example here:
http://forum.thegamecreators.com/?m=forum_view&t=155357&b=1

But packets can still be lost and the client can still lost the packet, if you do many other things. (If you wait mnRecvTCP>0 they don't get lost, but other important things can stop). So this example doesn't work for me.

Thank you so much.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 28th Apr 2010 23:10
Using TCP packets should never be lost. mnRecvTCP just returns 0 because the packet hasn't yet been received, a few milliseconds later and it will return >0 when the packet has been received.

When a TCP packet is received it is put into a queue waiting for mnRecvTCP to receive each packet individually.

Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 30th Apr 2010 06:30
Hi Michael,
You have all the reason, packets should not get lost.

I had a problem in my code and solved it (Had an end if where it should not be).

Thank you for your assistance it was very valuable.

Cheers

AlfaX
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 30th Apr 2010 19:06
Mike,

Any idea why just one user would get this error, and no one else does? He's running Windows XP SP2.



KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 30th Apr 2010 19:09
Mike,

Any idea why just one user would get this error, and no one else does? He's running Windows XP SP2.



Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 1st May 2010 20:18 Edited at: 1st May 2010 20:20
What language did you write the application in? Very strange error!

You might have done something like this, both are wrong and can cause memory issues that will not be noticeable all the time:


Maybe there is something wrong with the packet value passed i.e. you may have accidentally slightly changed the value e.g. by adding 100 to it.

If using C++ or another unmanaged language then you might be doing illegal things with memory somewhere else in your application.

There may be a bug in DarkNet, and if there is it should be fixed in the next version (to be released this Summer) as most of DarkNet has been rewritten.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 2nd May 2010 20:06
It's written in DBPro. It's just odd because this has only happened to this one person. 30-40 others have run this without the error.

I'll ask a few more questions of him to see if it might be his machine. Perhaps he has to many other things open and is low on memory or something.

When handling the transfer of strings, all my code is like this,



Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 4th May 2010 02:06
You are using mnAddString and mnGetString correctly.

I checked the DarkNet code and can't see any bugs. The problem is probably system related, perhaps due to low resources.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 11th May 2010 03:01
Is it possible to send or receive packets to/from a specific URL ?

Something like this causes an error (this is just a pure example)



KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th May 2010 18:38
No, that's not what that command is for.

That command does an IP address lookup of a server for the name you give it.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 11th May 2010 22:47
Quote: "That command does an IP address lookup of a server for the name you give it."


Ah I see what you mean, is there a way to have it receive or send packets to/from a specific address rather than the server or specify the "working directory/link extension"?

Login to post a reply

Server time is: 2024-11-21 20:14:21
Your offset time is: 2024-11-21 20:14:21