generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: We should have a function for sending primitive data to players.

Previous Thread :: Next Thread 
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
25 Feb 2012 06:46 AM
Each player, and the server, would have functions like:

(Player/Server):SendPacket("Hurr message",{1,"hai",true,Vector3.new(0,0,0)}[,Enum.PacketType.Reliable/Unreliable])

Where the first parameter is the type and second is a table with primitive data and roblox types (which roblox has special code for to send them properly)
The optional parameter tells roblox wheter the packet must reach its destination or not. Kind of like selecting between UDP and TCP. This would be useful for learning how to do networking and st00f.

And:

(P/S):GetPacket("Hurr message")
(P/S):GetPacketCount("Hurr message")

These can only be called from the client which the player or server is on.
GetPacket returns the table for the oldest packet of that type not read yet and removes it.
GetPacketCount returns how many packets of the type are there waiting to be read.








You can send data to any player or server. It either transmits them directly, or sends to server and from there to the target, depending on which way is faster/available.

Pros:
-More robust systems for making gui games where you can see other players (as with instances it sends data to every player and instances probably have some overhead too)
-Teaches how to do proper networking stoof
-Fun
-Moar fun


k?
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
25 Feb 2012 08:37 AM
[ Content Deleted ]
Report Abuse
LocalChum is not online. LocalChum
Joined: 04 Mar 2011
Total Posts: 6906
25 Feb 2012 10:27 AM
Use BindableFunction/BindableEvent or a StringValue that gets populated with a JSONified version of the table. That's all I can think of right now.
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
25 Feb 2012 12:27 PM
@local
thats unoptimized for what i want, and the data still goes to each player which makes the max data sent like 10th of what it would be if it just reached the target.
Report Abuse
LPGhatguy is not online. LPGhatguy
Forum Moderator
Joined: 27 Jun 2008
Total Posts: 4725
25 Feb 2012 01:20 PM
>Use BindableFunction/BindableEvent or a StringValue that gets populated with a JSONified version of the table. That's all I can think of right now.

BindableFunctions don't replicate, as shown here:
http://www.roblox.com/Forum/ShowPost.aspx?PostID=63240800
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
25 Feb 2012 02:43 PM
"as shown here"

As SAID here, not as SHOWN here. It annoys me so much when people make that mistake, seriously. It's not like you can put pictures on the forum or anything.
Report Abuse
myrkos is not online. myrkos
Joined: 06 Sep 2010
Total Posts: 8072
25 Feb 2012 02:45 PM
It's as WRITTEN here, derp. :o
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
25 Feb 2012 02:55 PM
@myrkos

No. It's as TYPED there.
Report Abuse
myrkos is not online. myrkos
Joined: 06 Sep 2010
Total Posts: 8072
25 Feb 2012 02:57 PM
@julien

No. It's as DISPLAYED FROM DECODED UTF-8 CHARACTERS TRANSMITTED FROM THE ROBLOX SERVER there.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
25 Feb 2012 03:20 PM
@myrkos

No. It's as DISPLAYED FROM UTF-8 CHARACTERS DECODED BY YOUR USER AGENT TRANSMITTED FROM ONE OF THE ROBLOX SERVERS TO YOUR COMPUTER there.
Report Abuse
EverquestI is not online. EverquestI
Joined: 03 Feb 2011
Total Posts: 11109
25 Feb 2012 03:27 PM
no im pretty sure as shown here is acceptable

How is siggy formed?
Report Abuse
LPGhatguy is not online. LPGhatguy
Forum Moderator
Joined: 27 Jun 2008
Total Posts: 4725
26 Feb 2012 02:09 AM
>As SAID here, not as SHOWN here. It annoys me so much when people make that mistake, seriously. It's not like you can put pictures on the forum or anything.

The text on the page is indeed *shown*, is it not?
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
26 Feb 2012 03:52 AM
i prefer "it dun raplicate cuz wiki [link here]"
Report Abuse
owen0202 is not online. owen0202
Joined: 27 Feb 2008
Total Posts: 6912
26 Feb 2012 04:37 PM
Shown here is perfectly acceptable.

Technically, it is shown. It is displayed on a monitor.

Get over yourself.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image