diff options
author | Teravus Ovares | 2008-05-31 12:18:29 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-31 12:18:29 +0000 |
commit | febe78d06249cd4d36a86e97610dd45ab518a757 (patch) | |
tree | 7b9733fc14045f09e874440b923cfe443b781b6a /OpenSim/Framework/Communications | |
parent | Mantis#1425. Thank you kindly, Melanie for a patch that: (diff) | |
download | opensim-SC-febe78d06249cd4d36a86e97610dd45ab518a757.zip opensim-SC-febe78d06249cd4d36a86e97610dd45ab518a757.tar.gz opensim-SC-febe78d06249cd4d36a86e97610dd45ab518a757.tar.bz2 opensim-SC-febe78d06249cd4d36a86e97610dd45ab518a757.tar.xz |
* Implements UserServer logoff in a few situations
* User tries to log-in but is already logged in. Userserver will send message to simulator user was in to log the user out there.
* From the UserServer, admin types 'logoff-user firstname lastname message'.
* Some regions may not get the message because they're not updated yet.
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r-- | OpenSim/Framework/Communications/IUserService.cs | 7 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/LoginService.cs | 15 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 15 |
3 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs index 67a8c78..59ad188 100644 --- a/OpenSim/Framework/Communications/IUserService.cs +++ b/OpenSim/Framework/Communications/IUserService.cs | |||
@@ -113,6 +113,13 @@ namespace OpenSim.Framework.Communications | |||
113 | /// Get's the User Appearance | 113 | /// Get's the User Appearance |
114 | AvatarAppearance GetUserAppearance(LLUUID user); | 114 | AvatarAppearance GetUserAppearance(LLUUID user); |
115 | 115 | ||
116 | /// <summary> | ||
117 | /// Updates the current region the User is in | ||
118 | /// </summary> | ||
119 | /// <param name="avatarid">User Region the Avatar is IN</param> | ||
120 | /// <param name="retionuuid">User Region the Avatar is IN</param> | ||
121 | void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle); | ||
122 | |||
116 | void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance); | 123 | void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance); |
117 | 124 | ||
118 | void AddAttachment(LLUUID user, LLUUID attach); | 125 | void AddAttachment(LLUUID user, LLUUID attach); |
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index bd0fa53..08b071f 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs | |||
@@ -79,7 +79,15 @@ namespace OpenSim.Framework.Communications | |||
79 | /// <param name="response">The existing response</param> | 79 | /// <param name="response">The existing response</param> |
80 | /// <param name="theUser">The user profile</param> | 80 | /// <param name="theUser">The user profile</param> |
81 | public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest); | 81 | public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest); |
82 | |||
83 | /// <summary> | ||
84 | /// If the user is already logged in, try to notify the region that the user they've got is dead. | ||
85 | /// </summary> | ||
86 | /// <param name="theUser"></param> | ||
87 | public virtual void LogOffUser(UserProfileData theUser, string message) | ||
88 | { | ||
82 | 89 | ||
90 | } | ||
83 | /// <summary> | 91 | /// <summary> |
84 | /// Get the initial login inventory skeleton (in other words, the folder structure) for the given user. | 92 | /// Get the initial login inventory skeleton (in other words, the folder structure) for the given user. |
85 | /// </summary> | 93 | /// </summary> |
@@ -196,9 +204,14 @@ namespace OpenSim.Framework.Communications | |||
196 | // because of some problem, for instance, the crashment of server or client, | 204 | // because of some problem, for instance, the crashment of server or client, |
197 | // the user cannot log in any longer. | 205 | // the user cannot log in any longer. |
198 | userProfile.CurrentAgent.AgentOnline = false; | 206 | userProfile.CurrentAgent.AgentOnline = false; |
199 | m_userManager.CommitAgent(ref userProfile); | ||
200 | 207 | ||
208 | m_userManager.CommitAgent(ref userProfile); | ||
209 | |||
210 | // try to tell the region that their user is dead. | ||
211 | LogOffUser(userProfile, "You were logged off because you logged in from another location"); | ||
212 | |||
201 | // Reject the login | 213 | // Reject the login |
214 | |||
202 | 215 | ||
203 | m_log.InfoFormat( | 216 | m_log.InfoFormat( |
204 | "[LOGIN END]: Notifying user {0} {1} that they are already logged in", | 217 | "[LOGIN END]: Notifying user {0} {1} that they are already logged in", |
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 87e06f1..8985bb6 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -187,6 +187,21 @@ namespace OpenSim.Framework.Communications | |||
187 | return null; | 187 | return null; |
188 | } | 188 | } |
189 | 189 | ||
190 | public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle) | ||
191 | { | ||
192 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | ||
193 | { | ||
194 | try | ||
195 | { | ||
196 | plugin.Value.UpdateUserCurrentRegion(avatarid, regionuuid, regionhandle); | ||
197 | } | ||
198 | catch (Exception e) | ||
199 | { | ||
200 | m_log.Info("[USERSTORAGE]: Unable to updateuser location via " + plugin.Key + "(" + e.ToString() + ")"); | ||
201 | } | ||
202 | } | ||
203 | } | ||
204 | |||
190 | /// <summary> | 205 | /// <summary> |
191 | /// Loads a user's friend list | 206 | /// Loads a user's friend list |
192 | /// </summary> | 207 | /// </summary> |