Thread Rating:
  • 4 Vote(s) - 4.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiserver 2.0
#31
MangaD:
Awesome, your CPP version looks great :D
I added your version and your Linux guide to the topic.

BTW, your version doesn't include the changes made in 2.01, but most of them are improvements for the ping command so it is not very important.

Zelphir:
Multiserver 1 binds only the "most suitable network interface" (according to MSDN).
And it makes problems, if you want for example to connect from Hamachi and from your real address with port forwarding.
So Multiserver 2 explicitly binds all the network interfaces of the computer.
It works smoothly for Windows, but according to your post seems that it doesn't work well for Linux.
Reply
Thanks given by: MangaD
#32
(06-29-2016, 06:41 PM)ayalx Wrote:  MangaD:
Awesome, your CPP version looks great :D
I added your version and your Linux guide to the topic.

BTW, your version doesn't include the changes made in 2.01, but most of them are improvements for the ping command so it is not very important.

Zelphir:
Multiserver 1 binds only the "most suitable network interface" (according to MSDN).
And it makes problems, if you want for example to connect from Hamachi and from your real address with port forwarding.
So Multiserver 2 explicitly binds all the network interfaces of the computer.
It works smoothly for Windows, but according to your post seems that it doesn't work well for Linux.

I only noticed this post now! >_>

First of all, thank you. :)

I started working on the translation to C++ before you released the source (used dotPeek to decompile). I had the ping command working as in your first version, but with the same problems. I was trying to solve the issue with asynchronous programming but postponed the project (will resume it later this month). I downloaded the source of your new version and will update with the changes when I get to it. This CPP version contains very few differences to the original (e.g. doesn't quit if port is in use, rather asks the user to close any programs using it).

The socket library that I am using also binds to IPv6 if available (with IPv4 compatibility). If not, it only binds to IPv4.

MultiServer is a wonderful program, thank you very much for creating it! :D
[Image: random.php?pic=random]
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
The meaning of life is to give life a meaning.
Stop existing. Start living.
Reply
Thanks given by: ayalx
#33
I am very glad to here it is useful :D
Yes I guessed so, in the released source code I also tried to give better names for the functions (like mainDataLoop LOL)
The ping command does work better, but I may do some more research in the future because I think it can be done even more accurate.
I thought about binding IPv6 too, but I think that LF2 itself doesn't know how to connect to IPv6 addresses, so it is unnecessary.
(Unless we build a bridge program, so LF2 will connect to it and the program will connect to the server using IPv6)
Reply
Thanks given by: MangaD
#34
Hi, I recently discovered a strange issue with Multiserver 2.0, in which it differs from Multiserver 1.

It's been working fine, when I had 192.168.0.13 as internal IP. Then one day the internal IP address changed to 192.168.0.12. I had to change my port forwarding accordingly and all other ways of connecting worked fine again, however, when I started Multiserver 2, it complained, that it could not bind to the port and address 192.168.0.13, although to my knowledge I didn't have that internal IP address anymore in my home network (router + a few machines).

I am not sure why this happens. Does Multiserver 2.0 somehow memorize my internal IP address and reuse the memorized value? As long as I don't get 192.168.0.13 assigned from my router again, I'll probably not be able to use it :(
[Image: 9nclhxgc.png]
Reply
Thanks given by:
#35
This is a wild guess, but try going to your Firewall settings and delete MultiServer from the allowed app list. When you open it again it will ask for permissions. Let us know if this works.
[Image: random.php?pic=random]
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
The meaning of life is to give life a meaning.
Stop existing. Start living.
Reply
Thanks given by:
#36
(07-20-2016, 01:55 PM)MangaD Wrote:  
This is a wild guess, but try going to your Firewall settings and delete MultiServer from the allowed app list. When you open it again it will ask for permissions. Let us know if this works.

This is a Linux OS :) The firewall never asks me and I do have only a rule there for port 12345 TCP. This rule is not bound to a specific 192.168.X.Y address though, as the system knows its own IP address in the home network and does not need this specification. The only other firewall is in the router. In the router firewall I always have to change the rule according to what my home network internal IP is, which seems natural to me. If I take that rule away, no one will be able to connect to me even when using Multiserver 1.

It's not really about not being able to connect, but about Multiserver 2 complaining not being able to bind to an IP address, which I don't have anymore, locally in my home network. If it only took the correct IP address to bind to, I am sure it would work just fine, just like Multiserver 1 does.
[Image: 9nclhxgc.png]
Reply
Thanks given by:
#37
Well you have to keep in mind that MultiServer 2.0 is a Windows program and may have problems running under Wine. So any bug you may come up with on Linux is not plausible.

Try installing mono-complete and run the program with mono, has worked well for me.

Code:
sudo apt-get install mono-complete
mono LF2\ Multi\ Server\ v2.0.exe
[Image: random.php?pic=random]
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
The meaning of life is to give life a meaning.
Stop existing. Start living.
Reply
Thanks given by:
#38
MultiServer 1 works like this:
Code:
Bind("0.0.0.0")
So the OS decides which IP address to use.

MultiServer 2 works like this:
Code:
For Each IPAddress of Computer:
    Bind(IPAddress)
So it should bind all the IP addresses of the computer.

Apparently your old IP still exists as a strange ghost, and MultiServer sees it.
But if you get only a warning, it is possible that MultiServer also sees your true IP address, and in this case it should work well despite the warning.
Have you tried to check it?

Hopefully I will have some time next week.
I will add an option to tell MultiServer how to do the binding (method 1 or method 2), so it will solve your problem anyway.
Reply
Thanks given by:
#39
Done cpp version including the changes of 2.01. Only tested a bit but seems to work well. However, the ping command does not work well in both versions as it gives a much lower value than the OS ping command. The following piece of code can't be right:

Code:
//LF2 has a inner clock, and it delays its respond if the request was sent quicker that its FPS ratio.
//So I subtract this ratio from the total ping result.
//Apparently LF2 waits 2 frames before it responds.
//I don't sure why. I will check it again when I have some time.
players[i].TotalWaitAmount -= PING_LF2_WAIT_BETWEEN_FRAMES * 2;
if (players[i].TotalWaitAmount < 0) players[i].TotalWaitAmount = 0;

So, zort just gave a great idea. How about using the system ping command instead of using LF2 to check it? In c++ I'd do it like:

Code:
system("ping some_ip");
[Image: random.php?pic=random]
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
The meaning of life is to give life a meaning.
Stop existing. Start living.
Reply
Thanks given by:
#40
(08-28-2016, 08:22 PM)MangaD Wrote:  Done cpp version including the changes of 2.01. Only tested a bit but seems to work well. However, the ping command does not work well in both versions as it gives a much lower value than the OS ping command. The following piece of code can't be right:

Code:
//LF2 has a inner clock, and it delays its respond if the request was sent quicker that its FPS ratio.
//So I subtract this ratio from the total ping result.
//Apparently LF2 waits 2 frames before it responds.
//I don't sure why. I will check it again when I have some time.
players[i].TotalWaitAmount -= PING_LF2_WAIT_BETWEEN_FRAMES * 2;
if (players[i].TotalWaitAmount < 0) players[i].TotalWaitAmount = 0;

So, zort just gave a great idea. How about using the system ping command instead of using LF2 to check it? In c++ I'd do it like:

Code:
system("ping some_ip");

Well... I don't know what's the rationale behind converting it to C++ but...

Anyways, calling ping command is a horrible idea because
1- it's a blocking operation
2- unnecessarily expensive since you're creating a new process
3- it's unnecessarily inefficient and stupid trying to capture and parse standard output of ping command

I would suggest using async methods of Ping class. I don't know how much it's applicable to your C++ code base though.
Ultimately, my constant dissatisfaction with the way things are becomes the driving force behind everything I do.
[Image: sigline.png]
LF2 IDE - Advanced visual data changer featuring instant data loader
LF2 Sprite Sheet Generator - Template based sprite sheet generator based on Gad's method
[Image: sigline.png]
There is no perfect language, but C++ is the worst.
Reply
Thanks given by: MangaD , Som1Lse




Users browsing this thread: 2 Guest(s)