Permalink
Browse files

[0.0-53] misc stability improvements; also updated some docs

  • Loading branch information...
1 parent 808c9fe commit e073433273ac79a7c9c344c5ec3d0216a2344110 @iamgreaser committed Jun 24, 2013
View
@@ -1,9 +1,12 @@
-GUYS GUYS GUYS
-FIRST THING YOU NEED TO READ:
+Forums: http://iceballga.me
+Our IRC channel is #iceball @ irc.quacknet.org (not quaKEnet, but quaCKnet).
-docs/READ_THIS_FIRST.txt might work (OK, it's out of date right now. Try running the tutorial.)
-If not, there's a tutorial on the forums:
- http://iceballga.me
+If you have a Windows build, running iceball.exe should give you a tutorial
+on how to actually run this thing.
+
+If you've built this for not-Windows, running ./iceball should do the same.
+
+The tutorial files are located in pkg/iceball/halp/.
------------------------------------------------------------------------------
View
@@ -1,2 +1,2 @@
-@echo off
-iceball-gl -c play.iceballga.me 20737
+@echo off
+iceball-gl -c play.iceballga.me 20737
View
@@ -1,3 +1,13 @@
+Sorry, but the contents of this file are horrendously out of date.
+You can either:
+1. run iceball.exe without any arguments, and get a tutorial, or
+2. read the tutorial in pkg/iceball/halp/texts.lua using something that isn't Notepad.
+
+The building information is a bit out of date
+- you need to copy sackit and enet to xlibinc/ or winlibs/ depending on your OS.
+
+Original text follows.
+
### INCOMPLETE. Hopefully will apply eventually. ###
Congratulations for successfully extracting Iceball from its archive!
View
@@ -0,0 +1,51 @@
+First things first, if you have a Windows build, double-click on iceball.exe.
+
+Things to check if it fails:
+
+*** Is this file in the same folder as iceball.exe? ***
+If so, you extraced the .zip wrong.
+You *MUST* retain the correct directory structure.
+
+*** Have you tried running it in the command line? ***
+Open opencmd.bat, and run it from there.
+See if you get any errors.
+You don't need to worry about stdout.txt/stderr.txt with the official builds,
+however if you built it yourself, you may need to check those files.
+
+*** Does opencmd.bat not work for you? ***
+Um, you will need access to a commandline *somehow*.
+
+*** I typed in the iceball-gl -c thing and it doesn't work! ***
+Did you hit enter?
+
+If so, and you get an error,
+take a screenshot or a copy of the EXACT text in your command prompt,
+and we can extend this section.
+
+*** Does it *actually* crash? ***
+Give us a screenshot of the commandline window showing how it crashed.
+
+The best idea?
+Run it in a debugger such as GDB (available with MinGW32).
+
+If you're using GDB, run it like do this:
+ handle SIGPIPE nostop noprint pass
+ run
+and then when it crashes, type:
+ bt full
+
+Note, if you get a SIGPIPE/Broken pipe "crash",
+you didn't set up the debugger correctly.
+I *think* this might be a non-Windows issue though.
+
+In my case I tend to prepend the commandline with "gdb --args ".
+
+Someone else can elaborate here if necessary.
+
+*** How do I change my name? ***
+Did you read the built-in tutorial?
+
+*** Anything else? ***
+Join us on IRC: #iceball @ irc.quacknet.org (NOT quaKEnet!).
+This really should be on a wiki somewhere.
+
View
@@ -19,7 +19,7 @@
#define VERSION_X 0
#define VERSION_Y 0
#define VERSION_A 0
-#define VERSION_Z 52
+#define VERSION_Z 53
// Remember to bump "Z" basically every time you change the engine!
// Remember to bump the version in Lua too!
// Remember to document API changes in a new version!
View
@@ -1,2 +1,4 @@
-@echo off
-cmd
+@echo off
+cmd
+pause
+
View
@@ -133,7 +133,7 @@ TOOL_EXPL = 3
-- sounds
if client then
- client.wav_cube_size(2)
+ client.wav_cube_size(1)
wav_rifle_shot = skin_load("wav", "rifle-shot.wav", DIR_PKG_WAV)
wav_rifle_reload = skin_load("wav", "rifle-reload.wav", DIR_PKG_WAV)
wav_whoosh = skin_load("wav", "whoosh.wav", DIR_PKG_WAV)
View
@@ -231,6 +231,11 @@ do
rgb = 85
while true do
obj, csize, usize, amount = common.fetch_poll()
+ -- TODO: don't do this every time fetch_poll returns - give it a bit of a rest!
+ if PKT_KEEPALIVE then
+ print(PKT_KEEPALIVE)
+ common.net_send(nil, common.net_pack("BB", PKT_KEEPALIVE), true)
+ end
--print("obj:", obj, csize, usize, amount)
if obj ~= false then break end
View
@@ -32,7 +32,7 @@ dofile("pkg/base/commands.lua")
client_list = {fdlist={}}
server_tick_accum = 0.
-function slot_add(sockfd, tidx, wpn, name)
+function slot_add(neth, tidx, wpn, name)
local i
for i=1,players.max do
if not players[i] then
@@ -53,7 +53,7 @@ function slot_add(sockfd, tidx, wpn, name)
team = tidx, -- 0 == blue, 1 == green
weapon = _wpn,
pid = i,
- sockfd = sockfd
+ neth = neth
})
if permissions["default"] ~= nil then
players[i].add_permission_group(permissions["default"].perms)
@@ -69,8 +69,10 @@ function slot_add(sockfd, tidx, wpn, name)
end
-function server.hook_file(sockfd, ftype, fname)
- print("hook_file:", sockfd, ftype, fname)
+function server.hook_file(neth, ftype, fname)
+ print("hook_file:", neth, ftype, fname)
+ local cli = client_list[neth]
+ if cli then cli.lastmsg = sec_current end
if fname:lower():find("svsave") then
return nil
@@ -89,50 +91,51 @@ function server.hook_file(sockfd, ftype, fname)
return true
end
-function server.hook_connect(sockfd, addrinfo)
+function server.hook_connect(neth, addrinfo)
-- TODO: enforce bans
- client_list.fdlist[#(client_list.fdlist)+1] = sockfd
- client_list[sockfd] = {
+ client_list.fdlist[#(client_list.fdlist)+1] = neth
+ client_list[neth] = {
fdidx = #(client_list.fdlist),
addrinfo = addrinfo,
+ lastmsg = nil,
plrid = nil
}
- print("connect:", sockfd, addrinfo.proto,
+ print("connect:", neth, addrinfo.proto,
addrinfo.addr and addrinfo.addr.sport,
addrinfo.addr and addrinfo.addr.ip,
addrinfo.addr and addrinfo.addr.cport)
- local ss = (sockfd == true and "(local)") or sockfd
+ local ss = (neth == true and "(local)") or neth
--[[net_broadcast(nil, common.net_pack("BIz", PKT_CHAT_ADD_TEXT, 0xFF800000,
- "Connected: player on sockfd "..ss))]]
- print("Connected: player on sockfd "..ss)
+ "Connected: player on neth "..ss))]]
+ print("Connected: player on neth "..ss)
end
-function server.hook_disconnect(sockfd, server_force, reason)
+function server.hook_disconnect(neth, server_force, reason)
-- just in case we get any stray disconnect messages
- if not client_list[sockfd] then return end
+ if not client_list[neth] then return end
- local plrid = client_list[sockfd].plrid
+ local plrid = client_list[neth].plrid
local plr = players[plrid]
- local fdidx = client_list[sockfd].fdidx
+ local fdidx = client_list[neth].fdidx
local cli2 = client_list[client_list.fdlist[#(client_list.fdlist)]]
cli2.fdidx = fdidx
client_list.fdlist[fdidx] = client_list.fdlist[#(client_list.fdlist)]
client_list.fdlist[#(client_list.fdlist)] = nil
- client_list[sockfd] = nil
- print("disconnect:", sockfd, server_force, reason)
+ client_list[neth] = nil
+ print("disconnect:", neth, server_force, reason)
- local ss = (sockfd == true and "(local)") or sockfd
+ local ss = (neth == true and "(local)") or neth
--[[net_broadcast(nil, common.net_pack("BIz", PKT_CHAT_ADD_TEXT, 0xFF800000,
- "Disconnected: player on sockfd "..ss))]]
- print("Disconnected: player on sockfd "..ss)
+ "Disconnected: player on neth "..ss))]]
+ print("Disconnected: player on neth "..ss)
if plr then
plr.intel_drop()
net_broadcast(nil, common.net_pack("BIz", PKT_CHAT_ADD_TEXT, 0xFF800000,
"* Player "..plr.name.." disconnected"))
- net_broadcast(sockfd, common.net_pack("BB",
+ net_broadcast(neth, common.net_pack("BB",
PKT_PLR_RM, plrid))
-- TODO fix crash bug
@@ -159,22 +162,40 @@ function server.hook_tick(sec_current, sec_delta)
lflush = sec_current
end
end
- local pkt, sockfd
+
+ local pkt, neth, cli
+ for neth, cli in pairs(client_list) do
+ if type(neth) == type(0) or neth == true then
+ --print(neth,cli.lastmsg, sec_current)
+ if not cli.lastmsg then
+ cli.lastmsg = sec_current
+ elseif neth ~= "true" and cli.lastmsg + NET_MAX_LAG < sec_current then
+ -- don't autokick the local client - it never ACTUALLY "disconnects"
+ -- otherwise we'll be chewing through this over and over again
+ print("Autokicking client "..((neth == true and "local") or neth))
+ server.net_kick(neth, "Connection timed out")
+ -- net_disconnect should be called by this point
+ end
+ end
+ end
+
while true do
- pkt, sockfd = common.net_recv()
+ pkt, neth = common.net_recv()
if not pkt then break end
- local cli = client_list[sockfd]
+ local cli = client_list[neth]
local plr = cli and players[cli.plrid]
+
+ if cli then cli.lastmsg = sec_current end
local cid
cid, pkt = common.net_unpack("B", pkt)
- --print("in",sockfd,cid)
+ --print("in",neth,cid)
local hdl = network.sys_tab_handlers[cid]
if hdl then
- hdl.f(sockfd, cli, plr, sec_current, common.net_unpack(hdl.s, pkt))
+ hdl.f(neth, cli, plr, sec_current, common.net_unpack(hdl.s, pkt))
else
print(string.format("S: unhandled packet %02X", cid))
end
Oops, something went wrong.

0 comments on commit e073433

Please sign in to comment.