|
@@ -378,7 +378,12 @@ namespace ET.Server
|
|
|
Map = self
|
|
|
};
|
|
|
|
|
|
- self.UnitPlayers.TryAdd(openId, unitPlayerData);
|
|
|
+ if(!self.UnitPlayers.TryAdd(openId, unitPlayerData))
|
|
|
+ {
|
|
|
+ Log.Debug("openid already exist");
|
|
|
+ await self.RemovePointUnit(objId);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
return unitPlayerData;
|
|
|
}
|
|
|
|
|
@@ -464,8 +469,8 @@ namespace ET.Server
|
|
|
double ang;
|
|
|
if (index == 0)
|
|
|
{
|
|
|
- r = (float)Math.Sqrt(rand.Next(2500)) + 10;
|
|
|
- ang = rand.Next(22) / 180.0f * Math.PI + Math.PI * 78f / 180f + Math.PI;
|
|
|
+ r = (float)Math.Sqrt(rand.Next(3025)) + 10;
|
|
|
+ ang = rand.Next(22) / 180.0f * Math.PI + Math.PI * 77f / 180f + Math.PI;
|
|
|
}
|
|
|
else if (index == 1)
|
|
|
{
|
|
@@ -474,8 +479,8 @@ namespace ET.Server
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- r = (float)Math.Sqrt(rand.Next(2500)) + 10;
|
|
|
- ang = rand.Next(22) / 180.0f * Math.PI + Math.PI * 150f / 180f;
|
|
|
+ r = (float)Math.Sqrt(rand.Next(2809)) + 10;
|
|
|
+ ang = rand.Next(22) / 180.0f * Math.PI + Math.PI * 148f / 180f;
|
|
|
}
|
|
|
|
|
|
return new Vector2(tower.X + (float)(r * Math.Cos(ang)), tower.Y - (float)(r * Math.Sin(ang)));
|