コード例 #1
0
        public ServerHandler(string databasePath, string attributesPath, DataBase.DataBaseBehaivour dataBaseBehaivour) : base()
        {
            DataBaseBehaivour = dataBaseBehaivour;
            dataBaseBehaivour.Init(databasePath, attributesPath);

            SynchronizableTypes.AddType(typeof(ValidateServerCall.Refresh),
                                        (object data, string id) =>
            {
                ValidateServerCall.Refresh refresh = data as ValidateServerCall.Refresh;
                if (refresh.info == null || refresh.info.dataAttributes.Count == 0)
                {
                    SendMessageViaTCP(new NetData(new ValidateServerCall.Refresh(clients[id].info), false), clients[id]);
                }
                else
                {
                    clients[id].info = refresh.info;
                }
            }
                                        );


            SynchronizableTypes.AddSyncSubType(typeof(DataBase.UserInfo));
            SynchronizableTypes.AddSyncSubType(typeof(DataBase.DataProperty));

            MatchmakingController.Init();
        }
コード例 #2
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            if ((instance != this))
            {
                Destroy(this.gameObject);
            }
        }

        DontDestroyOnLoad(this.gameObject);

        PV = GetComponent <PhotonView>();
    }