Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Net Library #5

Open
samcooke98 opened this issue Aug 6, 2013 · 4 comments
Open

Net Library #5

samcooke98 opened this issue Aug 6, 2013 · 4 comments
Labels

Comments

@samcooke98
Copy link
Collaborator

Ok, Have to use the net Library.

Some notes about how I'm implementing it

In sb\init.lua there is a table. This table must be only strings (it will check). A function will run util.AddNetworkString for each string. Strings are the name of the net message - it only needs to be precached on the server

Clientside - Net library works like:

net.Receive(messageName, function( length, client) 
    --Things must be read in the same order.
end)

Server - Net Library

--After precaching - done in sb\init.lua
net.Start(messageName)
net.WriteString("HelloWorld")
net.Send(ply) --ply can be a player or a table of players
@awilliamson
Copy link
Owner

net.Broadcast should be for sending to all players. Send should be for a single player. Otherwise it seems good

@samcooke98
Copy link
Collaborator Author

See my fork - Want me to push to master branch?
Haven't tested yet, I'll push then?

@awilliamson
Copy link
Owner

Not at the minute, wait till weekend then we can discuss and run some tests whilst on ts.
I might be available after you finish school on friday. If not it'll be sat morning for you.

@samcooke98
Copy link
Collaborator Author

Ok, that's fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants