Example #1
0
        /// <summary>
        /// Client is sending data.
        /// </summary>
        public static int OnSend(long s, byte[] buff, int len, int flags)
        {
            CheckThread();

            lock (SyncRoot) {
                if (ultimaSocket != null && ultimaSocket.Socket == s)
                {
                    if (redirecting)
                    {
                        Trace.WriteLine("Warning: Client is reusing login socket as game socket.", "Communication");
                        ultimaSocket = new GameSocket(s, ultimaSocket.Address, ultimaSocket.Port, loginSeed);
                        redirecting  = false;
                    }

                    return(ultimaSocket.Send(s, buff, len, flags));
                }
                else
                {
                    return(WinSock.send(s, buff, len, flags));
                }
            }
        }