/// <summary> /// Copia a estrutura para a Player e remove da lista de HexID. /// </summary> /// <param name="index"></param> /// <param name="hexIndex"></param> public static void AcceptHexID(NetConnection connection, HexaID hexID) { PlayerData pData = FindByConnection(connection); pData.HexID = hexID.HexID; pData.AccountID = hexID.AccountID; pData.Account = hexID.Account; pData.LanguageID = hexID.LanguageID; pData.AccessLevel = hexID.AccessLevel; pData.CharacterID = hexID.CharacterID; pData.CharSlot = hexID.CharSlot; pData.Service = hexID.Service; HexID.Remove(hexID); }
/// <summary> /// Copia a estrutura para a Player e remove da lista de HexID. /// </summary> /// <param name="index"></param> /// <param name="hexIndex"></param> public static void AcceptHexID(NetConnection connection, HexaID hexID) { var pData = FindByConnection(connection); pData.HexID = hexID.HexID; pData.AccountID = hexID.AccountID; pData.Account = hexID.Account; pData.LanguageID = hexID.LanguageID; pData.AccessLevel = hexID.AccessLevel; pData.Cash = hexID.Cash; pData.Pin = hexID.Pin; pData.Service = hexID.Service; HexID.Remove(hexID); }
/// <summary> /// Percorre todos os hexid e verifica o estado atual. /// </summary> public static void VerifyHexID() { foreach (HexaID hexID in HexID) { if (Equals(null, hexID)) { continue; } if (Environment.TickCount >= hexID.Time + 30000) { FileLog.WriteLog($"Removed HexID: {hexID.HexID} {hexID.Account}", System.Drawing.Color.Coral); HexID.Remove(hexID); } } }
/// <summary> /// Percorre todos os hexid e verifica o estado atual. /// </summary> public static void VerifyHexID() { //se algum dado estiver mais que 30 segundos no sistema, é removido da lista. //então, o jogador deve fazer um login foreach (var hexID in HexID) { if (Equals(null, hexID)) { continue; } if (Environment.TickCount > hexID.Time + 30000) { FileLog.WriteLog($"Removed HexID: {hexID.HexID} {hexID.Account}", Color.Coral); HexID.Remove(hexID); } } }
void Start() { //Debug.Log ("Hex slot created!"); gameManager = GameObject.FindGameObjectWithTag("GameController"); selected = false; placed = false; //hexID = "Slot"; //start of game hex slot //there should only be 1 blank hex at start of realm creation, unless using some variant like SuperRealm (much further down the line) if (gameObject.name == "Hex 0") { hexID = new HexID(0, 0); } ID = hexID.GetPosA().ToString() + ", " + hexID.GetPosB().ToString(); }
/// <summary> /// Adiciona os dados recebido do login server. /// </summary> /// <param name="data"></param> public static void AddHexID(NetIncomingMessage data) { var hexID = new HexaID(); hexID.HexID = data.ReadString(); hexID.Account = data.ReadString(); hexID.AccountID = data.ReadInt32(); hexID.LanguageID = data.ReadByte(); hexID.AccessLevel = data.ReadInt16(); hexID.Cash = data.ReadInt32(); hexID.Pin = data.ReadString(); hexID.Time = Environment.TickCount; var service = data.ReadInt32(); for (var n = 0; n < service; n++) { hexID.Service.Add(data.ReadString()); } HexID.Add(hexID); FileLog.WriteLog($"Data From Login Server ID: {hexID.AccountID} Account: {hexID.Account} {hexID.HexID}", Color.Black); }
/// <summary> /// Adiciona os dados recebido do login server. /// </summary> /// <param name="data"></param> public static void AddHexID(NetIncomingMessage data) { HexaID hexID = new HexaID(); hexID.HexID = data.ReadString(); hexID.Account = data.ReadString(); hexID.AccountID = data.ReadInt32(); hexID.LanguageID = data.ReadByte(); hexID.AccessLevel = data.ReadInt16(); hexID.CharacterID = data.ReadInt32(); hexID.CharSlot = data.ReadInt32(); var service = data.ReadInt32(); for (var n = 0; n < service; n++) { hexID.Service.Add(data.ReadString()); } hexID.Time = Environment.TickCount; HexID.Add(hexID); FileLog.WriteLog($"Data From World Server ID: {hexID.AccountID} Account: {hexID.Account} Char ID: {hexID.CharacterID} Slot: {hexID.CharSlot} {hexID.HexID}", System.Drawing.Color.Black); }
/// <summary> /// Limpa todos os dados. /// </summary> public static void Clear() { HexID.Clear(); Player.Clear(); }