void OnGameLeave(NetConnection <NetSession> conn, UserGameLeaveRequest request) { //get the leaving character Character character = conn.Session.Character; CharacterLeaveGame(character); }
void OnGameLeave(NetConnection <NetSession> sender, UserGameLeaveRequest request) { Character character = sender.Session.Character; Log.InfoFormat("UserGameLeaveRequest: characterID:{0}:{1} Map:{2}", character.Id, character.Info.Name, character.Info.mapId); this.CharacterLeave(character); sender.Session.Response.gameLeave = new UserGameLeaveResponse(); sender.Session.Response.gameLeave.Result = Result.Success; sender.Session.Response.gameLeave.Errormsg = "None"; sender.SendResponse(); }
private void OnGameLeave(NetConnection <NetSession> sender, UserGameLeaveRequest message) { Character character = sender.Session.Character; Log.InfoFormat("UserGameLeaveRequset:CharacterId:{0}:{1} Map:{2} ", character.Info.Id, character.Info.Name, character.Data.MapID); SessionManager.Instance.RemoveSession(character.Id); CharacterLeave(character); sender.Session.Response.gameLeave = new UserGameLeaveResponse(); sender.Session.Response.gameLeave.Result = Result.Success; sender.Session.Response.gameLeave.Errormsg = "None"; sender.SendResponse(); //sender.Session.Character = null; }
void OnGameLeave(NetConnection <NetSession> sender, UserGameLeaveRequest request) { Character character = sender.Session.Character; Log.InfoFormat("角色:昵称{0},id:{1}离开了地图", character.Info.Name, character.entityId); CharacterManager.Instance.RemoveCharacter(character.entityId); NetMessage message = new NetMessage(); message.Response = new NetMessageResponse(); message.Response.gameLeave = new UserGameLeaveResponse(); message.Response.gameLeave.Result = Result.Success; message.Response.gameLeave.Errormsg = "none"; sender.SendData(message); MapManager.Instance[character.Data.MapID].CharacterLeave(character); }
public void OnGameLeave(NetConnection <NetSession> sender, UserGameLeaveRequest request) { Character character = sender.Session.Character; Log.InfoFormat(" UserGameLeaveRequest:characterId:{0}; {1},map:{2}", character.Id, character.Info.Name, character.Info.mapId); CharacterLeave(character); NetMessage message = new NetMessage(); message.Response = new NetMessageResponse(); message.Response.gameLeave = new UserGameLeaveResponse(); message.Response.gameLeave.Result = Result.Success; message.Response.gameLeave.Errormsg = "none"; byte[] data = PackageHandler.PackMessage(message); sender.SendData(data, 0, data.Length); }
private void OnGameLeave(NetConnection <NetSession> sender, UserGameLeaveRequest request) { if (sender.Session.Character == null) { return; } //Log.InfoFormat("OnGameLeave Character TUser:{0} in Map{1}", sender.Session.TUser.ID, sender.Session.Character.Info.mapId); sender.Session.Response.gameLeave = new UserGameLeaveResponse() { Result = Result.Success, Errormsg = "None" }; SessionManager.Instance.RemoveSession(sender.Session.Character.Id); sender.SendResponse(); MapManager.Instance[sender.Session.Character.Info.mapId].CharacterLeave(sender.Session.Character); CharacterManager.Instance.RemoveCharacter(sender.Session.Character.Id); sender.Session.Character = null; }
void OnGameLeave(NetConnection <NetSession> sender, UserGameLeaveRequest request) { Character character = sender.Session.Character; Log.InfoFormat("UserGameLeaveRequest: characterID:{0}:{1} Map:{2}", character.Id, character.Info.Name, character.Info.mapId); // SessionManager.Instance.RemoveSession(character.Id); CharacterLeave(character); //NetMessage message = new NetMessage(); //message.Response = new NetMessageResponse(); //message.Response.gameLeave = new UserGameLeaveResponse(); //message.Response.gameLeave.Result = Result.Success; //message.Response.gameLeave.Errormsg = "None"; //byte[] data = PackageHandler.PackMessage(message); //sender.SendData(data, 0, data.Length); sender.Session.Response.gameLeave = new UserGameLeaveResponse(); sender.Session.Response.gameLeave.Result = Result.Success; sender.Session.Response.gameLeave.Errormsg = "None"; sender.SendResponse(); }
private void OnGameLeave(NetConnection <NetSession> sender, UserGameLeaveRequest message) { Character cha = sender.Session.Character; RemoveChara(cha); SkillBridge.Message.NetMessage rsp = new NetMessage(); rsp.Response = new NetMessageResponse(); rsp.Response.gameLeave = new UserGameLeaveResponse(); rsp.Response.gameLeave.Result = Result.Success; byte[] data = PackageHandler.PackMessage(rsp); sender.SendData(data, 0, data.Length); TCharacter character = sender.Session.Character.Data; character.MapID = cha.Info.mapId; character.MapPosX = cha.EntityData.Position.X; character.MapPosY = cha.EntityData.Position.Y; character.MapPosZ = cha.EntityData.Position.Z; character.MapRotX = cha.EntityData.Direction.X; character.MapRotY = cha.EntityData.Direction.Y; DBService.Instance.Entities.SaveChangesAsync(); sender.Session.Character = null; }
void OnGameLeave(NetConnection <NetSession> sender, UserGameLeaveRequest request) { }