protected override void ParseMessage(IncomingMessage inMessage)
 {
     int numEntries = inMessage.ReadInt32();
     for (int i = 0; i < numEntries; ++i) {
         string type = inMessage.ReadString();
         switch (type) {
             case "add":
                 AnimationEntry entry = new AnimationEntry();
                 entry.animationName = inMessage.ReadString();
                 entry.animationSpeed = 1.0f;
                 entry.loop = inMessage.ReadBool();
                 if (animations.Count > 0) {
                     AnimationEntry last = animations[animations.Count - 1];
                     if (last.loop)
                         animations.RemoveAt(animations.Count - 1);
                 }
                 animations.Add(entry);
                 break;
             case "clear":
                 animations.Clear();
                 clear = true;
                 break;
             default:
                 log.WarnFormat("Invalid animation message type: {0}", type);
                 break;
         }
     }
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     base.ParseMessage(inMessage);
     int numItems = inMessage.ReadInt32();
     for (int i = 0; i < numItems; ++i) {
         InvItemInfo info = new InvItemInfo();
         info.itemId = inMessage.ReadInt64();
         info.name = inMessage.ReadString();
         info.icon = inMessage.ReadString();
         offer1.Add(info);
     }
     accepted1 = inMessage.ReadBool();
     numItems = inMessage.ReadInt32();
     for (int i = 0; i < numItems; ++i) {
         InvItemInfo info = new InvItemInfo();
         info.itemId = inMessage.ReadInt64();
         info.name = inMessage.ReadString();
         info.icon = inMessage.ReadString();
         offer2.Add(info);
     }
     accepted2 = inMessage.ReadBool();
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     active = inMessage.ReadBool();
     sound = inMessage.ReadString();
 }
        protected override void ParseMessage(IncomingMessage inMessage)
        {
            int numEntries = inMessage.ReadInt32();
            for (int i = 0; i < numEntries; ++i) {
                string type = inMessage.ReadString();
                switch (type) {
                    case "add":
                        SoundEntry entry = new SoundEntry();
                        entry.soundName = inMessage.ReadString();
                        if (entry.soundName == "idle") {
                            sounds.Clear();
                            clear = true;
                            break;
                        } else if (entry.soundName == "strike") {
                            entry.soundName = "swing.wav";
                        } else if (entry.soundName == "run") {
                            entry.soundName = "gravelwalk.wav";
                        } else if (entry.soundName == "death") {
                            entry.soundName = "ugh.wav";
                        }

                        entry.soundSpeed = 1.0f;
                        entry.soundGain = 1.0f;
                        entry.loop = inMessage.ReadBool();
                        log.InfoFormat("Playing Sound {0}, looping = {1}",
                                       entry.soundName, entry.loop);
                        if (sounds.Count > 0) {
                            SoundEntry last = sounds[sounds.Count - 1];
                            if (last.loop)
                                sounds.RemoveAt(sounds.Count - 1);
                        }
                        sounds.Add(entry);
                        break;
                    case "clear":
                        sounds.Clear();
                        clear = true;
                        break;
                    default:
                        log.ErrorFormat("Invalid sound message type: {0}", type);
                        break;
                }
            }
        }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     base.ParseMessage(inMessage);
     accepted = inMessage.ReadBool();
     cancelled = inMessage.ReadBool();
     int numItems = inMessage.ReadInt32();
     for (int i = 0; i < numItems; ++i) {
         offer.Add(inMessage.ReadInt64());
     }
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     base.ParseMessage(inMessage);
     questId = inMessage.ReadInt64();
     accepted = inMessage.ReadBool();
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     worldName = inMessage.ReadString();
     status = inMessage.ReadBool();
     hostname = inMessage.ReadString();
     port = inMessage.ReadInt32();
     try {
         patcherUrl = inMessage.ReadString();
         updateUrl = inMessage.ReadString();
     } catch (System.IO.EndOfStreamException) {
         log.Warn("Got old style world resolve response");
         // ignore this - it means we got an old style response
     }
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     base.ParseMessage(inMessage);
     name = inMessage.ReadString();
     location = inMessage.ReadIntVector();
     orientation = inMessage.ReadQuaternion();
     scale = inMessage.ReadVector();
     objectType = (ObjectNodeType)inMessage.ReadInt32();
     followTerrain = inMessage.ReadBool();
     try {
         direction = inMessage.ReadVector();
         lastInterp = inMessage.ReadTimestamp();
     } catch (System.IO.EndOfStreamException) {
         // ignore this - it means we got an old style response
     }
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     base.ParseMessage(inMessage);
     status = inMessage.ReadBool();
 }
 public virtual void ParseMessage(IncomingMessage inMessage)
 {
     meshFile = inMessage.ReadString();
     int submeshCount = inMessage.ReadInt32();
     // submesh count of zero means we leave the submesh list null
     if (submeshCount != 0)
         submeshList = new List<SubmeshInfo>();
     for (int i = 0; i < submeshCount; ++i) {
         SubmeshInfo submeshInfo = new SubmeshInfo();
         submeshInfo.SubmeshName = inMessage.ReadString();
         submeshInfo.MaterialName = inMessage.ReadString();
         submeshInfo.CastShadows = inMessage.ReadBool();
         submeshInfo.ReceiveShadows = inMessage.ReadBool();
         submeshList.Add(submeshInfo);
         log.InfoFormat("submesh name: {0}; material: {1}; castShadows: {2}", submeshInfo.SubmeshName, submeshInfo.MaterialName, submeshInfo.CastShadows.ToString());
     }
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     base.ParseMessage(inMessage);
     log.InfoFormat("LoginResponseMessage.ParseMessage - Oid: {0}", oid);
     success = inMessage.ReadBool();
     message = inMessage.ReadString();
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     loadingState = inMessage.ReadBool();
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     followTerrain = inMessage.ReadBool();
 }
 protected override void ParseMessage(IncomingMessage inMessage)
 {
     base.ParseMessage(inMessage);
     attackType = inMessage.ReadString();
     attackStatus = inMessage.ReadBool();
 }