View topic - Lua Lobby / Socket



All times are UTC + 1 hour


Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Lua Lobby / Socket
PostPosted: 21 Apr 2012, 06:28 

Joined: 16 Apr 2012, 09:48
I would like to start playing around with implementing basic lobby functionality through Lua.

To my understanding, LuaLobby is going to be (or already is) deprecated and I should use LuaSocket instead.

Where can I find documentation about current (uberserver?) server-client protocol?


Top
 Offline Profile  
 
 Post subject: Re: Lua Lobby / Socket
PostPosted: 21 Apr 2012, 06:48 
Lobby Developer
User avatar

Joined: 14 Aug 2007, 15:15
search.php?keywords=lobby+protocol&terms=all&author=&sc=1&sf=all&sk=t&sd=d&sr=posts&st=0&ch=300&t=0&submit=Search

Would've been the first hit before your post.


Top
 Offline Profile  
 
 Post subject: Re: Lua Lobby / Socket
PostPosted: 21 Apr 2012, 08:01 

Joined: 16 Apr 2012, 09:48
Thanks, can you please edit the link so it doesn't break forum layout?

How can I run a minimalistic spring instance, with the intent of only running my Lua code?
(not asking for an external Lua interpreter)

I would like to have the lobby run entirely from spring.


For future reference, this is the lobby protocol: http://springrts.com/dl/LobbyProtocol/


Top
 Offline Profile  
 
 Post subject: Re: Lua Lobby / Socket
PostPosted: 23 Apr 2012, 14:52 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
not sure if that is helpful:
http://pastebin.com/3xPn03Xd

you can type /luaui join and it will join a hardcoded lobby channel.
if you just type /luaui blablabla it will say "blablabla" in that channel.

it is a bit choatic because I was just testing around..still afaik only example of something a bit like lua lobby?
Somewhere I have a bit better version where you can also join battles and recieve the script.txt
Or maybe it got lost when clearing out all the springtest installs :roll:

Quote:
How can I run a minimalistic spring instance, with the intent of only running my Lua code?
I think a mod and map always have to be loaded. (unless headless spring but then you have no graphics at all: can not draw chat, buttons etc)
So maybe just use a very small map and mod for now...


Top
 Offline Profile  
 
 Post subject: Re: Lua Lobby / Socket
PostPosted: 24 Apr 2012, 08:17 

Joined: 16 Apr 2012, 09:48
knorke wrote:
not sure if that is helpful:
http://pastebin.com/3xPn03Xd

you can type /luaui join and it will join a hardcoded lobby channel.
if you just type /luaui blablabla it will say "blablabla" in that channel.

it is a bit choatic because I was just testing around..still afaik only example of something a bit like lua lobby?
Somewhere I have a bit better version where you can also join battles and recieve the script.txt
Or maybe it got lost when clearing out all the springtest installs :roll:

Thanks, that is useful.

knorke wrote:
I think a mod and map always have to be loaded. (unless headless spring but then you have no graphics at all: can not draw chat, buttons etc)
So maybe just use a very small map and mod for now...

I guess I will use a dummy mod/map then.

Is there a way to keep the socket and/or run lua code (to send ping/pong) after I call Spring.Restart?


Top
 Offline Profile  
 
 Post subject: Re: Lua Lobby / Socket
PostPosted: 24 Apr 2012, 10:22 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Quote:
Is there a way to keep the socket and/or run lua code (to send ping/pong) after I call Spring.Restart?
atm no..basically you lose everything at Spring.Restart
That was also my question in this thread:
viewtopic.php?f=23&t=27683
Since lua socket is not 100% done yet (?) maybe that will eventually change?
For now the only way to keep data between restarting is writing/reading files or via script.txt and reinitiliaze everything.


Top
 Offline Profile  
 
 Post subject: Re: Lua Lobby / Socket
PostPosted: 24 Apr 2012, 11:25 

Joined: 16 Apr 2012, 09:48
knorke wrote:
Quote:
Is there a way to keep the socket and/or run lua code (to send ping/pong) after I call Spring.Restart?
atm no..basically you lose everything at Spring.Restart
That was also my question in this thread:
viewtopic.php?f=23&t=27683
Since lua socket is not 100% done yet (?) maybe that will eventually change?
For now the only way to keep data between restarting is writing/reading files or via script.txt and reinitiliaze everything.

There's also the choice of making a separate application through which connection itself / socket is handled that communicates with spring's Lua via localhost.

I guess I'll make it a standalone Lua lobby, i.e. not relying on spring at all, using only some Lua interpreter and libraries.


Top
 Offline Profile  
 
 Post subject: Re: Lua Lobby / Socket
PostPosted: 25 Apr 2012, 12:34 
Lua Coder

Joined: 12 Jul 2009, 17:57
My Lua lobby reinitilizes and connects nearly instantly so there is no much need for saving anything but the battle you were. Though it is heavily helped with C++ partially handling the commands. I handle some commands with Lua too.


Attachments:
luaLobbyProto.lua [4.27 KiB]
Downloaded 124 times
Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.