This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
NicholasScott1337 edited this page Jul 18, 2015
·
2 revisions
Changelog:
- Events!!! YEE SO MANY EVENTS, Check the wiki for details, events include: Client: connected, received packet, disconencted, cmdRegistered, send data, kickedFromServer... Server: userConnected, userDisconnected, userTimedOut, userKicked, receive, connected, disconnected, cmdRegsitered, data sent
- If you need to make your own event you can set it the same way you set default events and call it with net.event.server.myCustomEvent( parameters )
- We are now independent, and have no requirements besides our Net.lua file :D
- New Table! --net.client, holds the ip and port of the connected server, if not connected to a server it is nil
- New Table! --net.server, holds the port that we're listening on, if not listening it is nil
- New Variable! --net.connected, true if currently connected, false if not
- New Default Registered Command! --disconnect, server received, received when a client disconnects with net:disconnect() and will print to console saying "User [IP:PORT] disconnected"
- Ping is now measured in milliseconds ;) You know who you are :D
- New Function! --net:encode( table ) Encodes a table into a string to be sent across the network, WARNING: Doesn't currently handle tables inside of tables :(
- New Function! --net:decode( table ) Decodes a table from a string after received
- New handshake OMG OMG OMG IT"S HERE HEEHEHEHHE YEEE :D
- New Function! --net:connectedUsers() Returns a table of the currently connected clients and their ping, if it's above the max ping it could mean they're in the process of timing out :D
- New Function! --net:kickUser( id, reason ) Kicks the user with the id, if id is invalid, nothing happens, if reason is nil it will default to "Kicked by administrator"
- New Function! --net:setMaxPing( ping ) Sets the max ping, if it's client it should be around double that of the servers max ping, Ping is measured in seconds
- New Variable! --net.connected True if connected to either server if client or listening on a port if server
- Automatically times out users who exceed the maximum ping
- New Default Registered Command! --print client and server, prints to the console the param of the cmd
- New Default Registered Command! --kick client received, will print the info to the console about the kick and does other stuff disconnect related
- New Default Registered Command --ping server received, for the handshake feauture
- Removed net:draw() function :( Seems useless, if anyone does find it useful, or require it, let me know and I'll re add it :)
- Modified variables passed into the cmd functions, now has a dt at the end ie. net:registerCMD("STUFF", function( table, param, id, t ) print( t ) end ) t is the deltatime of love.update passed on when it's received, useful for timing stuff
- New Function! --net:isClient() Returns true if it's currently running as a udp client
- New Function! --net:isServer() Returns true if it's currently running as a udp server
- New Function! --net:commands() Returns a table of the current registered commands, format is cmd = function, cmd is the string command and function is the function
- Various other global to local variable conversions for optimizations :D
- net:init( state ) is no longer case sensitive!! :D YEEE So you can do net:init( "SErVEr") and it will work :D
- Functions are now local and returned in the calling of the require() ie. Net = require("Net.lua") then call them as such Net:init("Server")
- Commands table is now local