[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Enigma-devel] Re: network 2-player game

From: Tacvek
Subject: Re: [Enigma-devel] Re: network 2-player game
Date: Fri, 17 Mar 2006 16:26:01 -0500

----- Original Message ----- From: "Ronald Lamprecht" <address@hidden>
To: "Tacvek" <address@hidden>
Cc: "enigma-devel" <address@hidden>
Sent: Friday, March 17, 2006 1:56 PM
Subject: Re: [Enigma-devel] Re: network 2-player game

The demanding task of the network game is not the event queueing and networking stuff but the cloneing of the world! I started with the Lua world part -- that is the reason we need to upgrade to Lua 5, because it supports serialization.

The major problem with Lua 5 was the undocumented changes to the error system. It appears to be possible to use the metatable system to re-create tags (to the extent that they are needed), but i was unable to figure out how to account for the changes in the error system.

I am aware of the documented changes like "%ident" upvalues, that have
been used by Nat Pryce (and myself).

It has been a while, but IIRC the method for calling LUA code from C[++] when errors must be caught is different than in lua 5. The function used to pass errors into lua (so lua code can intecept) changed, although that was simple to overcome (Lua_error does not accept a string argument. A string mush be pushed onto the lua stack instead). The big problem seemed to be in reciving some form of callback in the case of an unhandled error. Lua 4 used _ERRORMESSAGE which called _ALERT which enigma hooked to capture error messages. Lua 5 appears to lack _ERRORMESSAGE, but can catch errors by using lua_pcall(), Otherwise the error will propagate. One thing I missed before that would rectify this. A lua_CFunction can be provided to lua. This would be called right before the LUA state is closed via exit(EXIT_FAILURE). This can be used to display the error message, instead of hooking _ALERT.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]