protected override void OnSocketKilled(string msg) { INetworkConnection con = GetOwningServerConnection(); if (con != null && con.IsAlive && ServerUser.CurrentCharacter != null) { PropertyBag bag = new PropertyBag(); bag.SetProperty((int)PropertyID.CharacterId, ServerUser.CurrentCharacter.CharacterInfo.ID); if (ServerUser.TransferTarget != null) { bag.SetProperty((int)PropertyID.Name, ServerUser.TransferTarget); } con.SendGenericMessage((int)GenericMessageType.CharacterDisconnected, bag, false); } if (ServerUser.TransferTarget == null || ServerUser.TransferTarget.Length == 0) // if we're not transferring { if (ServerUser.Profile != null && !ServerUser.IsAuthorizedClusterServer) { ServerUser.Profile.SetLoggedOut(); if (ServerBase.UseDatabaseConnectivity && ServerUser.IsAuthenticated) { ServerUser.Profile.Save(MyServer.RequireAuthentication); } } // kill auth ticket on this server. ConnectionManager.UnAuthorizeUser(ServerUser, false); } base.OnSocketKilled(msg); }
/// <summary> /// Gets called when we are ready to communicate with the player, i.e. we can start sending packets /// </summary> protected virtual void OnConnectionReady() { INetworkConnection con = GetOwningServerConnection(); if (con != null && con.IsAlive && ServerUser.CurrentCharacter != null) { PropertyBag bag = new PropertyBag(); bag.SetProperty((int)PropertyID.CharacterInfo, ServerUser.CurrentCharacter as IComponent); bag.SetProperty((int)PropertyID.Owner, ServerUser.ID); con.SendGenericMessage((int)GenericMessageType.CharacterTransferComplete, bag, false); } }