Example #1
0
        /// <summary>
        /// Occurs when the client has been sucessfully authenticated by the loginserver.
        /// Called by UILoginDialog.cs.
        /// </summary>
        /// <param name="Client">The client that received the packet.</param>
        /// <param name="Packet">The packet that was received.</param>
        public static void OnInitLoginNotify(NetworkClient Client, ProcessedPacket Packet)
        {
            //Account was authenticated, so add the client to the player's account.
            PlayerAccount.Client = Client;

            if (!Directory.Exists("CharacterCache"))
            {
                Directory.CreateDirectory("CharacterCache");

                //The charactercache didn't exist, so send the current time, which is
                //newer than the server's stamp. This will cause the server to send the entire cache.
                UIPacketSenders.SendCharacterInfoRequest(DateTime.Now.ToString("yyyy.MM.dd hh:mm:ss"));
            }
            else
            {
                if (!File.Exists("CharacterCache\\Sims.cache"))
                {
                    //The charactercache didn't exist, so send the current time, which is
                    //newer than the server's stamp. This will cause the server to send the entire cache.
                    UIPacketSenders.SendCharacterInfoRequest(DateTime.Now.ToString("yyyy.MM.dd hh:mm:ss"));
                }
                else
                {
                    string LastDateCached = Cache.GetDateCached();
                    if (LastDateCached == "")
                    {
                        UIPacketSenders.SendCharacterInfoRequest(DateTime.Now.ToString("yyyy.MM.dd hh:mm:ss"));
                    }
                    else
                    {
                        UIPacketSenders.SendCharacterInfoRequest(LastDateCached);
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Occurs when the client has been sucessfully authenticated by the loginserver.
        /// Called by UILoginDialog.cs.
        /// </summary>
        /// <param name="Client">The client that received the packet.</param>
        /// <param name="Packet">The packet that was received.</param>
        public static void OnInitLoginNotify(NetworkClient Client, PacketStream Packet)
        {
            byte Opcode = (byte)Packet.ReadByte();

            //Account was authenticated, so add the client to the player's account.
            PlayerAccount.Client = Client;

            if (!Directory.Exists("CharacterCache"))
            {
                Directory.CreateDirectory("CharacterCache");

                //The charactercache didn't exist, so send the current time, which is
                //newer than the server's stamp. This will cause the server to send the entire cache.
                UIPacketSenders.SendCharacterInfoRequest(DateTime.Now.ToString("yyyy.MM.dd hh:mm:ss"));
            }
            else
            {
                if (!File.Exists("CharacterCache\\Sims.tempcache"))
                {
                    //The charactercache didn't exist, so send the current time, which is
                    //newer than the server's stamp. This will cause the server to send the entire cache.
                    UIPacketSenders.SendCharacterInfoRequest(DateTime.Now.ToString("yyyy.MM.dd hh:mm:ss"));
                }
            }
        }