![]() |
naev 0.12.5
|
Lightly modified version of https://github.com/leafo/lua-enet/blob/master/enet.c (rev 97d91e8c4337555425fa751f02f552bbb553f17b, upstream copyright below). More...
#include <stdlib.h>#include <string.h>#include "lua.h"#include "lualib.h"#include "lauxlib.h"#include <enet/enet.h>
Go to the source code of this file.
Macros | |
| #define | LUA_COMPAT_MODULE |
| #define | check_host(l, idx) |
| #define | check_peer(l, idx) |
Functions | |
| static void | parse_address (lua_State *l, const char *addr_str, ENetAddress *address) |
| size_t | find_peer_index (lua_State *l, ENetHost *enet_host, ENetPeer *peer) |
| static void | push_peer (lua_State *l, ENetPeer *peer) |
| static void | push_event (lua_State *l, ENetEvent *event) |
| static ENetPacket * | read_packet (lua_State *l, int idx, enet_uint8 *channel_id) |
| static int | host_create (lua_State *l) |
| static int | linked_version (lua_State *l) |
| static int | host_service (lua_State *l) |
| static int | host_check_events (lua_State *l) |
| static int | host_compress_with_range_coder (lua_State *l) |
| static int | host_connect (lua_State *l) |
| static int | host_flush (lua_State *l) |
| static int | host_broadcast (lua_State *l) |
| static int | host_channel_limit (lua_State *l) |
| static int | host_bandwidth_limit (lua_State *l) |
| static int | host_get_socket_address (lua_State *l) |
| static int | host_total_sent_data (lua_State *l) |
| static int | host_total_received_data (lua_State *l) |
| static int | host_service_time (lua_State *l) |
| static int | host_peer_count (lua_State *l) |
| static int | host_get_peer (lua_State *l) |
| static int | host_gc (lua_State *l) |
| static int | peer_tostring (lua_State *l) |
| static int | peer_ping (lua_State *l) |
| static int | peer_throttle_configure (lua_State *l) |
| static int | peer_round_trip_time (lua_State *l) |
| static int | peer_last_round_trip_time (lua_State *l) |
| static int | peer_ping_interval (lua_State *l) |
| static int | peer_timeout (lua_State *l) |
| static int | peer_disconnect (lua_State *l) |
| static int | peer_disconnect_now (lua_State *l) |
| static int | peer_disconnect_later (lua_State *l) |
| static int | peer_index (lua_State *l) |
| static int | peer_state (lua_State *l) |
| static int | peer_connect_id (lua_State *l) |
| static int | peer_reset (lua_State *l) |
| static int | peer_receive (lua_State *l) |
| static int | peer_send (lua_State *l) |
| int | luaopen_enet (lua_State *l) |
Variables | |
| static const struct luaL_Reg | enet_funcs [] |
| static const struct luaL_Reg | enet_host_funcs [] |
| static const struct luaL_Reg | enet_peer_funcs [] |
Lightly modified version of https://github.com/leafo/lua-enet/blob/master/enet.c (rev 97d91e8c4337555425fa751f02f552bbb553f17b, upstream copyright below).
Definition in file lua_enet.c.
| #define check_host | ( | l, | |
| idx ) |
Definition at line 42 of file lua_enet.c.
| #define check_peer | ( | l, | |
| idx ) |
Definition at line 45 of file lua_enet.c.
| #define LUA_COMPAT_MODULE |
Copyright (C) 2014 by Leaf Corcoran
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING IN THE SOFTWARE.
Definition at line 36 of file lua_enet.c.
| size_t find_peer_index | ( | lua_State * | l, |
| ENetHost * | enet_host, | ||
| ENetPeer * | peer ) |
Find the index of a given peer for which we only have the pointer.
Definition at line 99 of file lua_enet.c.
|
static |
Definition at line 412 of file lua_enet.c.
|
static |
Definition at line 389 of file lua_enet.c.
|
static |
Definition at line 402 of file lua_enet.c.
|
static |
Dispatch a single event if available
Definition at line 305 of file lua_enet.c.
|
static |
Enables an adaptive order-2 PPM range coder for the transmitted data of all peers.
Definition at line 323 of file lua_enet.c.
|
static |
Connect a host to an address Args: the address [channel_count = 1] [data = 0]
Definition at line 346 of file lua_enet.c.
|
static |
Create a new host Args: address (nil for client) [peer_count = 64] [channel_count = 1] [in_bandwidth = 0] [out_bandwidth = 0]
Definition at line 220 of file lua_enet.c.
|
static |
Definition at line 380 of file lua_enet.c.
|
static |
Definition at line 501 of file lua_enet.c.
|
static |
Definition at line 483 of file lua_enet.c.
|
static |
Definition at line 423 of file lua_enet.c.
|
static |
Definition at line 472 of file lua_enet.c.
|
static |
Serice a host Args: timeout
Return nil on no event an event table on event
Definition at line 283 of file lua_enet.c.
|
static |
Definition at line 461 of file lua_enet.c.
|
static |
Definition at line 451 of file lua_enet.c.
|
static |
Definition at line 440 of file lua_enet.c.
|
static |
Definition at line 266 of file lua_enet.c.
| int luaopen_enet | ( | lua_State * | l | ) |
Definition at line 791 of file lua_enet.c.
|
static |
Parse address string, eg: :5959 127.0.0.1: website.com:8080
Definition at line 54 of file lua_enet.c.
|
static |
Definition at line 680 of file lua_enet.c.
|
static |
Definition at line 606 of file lua_enet.c.
|
static |
Definition at line 622 of file lua_enet.c.
|
static |
Definition at line 614 of file lua_enet.c.
|
static |
Definition at line 630 of file lua_enet.c.
|
static |
Definition at line 554 of file lua_enet.c.
|
static |
Definition at line 524 of file lua_enet.c.
|
static |
Definition at line 566 of file lua_enet.c.
|
static |
Definition at line 695 of file lua_enet.c.
|
static |
Definition at line 689 of file lua_enet.c.
|
static |
Definition at line 541 of file lua_enet.c.
|
static |
Send a lua string to a peer Args: packet data, string channel id flags ["reliable", nil]
Definition at line 723 of file lua_enet.c.
|
static |
Definition at line 639 of file lua_enet.c.
|
static |
Definition at line 530 of file lua_enet.c.
|
static |
Definition at line 579 of file lua_enet.c.
|
static |
Definition at line 512 of file lua_enet.c.
|
static |
Definition at line 133 of file lua_enet.c.
|
static |
Definition at line 111 of file lua_enet.c.
|
static |
Read a packet off the stack as a string idx is position of string
Definition at line 177 of file lua_enet.c.
|
static |
Definition at line 740 of file lua_enet.c.
|
static |
Definition at line 746 of file lua_enet.c.
|
static |
Definition at line 770 of file lua_enet.c.