Răsfoiți Sursa

removed debug printouts, fixed test

leaf corcoran 14 ani în urmă
părinte
comite
89fcc03d68
2 a modificat fișierele cu 6 adăugiri și 7 ștergeri
  1. 5 6
      enet.c
  2. 1 1
      test/unreliable/server.lua

+ 5 - 6
enet.c

@@ -69,7 +69,7 @@ static void push_peer(lua_State *l, ENetPeer *peer) {
 	lua_gettable(l, -2);
 
 	if (lua_isnil(l, -1)) {
-		printf("creating new peer\n");
+		// printf("creating new peer\n");
 		lua_pop(l, 1);
 
 		*(ENetPeer**)lua_newuserdata(l, sizeof(void*)) = peer;
@@ -186,8 +186,8 @@ static int host_create(lua_State *l) {
 			if (!lua_isnil(l, 2)) peer_count = luaL_checkint(l, 2);
 	}
 
-	printf("host create, peers=%d, channels=%d, in=%d, out=%d\n",
-			peer_count, channel_count, in_bandwidth, out_bandwidth);
+	// printf("host create, peers=%d, channels=%d, in=%d, out=%d\n",
+	// 		peer_count, channel_count, in_bandwidth, out_bandwidth);
 	ENetHost *host = enet_host_create(have_address ? &address : NULL, peer_count,
 			channel_count, in_bandwidth, out_bandwidth);
 
@@ -262,7 +262,7 @@ static int host_connect(lua_State *l) {
 			if (!lua_isnil(l, 3)) channel_count = luaL_checkint(l, 3);
 	}
 
-	printf("host connect, channels=%d, data=%d\n", channel_count, data);
+	// printf("host connect, channels=%d, data=%d\n", channel_count, data);
 	ENetPeer *peer = enet_host_connect(host, &address, channel_count, data);
 
 	if (peer == NULL) {
@@ -403,7 +403,7 @@ static int peer_send(lua_State *l) {
 	enet_uint8 channel_id;
 	ENetPacket *packet = read_packet(l, 2, &channel_id);
 
-	printf("sending, channel_id=%d\n", channel_id);
+	// printf("sending, channel_id=%d\n", channel_id);
 	enet_peer_send(peer, channel_id, packet);
 	return 0;
 }
@@ -471,7 +471,6 @@ LUALIB_API int luaopen_enet(lua_State *l) {
 	lua_setfield(l, LUA_REGISTRYINDEX, "enet_peers");
 
 	luaL_register(l, "enet", enet_funcs);
-	printf("loaded enet\n");
 	return 0;
 }
 

+ 1 - 1
test/unreliable/server.lua

@@ -7,7 +7,7 @@ while true do
 	if event and event.type == "connect" then
 		event.peer:send("hello world")
 		for i = 0, 100 do
-			event.peer:send(tostring(i), 1, "something else")
+			event.peer:send(tostring(i), 1, "unreliable")
 		end
 	end
 end