Annotation of /trunk/ModularRex/RexParts/RexTestModule.cs
Parent Directory
|
Revision Log
Revision 4 - (view) (download)
| 1 : | afrisby | 2 | using System.Reflection; |
| 2 : | using log4net; | ||
| 3 : | using ModularRex.RexNetwork; | ||
| 4 : | using Nini.Config; | ||
| 5 : | using OpenSim.Region.Environment.Interfaces; | ||
| 6 : | using OpenSim.Region.Environment.Scenes; | ||
| 7 : | |||
| 8 : | namespace ModularRex.RexParts | ||
| 9 : | { | ||
| 10 : | public class RexTestModule : IRegionModule | ||
| 11 : | { | ||
| 12 : | private static readonly ILog m_log = | ||
| 13 : | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
| 14 : | |||
| 15 : | public void Initialise(Scene scene, IConfigSource source) | ||
| 16 : | { | ||
| 17 : | scene.EventManager.OnNewClient += EventManager_OnNewClient; | ||
| 18 : | } | ||
| 19 : | |||
| 20 : | void EventManager_OnNewClient(OpenSim.Framework.IClientAPI client) | ||
| 21 : | { | ||
| 22 : | if(client is RexClientView) | ||
| 23 : | { | ||
| 24 : | m_log.Info( | ||
| 25 : | "[REXCLIENT] Confirmed connection from RexPacketServer. This user can use Rex functionalities."); | ||
| 26 : | afrisby | 4 | |
| 27 : | RexClientView rcv = (RexClientView) client; | ||
| 28 : | rcv.OnRexAppearance += rcv_OnRexAppearance; | ||
| 29 : | rcv.OnRexFaceExpression += rcv_OnRexFaceExpression; | ||
| 30 : | rcv.OnChatFromViewer += rcv_OnChatFromViewer; | ||
| 31 : | } else | ||
| 32 : | { | ||
| 33 : | m_log.Info("[REXCLIENT] User is not entering via RexPacketServer. Ignoring."); | ||
| 34 : | afrisby | 2 | } |
| 35 : | } | ||
| 36 : | |||
| 37 : | afrisby | 4 | void rcv_OnChatFromViewer(object sender, OpenSim.Framework.OSChatMessage e) |
| 38 : | { | ||
| 39 : | if(e.Message.StartsWith("/rexauth ")) | ||
| 40 : | { | ||
| 41 : | ((RexClientView) e.Sender).RexAuthURL = e.Message.Split(' ')[1]; | ||
| 42 : | } | ||
| 43 : | if (e.Message.StartsWith("/rexav ")) | ||
| 44 : | { | ||
| 45 : | ((RexClientView)e.Sender).RexAvatarURL = e.Message.Split(' ')[1]; | ||
| 46 : | } | ||
| 47 : | } | ||
| 48 : | |||
| 49 : | void rcv_OnRexFaceExpression(RexClientView sender, System.Collections.Generic.List<string> vParams) | ||
| 50 : | { | ||
| 51 : | m_log.Info("[REXCLIENT] Recieved Rex Facial Expression"); | ||
| 52 : | } | ||
| 53 : | |||
| 54 : | void rcv_OnRexAppearance(RexClientView sender) | ||
| 55 : | { | ||
| 56 : | m_log.Info("[REXCLIENT] Recieved Rex Appearance"); | ||
| 57 : | } | ||
| 58 : | |||
| 59 : | afrisby | 2 | public void PostInitialise() |
| 60 : | { | ||
| 61 : | |||
| 62 : | } | ||
| 63 : | |||
| 64 : | public void Close() | ||
| 65 : | { | ||
| 66 : | |||
| 67 : | } | ||
| 68 : | |||
| 69 : | public string Name | ||
| 70 : | { | ||
| 71 : | get { return "RexTestModule"; } | ||
| 72 : | } | ||
| 73 : | |||
| 74 : | public bool IsSharedModule | ||
| 75 : | { | ||
| 76 : | get { return true; } | ||
| 77 : | } | ||
| 78 : | } | ||
| 79 : | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

