|
@@ -25,7 +25,7 @@ namespace ET.Server
|
|
|
self.UnitObjIds = new Dictionary<string, int>();
|
|
|
self.UnitPlayerLikes = new Dictionary<string, int>();
|
|
|
|
|
|
-
|
|
|
+
|
|
|
self.AddComponent<MapEventComponent>();
|
|
|
|
|
|
self.AddComponent<MapReliveTimeComponent>();
|
|
@@ -57,7 +57,11 @@ namespace ET.Server
|
|
|
return string.IsNullOrEmpty(result)? null : JsonConvert.DeserializeObject<GetPlayerData>(result);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public static void SyncPlayerHistoryData(this Map self, WNPlayer player)
|
|
|
{
|
|
|
GetPlayerData result = self.GetPlayerData(player.GetId());
|
|
@@ -70,28 +74,33 @@ namespace ET.Server
|
|
|
player.GetComponent<PlayerTempDataComponent>().SyncHistoryData(self.Prop, self.InstanceId, result);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public static void AddPlayer(this Map self, WNPlayer player)
|
|
|
- {
|
|
|
- Log.Info($"addPlayer: playerId={player.GetId()}, mapId={self.MapId}, ip={player.Session.RemoteAddress}");
|
|
|
- self.SetForce(player);
|
|
|
- self.Players.TryAdd(player.GetId(), player);
|
|
|
- player.Map = self;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public static WNPlayer GetPlayer(this Map self, long playerId)
|
|
|
{
|
|
|
return self.Players.TryGetValue(playerId, out WNPlayer player) ? player : null;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public static void SetForce(this Map self, WNPlayer player)
|
|
|
{
|
|
|
player.Force = (int)AreaForce.FORCEA;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public static void RemovePlayer(this Map self, WNPlayer player, bool keepObject)
|
|
|
{
|
|
|
Log.Info($"removePlayer: playerId={player.GetId()}, mapId={self.MapId}, ip={player.Session.RemoteAddress}");
|
|
@@ -104,7 +113,11 @@ namespace ET.Server
|
|
|
player.GetComponent<PlayerTempDataComponent>().MapData.ready = false;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public static void PlayerEnterRequest(this Map self, WNPlayer player)
|
|
|
{
|
|
|
bool ready = player.GetComponent<PlayerTempDataComponent>().MapData.ready;
|
|
@@ -127,7 +140,52 @@ namespace ET.Server
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static void AddPlayer(this Map self, WNPlayer player)
|
|
|
+ {
|
|
|
+ Log.Info($"addPlayer: playerId={player.GetId()}, mapId={self.MapId}, ip={player.Session.RemoteAddress}");
|
|
|
+ self.SetForce(player);
|
|
|
+ self.Players.TryAdd(player.GetId(), player);
|
|
|
+ player.Map = self;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static void PlayerReady(this Map self, WNPlayer player)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static void PlayerEntered(this Map self, WNPlayer player)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static void PlayerLogin(this Map self, WNPlayer player)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public static void PlayerLeaveRequest(this Map self, WNPlayer player, bool keepObject)
|
|
|
{
|
|
|
try
|
|
@@ -142,13 +200,24 @@ namespace ET.Server
|
|
|
Log.Debug($"playerLeaveRequest--------------------{player.GetName()} - {self.InstanceId} - {self.Prop.Name}");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public static void BindBattleServer(this Map self, WNPlayer player, string serverId)
|
|
|
{
|
|
|
self.BattleServerId = serverId;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public static async ETTask<int> AddUnits(this Map self, List<Struct.MonsterUnit> data, bool needReturn)
|
|
|
{
|
|
|
if (data.Count <= 0)
|