Annotation of /trunk/ModularRex/RexParts/RexTestModule.cs
Parent Directory
|
Revision Log
Revision 63 - (view) (download)
| 1 : | afrisby | 2 | using System.Reflection; |
| 2 : | using log4net; | ||
| 3 : | using ModularRex.RexNetwork; | ||
| 4 : | using Nini.Config; | ||
| 5 : | mikkopa | 63 | using OpenSim.Region.Framework.Interfaces; |
| 6 : | using OpenSim.Region.Framework.Scenes; | ||
| 7 : | afrisby | 2 | |
| 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 : | afrisby | 5 | if (client is RexClientView) |
| 23 : | afrisby | 2 | { |
| 24 : | m_log.Info( | ||
| 25 : | "[REXCLIENT] Confirmed connection from RexPacketServer. This user can use Rex functionalities."); | ||
| 26 : | afrisby | 4 | |
| 27 : | afrisby | 5 | RexClientView rcv = (RexClientView)client; |
| 28 : | afrisby | 4 | rcv.OnRexAppearance += rcv_OnRexAppearance; |
| 29 : | rcv.OnRexFaceExpression += rcv_OnRexFaceExpression; | ||
| 30 : | afrisby | 5 | rcv.OnChatFromClient += rcv_OnChatFromClient; |
| 31 : | } | ||
| 32 : | else | ||
| 33 : | afrisby | 4 | { |
| 34 : | m_log.Info("[REXCLIENT] User is not entering via RexPacketServer. Ignoring."); | ||
| 35 : | afrisby | 2 | } |
| 36 : | } | ||
| 37 : | |||
| 38 : | afrisby | 5 | void rcv_OnChatFromClient(object sender, OpenSim.Framework.OSChatMessage e) |
| 39 : | afrisby | 4 | { |
| 40 : | afrisby | 5 | if (e.Message.StartsWith("/rexauth ")) |
| 41 : | afrisby | 4 | { |
| 42 : | afrisby | 5 | ((RexClientView)e.Sender).RexAuthURL = e.Message.Split(' ')[1]; |
| 43 : | afrisby | 4 | } |
| 44 : | if (e.Message.StartsWith("/rexav ")) | ||
| 45 : | { | ||
| 46 : | ((RexClientView)e.Sender).RexAvatarURL = e.Message.Split(' ')[1]; | ||
| 47 : | } | ||
| 48 : | } | ||
| 49 : | |||
| 50 : | void rcv_OnRexFaceExpression(RexClientView sender, System.Collections.Generic.List<string> vParams) | ||
| 51 : | { | ||
| 52 : | m_log.Info("[REXCLIENT] Recieved Rex Facial Expression"); | ||
| 53 : | } | ||
| 54 : | |||
| 55 : | void rcv_OnRexAppearance(RexClientView sender) | ||
| 56 : | { | ||
| 57 : | m_log.Info("[REXCLIENT] Recieved Rex Appearance"); | ||
| 58 : | } | ||
| 59 : | |||
| 60 : | afrisby | 2 | public void PostInitialise() |
| 61 : | { | ||
| 62 : | |||
| 63 : | } | ||
| 64 : | |||
| 65 : | public void Close() | ||
| 66 : | { | ||
| 67 : | |||
| 68 : | } | ||
| 69 : | |||
| 70 : | public string Name | ||
| 71 : | { | ||
| 72 : | get { return "RexTestModule"; } | ||
| 73 : | } | ||
| 74 : | |||
| 75 : | public bool IsSharedModule | ||
| 76 : | { | ||
| 77 : | get { return true; } | ||
| 78 : | } | ||
| 79 : | } | ||
| 80 : | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

