local chat

Tech talk for MV3D developers or those looking to lend a hand.

Moderator: SirGolan

local chat

Postby jhamel » Tue Sep 20, 2011 8:42 am

Hi,
Can someone say me the best entry-point to setup the local chat at my chatwindow ?. At this time I can with
Code: Select all
 player = self.client.conductor.getLocalService(IPlayerClient)
use the player methods and variables like player.pcname, player.pc, player.pcid,player.login, player.password and so on. But how can I do this things:

How can I add special keybindings/actions to the player ? Especially I get the player at my modified state.py at the InGame class. For example STRG-G to play a gesture or STRG-H to open the chat window ?
How can I set my own variables to the player, I need a player-uuid and a session-uuid for example ?
How can i say something in local chat, how can I fetch the words, that other say in local chat ? ( I wish to redirect that to my chat window ).
Perhaps someone give me some code-snippets ?

Thanks,
Juergen
jhamel
 
Posts: 17
Joined: Fri Jul 15, 2011 11:07 am

Re: local chat

Postby SirGolan » Tue Sep 20, 2011 4:53 pm

Can someone say me the best entry-point to setup the local chat at my chatwindow ?

There's already a very basic local chat system implemented. It's not done in a great way as it is one of the earlier systems added. It currently uses the event broadcasting system to relay chat messages (which also is one of the earlier systems and deserves a good look before I'd suggest you base anything off of it). In the Ogre client, you can hit F2 to bring up the chat window, but I don't know if that was ever added to the Panda client.

It seems like this would make a good tutorial.

How can I add special keybindings/actions to the player ?


Keybindings are in mv3d.client.ui.player. There isn't a great API for adding new ones yet. If you happen to make one, I'd love to add it back to MV3D. Some of those keybindings end up with a call of self.pc.do("action", parameters...). If you look in mv3d.server.player and the PlayerManipulator class, you'll see where those actions are implemented. Again, there isn't yet an API for adding new ones.

I just added #831 and #832 to add APIs for both of those things, but that won't make it into the current release unless you want to take it on.

How can I set my own variables to the player, I need a player-uuid and a session-uuid for example ?

Are these things you want stored on the server? Are they temporary on the server?

Perhaps someone give me some code-snippets ?


We should probably have a tutorial on creating a basic chat system. :) Hopefully the answers I've given you point you in the right direction.

Thanks,
Mike
SirGolan
Site Admin
 
Posts: 214
Joined: Wed Mar 19, 2008 7:04 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron