private RemoveUserFromRoomThread ( |
||
user | ||
free | bool | |
Résultat | void |
internal void RemoveUser(IList <ulong> guids, int roomId, bool free, MyAction <bool, int, IList <User> > callbackOnFinish) { Room room = GetRoomByID(roomId); if (null != room) { List <User> users = new List <User>(); for (int i = 0; i < guids.Count; ++i) { User user = room.GetUserByGuid(guids[i]); if (null != user) { room.RemoveUserFromRoomThread(user, free); users.Add(user); } } if (null != callbackOnFinish) { int sceneId = 0; Scene scene = room.ActiveScene; if (null != scene) { sceneId = scene.SceneResId; } callbackOnFinish(true, sceneId, users); return; } } if (null != callbackOnFinish) { callbackOnFinish(false, -1, null); } }
private void RemoveUserForChangeScene(Room room, User user, ulong userGuid, int roomId, int targetRoomId, PBChannel channel, int handle, uint seq) { Msg_RL_ChangeSceneResult replyBuilder = new Msg_RL_ChangeSceneResult(); EntityInfo info = user.Info; if (null != info) { replyBuilder.HP = info.Hp; replyBuilder.MP = info.Energy; } room.RemoveUserFromRoomThread(user, true); replyBuilder.UserGuid = userGuid; replyBuilder.RoomID = roomId; replyBuilder.TargetRoomID = targetRoomId; replyBuilder.Result = (int)SceneOperationResultEnum.Success; channel.Send(replyBuilder); }
private void RemoveUserForChangeScene(Room room, User user, ulong userGuid, int roomId, int targetRoomId, PBChannel channel, int handle, uint seq) { Msg_RL_ChangeSceneResult replyBuilder = new Msg_RL_ChangeSceneResult(); EntityInfo info = user.Info; if (null != info) { replyBuilder.HP = info.Hp; replyBuilder.MP = info.Energy; } room.RemoveUserFromRoomThread(user, true); replyBuilder.UserGuid = userGuid; replyBuilder.RoomID = roomId; replyBuilder.TargetRoomID = targetRoomId; replyBuilder.Result = (int)SceneOperationResultEnum.Success; channel.Send(replyBuilder); }