Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using PangyaAPI.BinaryModels;
- using System;
- using System.IO;
- using System.Net;
- using System.Net.Sockets;
- namespace PangyaAPI
- {
- public partial class Player
- {
- #region private Fields
- private static PangyaCryptographyOld.Pang _pang;
- #endregion
- #region Delegates
- public delegate void PacketChangedEvent();
- #endregion
- #region Events
- public event PacketChangedEvent OnPacketChanged;
- #endregion
- #region Public Fields
- public PangyaBinaryWriter Response;
- //Conexão
- public TcpClient Tcp;
- public Socket socket;
- /// <summary>
- /// Packet Atual
- /// </summary>
- private Packet _currentPacket;
- public Packet CurrentPacket
- {
- get { return _currentPacket; }
- set
- {
- _currentPacket = value;
- OnPacketChanged?.Invoke();
- }
- }
- /// <summary>
- /// Packet Anterior
- /// </summary>
- public Packet PreviousPacket { get; set; }
- //Teste
- public UInt16 GameID { get; set; }
- public UInt32 Title_TypeID = 0;
- public byte TypeChat = 0x00;
- public byte Game_Role { get; set; } //game_role diz ser admin da sala byte 8 , quem entra apos ser criada a sala é byte 1
- public byte Game_Slot = 0x01; //
- public byte Game_ready = 0x00; //coloco 0,
- public UInt16 ID_ROM { get; set; } = 1;
- public int ConnectionId { get; set; }
- public byte CountList {get; set;}
- //Identificador da conta no banco de dados
- public PlayerMemberInfo UserInfo { get; set; }
- //estatica do player
- public PlayerStaticInfo InfoStatistic { get; set; }
- public PlayerMemberMacro Macro { get; set; }
- //Chave de criptografia e decriptografia
- public byte Key { get; private set; }
- #endregion
- // private ProjectG _projectG { get; set; }
- public Player(TcpClient tcp)
- {
- _pang = new PangyaCryptographyOld.Pang();
- Tcp = tcp;
- //Gera uma chave dinâmica
- Key = Convert.ToByte(new Random().Next(1, 17));
- //Maximo hexadecimal value: FF (255)
- ////Chave Fixa
- Key = 0x0A; //chave 10
- //_responseStream = new MemoryStream();
- Response = new PangyaBinaryWriter(new MemoryStream());
- }
- public string GetIpAdress()
- {
- return ((IPEndPoint)Tcp.Client.RemoteEndPoint).Address.ToString();
- }
- public void Disconnect()
- {
- Tcp.Close();
- }
- }
- public class PlayerMemberInfo
- {
- public int UID { get; set; }
- public byte? IDState { get; set; }
- public byte? Logon { get; set; }
- public byte? FirstSet { get; set; }
- public string Username { get; set; }
- public string Password { get; set; }
- public string Nickname { get; set; }
- public string AuthKey_Login { get; set; }
- public string AuthKey_Game { get; set; }
- public int? Cookie { get; set; }
- public int Pang { get; set; }
- public byte? Sex { get; set; }
- public byte? Capabilities { get; set; }
- public int? DailyLoginCount { get; set; }
- public DateTime? LastLogonTime { get; set; }
- public UInt32 CHARACTER_ID { get; set; }
- }
- public class PlayerMemberMacro
- {
- public string Macro1 { get; set; }
- public string Macro2 { get; set; }
- public string Macro3 { get; set; }
- public string Macro4 { get; set; }
- public string Macro5 { get; set; }
- public string Macro6 { get; set; }
- public string Macro7 { get; set; }
- public string Macro8 { get; set; }
- public string Macro9 { get; set; }
- public string Macro10 { get; set; }
- }
- public class PlayerStaticInfo
- {
- public int UID { get; set; }
- public int Drive { get; set; }
- public int Putt { get; set; }
- public int Playtime { get; set; }
- public float Longest { get; set; }
- public int Distance { get; set; }
- public int Pangya { get; set; }
- public int Hole { get; set; }
- public int TeamHole { get; set; }
- public int Holeinone { get; set; }
- public int OB { get; set; }
- public int Bunker { get; set; }
- public int Fairway { get; set; }
- public int Albatross { get; set; }
- public int Holein { get; set; }
- public int Pang { get; set; }
- public int Timeout { get; set; }
- public short Game_Level { get; set; }
- public int Game_Point { get; set; }
- public int PuttIn { get; set; }
- public float LongestPuttIn { get; set; }
- public float LongestChipIn { get; set; }
- public int NoMannerGameCount { get; set; }
- public int ShotTime { get; set; }
- public int GameCount { get; set; }
- public int DisconnectGames { get; set; }
- public int wTeamWin { get; set; }
- public int wTeamGames { get; set; }
- public short LadderPoint { get; set; }
- public short LadderWin { get; set; }
- public short LadderLose { get; set; }
- public short LadderDraw { get; set; }
- public int ComboCount { get; set; }
- public int MaxComboCount { get; set; }
- public int TotalScore { get; set; }
- public short BestScore0 { get; set; }
- public short BestScore1 { get; set; }
- public short BestScore2 { get; set; }
- public short BestScore3 { get; set; }
- public short BESTSCORE4 { get; set; }
- public int MaxPang0 { get; set; }
- public int MaxPang1 { get; set; }
- public int MaxPang2 { get; set; }
- public int MaxPang3 { get; set; }
- public int MAXPANG4 { get; set; }
- public int SumPang { get; set; }
- public short LadderHole { get; set; }
- public int GameCountSeason { get; set; }
- public long SkinsPang { get; set; }
- public int SkinsWin { get; set; }
- public int SkinsLose { get; set; }
- public int SkinsRunHoles { get; set; }
- public int SkinsStrikePoint { get; set; }
- public int SkinsAllinCount { get; set; }
- public int EventValue { get; set; }
- public int EventFlag { get; set; }
- public byte Unknow = 0x00;
- public byte[] Unknow2 { get; set; } = new byte[6];//5 ou 6?
- public byte[] Unknow3 { get; set; } = new byte[8];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement