public static ServerMessage ReadFrom(System.IO.BinaryReader reader)
        {
            try
            {
                switch (reader.ReadInt32())
                {
                case GetAction.TAG:
                    return(GetAction.ReadFrom(reader));

                case Finish.TAG:
                    return(Finish.ReadFrom(reader));

                case DebugUpdate.TAG:
                    return(DebugUpdate.ReadFrom(reader));

                default:
                    throw new System.Exception("Unexpected tag value");
                }
            }
            catch (Exception e)
            {
                Environment.Exit(1);
                throw;
            }
        }
Beispiel #2
0
        public static ServerMessage ReadFrom(BinaryReader reader)
        {
            switch (reader.ReadInt32())
            {
            case GetAction.TAG:
                return(GetAction.ReadFrom(reader));

            case Finish.TAG:
                return(Finish.ReadFrom(reader));

            case DebugUpdate.TAG:
                return(DebugUpdate.ReadFrom(reader));

            default:
                throw new Exception("Unexpected tag value");
            }
        }