Erlang/OTP Forums

Author Message

<  Open Telecom Platform (OTP)  ~  A mud login fsm that hands off to another fsm when done.

glemzurg
Posted: Wed Feb 17, 2010 6:27 am Reply with quote
Joined: 17 Feb 2010 Posts: 3 Location: Las Vegas, NV
Hi all.

Just starting to learn Erlang and I'm writing a mud with it, porting some C++ code from Mud Game Programming by Ron Penton.

I've setup and slightly altered the non-blocking TCP server in the tutorials as a start, and now I'm looking to implement the user login.

Here is what I'm thinking, and I'd like feedback please.

Rather than the tcp_listener starting a tcp_echo_fsm's, I'm thinking I'll have it start login_fsm's which has the mud greeting and initial login states (with accompianying text prompts).

The login_fsm is passed the port and will create the tcp_echo_fsm, but the echo_fsm will be altered to send data messages to its "parent" (the login_fsm in this case, a different fsm after login).

Once the login is successfuly, it will pass the modified tcp_echo_fsm to a user_fsm which represents the game behavior for the logged in user, then it will end.

I'm not exactly sure what the "parent" relationship mentioned above is, but I'd like to keep the tcp fsm just protocol code and also keep the login logic separated from the already-logged-in user logic.

Any suggestions would be appreciated.

Thanks,

Justin
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum