use Tcp and UDP at the same time in 2X?

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

liverol
Posts: 31
Joined: 15 Jul 2009, 23:49

use Tcp and UDP at the same time in 2X?

Postby liverol » 27 Sep 2010, 03:21

hi there,after checked the beta version doc i got a question,
can i use upd and tcp at the same time with 2X?,after initUDP,will sfs
use the udp all the time and i can't send TCP message again??

is there a way to mix using UDP and TCP?how to swith one off when i want to use another one?

thanks!!
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 27 Sep 2010, 06:54

Hi - the post really belongs to the beta forums, but I'll answer and Marco can decide if he wants it moved.

Yes - you can mix freely on a per extension request basis.

So you can for your transform sync use UDP and for animation sync use TCP - or whatever mix you want.

One of the overloads is:

public ExtensionRequest(string extCmd, ISFSObject parameters, Room room, bool useUDP)

so its all just a bool setting to control.

/Thomas
liverol
Posts: 31
Joined: 15 Jul 2009, 23:49

Postby liverol » 27 Sep 2010, 07:52

sorry for the wrong place!please move this post as you wish!!
:P

thanks for the reply,i checked the .net api again and i got this function,but seems like only one class (ExtensionRequest) has the udp option params??
what if i want to send SFS object/public message using udp?

Does this mean this function/class is enough for all? or just becase other functions don't implement the udp option now?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 27 Sep 2010, 14:45

Similar to SFS1, where only extension communication allowed for specifying a different protocol (string, json, xml). All regular SFS methods are TCP, and most of these are really not things you want to run over UDP anyways (and potentially have it lost).

/Thomas
liverol
Posts: 31
Joined: 15 Jul 2009, 23:49

Postby liverol » 28 Sep 2010, 00:24

Thanks,
Does this also mean if i want to sync transform using udp,i should write an extension to handle this?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 28 Sep 2010, 04:56

Hi,

Yeah - thats what it means. Which in my opinion is also the right way to do it (to use authoritative servers and/or servers with filtering/zoning).

Depending on what kind of game you make, using an extension to minimum filter information send to a given client to a need to know basis will lower risk of cheating.

One good example was the early starcraft days (if I remember correct), where the server simply spammed details about everything to each client and let the game client code filter away information based on fog of war etc. Didnt take long for someone to write a radar that showed everything for units even under fog of war.

So the server extension should try to limit re-distributing a transform to only clients that are close by / in sight. This also has the nice side effect of limiting bandwidth usage

/Thomas
liverol
Posts: 31
Joined: 15 Jul 2009, 23:49

Postby liverol » 28 Sep 2010, 09:14

got it!! :D

Here comes the last question:
it seems like the Flash AS extension will be no longer support in 2x?
(just see java version in the folder)

is this true?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 28 Sep 2010, 10:08

Dont know what those plans are. Right now its java only, yep.

/Thomas
liverol
Posts: 31
Joined: 15 Jul 2009, 23:49

Postby liverol » 11 Oct 2010, 04:59

flash extension should be in because it's easy and fast,handy for lightweight extension.love it so much!! :D
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 11 Oct 2010, 05:46

I'm more of a "real languages" guy (without dissing the alternatives).

Java and C# are just so much nicer debugging in, have nice and rigid structures and the best performance you can get. For the server to not have to parse scripts can make a nice performance boost - thats why java makes sense there vs. the others.

But my own primary reason is, that both C# and Java have the best IDE support (Visual Studio / MonoDevelop and Intellij IDEA). Which makes me much more productive than not having to type 2-3 lines more.

/T

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 1 guest