Пример #1
0
 public virtual void UpdateData(BinWriter w, bool clear, bool isClient)
 {
     w.Write((char)0xFF);             // UpdateData
     w.Write(GUID);
     //w.Write((byte)0);
     ObjectUpdateManager.WriteDataUpdate(w, m_updateValues, this, clear, isClient);
 }
Пример #2
0
 public virtual void AddCreateObject(BinWriter w, bool isClient, bool clear)
 {
     PreCreateObject(isClient);
     w.Write((byte)2);             // CreateObject
     w.Write(GUID);
     w.Write((byte)ObjectType);
     write_updatemovement(w);
     w.Write(isClient ? 1 : 0);
     w.Write(1);
     w.Write(0);
     w.Write((long)0);
     ObjectUpdateManager.WriteDataUpdate(w, m_updateValues, this, clear, isClient);
 }
 public bool Load(out string error)
 {
     error = string.Empty;
     try
     {
         foreach (Assembly asm in assemblies)
         {
             ObjectUpdateManager.SearchAssemblyForUpdateObjects(asm);
             foreach (Type type in asm.GetTypes())
             {
                 if (type.IsClass == false)
                 {
                     continue;
                 }
                 if (type.BaseType == typeof(PlayerObject))
                 {
                     if (PlayerObjectType != typeof(PlayerObject))
                     {
                         Unload();
                         error = "You can only have 1 custom player object in scripts.";
                         return(false);
                     }
                     PlayerObjectType = type;
                 }
                 if (type.IsDefined(typeof(ScriptPacketHandler), true))
                 {
                     RegisterScriptPacketHandler(type);
                 }
                 if (type.IsDefined(typeof(WorldPacketHandler), true))
                 {
                     RegisterClientPacketHandler(type);
                 }
                 if (type.IsDefined(typeof(ChatCmdHandler), true))
                 {
                     RegisterChatHandler(type);
                 }
             }
         }
     }
     catch (Exception e)
     {
         Unload();
         error = e.Message;
         return(false);
     }
     WorldServer.Scripts = this;
     return(true);
 }
Пример #4
0
 static WorldServer()
 {
     ObjectUpdateManager.SearchAssemblyForUpdateObjects(Assembly.GetExecutingAssembly());
     WorldPacketManager.SearchAssemblyForHandlers(Assembly.GetExecutingAssembly());
     m_scriptManager = ScriptManager.GetScriptManager();
 }
Пример #5
0
 public virtual void UpdateData(BinWriter w)
 {
     w.Write((byte)0);             // UpdateData
     w.Write(GUID);
     ObjectUpdateManager.WriteDataUpdate(w, m_updateValues, this, true);
 }