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

