عرض مشاركة واحدة
قديم 2020-02-18, 11:06 PM
المشاركة 9
bosha1
.:: عضو نشيط ::.
  • غير متواجد
Unhappy رد: حل السالب في الفلوس
بضيفو ي صحبى

بيجبلى ايرور

دا ي صحبى الكود معلش ضيفو انت وادهوالى

دا ي صحبى الكود



كود:
public void Disconnect(bool save = true) { if (Fake) return; if (Screen != null) Screen.DisposeTimers(); PacketHandler.RemoveTPA(this); Program.World.Unregister(this); if (OnDisconnect != null) OnDisconnect(this); if (_socket.Connector != null) { _socket.Disconnect(); //foreach (var c in LoaderClient.CLients)///// //{ // if (this.Account != null) // { // if (c.Username == this.Account.Username) // { // c.Disconnect(); // LoaderClient.CLients.Remove(c); // } // } //} ShutDown(); } /* if (_socket.Connector != null) { if (Entity != null) { if (Entity.MyPokerTable != null) { if (Entity.MyPokerTable.Entitys.ContainsKey(Entity.UID) && Entity.MyPokerTable.Pot > 1) { byte[] P = new byte[10]; P[6] = 4; P[9] = 200; Entity.MyPokerTable.NewEntityMove(P, Entity.UID); } else Entity.MyPokerTable.RemoveEntity(Entity.UID); } } _socket.Disconnect(); ShutDown(); }*/ }




ودا الكود التانى


كود:
private void ShutDown() { if (Socket.Connector == null) return; Socket.Connector = null; if (this.Entity != null) { try { if (this.Entity.JustCreated) return; Time32 now = Time32.Now; Kernel.DisconnectPool.Add(this.Entity.UID, this); RemoveScreenSpawn(this.Entity, false); Database.EntityTable.UpdateOnlineStatus(this, false); using (var conn = Database.DataHolder.MySqlConnection) { conn.Open(); NobilityOff.Save(this, conn); } Database.EntityTable.SaveEntity(this); if (!TransferedEntity) Database.EntityVariableTable.Save(this); Database.SkillTable.SaveProficiencies(this); if (!TransferedEntity) { Database.ArenaTable.SaveArenaStatistics(this.ArenaStatistic); Database.TeamArenaTable.SaveArenaStatistics(this.TeamArenaStatistic); } Kernel.GamePool.Remove(this.Entity.UID); if (Booth != null) Booth.Remove(); if (Quests != null) Quests.Save(); if (Pet != null) Pet.ClearAll(); if (QualifierGroup != null) QualifierGroup.End(this); if (TeamQualifierGroup != null) TeamQualifierGroup.CheckEnd(this, true); if (Entity.CLanArenaBattleFight != null) Entity.CLanArenaBattleFight.CheakToEnd(this, true); if (Entity.GuildArenaBattleFight != null) Entity.GuildArenaBattleFight.CheakToEnd(this, true); if (Entity.MyClones.Count > 0) { foreach (var item in Entity.MyClones.Values) { MsgActionProto Action = new MsgActionProto(); Action.UID = item.UID; Action.TimeStamp = (uint)Time32.Now.GetHashCode(); Action.ID = MsgActionEmulator.RemoveEntity; SendScreen(MsgActionEmulator.SendPacket(Action)); } Entity.MyClones.Clear(); } if (Challenge != null) Challenge.End(this); EndQualifier(); Database.SkillTable.SaveClientSpells(this); Game.Arena.Clear(this); Game.TeamArena.Clear(this); RemoveScreenSpawn(this.Entity, false); #region Friend/TradePartner/Apprentice Message msg = new Message("Your friend, " + Entity.Name + ", has logged off.", System.Drawing.Color.Red, Message.TopLeft); if (Friends == null) Friends = new SafeDictionary<uint, Game.ConquerStructures.Society.Friend>(100); foreach (Game.ConquerStructures.Society.Friend friend in Friends.Values) { if (friend.IsOnline) { var packet = new Network.GamePackets.KnownPersons(true) { UID = Entity.UID, Type = Network.GamePackets.KnownPersons.RemovePerson, Name = Entity.Name, Online = false }; friend.Client.Send(packet); packet.Type = Network.GamePackets.KnownPersons.AddFriend; if (friend != null) { if (friend.Client != null) { friend.Client.Send(packet); friend.Client.Send(msg); } } } } Message msg2 = new Message("Your partner, " + Entity.Name + ", has logged off.", System.Drawing.Color.Red, Message.TopLeft); if (Partners != null) { foreach (Game.ConquerStructures.Society.TradePartner partner in Partners.Values) { if (partner.IsOnline) { var packet = new TradePartner(true) { UID = Entity.UID, Type = TradePartner.BreakPartnership, Name = Entity.Name, HoursLeft = (int)(new TimeSpan(partner.ProbationStartedOn.AddDays(3).Ticks).TotalHours - new TimeSpan(DateTime.Now.Ticks).TotalHours), Online = false }; partner.Client.Send(packet); packet.Type = TradePartner.AddPartner; if (partner != null) { if (partner.Client != null) { partner.Client.Send(packet); partner.Client.Send(msg2); } } } } } MentorInformation Information = new MentorInformation(true); Information.Mentor_Type = 1; Information.Mentor_ID = Entity.UID; Information.Mentor_Level = Entity.Level; Information.Mentor_Class = Entity.Class; Information.Mentor_PkPoints = Entity.PKPoints; Information.Mentor_Mesh = Entity.Mesh; Information.Mentor_Online = false; Information.String_Count = 3; Information.Mentor_Name = Entity.Name; Information.Mentor_Spouse_Name = Entity.Spouse; if (Apprentices == null) Apprentices = new SafeDictionary<uint, Game.ConquerStructures.Society.Apprentice>(); foreach (var appr in Apprentices.Values) { if (appr.IsOnline) { Information.Apprentice_ID = appr.ID; Information.Enrole_Date = appr.EnroleDate; Information.Apprentice_Name = appr.Name; appr.Client.Send(Information); appr.Client.ReviewMentor(); } } if (Mentor != null) { if (Mentor.IsOnline) { ApprenticeInformation AppInfo = new ApprenticeInformation(); AppInfo.Apprentice_ID = Entity.UID; AppInfo.Apprentice_Level = Entity.Level; AppInfo.Apprentice_Name = Entity.Name; AppInfo.Apprentice_Online = false; AppInfo.Apprentice_Spouse_Name = Entity.Spouse; AppInfo.Enrole_date = Mentor.EnroleDate; AppInfo.Mentor_ID = Mentor.Client.Entity.UID; AppInfo.Mentor_Mesh = Mentor.Client.Entity.Mesh; AppInfo.Mentor_Name = Mentor.Client.Entity.Name; AppInfo.Type = 2; Mentor.Client.Send(AppInfo); } } #endregion #region Team /* if (Team != null) { if (Team.TeamLeader) { Network.GamePackets.Team team = new Network.GamePackets.Team(); team.UID = Account.EntityID; team.Type = Network.GamePackets.Team.Dismiss; foreach (Client.GameState Teammate in Team.Teammates) { if (Teammate != null) { if (Teammate.Entity.UID != Account.EntityID) { Teammate.Send(team); Teammate.Team = null; } } } } else { Network.GamePackets.Team team = new Network.GamePackets.Team(); team.UID = Account.EntityID; team.Type = Network.GamePackets.Team.ExitTeam; foreach (Client.GameState Teammate in Team.Teammates) { if (Teammate != null) { if (Teammate.Entity.UID != Account.EntityID) { Teammate.Send(team); Teammate.Team.Remove(this); } } } } }*/ #endregion if (Team != null) { Team.Remove(this, true); } } catch (Exception e) { Program.SaveException(e); } finally { Kernel.DisconnectPool.Remove(this.Entity.UID); Console.WriteLine("Player " + this.Entity.Name + "*Has logged off*" + "[IP]" + this.Account.IP + "" , ConsoleColor.Red); } } }


ودا الايرور الى بيجيلى

معلش ي صحبى هتعبك معايا بس انا نفسى احل المشكله دى