![]() |
naev 0.11.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 44 of file lua_enet.c.
| #define check_peer | ( | l, | |
| idx ) |
Definition at line 47 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 38 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 101 of file lua_enet.c.
|
static |
Definition at line 414 of file lua_enet.c.
|
static |
Definition at line 391 of file lua_enet.c.
|
static |
Definition at line 404 of file lua_enet.c.
|
static |
Dispatch a single event if available
Definition at line 307 of file lua_enet.c.
|
static |
Enables an adaptive order-2 PPM range coder for the transmitted data of all peers.
Definition at line 325 of file lua_enet.c.
|
static |
Connect a host to an address Args: the address [channel_count = 1] [data = 0]
Definition at line 348 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 222 of file lua_enet.c.
|
static |
Definition at line 382 of file lua_enet.c.
|
static |
Definition at line 503 of file lua_enet.c.
|
static |
Definition at line 485 of file lua_enet.c.
|
static |
Definition at line 425 of file lua_enet.c.
|
static |
Definition at line 474 of file lua_enet.c.
|
static |
Serice a host Args: timeout
Return nil on no event an event table on event
Definition at line 285 of file lua_enet.c.
|
static |
Definition at line 463 of file lua_enet.c.
|
static |
Definition at line 453 of file lua_enet.c.
|
static |
Definition at line 442 of file lua_enet.c.
|
static |
Definition at line 268 of file lua_enet.c.
| int luaopen_enet | ( | lua_State * | l | ) |
Definition at line 793 of file lua_enet.c.
|
static |
Parse address string, eg: :5959 127.0.0.1: website.com:8080
Definition at line 56 of file lua_enet.c.
|
static |
Definition at line 682 of file lua_enet.c.
|
static |
Definition at line 608 of file lua_enet.c.
|
static |
Definition at line 624 of file lua_enet.c.
|
static |
Definition at line 616 of file lua_enet.c.
|
static |
Definition at line 632 of file lua_enet.c.
|
static |
Definition at line 556 of file lua_enet.c.
|
static |
Definition at line 526 of file lua_enet.c.
|
static |
Definition at line 568 of file lua_enet.c.
|
static |
Definition at line 697 of file lua_enet.c.
|
static |
Definition at line 691 of file lua_enet.c.
|
static |
Definition at line 543 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 725 of file lua_enet.c.
|
static |
Definition at line 641 of file lua_enet.c.
|
static |
Definition at line 532 of file lua_enet.c.
|
static |
Definition at line 581 of file lua_enet.c.
|
static |
Definition at line 514 of file lua_enet.c.
|
static |
Definition at line 135 of file lua_enet.c.
|
static |
Definition at line 113 of file lua_enet.c.
|
static |
Read a packet off the stack as a string idx is position of string
Definition at line 179 of file lua_enet.c.
|
static |
Definition at line 742 of file lua_enet.c.
|
static |
Definition at line 748 of file lua_enet.c.
|
static |
Definition at line 772 of file lua_enet.c.