TA3D NetServer

Everything related to the code /
Tout ce qui touche au code
Post Reply
User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

TA3D NetServer

Post by zuzuf » Sun Mar 15, 2009 1:48 am

What is it ?

TA3D NetServer is the new server that will handle global chat (with separate channels, etc...), update notifications, user accounts, mod services, stats, ...

Ok nice, but how does it work ?

I began writing a Lua NetServer (yes it's written in Lua, no it doesn't require all the server CPU resources ...) based on luasocket and luasql.mysql . Currently there is only the netserver and a small command line client in Lua I wrote to test the protocol.

For now it doesn't support much of the planned features, only basic ones:
* you can register a new account
* you can log in/out (disconnecting log out too)
* admins can kick/ban/unban/kill (but not self kill), beware that kill is definitive (account erased)
* you can get the list of all connected clients
* you can send/receive messages to/from other clients
* server can send general purpose messages (update notifications, kick/ban/kill messages) as well as error messages
* server sends an update notification if needed when connect and send your client version

So basically, the core is working. You can test it using the command line client (in the subversion repository netserver/netclient.lua) and connecting to my server:

Code: Select all

./netclient.lua netserver.ta3d.org
> CLIENT my_client_version
> REGISTER login password
or
> LOGIN login password

available commands are:
> GET CLIENT LIST (you'll have to hit enter to read server messages)
> SEND user message
PS: beware passwords are not encrypted yet !! (they will be as soon as there is a client supporting encryption :p, but for now it's easier this way when testing)
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Sun Mar 15, 2009 8:24 am

Sorry, I didn`t get it... Is this some kind of ingame chat or it is a separate programm for developers to communicate? :P

How can I run it?

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sun Mar 15, 2009 1:07 pm

It's not for ingame chat, this is a kind of battle.net thing. When you'll get into the multiplayer screen you'll have to chose between LAN games and Internet games. In LAN mode it uses broadcasting to discover servers (so this is limited to the LAN) whereas in Internet mode you'll have to create an account, then log in. Once you're logged in you'll see the default chat room, the list of players in that chat room, the list of all chat rooms, buttons to create/join a game, access the online mod repository, edit your account settings, see your rank and other player's rank and stats. Also you'll receive messages from the server that may pop up (update notifications, error messages).

you can get the client there : http://netserver.ta3d.org/netclient.lua
You'll need Lua 5.1 with luasocket to run it, for windows you'll find it there:
http://luabinaries.luaforge.net/download.html
http://luaforge.net/frs/?group_id=23

once you get it installed, just run the netclient.lua script with the server name/IP as parameter:
netclient.lua netserver.ta3d.org

I'll add a GUI client soon in TA3D :)
=>;-D Penguin Powered

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sun Mar 15, 2009 2:57 pm

Wow, Lua is cool 8)

It can load chunks of code and I added a nice feature:
we can do warm restart of the server :) without closing any connection nor stopping any service (their code is just updated). It also monitors errors of warm started instances of code (unfortunately we cannot unload previously loaded things without ending current chunks ...) so if the running instance crashes, it'll fall back to previous one, trying to fix data structures if possible and then send a message to all admins, telling them a crash occurred :)

Of course this mechanism won't prevent the server from crashing when it faces a logical bug, but if the updates is buggy it may be able to fall back to previously running server without interrupting service :), so updating is safe :D
=>;-D Penguin Powered

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Mon Mar 16, 2009 12:58 am

I've implemented a first draft of TA3D NetClient interface.
Chat if fully operational, server messages too.

in order to create a new chan, type:

Code: Select all

/CHAN my_new_chan
in the text input bar (every line starting with a '/' is sent to the server as a command).

Currently it supports all current features of NetServer (chat, chan, admin commands, logging in/out, registering, server messages/errors popups).

I am going to build a test package :)
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests