Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.61 KB | None | 0 0
  1. #region 2090 Watchers
  2. case 2090:
  3. {
  4. byte Typ = packet[6];
  5. Game.Entity MyChar = client.Entity;
  6. switch (Typ)
  7. {
  8. case 0:
  9. {
  10. if (MyChar.PokerTable > 0)
  11. {
  12. if (Kernel.PokerTables.ContainsKey(MyChar.PokerTable))
  13. {
  14. byte Seat = packet[7];
  15. Game.PokerTable T = MyChar.MyPokerTable;
  16. if (T.Players.ContainsKey(client.Entity.UID)) return;
  17. if (T.FreeSeat(Seat))
  18. {
  19. T.AddNewPlayer(MyChar, Seat, true);
  20. byte CurrentState = 1;
  21. if (!T.Players.ContainsKey(MyChar.UID))
  22. if (T.Watchers.ContainsKey(MyChar.UID))
  23. {
  24. CurrentState = T.Watchers[MyChar.UID].CurrentState;
  25. T.Watchers.Remove(MyChar.UID);
  26. }
  27. client.Send(Game.PokerPackets.PokerPlayerInfo(Seat, MyChar.UID, CurrentState, T.Nomber));
  28. foreach (Game.PokerPlayer P in T.Players.Values)
  29. {
  30. if (P.PlayerId == MyChar.UID) continue;
  31. client.Send(Game.PokerPackets.PokerPlayerInfo(P.Seat, P.PlayerId, P.CurrentState, T.Nomber));
  32. P.Send(Game.PokerPackets.PokerPlayerInfo(Seat, MyChar.UID, CurrentState, T.Nomber));
  33. }
  34. foreach (Game.PokerPlayer P in T.Watchers.Values)
  35. {
  36. if (P.PlayerId == MyChar.UID) continue;
  37. client.Send(Game.PokerPackets.PokerPlayerInfo(P.Seat, P.PlayerId, P.CurrentState, T.Nomber));
  38. P.Send(Game.PokerPackets.PokerPlayerInfo(Seat, MyChar.UID, CurrentState, T.Nomber));
  39. }
  40. if (T.Players.Count == 2 && T.Pot == 0) T.SetNewRound(10);
  41. }
  42. }
  43. }
  44. break;
  45. }
  46. case 1:
  47. {
  48. if (MyChar.PokerTable > 0)
  49. {
  50. if (Kernel.PokerTables.ContainsKey(MyChar.PokerTable))
  51. {
  52. byte Seat = packet[8];
  53. Game.PokerTable T = MyChar.MyPokerTable;
  54. if (T.Players.ContainsKey(client.Entity.UID)) return;
  55. if (T.FreeSeat(Seat))
  56. {
  57. T.AddNewPlayer(MyChar, Seat, true);
  58. byte CurrentState = 1;
  59. if (!T.Players.ContainsKey(MyChar.UID))
  60. if (T.Watchers.ContainsKey(MyChar.UID))
  61. {
  62. CurrentState = T.Watchers[MyChar.UID].CurrentState;
  63. T.Watchers.Remove(MyChar.UID);
  64. }
  65. client.Send(Game.PokerPackets.PokerPlayerInfo(Seat, MyChar.UID, CurrentState, T.Nomber));
  66. foreach (Game.PokerPlayer P in T.Players.Values)
  67. {
  68. if (P.PlayerId == MyChar.UID) continue;
  69. client.Send(Game.PokerPackets.PokerPlayerInfo(P.Seat, P.PlayerId, P.CurrentState, T.Nomber));
  70. P.Send(Game.PokerPackets.PokerPlayerInfo(Seat, MyChar.UID, CurrentState, T.Nomber));
  71. }
  72. foreach (Game.PokerPlayer P in T.Watchers.Values)
  73. {
  74. if (P.PlayerId == MyChar.UID) continue;
  75. client.Send(Game.PokerPackets.PokerPlayerInfo(P.Seat, P.PlayerId, P.CurrentState, T.Nomber));
  76. P.Send(Game.PokerPackets.PokerPlayerInfo(Seat, MyChar.UID, CurrentState, T.Nomber));
  77. }
  78. if (T.Players.Count == 2 && T.Pot == 0) T.SetNewRound(10);
  79. }
  80. }
  81. }
  82. break;
  83. }
  84. default:
  85. {
  86.  
  87. string D = "";
  88. for (int x = 0; x < packet.Length; x++)
  89. D += packet[x].ToString("X") + " ";
  90. client.Send(new Message("Unknown type: " + ID + " with length " + packet.Length + " :- " + D, System.Drawing.Color.CadetBlue, Message.Talk));
  91. break;
  92. }
  93. }
  94. break;
  95. }
  96. #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement