|
@@ -5,28 +5,12 @@ using MongoDB.Driver;
|
|
|
|
|
|
|
|
namespace ET
|
|
namespace ET
|
|
|
{
|
|
{
|
|
|
- public class DBComponentAwakeSystem : AwakeSystem<DBComponent, string, string>
|
|
|
|
|
|
|
+ public class DBComponentAwakeSystem : AwakeSystem<DBComponent, string, string, int>
|
|
|
{
|
|
{
|
|
|
- public override void Awake(DBComponent self, string dbConnection, string dbName)
|
|
|
|
|
|
|
+ public override void Awake(DBComponent self, string dbConnection, string dbName, int zone)
|
|
|
{
|
|
{
|
|
|
self.mongoClient = new MongoClient(dbConnection);
|
|
self.mongoClient = new MongoClient(dbConnection);
|
|
|
self.database = self.mongoClient.GetDatabase(dbName);
|
|
self.database = self.mongoClient.GetDatabase(dbName);
|
|
|
-
|
|
|
|
|
- self.Transfers.Clear();
|
|
|
|
|
- foreach (Type type in Game.EventSystem.GetTypes().Values)
|
|
|
|
|
- {
|
|
|
|
|
- if (type == typeof (IDBCollection))
|
|
|
|
|
- {
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- if (!typeof(IDBCollection).IsAssignableFrom(type))
|
|
|
|
|
- {
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- self.Transfers.Add(type.Name);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- DBComponent.Instance = self;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -34,8 +18,6 @@ namespace ET
|
|
|
{
|
|
{
|
|
|
public override void Destroy(DBComponent self)
|
|
public override void Destroy(DBComponent self)
|
|
|
{
|
|
{
|
|
|
- DBComponent.Instance = null;
|
|
|
|
|
- self.Transfers.Clear();
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|