|
@@ -147,7 +147,6 @@ public class SFSPlazaRoomManager
|
|
|
|
|
|
public GardenSmartFox GardenSmartFox;
|
|
|
|
|
|
- public User SelfUser;
|
|
|
public PlazaRoomPlayer SelfInstance;
|
|
|
public Room CurrentPlazaRoom;
|
|
|
|
|
@@ -161,7 +160,7 @@ public class SFSPlazaRoomManager
|
|
|
public bool EnteringPlazaRoom;
|
|
|
public JoinRoomResult JoinRoomResult;
|
|
|
|
|
|
- public Dictionary<User, PlazaRoomPlayer> UserInstanceDictionary = new Dictionary<User, PlazaRoomPlayer>();
|
|
|
+ public Dictionary<int, PlazaRoomPlayer> UserInstanceDictionary = new Dictionary<int, PlazaRoomPlayer>();
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -261,12 +260,11 @@ public class SFSPlazaRoomManager
|
|
|
GardenSmartFox.PlazaRoomManager.PlazaRoomCamera = ManaReso.Get<Camera>("MainCamera");
|
|
|
GardenSmartFox.PlazaRoomManager.CameraOriginPosition = GardenSmartFox.PlazaRoomManager.PlazaRoomCamera.transform.position;
|
|
|
|
|
|
- SelfUser = GardenSmartFox.User;
|
|
|
PlayerDefaultPosition = ManaReso.Get("PlazaRoomDefaultPosition").position;
|
|
|
- SelfInstance = InstantiatePlayer(SelfUser, ManaNickName.NickName, PlayerDefaultPosition, PlayerDirection.Left, ManaData.GetDressDataIDs(ManaPlayer.Player));
|
|
|
+ SelfInstance = InstantiatePlayer(ManaNickName.NickName, PlayerDefaultPosition, PlayerDirection.Left, ManaData.GetDressDataIDs(ManaPlayer.Player));
|
|
|
SelfInstance.Player.transform.position += new Vector3(0, 0, -0.001f);
|
|
|
-
|
|
|
- UserInstanceDictionary.Add(SelfUser, SelfInstance);
|
|
|
+
|
|
|
+ UserInstanceDictionary.Add(SFSManager.GardenSmartFox.User.Id, SelfInstance);
|
|
|
|
|
|
SendInstantiateRequset(-1);
|
|
|
|
|
@@ -314,7 +312,7 @@ public class SFSPlazaRoomManager
|
|
|
kv.Value.Save();
|
|
|
}
|
|
|
|
|
|
- UserInstanceDictionary = new Dictionary<User, PlazaRoomPlayer>();
|
|
|
+ UserInstanceDictionary = new Dictionary<int, PlazaRoomPlayer>();
|
|
|
}
|
|
|
);
|
|
|
}
|
|
@@ -460,45 +458,45 @@ public class SFSPlazaRoomManager
|
|
|
TryEnterPlazaRoom();
|
|
|
}
|
|
|
|
|
|
- public void OnUserExitPlazaRoom(User user)
|
|
|
+ public void OnUserExitPlazaRoom(int userID)
|
|
|
{
|
|
|
- UserInstanceDictionary[user].Save();
|
|
|
+ UserInstanceDictionary[userID].Save();
|
|
|
|
|
|
- UserInstanceDictionary.Remove(user);
|
|
|
+ UserInstanceDictionary.Remove(userID);
|
|
|
}
|
|
|
|
|
|
- public void OnUserEnterPlazaRoom(User user)
|
|
|
+ public void OnUserEnterPlazaRoom(int senderID)
|
|
|
{
|
|
|
- SendInstantiateRequset(user);
|
|
|
+ SendInstantiateRequset(senderID);
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void Synchronize(User sender, SFSObject parameter)
|
|
|
+ public void Synchronize(int senderID, ISFSObject parameter)
|
|
|
{
|
|
|
- if (!UserInstanceDictionary.ContainsKey(sender))
|
|
|
+ if (!UserInstanceDictionary.ContainsKey(senderID))
|
|
|
return;
|
|
|
|
|
|
- if (sender.IsItMe)
|
|
|
+ if (SFSManager.GardenSmartFox.User.Id == senderID)
|
|
|
return;
|
|
|
|
|
|
if (parameter.ContainsKey(InfoLabel.Destination.GetHashString()))
|
|
|
{
|
|
|
Vector3 destination = parameter.GetUtfString(InfoLabel.Destination.GetHashString()).StringToVector();
|
|
|
|
|
|
- SynchronizeDestination(destination, sender);
|
|
|
+ SynchronizeDestination(destination, senderID);
|
|
|
}
|
|
|
|
|
|
if (parameter.ContainsKey(InfoLabel.Close.GetHashString()))
|
|
|
{
|
|
|
List<int> closeIDs = parameter.GetIntArray(InfoLabel.Destination.GetHashString()).ToList();
|
|
|
|
|
|
- SynchronizeClose(closeIDs, sender);
|
|
|
+ SynchronizeClose(closeIDs, senderID);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void SynchronizeClose(List<int> closeIDs, User sender)
|
|
|
+ public void SynchronizeClose(List<int> closeIDs, int senderID)
|
|
|
{
|
|
|
- Player player = UserInstanceDictionary[sender].Player;
|
|
|
+ Player player = UserInstanceDictionary[senderID].Player;
|
|
|
|
|
|
foreach (var closeID in closeIDs)
|
|
|
{
|
|
@@ -508,15 +506,15 @@ public class SFSPlazaRoomManager
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void SynchronizeDestination(Vector3 destination, User sender)
|
|
|
+ public void SynchronizeDestination(Vector3 destination, int senderID)
|
|
|
{
|
|
|
- UserInstanceDictionary[sender].MoveTo(destination);
|
|
|
+ UserInstanceDictionary[senderID].MoveTo(destination);
|
|
|
}
|
|
|
|
|
|
private float ExpressionDuration = 1;
|
|
|
- public void ReceiveExpression(int expressionID, User sender)
|
|
|
+ public void ReceiveExpression(int expressionID, int senderID)
|
|
|
{
|
|
|
- PlazaRoomPlayer plazaRoomPlayer = UserInstanceDictionary[sender];
|
|
|
+ PlazaRoomPlayer plazaRoomPlayer = UserInstanceDictionary[senderID];
|
|
|
|
|
|
string expressionName = Enum.GetName(typeof(ExpressionID), expressionID);
|
|
|
plazaRoomPlayer.Player.ChangeExpression(expressionName, ExpressionDuration);
|
|
@@ -526,10 +524,9 @@ public class SFSPlazaRoomManager
|
|
|
ManaReso.SetText("X_CurrentInfoLab", message);
|
|
|
}
|
|
|
|
|
|
- public void ReceivePublicMessage(string message, User sender)
|
|
|
+ public void ReceivePublicMessage(string message, int senderID)
|
|
|
{
|
|
|
- //Debug.Log(sender.Id);
|
|
|
- PlazaRoomPlayer plazaRoomPlayer = UserInstanceDictionary[sender];
|
|
|
+ PlazaRoomPlayer plazaRoomPlayer = UserInstanceDictionary[senderID];
|
|
|
|
|
|
plazaRoomPlayer.ShowMessage(message);
|
|
|
|
|
@@ -538,12 +535,12 @@ public class SFSPlazaRoomManager
|
|
|
ManaReso.SetText("X_CurrentInfoLab", message);
|
|
|
}
|
|
|
|
|
|
- public void OnInstantiate(User user, SFSObject parameter)
|
|
|
+ public void OnInstantiate(int senderID, ISFSObject parameter)
|
|
|
{
|
|
|
- if (user.IsItMe)
|
|
|
+ if (SFSManager.GardenSmartFox.User.Id == senderID)
|
|
|
return;
|
|
|
|
|
|
- UserInstanceDictionary.Add(user, InstantiatePlayer(user, parameter));
|
|
|
+ UserInstanceDictionary.Add(senderID, InstantiatePlayer(parameter));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -570,12 +567,6 @@ public class SFSPlazaRoomManager
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public void SendInstantiateRequset(User receiver)
|
|
|
- {
|
|
|
- SendInstantiateRequset(receiver.Id);
|
|
|
- }
|
|
|
-
|
|
|
public void SendInstantiateRequset(int receiverID)
|
|
|
{
|
|
|
SFSObject parameter = new SFSObject();
|
|
@@ -593,13 +584,12 @@ public class SFSPlazaRoomManager
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public void SendSynchronizeDestination(Vector3 destination)
|
|
|
{
|
|
|
SFSManager.GardenSmartFox.EventManager.PlazaRoomEvent.SendSynchronizeDestination(destination);
|
|
|
}
|
|
|
|
|
|
- public PlazaRoomPlayer InstantiatePlayer(User user, string nickName, Vector3 position, PlayerDirection direction, List<int> dressDataIDs)
|
|
|
+ public PlazaRoomPlayer InstantiatePlayer(string nickName, Vector3 position, PlayerDirection direction, List<int> dressDataIDs)
|
|
|
{
|
|
|
Transform parent = ManaReso.Get("PlazaRoom", false);
|
|
|
Transform tra = ManaReso.Get("Player", Folder.Scene, false, parent, false, ObjType.Player);
|
|
@@ -629,14 +619,14 @@ public class SFSPlazaRoomManager
|
|
|
return new PlazaRoomPlayer(player, nickName);
|
|
|
}
|
|
|
|
|
|
- public PlazaRoomPlayer InstantiatePlayer(User user, SFSObject parameter)
|
|
|
+ public PlazaRoomPlayer InstantiatePlayer(ISFSObject parameter)
|
|
|
{
|
|
|
List<int> dressDatas = ManaData.GetDressDataIDs(parameter);
|
|
|
Vector3 position = parameter.GetUtfString(InfoLabel.Position.GetHashString()).StringToVector();
|
|
|
PlayerDirection direction = (PlayerDirection) parameter.GetInt(InfoLabel.PlayerDirection.GetHashString());
|
|
|
string nickName = parameter.GetUtfString(InfoLabel.NickName.GetHashString());
|
|
|
|
|
|
- PlazaRoomPlayer plazaRoomPlayer = InstantiatePlayer(user, nickName, position, direction, dressDatas);
|
|
|
+ PlazaRoomPlayer plazaRoomPlayer = InstantiatePlayer(nickName, position, direction, dressDatas);
|
|
|
|
|
|
return plazaRoomPlayer;
|
|
|
}
|